(function(){function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(n,e)})(e)}function _construct(e,t,n){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var r=new(e.bind.apply(e,o));return n&&_setPrototypeOf(r,n.prototype),r}function _isNativeFunction(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}function _readOnlyError(e){throw new TypeError('"'+e+'" is read-only')}function _superPropGet(e,t,n,o){var r=_get(_getPrototypeOf(1&o?e.prototype:e),t,n);return 2&o&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=_superPropBase(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}}).apply(null,arguments)}function _superPropBase(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _callSuper(e,t,n){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],_getPrototypeOf(e).constructor):t.apply(e,n))}function _possibleConstructorReturn(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function p(e,t,n,o){var i=t&&t.prototype instanceof z?t:z,a=Object.create(i.prototype),s=new R(o||[]);return r(a,"_invoke",{value:q(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var u="suspendedStart",b="executing",M="completed",h={};function z(){}function O(){}function f(){}var g={};l(g,a,function(){return this});var m=Object.getPrototypeOf,_=m&&m(m(k([])));_&&_!==n&&o.call(_,a)&&(g=_);var A=f.prototype=z.prototype=Object.create(g);function y(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function v(e,t){function n(r,i,a,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,p=l.value;return p&&"object"==typeof p&&o.call(p,"__await")?t.resolve(p.__await).then(function(e){n("next",e,a,s)},function(e){n("throw",e,a,s)}):t.resolve(p).then(function(e){l.value=e,a(l)},function(e){return n("throw",e,a,s)})}s(c.arg)}var i;r(this,"_invoke",{value:function(e,o){function r(){return new t(function(t,r){n(e,o,t,r)})}return i=i?i.then(r,r):r()}})}function q(t,n,o){var r=u;return function(i,a){if(r===b)throw Error("Generator is already running");if(r===M){if("throw"===i)throw a;return{value:e,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=L(s,o);if(c){if(c===h)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===u)throw r=M,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=b;var l=d(t,n,o);if("normal"===l.type){if(r=o.done?M:"suspendedYield",l.arg===h)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(r=M,o.method="throw",o.arg=l.arg)}}}function L(t,n){var o=n.method,r=t.iterator[o];if(r===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,L(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;var i=d(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function W(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(W,this),this.reset(!0)}function k(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;C(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:k(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),h}},t}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&(t=this.languageMessages.filter(function(t){return t.text_code===e})),this.isLanguageChanged=!1,0===t.length?e.replace(/_/g," ").toLowerCase().split(" ").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" "):t[0].message[this.selectedLanguage.toUpperCase()]}},{key:"getInitialProcessRequest",value:function(){var e=this,t={status:r.a.STATUS.ACTIVE,jurisdiction_id:"1"===localStorage.getItem(r.a.LOCAL_STORAGE.IS_JURISDICTION)?localStorage.getItem(r.a.LOCAL_STORAGE.JURISDICTION_ID):1};this.dashboardService.getInitialProcessRequest(t).subscribe(function(t){200==t.status&&(e.initialProcessList=t.data)})}},{key:"showToaster",value:function(e,t){var n;clearTimeout(this.toasterTimeout),$(".alert.toastr")&&$(".alert.toastr").remove(),"error"===e&&(n="
"),"success"===e&&(n="
");var o=$(n).appendTo(".toast-popup-wrapper");setTimeout(function(){$(".toast-popup-wrapper").addClass("show")},10),setTimeout(function(){$(".toast-popup-wrapper").addClass("active")},50),this.toasterTimeout=setTimeout(function(){$(".toast-popup-wrapper").removeClass("show"),$(".toast-popup-wrapper").removeClass("active"),$(o).remove()},3e3)}},{key:"getNotifications",value:function(){var e=this,t={user_id:!0,type:[r.a.NOTIFICATION_SUB_TYPE.CUSTOMER,r.a.NOTIFICATION_SUB_TYPE.ESCALATE_NOTIFICATION],mark_as:0};this.accessToken.role_id!==r.a.LOGIN_ROLE.CUSTOMER&&this.accessToken.role_id!==r.a.LOGIN_ROLE.CONSULTANT1&&this.accessToken.role_id!==r.a.LOGIN_ROLE.CONSULTANT2||(t.type=[r.a.NOTIFICATION_SUB_TYPE.CUSTOMER,r.a.NOTIFICATION_SUB_TYPE.ESCALATE_NOTIFICATION,r.a.NOTIFICATION_SUB_TYPE.FEEDBACK_NOTIFICATION]),this.notificationsService.getNotifications(t).subscribe(function(t){var n;200==t.status&&(e.unreadNotificationList=t.data,null===(n=e.unreadNotificationList)||void 0===n||n.map(function(t){t.comment.includes("feedbackLink")&&(t.comment=e.domSanitizer.bypassSecurityTrustHtml(t.comment))}))},function(t){e.showToaster("error","Something went wrong. Please try again.")})}},{key:"handleClick",value:function(e){var t=e.target;if("A"===t.tagName&&(e.preventDefault(),t.getAttribute("href"))){var n=t.getAttribute("data-tag"),o=t.getAttribute("href");this.handleFeedbackModelOpen("dynamic","customer",o,n)}}},{key:"getIPAddress",value:function(){return this.http.get("https://api.ipify.org")}},{key:"getDefaultConfigurations",value:function(){var e=this,t=this;t.companyService.getDefaultConfigurations().subscribe(function(n){var o,i,a;if(200===n.status){var s=n.data.result.find(function(e){return"zone"===e.key});e.selectedDomain=null===(o=null==s?void 0:s.value)||void 0===o?void 0:o.domain,e.selectedZoneFullName=null===(i=null==s?void 0:s.value)||void 0===i?void 0:i.full_name;var c=n.data.result.find(function(e){return"visa_counter"===e.key});e.isVisaCounterEnabled=1==(null==c?void 0:c.value);var l=n.data.result.find(function(e){return"concierge_service_name"===e.key});localStorage.setItem(r.a.CONCIERGE_SERVICE_NAME,l?null==l?void 0:l.value:"Concierge Services");var p=n.data.result.filter(function(e){return"DEFAULT_LANGUAGE"===e.key});p.length>0&&p[0].value&&(e.selectedLanguage=p[0].value);var d=n.data.result.filter(function(e){return"Theme"===e.key});d.length>0&&d[0].value&&(e.selectedTheme=d[0].value),t.getDefaultTheme();var u=n.data.result.find(function(e){return"date_format"===e.key});t.dateFormatSettingObj=t.getDtFrForPicker(u.value),t.dateFormatForPatchVal=t.setDateFormatForPatchVal(u.value);var b=n.data.result.filter(function(e){return"HELP_SUPPORT"===e.key});t.isHelpSupportVisible=(null==b?void 0:b.length)>0&&"1"==(null===(a=b[0])||void 0===a?void 0:a.value)}},function(t){e.showToaster("error","Something went wrong. Please try again.")})}},{key:"setDateFormatForPatchVal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"DD-MM-YYYY",t="DD-MM-YYYY";if(e&&(e.includes("-")||e.includes("/"))){var n=e.includes("-")?"-":e.includes("/")?"/":"",o=e.split(n);if(o&&o.length>0){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"DD-MM-YYYY",t="DD-MM-YYYY";if(e&&(e.includes("-")||e.includes("/"))){var n=e.includes("-")?"-":e.includes("/")?"/":"",o=e.split(n);if(o&&o.length>0){for(var r=0;r0&&(n[0].css&&(e.selectedThemeCss=e.domSanitizer.bypassSecurityTrustResourceUrl(n[0].css)),e.selectedThemeImages=n[0].images,e.favIcon.href=e.selectedThemeImages+"/favicon.ico")}},function(t){e.showToaster("error","Something went wrong. Please try again.")})}},{key:"logOut",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=localStorage.getItem("auth-token");if(console.log("\ud83d\ude80 ~ CommonService ~ logOut ~ accessTokenData:",o),n||this._token.tokenKey&&!o){var i="login";this.user_type==r.a.LOGIN_ROLE.AGENT?i="login/agent":this.user_type==r.a.LOGIN_ROLE.CONSULTANT1?i="login/consultant1":this.user_type==r.a.LOGIN_ROLE.CONSULTANT2&&(i="login/consultant2");var a=localStorage.getItem(r.a.LOCAL_STORAGE.USER_CREDENTIALS);localStorage.clear(),this.companyList=[],this.selectedCompany={},this.designation=null,this.accessToken="",this.user_type="",this.parentRoleId="",this.loginUserId="",this.isCompanyActive=!1,this.getDefaultConfigurations(),localStorage.removeItem(r.a.is_show_banner),localStorage.removeItem(r.a.is_show_ads),localStorage.removeItem(r.a.CONCIERGE_SERVICE_NAME),localStorage.setItem(r.a.LOCAL_STORAGE.USER_CREDENTIALS,a),this.titleService.setTitle("Login | "+(null===(t=null===(e=this.accessToken)||void 0===e?void 0:e.zone)||void 0===t?void 0:t.full_name)),$(document).off("mousemove keyup keypress"),this.cookieService.remove("onlineUser"),this.router.navigate([i])}else console.log("\ud83d\ude80 ~ CommonService ~ logOut ~ this._token.tokenKey:",this._token.tokenKey)}},{key:"loadDefaultSelectAnimation",value:function(){$("select").each(function(){$(this).val()?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")})}},{key:"loadDefaultInputAnimation",value:function(){$(".material_input").each(function(){$(this).val()&&0!==$(this).val().length?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")})}},{key:"loadDefaultPasswordAnimation",value:function(){$(document).off("click",".fa-eye-slash, .fa-eye"),$(document).on("click",".fa-eye-slash, .fa-eye",function(e){e.preventDefault(),$(this).hasClass("fa-eye-slash")?$(this).removeClass("fa-eye-slash").addClass("fa-eye"):$(this).hasClass("fa-eye")&&$(this).removeClass("fa-eye").addClass("fa-eye-slash"),"password"===$(this).parent().parents(".form-group").children(".material_input_block").children(".form-control").attr("type")?$(this).parent().parents(".form-group").children(".material_input_block").children(".form-control").attr("type","text"):"text"===$(this).parent().parents(".form-group").children(".material_input_block").children(".form-control").attr("type")&&$(this).parent().parents(".form-group").children(".material_input_block").children(".form-control").attr("type","password")})}},{key:"loadCommonJs",value:function(){$(document).on("focus keyup blur",".material_input_block .material_input",function(){$(this).val()&&0!==$(this).val().length?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")}),$(document).on("change","select",function(){$(this).val()?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")}),$(document).on("change",".datepicker input",function(){$(this).val()?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")}),$(document).on("focus",".material_input.material_textarea",function(){$(this).parent(".material_input_block").addClass("focused")}),$(document).on("blur",".material_input.material_textarea",function(){$(this).parent(".material_input_block").removeClass("focused")}),$(document).on("wheel","input[type=number]",function(e){$(this).blur()}),$(document).on("click",".search-toggle",function(e){e.preventDefault(),$(this).parent(".head-search").children(".search-input").is(":visible")?$(this).parent(".head-search").children(".search-input").hide():$(this).parent(".head-search").children(".search-input").show()}),$(document).on("focus",".form-control, input",function(){$(this).parent().addClass("input")}),$(document).on("blur",".form-control, input",function(){$(this).parent().removeClass("input")}),$(document).on("focus",".phone-number",function(){$(this).parent().parent().parent().addClass("input")}),$(document).on("blur",".phone-number",function(){$(this).parent().parent().parent().removeClass("input")}),$(document).on("focus",".otp-input",function(){$(this).addClass("input")}),$(document).on("blur",".otp-input",function(){$(this).removeClass("input")}),$(document).on("focus",".select2-search__field",function(){$(this).parents(".form-group").addClass("input-active")}),$(document).on("blur",".select2-search__field",function(){(!$(this).parents(".select2-label").find("select").val()||$(this).parents(".select2-label").find("select").val()&&0===$(this).parents(".select2-label").find("select").val().length)&&$(this).parents(".form-group").removeClass("input-active")}),$(document).off("click",".accordion-title"),$(document).on("click",".accordion-title",function(){return $(this).next().slideToggle(),$(this).toggleClass("active"),$(":input:not(:hidden)").each(function(e){$(this).attr("tabindex",e+1)}),!1})}},{key:"getCompany",value:function(){var e=this;this.isCompanySelected=!(!this.selectedCompany||!this.selectedCompany.id),this.isCompanyActive=!(!this.selectedCompany||![1,6,7,8].includes(parseInt(this.selectedCompany.status)));var t={jurisdiction_id:"1"===localStorage.getItem(r.a.LOCAL_STORAGE.IS_JURISDICTION)?localStorage.getItem(r.a.LOCAL_STORAGE.JURISDICTION_ID):1,user_id:!0,email:!0};this.companyService.getCompany(t).subscribe(function(t){var n,o,r;if(200===t.status){if(e.companyList=null===(n=t.data)||void 0===n?void 0:n.map(function(e){return Object.assign(Object.assign({},e),{company_name:$("