indigitall-web-sdk 4.16.5 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/sdk.js +643 -0
- package/sdk.min.js +1 -1
- package/src/Indigitall.js +2 -2
package/sdk.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see sdk.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.16.5","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>W});var i={};n.r(i),n.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>T,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>M,TopicSubscribeType:()=>L});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>x,DateUtils:()=>R,ErrorUtils:()=>b,JsonUtils:()=>Y,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>G,Validations:()=>F});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const r=n.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){const t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,r)=>{e||r(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),r(!1)}})}async put(e,t,n){return new Promise((r,i)=>{e||i(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),r(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+=`${error.errorCode}: ${error.errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(e,t,n){if(null!=e){const r=Object.values(e.ErrorCode).indexOf(t);if(r>=0){const t=Object.keys(e.ErrorCode)[r],i=Object.values(e.ErrorCode)[r];return new v({code:t,errorId:i},Object.values(e.ErrorMessage)[r],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},T=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,r){const i=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&i.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),r&&(s.credentials=r);try{const t=new AbortController;let r;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(r=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(r&&clearTimeout(r),304!=a.status){const t=await a.json();return a.ok?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),M=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),L=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let r=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,r=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):r=new Date(Date.now()+36e5),!t){const e=r.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let r=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+r+" to "+n.state).writeLog(),r=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",x=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const r=window?.crypto?.subtle;if(!r)return;const i=await r.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await r.sign(j,i,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}},Y=class{static compareJSON(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r]){if("object"!=typeof e[r]||"object"!=typeof t[r])return!1;if(!isEqual(e[r],t[r]))return!1}return!0}},F=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},G=class{static setTopicChannel(e,t){const n=[];for(let r=0;r<e.length;r++){const i=e[r];i.channel=t,n.push(i)}return n}},W={Repository:y,Config:c,Api:i,Models:o,Utils:s};return r})(),e.exports=t()},315(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(254)),i=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(d(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,i,"GeneratorFunction"),d(h),d(h,i,"Generator"),d(h,r,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}d=function(e,t,n,r){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,r)}function h(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){h(o,r,i,s,a,"next",e)}function a(e){h(o,r,i,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function y(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(I=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return I.apply(this,arguments)})},{key:"call",value:(y=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,b;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new r.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new i.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(b=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,b));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,b));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,r){return y.apply(this,arguments)})},{key:"get",value:(h=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return h.apply(this,arguments)})},{key:"post",value:(d=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return d.apply(this,arguments)})},{key:"put",value:(l=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"delete",value:(c=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return c.apply(this,arguments)})}],t&&E(e.prototype,t),n&&E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y,I}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var r=a(n(468)),i=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i;function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+="".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((i=n(237))&&i.__esModule?i:{default:i}).default);t.default=f},943(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(r=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,r),i&&u(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(i.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var u=function(){return function(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new i.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}])}();t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={platform:"webpush",version:"0.0.1"},i=n(904);r.version=i.version,r=Object.assign(r,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}});t.default=r},610(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}var f=c(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=new i.default;if(null!=t){r.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,r.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,r.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),r.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),r.setEncryptionType(this.encryptionType)}});t.default=f},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var u=function(){return function(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new i.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}])}();t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410};var r={ErrorCode:n,ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=r},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=i(function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=r&&(this.exceptionMessage=r)});t.default=s},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return r.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var r=n(902),i=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,r,o,s){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return i(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,i(h,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,s,"GeneratorFunction"),i(h),i(h,s,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:p}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,n,r){function s(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,n,r)}function o(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,u,"next",e)}function u(e){o(s,r,i,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB},t=[{key:"getDB",value:(l=s(r().m(function e(){var t=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var r=t.IDB;if(r){var i=r.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){var t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return l.apply(this,arguments)})},{key:"get",value:(c=s(r().m(function e(t,n){var i=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(i.close(t),e(n.target.result.store.value)),r(!1)}}))},e)})),function(e,t){return c.apply(this,arguments)})},{key:"put",value:(u=s(r().m(function e(t,n,i){var o=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.store.put({store:{key:n,value:i}},n).onsuccess=function(n){o.close(t),e(i)}}))},e)})),function(e,t,n){return u.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(o=s(r().m(function e(t,n){var i,o;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return i=e.v,e.a(2,this.put(i,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return o.apply(this,arguments)})},{key:"getItem",value:(i=s(r().m(function e(t){var n,i;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,i=e.v,e.a(2,i)}},e,this,[[0,2]])})),function(e){return i.apply(this,arguments)})}],t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,i,o,u,c,l}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(122)),i=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,i,"GeneratorFunction"),f(h),f(h,i,"Generator"),f(h,r,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}function d(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){d(o,r,i,s,a,"next",e)}function a(e){d(o,r,i,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function E(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=i.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){i.default.setItem(e,t)}},{key:"getStorage",value:function(e){return i.default.getItem(e)}},{key:"clearStorage",value:function(){i.default.clear()}},{key:"setBrowserPublicKey",value:function(e){i.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return i.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){i.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return i.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(A=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return A.apply(this,arguments)})},{key:"getAppKey",value:function(){return i.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(O=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return O.apply(this,arguments)})},{key:"setVAPID",value:function(e){i.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return i.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){i.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return i.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){i.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){var e=i.default.getItem(this.SERVICE_SYNC_TIME);return e||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){i.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return i.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){i.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){var e=i.default.getItem(this.LOCATION_UPDATE_MINUTES);return e||30}},{key:"setRequestLocation",value:(T=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return T.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!i.default&&i.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(b=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"getPlatform",value:function(){return i.default&&i.default.getItem(this.PLATFORM)||r.default.platform}},{key:"getVersion",value:function(){return r.default.version}},{key:"setBrowserName",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getBrowserName",value:function(){return i.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){i.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return i.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getOsName",value:function(){return i.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){i.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return i.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){i.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return i.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){i.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return i.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){i.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return i.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){i.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return i.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){i.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return i.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){i.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==i.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){i.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return i.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){i.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return i.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default&&i.default.isLocalStorageAvailable()&&i.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getExternalIdRequest",value:(m=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!i.default||!i.default.isLocalStorageAvailable()){e.n=1;break}t=i.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return m.apply(this,arguments)})},{key:"setExternalId",value:function(e){i.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return i.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(g=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,i.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return g.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(I=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return I.apply(this,arguments)})},{key:"setLatitude",value:function(e){i.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return i.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){i.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return i.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"getInAppTopicList",value:(E=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return E.apply(this,arguments)})},{key:"setTopicList",value:(d=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return d.apply(this,arguments)})},{key:"getTopicList",value:(f=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return f.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(c=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return c.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(u=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,b,T,O,P,A}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"isServiceTimestampExceed",value:function(){return!(new r.default).getServiceTimestamp()||(new r.default).getServiceSyncTime()<=(Date.now()-(new r.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new i.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}],(t=null)&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(254))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(a(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,i,"GeneratorFunction"),a(h),a(h,i,"Generator"),a(h,r,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}a=function(e,t,n,r){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,r)}function u(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){u(o,r,i,s,a,"next",e)}function a(e){u(o,r,i,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},null,[{key:"getLocationPermission",value:(r=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return r.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var r,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(r=e.v)&&(o=r.state,"onchange"in r&&(r.onchange=function(){new i.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+r.state).writeLog(),o=r.state,n&&n({name:t,state:r.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var r=n(225),i=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,r,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function c(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=null,n=[{key:"createHmac",value:(o=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new i.default).isAvoidCypher()&&(new i.default).getEncryptionType()!==r.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new i.default).getEncryptionType()!==r.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),s=function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function s(e){c(i,n,r,s,a,"next",e)}function a(e){c(i,n,r,s,a,"throw",e)}s(void 0)})},function(e,t){return s.apply(this,arguments)})}],t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o,s}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var r=this.tryToParseLeniently(n);return r?this.formatCanonicalUTC(r):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=r(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.parseByFormat(e,i);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],(t=null)&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]);t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(735)),i=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new i.default(s,Object.values(e.ErrorMessage)[o],n)}return new i.default(r.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},i=[{key:"compareJSON",value:function(e,t){var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,s=r;o<s.length;o++){var a=s[o];if(e[a]!==t[a]){if("object"!=n(e[a])||"object"!=n(t[a]))return!1;if(!isEqual(e[a],t[a]))return!1}}return!0}}],(t=null)&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=i.default.INFO,this.setLogLevel((new r.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=i.default.DEBUG&&e<=i.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=i.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=i.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=i.default.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+="".concat(error.errorCode,": ").concat(error.errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"setTopicChannel",value:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i.channel=t,n.push(i)}return n}}],(t=null)&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],(t=null)&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var r=h(n(622)),i=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},740(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.16.5","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>W});var i={};n.r(i),n.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>T,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>M,TopicSubscribeType:()=>L});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>x,DateUtils:()=>R,ErrorUtils:()=>b,JsonUtils:()=>Y,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>G,Validations:()=>F});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const r=n.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){const t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,r)=>{e||r(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),r(!1)}})}async put(e,t,n){return new Promise((r,i)=>{e||i(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),r(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+=`${error.errorCode}: ${error.errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(e,t,n){if(null!=e){const r=Object.values(e.ErrorCode).indexOf(t);if(r>=0){const t=Object.keys(e.ErrorCode)[r],i=Object.values(e.ErrorCode)[r];return new v({code:t,errorId:i},Object.values(e.ErrorMessage)[r],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},T=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,r){const i=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&i.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),r&&(s.credentials=r);try{const t=new AbortController;let r;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(r=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(r&&clearTimeout(r),304!=a.status){const t=await a.json();return a.ok?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),M=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),L=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let r=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,r=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):r=new Date(Date.now()+36e5),!t){const e=r.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let r=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+r+" to "+n.state).writeLog(),r=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",x=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const r=window?.crypto?.subtle;if(!r)return;const i=await r.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await r.sign(j,i,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}},Y=class{static compareJSON(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r]){if("object"!=typeof e[r]||"object"!=typeof t[r])return!1;if(!isEqual(e[r],t[r]))return!1}return!0}},F=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},G=class{static setTopicChannel(e,t){const n=[];for(let r=0;r<e.length;r++){const i=e[r];i.channel=t,n.push(i)}return n}},W={Repository:y,Config:c,Api:i,Models:o,Utils:s};return r})(),e.exports=t()},315(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(i.get||i.set)?n(o,s,i):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(254)),i=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(d(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,i,"GeneratorFunction"),d(h),d(h,i,"Generator"),d(h,r,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}d=function(e,t,n,r){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,r)}function h(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){h(o,r,i,s,a,"next",e)}function a(e){h(o,r,i,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,b;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new r.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new i.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(b=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,b));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,b));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,r){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var r=a(n(468)),i=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i;function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((i=n(237))&&i.__esModule?i:{default:i}).default);t.default=f},943(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(r=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new i.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={platform:"webpush",version:"0.0.1"},i=n(904);r.version=i.version,r=Object.assign(r,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=r},610(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}var l=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=new i.default;if(null!=t){r.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,r.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,r.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),r.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),r.setEncryptionType(this.encryptionType)}});t.default=l},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new i.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=n},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=r&&(this.exceptionMessage=r)});t.default=o},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return r.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var r=n(902),i=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,r,o,s){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return i(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,i(h,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,s,"GeneratorFunction"),i(h),i(h,s,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:p}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,n,r){function s(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,n,r)}function o(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,u,"next",e)}function u(e){o(s,r,i,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB},t=[{key:"getDB",value:(c=s(r().m(function e(){var t=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var r=t.IDB;if(r){var i=r.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){var t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(r().m(function e(t,n){var i=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(i.close(t),e(n.target.result.store.value)),r(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(r().m(function e(t,n,i){var o=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.store.put({store:{key:n,value:i}},n).onsuccess=function(n){o.close(t),e(i)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(i=s(r().m(function e(t,n){var i,o;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return i=e.v,e.a(2,this.put(i,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return i.apply(this,arguments)})},{key:"getItem",value:(n=s(r().m(function e(t){var n,i;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,i=e.v,e.a(2,i)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,i,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(122)),i=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,i,"GeneratorFunction"),f(h),f(h,i,"Generator"),f(h,r,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}function d(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){d(o,r,i,s,a,"next",e)}function a(e){d(o,r,i,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=i.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){i.default.setItem(e,t)}},{key:"getStorage",value:function(e){return i.default.getItem(e)}},{key:"clearStorage",value:function(){i.default.clear()}},{key:"setBrowserPublicKey",value:function(e){i.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return i.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){i.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return i.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return i.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(T=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return T.apply(this,arguments)})},{key:"setVAPID",value:function(e){i.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return i.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){i.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return i.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){i.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return i.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){i.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return i.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){i.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return i.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(b=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!i.default&&i.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return i.default&&i.default.getItem(this.PLATFORM)||r.default.platform}},{key:"getVersion",value:function(){return r.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return i.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){i.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return i.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return i.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){i.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return i.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){i.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return i.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){i.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return i.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){i.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return i.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){i.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return i.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){i.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return i.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){i.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==i.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){i.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return i.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){i.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return i.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default&&i.default.isLocalStorageAvailable()&&i.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!i.default||!i.default.isLocalStorageAvailable()){e.n=1;break}t=i.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){i.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return i.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,i.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){i.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return i.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){i.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return i.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,b,T,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new r.default).getServiceTimestamp()||(new r.default).getServiceSyncTime()<=(Date.now()-(new r.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new i.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}],t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(254))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(a(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,i,"GeneratorFunction"),a(h),a(h,i,"Generator"),a(h,r,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}a=function(e,t,n,r){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,r)}function u(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){u(o,r,i,s,a,"next",e)}function a(e){u(o,r,i,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(r=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return r.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var r,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(r=e.v)&&(o=r.state,"onchange"in r&&(r.onchange=function(){new i.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+r.state).writeLog(),o=r.state,n&&n({name:t,state:r.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var r=n(225),i=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,r,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function c(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new i.default).isAvoidCypher()&&(new i.default).getEncryptionType()!==r.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new i.default).getEncryptionType()!==r.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(e){c(o,r,i,s,a,"next",e)}function a(e){c(o,r,i,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var r=this.tryToParseLeniently(n);return r?this.formatCanonicalUTC(r):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=r(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.parseByFormat(e,i);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(735)),i=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new i.default(s,Object.values(e.ErrorMessage)[o],n)}return new i.default(r.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"compareJSON",value:function(e,t){var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,s=r;o<s.length;o++){var a=s[o];if(e[a]!==t[a]){if("object"!=n(e[a])||"object"!=n(t[a]))return!1;if(!isEqual(e[a],t[a]))return!1}}return!0}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=i.default.INFO,this.setLogLevel((new r.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=i.default.DEBUG&&e<=i.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=i.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=i.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=i.default.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+="".concat(error.errorCode,": ").concat(error.errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i.channel=t,n.push(i)}return n}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var r=h(n(622)),i=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.16.5","_id":"indigitall-web-core@4.16.5","_inBundle":false,"_integrity":"sha512-1rudsnXyzNLi8Syln24ZpaMlGsZsLgTWsohGi/fDboS53w4GW4+ln4E96HmoO2vom7CTNBV+gbcscpfgfMNcSw==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.16.5","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.16.5","saveSpec":null,"fetchSpec":"4.16.5"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.16.5.tgz","_shasum":"7011471d0100272867681db5a6e55f5559544aa8","_spec":"indigitall-web-core@4.16.5","_where":"/home/circleci/webpush/customer","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.16.5"}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{default:()=>A});const{Repository:e}=n(315).Core,t=new class extends e{constructor(){super(),this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID"}async setDeviceId(e){this.setStorage(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}},{Validations:i,Log:o}=n(315).Core.Utils,s=class extends i{static isAppKeyFormat(){const e=t.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFormatRequest(){const e=new o("[IND]CustomerValidations: "),n=t.getDeviceId();let r=!0;return this.isAppKeyFormat()||(r=!1,e.w("appKey is null or empty").writeLog()),t.isPushDisabled()||this.isValidFormat(n)||(r=!1,e.w("deviceId is null or empty").writeLog()),r}},a=class{constructor(e){e.id&&(this.id=e.id),e.customerId&&(this.customerId=e.customerId),e.applicationId&&(this.applicationId=e.applicationId),e.createdAt&&(this.createdAt=e.createdAt),e.updatedAt&&(this.updatedAt=e.updatedAt)}getCustomerId(){return this.customerId}getApplicationId(){return this.applicationId}getId(){return this.id}getCreatedAt(){return this.createdAt}getUpdatedAt(){return this.updatedAt}toJSON(){return{id:this.id,customerId:this.customerId,applicationId:this.applicationId,createdAt:this.createdAt,updatedAt:this.updatedAt}}},u=class{constructor(e,t){this.customerFieldKey=e,this.customerFieldValue=t}getCustomerFieldKey(){return this.customerFieldKey}getCustomerFieldValue(){return this.customerFieldValue}toJSON(){return JSON.parse(`"${this.customerFieldKey}":"${this.customerFieldValue}"`)}},{ErrorDictionary:c}=n(315).Core.Models,l=c.ErrorCode;Object.assign(l,{CUSTOMER_GET_ERROR:4001,CUSTOMER_PARAMS_ERROR:4011,CUSTOMER_GENERAL_ERROR:4600,CUSTOMER_NO_EXTERNAL_CODE:4601,DISABLED_CHANNEL:4404});const f=c.ErrorMessage;Object.assign(f,{CUSTOMER_GET_ERROR:"customer get error",CUSTOMER_PARAMS_ERROR:"Params are not correct",CUSTOMER_GENERAL_ERROR:"general error",CUSTOMER_NO_EXTERNAL_CODE:"no external code registered",DISABLED_CHANNEL:"disabled channel"});const d={ErrorCode:l,ErrorMessage:f},{Config:h}=n(315).Core,{BaseClient:p}=n(315).Core.Api,{ErrorModel:E}=n(315).Core.Models,{CommonUtils:y,ErrorUtils:I}=n(315).Core.Utils,g=new class extends p{constructor(){super(),this.URL_BASE=h.client.CUSTOMER_URL_BASE,this.ENDPOINT_CUSTOMER="/customer",this.ENDPOINT_CUSTOMER_FIELD=this.ENDPOINT_CUSTOMER+"/field",this.ENDPOINT_CUSTOMER_LINK=this.ENDPOINT_CUSTOMER+"/link",this.ENDPOINT_EVENT="/event",this.ENDPOINT_CUSTOMER_EVENT_JOURNEY=this.ENDPOINT_CUSTOMER+this.ENDPOINT_EVENT+"/custom"}async getURL(){let e=await t.getUrlDeviceApi();return e?e=e.replaceAll("v1","v2"):h.client.CUSTOMER_URL_BASE}async getCustomer(e,n,r){if(s.isAppKeyFormat()&&s.isValidFormat(t.getExternalId())){const t=await this.get(this.ENDPOINT_CUSTOMER,e.getCustomerRequest());t&&!(t instanceof E)&&t.statusCode>=200&&t.statusCode<300?y.isFunction(n)&&n(new a(t.data)):t?y.isFunction(r)&&r(t):y.isFunction(r)&&r()}else y.isFunction(r)&&r(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async getCustomerField(e,n,r){if(s.isAppKeyFormat()&&s.isValidFormat(t.getExternalId())){const t=await this.get(this.ENDPOINT_CUSTOMER_FIELD,e.getCustomerFieldRequest()),i=[];for(const e in t.data)t.data.hasOwnProperty(e)&&i.push(new u(e,t.data[e]));t&&i.length>0&&!(t instanceof E)&&t.statusCode>=200&&t.statusCode<300?y.isFunction(n)&&n(i):t?y.isFunction(r)&&r(t):y.isFunction(r)&&r()}else y.isFunction(r)&&r(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async putCustomerField(e,n,r){if(s.isAppKeyFormat()&&s.isValidFormat(t.getExternalId())){const t=await this.put(this.ENDPOINT_CUSTOMER_FIELD,e.putCustomerFieldRequest());this.getCustomerResponse(t,n,r)}else y.isFunction(r)&&r(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async deleteCustomerField(e,n,r){if(s.isAppKeyFormat()&&s.isValidFormat(t.getExternalId())){const t=await this.delete(this.ENDPOINT_CUSTOMER_FIELD,e.deleteCustomerFieldRequest());this.getCustomerResponse(t,n,r)}else y.isFunction(r)&&r(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async postCustomerLink(e,n,r){if(s.isValidFormatRequest()&&s.isValidFormat(t.getExternalId())){const t=await this.post(this.ENDPOINT_CUSTOMER_LINK,e.postAndDeleteCustomerLinkRequest());this.getCustomerResponse(t,n,r)}else y.isFunction(r)&&r(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async deleteCustomerLink(e,n,r){if(s.isValidFormatRequest()&&s.isValidFormat(t.getExternalId())){const t=await this.delete(this.ENDPOINT_CUSTOMER_LINK,e.postAndDeleteCustomerLinkRequest());this.getCustomerResponse(t,n,r)}else y.isFunction(r)&&r(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async getCustomerResponse(e,t,n){e&&!(e instanceof E)&&e.statusCode>=200&&e.statusCode<300?y.isFunction(t)&&(""!=e.data?t(e.data):t()):e?y.isFunction(n)&&n(e):y.isFunction(n)&&n()}async postCustomJourneyEvent(e,n,r){if(s.isValidFormatRequest()&&s.isValidFormat(t.getExternalId())){const t=await this.post(this.ENDPOINT_CUSTOMER_EVENT_JOURNEY,e.postCustomEventRequest());this.getCustomerResponse(t,n,r)}else y.isFunction(r)&&r(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}},{BaseEventRequest:m}=n(315).Core.Api,{Device:_}=n(315).Core.Models,v=class extends m{constructor(){super(),null!=t.getExternalId()&&(this.customerId=t.getExternalId())}postCustomEventRequest(){return this.params="",this.body=this.createCustomEventBodyJson(),this}createCustomEventBodyJson(){const e={};try{e.customData=this.customData,e.eventType=this.eventType,e.externalCode=this.customerId,e.eventId=this.eventId,e.eventAt=this.eventAt}catch(e){console.log("Error creating custom event request: "+e)}return e}setEventType(e){this.eventType=e}setCustomData(e){this.customData=e}},{BaseRequest:S}=n(315).Core.Api,{Device:b}=n(315).Core.Models,T=class extends S{constructor(){super(),this.device=new b,null!=t.getExternalId()&&(this.customerId=t.getExternalId()),this.fieldNames,this.link,this.fields,this.eventType,this.customData}getCustomerRequest(){return this.params=this.createQueryStringCustomerId(),this}getCustomerFieldRequest(){return this.params=this.createQueryString(),this}putCustomerFieldRequest(){return this.params=this.createQueryStringCustomerId(),this.body=this.createBodyJson(),this}deleteCustomerFieldRequest(){return this.params=this.createQueryStringCustomerId(),this.body=this.createDeleteBodyJson(),this}postAndDeleteCustomerLinkRequest(){return this.params="",this.body=this.createBodyJson(),this}createQueryString(){let e="";return e+=this.createQueryStringCustomerId(),this.fieldNames&&(e+=`&${this.PARAM_CUSTOMER_FIELD_NAMES}=${this.fieldNames}`),this.fields&&(e+=`&${this.PARAM_CUSTOMER_FIELDS}=${this.fields}`),this.link&&(e+=`&${this.PARAM_CUSTOMER_LINK}=${this.link}`),e}createQueryStringCustomerId(){return this.PARAM_CUSTOMER_ID+"="+this.customerId}createBodyJson(){let e={};try{this.channel&&"none"!=this.channel&&(e.channel=this.channel,this.device&&this.device.deviceId&&(e.deviceId=this.device.deviceId),this.customerId&&(e.customerId=this.customerId)),this.link&&(e.link=this.link),this.fields&&(e=this.fields)}catch(e){console.log("Error fieldNames request :"+e)}return e}createDeleteBodyJson(){const e={},t=[];try{if(this.fieldNames){for(let e=0;e<this.fieldNames.length;e++)t.push(this.fieldNames[e]);e.fields=t}}catch(e){console.log("Error fieldNames request :"+e)}return e}setFields(e){this.fields=e}setFieldNames(e){this.fieldNames=e}setLink(e){this.link=e}setChannel(e){this.channel=e}setEventType(e){this.eventType=e}setCustomData(e){this.customData=e}},{CommonUtils:O,ErrorUtils:P}=n(315).Core.Utils,A=class{static async getCustomer(e,t){const n=new T;await g.getCustomer(n,e,t)}static async getCustomerInformation(e,t,n){const r=new T;null!=e&&(Array.isArray(e)?r.setFieldNames(e):O.isFunction(n)&&n(P.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))),await g.getCustomerField(r,t,n)}static async assignOrUpdateValueToCustomerFields(e,t,n){let r;try{"string"==typeof e?r=JSON.parse(r):"object"==typeof e&&(r=e)}catch(e){O.isFunction(n)&&n(P.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS,e))}if(r){const e=new T;e.setFields(r),await g.putCustomerField(e,t,n)}else O.isFunction(n)&&n(P.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))}static async deleteValuesFromCustomerFields(e,t,n){if(Array.isArray(e)){const r=new T;r.setFieldNames(e),await g.deleteCustomerField(r,t,n)}else O.isFunction(n)&&n(P.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))}static async link(e,t,n){if("none"===e)return void(O.isFunction(n)&&n(P.showError(d,d.ErrorCode.DISABLED_CHANNEL)));const r=new T;r.setChannel(e),await g.postCustomerLink(r,t,n)}static async unlink(e,t,n){if("none"==e)return void(O.isFunction(n)&&n(P.showError(d,d.ErrorCode.DISABLED_CHANNEL)));const r=new T;r.setChannel(e),await g.deleteCustomerLink(r,t,n)}static async sendCustomerCustomEvent(e,t,n=null,r=null,i,o){let s,a;try{"string"==typeof t?s=JSON.parse(t):"object"==typeof t&&(s=t),"string"==typeof e&&(a=e)}catch(e){O.isFunction(o)&&o(P.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))}if(s&&a){const e=new v;e.setCustomData(s),e.setEventType(a),e.setEventId(n),e.setEventAt(r),await g.postCustomJourneyEvent(e,i,o)}else O.isFunction(o)&&o(P.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))}}})(),r})(),e.exports=t()},960(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(740));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},126(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.16.5","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>W});var i={};n.r(i),n.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>T,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>M,TopicSubscribeType:()=>L});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>x,DateUtils:()=>R,ErrorUtils:()=>b,JsonUtils:()=>Y,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>G,Validations:()=>F});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const r=n.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){const t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,r)=>{e||r(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),r(!1)}})}async put(e,t,n){return new Promise((r,i)=>{e||i(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),r(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+=`${error.errorCode}: ${error.errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(e,t,n){if(null!=e){const r=Object.values(e.ErrorCode).indexOf(t);if(r>=0){const t=Object.keys(e.ErrorCode)[r],i=Object.values(e.ErrorCode)[r];return new v({code:t,errorId:i},Object.values(e.ErrorMessage)[r],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},T=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,r){const i=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&i.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),r&&(s.credentials=r);try{const t=new AbortController;let r;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(r=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(r&&clearTimeout(r),304!=a.status){const t=await a.json();return a.ok?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),M=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),L=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let r=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,r=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):r=new Date(Date.now()+36e5),!t){const e=r.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let r=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+r+" to "+n.state).writeLog(),r=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",x=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const r=window?.crypto?.subtle;if(!r)return;const i=await r.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await r.sign(j,i,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}},Y=class{static compareJSON(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r]){if("object"!=typeof e[r]||"object"!=typeof t[r])return!1;if(!isEqual(e[r],t[r]))return!1}return!0}},F=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},G=class{static setTopicChannel(e,t){const n=[];for(let r=0;r<e.length;r++){const i=e[r];i.channel=t,n.push(i)}return n}},W={Repository:y,Config:c,Api:i,Models:o,Utils:s};return r})(),e.exports=t()},315(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(i.get||i.set)?n(o,s,i):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(254)),i=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(d(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,i,"GeneratorFunction"),d(h),d(h,i,"Generator"),d(h,r,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}d=function(e,t,n,r){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,r)}function h(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){h(o,r,i,s,a,"next",e)}function a(e){h(o,r,i,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,b;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new r.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new i.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(b=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,b));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,b));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,r){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var r=a(n(468)),i=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i;function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((i=n(237))&&i.__esModule?i:{default:i}).default);t.default=f},943(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(r=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new i.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={platform:"webpush",version:"0.0.1"},i=n(904);r.version=i.version,r=Object.assign(r,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=r},610(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}var l=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=new i.default;if(null!=t){r.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,r.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,r.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),r.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),r.setEncryptionType(this.encryptionType)}});t.default=l},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new i.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=n},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=r&&(this.exceptionMessage=r)});t.default=o},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return r.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var r=n(902),i=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,r,o,s){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return i(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,i(h,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,s,"GeneratorFunction"),i(h),i(h,s,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:p}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,n,r){function s(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,n,r)}function o(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,u,"next",e)}function u(e){o(s,r,i,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB},t=[{key:"getDB",value:(c=s(r().m(function e(){var t=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var r=t.IDB;if(r){var i=r.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){var t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(r().m(function e(t,n){var i=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(i.close(t),e(n.target.result.store.value)),r(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(r().m(function e(t,n,i){var o=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.store.put({store:{key:n,value:i}},n).onsuccess=function(n){o.close(t),e(i)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(i=s(r().m(function e(t,n){var i,o;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return i=e.v,e.a(2,this.put(i,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return i.apply(this,arguments)})},{key:"getItem",value:(n=s(r().m(function e(t){var n,i;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,i=e.v,e.a(2,i)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,i,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(122)),i=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,i,"GeneratorFunction"),f(h),f(h,i,"Generator"),f(h,r,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}function d(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){d(o,r,i,s,a,"next",e)}function a(e){d(o,r,i,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=i.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){i.default.setItem(e,t)}},{key:"getStorage",value:function(e){return i.default.getItem(e)}},{key:"clearStorage",value:function(){i.default.clear()}},{key:"setBrowserPublicKey",value:function(e){i.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return i.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){i.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return i.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return i.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(T=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return T.apply(this,arguments)})},{key:"setVAPID",value:function(e){i.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return i.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){i.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return i.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){i.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return i.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){i.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return i.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){i.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return i.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(b=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!i.default&&i.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return i.default&&i.default.getItem(this.PLATFORM)||r.default.platform}},{key:"getVersion",value:function(){return r.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return i.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){i.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return i.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return i.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){i.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return i.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){i.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return i.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){i.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return i.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){i.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return i.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){i.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return i.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){i.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return i.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){i.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==i.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){i.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return i.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){i.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return i.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default&&i.default.isLocalStorageAvailable()&&i.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!i.default||!i.default.isLocalStorageAvailable()){e.n=1;break}t=i.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){i.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return i.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,i.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){i.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return i.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){i.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return i.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,b,T,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new r.default).getServiceTimestamp()||(new r.default).getServiceSyncTime()<=(Date.now()-(new r.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new i.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}],t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(254))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(a(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,i,"GeneratorFunction"),a(h),a(h,i,"Generator"),a(h,r,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}a=function(e,t,n,r){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,r)}function u(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){u(o,r,i,s,a,"next",e)}function a(e){u(o,r,i,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(r=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return r.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var r,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(r=e.v)&&(o=r.state,"onchange"in r&&(r.onchange=function(){new i.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+r.state).writeLog(),o=r.state,n&&n({name:t,state:r.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var r=n(225),i=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,r,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function c(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new i.default).isAvoidCypher()&&(new i.default).getEncryptionType()!==r.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new i.default).getEncryptionType()!==r.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(e){c(o,r,i,s,a,"next",e)}function a(e){c(o,r,i,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var r=this.tryToParseLeniently(n);return r?this.formatCanonicalUTC(r):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=r(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.parseByFormat(e,i);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(735)),i=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new i.default(s,Object.values(e.ErrorMessage)[o],n)}return new i.default(r.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"compareJSON",value:function(e,t){var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,s=r;o<s.length;o++){var a=s[o];if(e[a]!==t[a]){if("object"!=n(e[a])||"object"!=n(t[a]))return!1;if(!isEqual(e[a],t[a]))return!1}}return!0}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=i.default.INFO,this.setLogLevel((new r.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=i.default.DEBUG&&e<=i.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=i.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=i.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=i.default.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+="".concat(error.errorCode,": ").concat(error.errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i.channel=t,n.push(i)}return n}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var r=h(n(622)),i=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.16.5","_id":"indigitall-web-core@4.16.5","_inBundle":false,"_integrity":"sha512-1rudsnXyzNLi8Syln24ZpaMlGsZsLgTWsohGi/fDboS53w4GW4+ln4E96HmoO2vom7CTNBV+gbcscpfgfMNcSw==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.16.5","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.16.5","saveSpec":null,"fetchSpec":"4.16.5"},"_requiredBy":["#USER","/","/indigitall-web-customer"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.16.5.tgz","_shasum":"7011471d0100272867681db5a6e55f5559544aa8","_spec":"indigitall-web-core@4.16.5","_where":"/home/circleci/webpush/inapp","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.16.5"}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{default:()=>xe});const{BaseRequest:e}=n(315).Core.Api,t=class extends e{constructor(){super(),this.PARAM_INAPP_LIMIT="limit",this.PARAM_INAPP_PAGE="page",this.INAPP_TOPIC_LIST_LIMIT=20,this.page=0}getTopicsRequest(){return this.params=this.getTopicsQuery(),this}getTopicsQuery(){let e="";return e+=`${this.PARAM_INAPP_LIMIT}=${o.getInAppTopicPageLimit()}&`,e+=`${this.PARAM_INAPP_PAGE}=${this.page}`,e}},{Repository:i}=n(315).Core,o=new class extends i{constructor(){super(),this.INAPP_SHOW_ONCE=this.REPOSITORY+".INAPP_SHOW_ONCE",this.INAPP_TIMES_CLICKED=this.REPOSITORY+".INAPP_TIMES_CLICKED",this.INAPP_DISMISS_FOREVER=this.REPOSITORY+".INAPP_DISMISS_FOREVER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.INAPP_TOPICS_SYNC=this.REPOSITORY+".INAPP_TOPICS_SYNC",this.AVOID_ACTION=this.REPOSITORY+".AVOID_ACTION",this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_INAPP_V2_SERVICE_SYNC_TIME",this.AUDIENCE_DATE_CACHE_TTL=this.REPOSITORY+".AUDIENCE_DATE_CACHE_TTL",this.INAPP_AUDIENCES=this.REPOSITORY+".INAPP_AUDIENCES",this.INAPP_AUDIENCES_CACHE=this.REPOSITORY+".INAPP_AUDIENCES_CACHE",this.INAPP_AUDIENCES_LAST_UPDATE=this.REPOSITORY+".INAPP_AUDIENCES_LAST_UPDATE",this.INAPP_CACHE=this.REPOSITORY+".INAPP_CACHE",this.INAPP_LIMIT_TO_IGNORE=this.REPOSITORY+".INAPP_LIMIT_TO_IGNORE",this.INAPP_PROFILE=this.REPOSITORY+".INAPP_PROFILE",this.INAPP_TIME_SLIDE_CAROUSEL=this.REPOSITORY+".INAPP_TIME_SLIDE_CAROUSEL",this.INAPP_TOPIC_PAGE_LIMIT=this.REPOSITORY+".INAPP_TOPIC_PAGE_LIMIT",this.INAPP_AUDIENCE_DEVICE_ID_ENABLED=this.REPOSITORY+".INAPP_AUDIENCE_DEVICE_ID_ENABLED"}async setItemStorage(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_CACHE,e),this.setItemSessionStorage(this.REPOSITORY,e)}async getItemStorage(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()&&(e=this.getItemSessionStorage(this.REPOSITORY)),!e&&this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_CACHE))}catch(e){}return e}setDeviceId(e){this.setStorage(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}getInAppShowOnce(){return this.getStorage(this.INAPP_SHOW_ONCE)}setInAppShowOnce(e){this.setStorage(this.INAPP_SHOW_ONCE,e)}getInAppTimesClicked(){return this.getStorage(this.INAPP_TIMES_CLICKED)}setInAppTimesClicked(e){this.setStorage(this.INAPP_TIMES_CLICKED,e)}getInAppDismissForever(){return this.getStorage(this.INAPP_DISMISS_FOREVER)}setInAppDismissForever(e){this.setStorage(this.INAPP_DISMISS_FOREVER,e)}getInAppTopics(){return this.getStorage(this.INAPP_TOPICS)?this.getStorage(this.INAPP_TOPICS).split(","):null}setInAppTopics(e){this.setStorage(this.INAPP_TOPICS,e)}async getInAppTopicsSync(){let e=null;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS_SYNC))}catch(e){}return e}async setInAppTopicsSync(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS_SYNC,e)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){}return e}isAvoidAction(){return this.getStorage(this.AVOID_ACTION)}setAvoidAction(e){this.setStorage(this.AVOID_ACTION,e)}getConfigInAppV2ServiceSyncTime(){return this.getStorage(this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME)}setConfigInAppV2ServiceSyncTime(e){this.setStorage(this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME,e)}getInAppAudienceDateCacheTtl(){return this.getStorage(this.AUDIENCE_DATE_CACHE_TTL)}setInAppAudienceDateCacheTtl(e){this.setStorage(this.AUDIENCE_DATE_CACHE_TTL,e)}getAudienceModel(){return this.getStorage(this.INAPP_AUDIENCES)}setAudienceModel(e){this.setStorage(this.INAPP_AUDIENCES,e)}getAudienceCache(){return this.getStorage(this.INAPP_AUDIENCES_CACHE)}setAudienceCache(e){this.setStorage(this.INAPP_AUDIENCES_CACHE,e)}getAudienceLastUpdate(){return this.getStorage(this.INAPP_AUDIENCES_LAST_UPDATE)}setAudienceLastUpdate(e){this.setStorage(this.INAPP_AUDIENCES_LAST_UPDATE,e)}getInAppCache(){const e=this.getStorage(this.INAPP_CACHE);try{return e?JSON.parse(e):[]}catch(e){return console.log("getInAppCache: invalid JSON in storage",e),[]}}setInAppCache(e){if(Array.isArray(e))try{const t=JSON.stringify(e);this.setStorage(this.INAPP_CACHE,t)}catch(e){console.log("setInAppCache: error stringifying value",e)}else console.log("setInAppCache: value must be a JSON array")}getInAppLimitToIgnore(){return this.getStorage(this.INAPP_LIMIT_TO_IGNORE)}setInAppLimitToIgnore(e){this.setStorage(this.INAPP_LIMIT_TO_IGNORE,e)}getInAppProfile(){const e=this.getStorage(this.INAPP_PROFILE);return null==e||""===e?null:e}setInAppProfile(e){let t="";null!==e&&(t=e),this.setStorage(this.INAPP_PROFILE,t)}getInAppTopicPageLimit(){const e=this.getStorage(this.INAPP_TOPIC_PAGE_LIMIT);return 0==e?(new t).INAPP_TOPIC_LIST_LIMIT:e}setInAppTopicPageLimit(e){this.setStorage(this.INAPP_TOPIC_PAGE_LIMIT,e)}getTimeSlideForCarousel(){return this.getStorage(this.INAPP_TIME_SLIDE_CAROUSEL)}setTimeSlideForCarousel(e){this.setStorage(this.INAPP_TIME_SLIDE_CAROUSEL,e)}isAudienceDeviceIdEnabled(){return!!this.getStorage(this.INAPP_AUDIENCE_DEVICE_ID_ENABLED)&&this.getStorage(this.INAPP_AUDIENCE_DEVICE_ID_ENABLED)}setAudienceDeviceIdEnabled(e){this.setStorage(this.INAPP_AUDIENCE_DEVICE_ID_ENABLED,e)}},{Validations:s,Log:a}=n(315).Core.Utils,u=class extends s{static isAppKeyFormat(){const e=o.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFieldFormat(e){return null!=e&&""!=e&&"null"!=e}static isValidFormatRequest(){const e=new a("[IND]InAppValidations: "),t=o.getDeviceId();let n=!0;return this.isAppKeyFormat()||(n=!1,e.w("appKey is null or empty").writeLog()),this.isValidFormat(t)||(n=!1,e.w("deviceId is null or empty").writeLog()),n}static getInAppRegisterInvalidFields(){const e=[],t=this.isValidFormatRequest(),n=this.isValidFieldFormat(o.getExternalId());return t||e.push("deviceId"),o.isAudienceDeviceIdEnabled()||n||e.push("externalCode"),e}},{ErrorDictionary:c}=n(315).Core.Models,l=c.ErrorCode;Object.assign(l,{INAPP_ERROR:2e3,INAPP_SHOW_INAPP_ERROR:2100,INAPP_WAS_EXPIRED:2101,INAPP_WAS_SHOWN_MANY_TIMES:2102,INAPP_WAS_CLICKED_MANY_TIMES:2103,INAPP_TOPIC_EMPTY:2104,INAPP_TOPIC_LIST_NO_MORE_PAGES:2005,INAPP_CAMPAIGN_NOT_EXIST:2403,INAPP_FORM_TYPE_NOT_CORRECT:2120,INAPP_FORM_FIELD_IS_EMPTY:2121,INAPP_POPUP_ERROR:2300,INAPP_WAS_DISMISSED_FOREVER:2304,INAPP_ERROR_CONTENT_MESSAGE:2305,INAPP_INSTANCE_TOPICS_ERROR:2306,INAPP_GENERAL_ERROR:2600,INAPP_AUDIENCES_BAD_REQUEST:4803,INAPP_AUDIENCE_NO_CHANGE:304});const f=c.ErrorMessage;Object.assign(f,{INAPP_ERROR:"inApp error",INAPP_SHOW_INAPP_ERROR:"error on show inApp",INAPP_WAS_EXPIRED:"InApp cache has timed out",INAPP_WAS_SHOWN_MANY_TIMES:"InApp was shown more than $x times",INAPP_WAS_CLICKED_MANY_TIMES:"InApp was clicked more than $x times",INAPP_TOPIC_EMPTY:"There is no inApp Topics subscription",INAPP_TOPIC_LIST_NO_MORE_PAGES:"No more pages for inApp topics",INAPP_CAMPAIGN_NOT_EXIST:"Campaign doesn't exist with the code",INAPP_FORM_TYPE_NOT_CORRECT:"Input type is not correct",INAPP_FORM_FIELD_IS_EMPTY:"Field is empty",INAPP_POPUP_ERROR:"error on popup",INAPP_WAS_DISMISSED_FOREVER:"InApp was dismissed forever",INAPP_ERROR_CONTENT_MESSAGE:"InApp error with content",INAPP_INSTANCE_TOPICS_ERROR:"topics instance is not correct, only string[] is valid types",INAPP_GENERAL_ERROR:"inApp general error",INAPP_AUDIENCES_BAD_REQUEST:"Audience bad request",INAPP_AUDIENCE_NO_CHANGE:"Audience with no change"});const d={ErrorCode:l,ErrorMessage:f},h=class{constructor(e){this.URL="url",e.actionId&&(this.actionId=e.actionId),e.destroy&&(this.destroy=e.destroy),e.topics&&(this.topics=e.topics),e.type&&(this.type=e.type),e.url&&(this.url=e.url),e.app&&(this.app=e.app),e.no_action&&(this.no_action=e.no_action)}},p=class{constructor(e){e.borderRadius&&(this.borderRadius=e.borderRadius)}},E=class{constructor(e){e.contentUrl&&(this.contentUrl=e.contentUrl),e.showTime&&(this.showTime=e.showTime),e.numberOfShows&&(this.numberOfShows=e.numberOfShows),e.numberOfClicks&&(this.numberOfClicks=e.numberOfClicks),e.dismissForever&&(this.dismissForever=e.dismissForever),e.layout&&(this.layout=new p(e.layout)),e.action&&(this.action=new h(e.action))}setAction(e){this.action=e}},y=class{constructor(e){this.timesShowed=0,this.timesClicked=0,this.wasDismissed=!1,e&&(e.timesShowed&&(this.timesShowed=e.timesShowed),e.timesClicked&&(this.timesClicked=e.timesClicked),e.wasDismissed&&(this.wasDismissed=e.wasDismissed))}},I=class{static async searchInApp(e){console.warn("searchInApp is deprecated. Use searchInAppWithInApp(inApp) instead.");const t=await this.getListInApp();return null==t?null:this.findInAppFromInAppList(t,e)}static async searchListInAppWithCode(e){const t=await this.getListInApp();return null==t?null:this.findInAppsFromInAppList(t,e)}static async searchInAppWithInAppIdAndSchema(e,t){console.warn("searchInAppWithInAppIdAndSchema is deprecated. Use searchInAppWithInApp(inApp) instead.");const n=await this.getListInApp();return null==n?null:this.getInAppFromIdAndCode(n,e,t)}static async searchInAppWithInAppId(e){console.warn("searchInAppWithInAppId is deprecated. Use searchInAppWithInApp(inApp) instead.");const t=await this.getListInApp();return null==t?null:this.findInAppFromInAppListWithInAppId(t,e)}static async searchInAppWithInApp(e){const t=await this.getListInApp();return null==t?null:this.findInAppsFromInAppListWithInApp(t,e)}static async addInApp(e){let t=await this.getListInApp();null!=t?t.push(e):t=[e],await o.setItemStorage(JSON.stringify(t))}static async getListInApp(){let e=null;try{const t=await o.getItemStorage();t&&(e=JSON.parse(t))}catch(e){console.log(e)}return e}static async addInAppNewClick(e){this.updateInAppField(e,!0,null,null)}static async addInAppNewShow(e){this.updateInAppField(e,null,!0,null)}static async addInAppDismissForever(e){this.updateInAppField(e,null,null,!0)}static async updateInAppField(e,t,n,r){const i=await this.getListInApp(),s=[];if(null!=i){const a=o.getInAppProfile();for(let o=0;o<i.length;o++)a?i[o].inAppId==e.inAppId&&i[o].profile&&i[o].profile==a&&(null!=t&&(i[o].inAppShow.timesClicked+=1),null!=n&&(i[o].inAppShow.timesShowed+=1),null!=r&&(i[o].inAppShow.wasDismissed=!0)):i[o].inAppId!=e.inAppId||void 0!==i[o].profile&&null!==i[o].profile&&""!==i[o].profile||(null!=t&&(i[o].inAppShow.timesClicked+=1),null!=n&&(i[o].inAppShow.timesShowed+=1),null!=r&&(i[o].inAppShow.wasDismissed=!0)),s.push(i[o])}await o.setItemStorage(JSON.stringify(s))}static async updateInApp(e){const t=await this.getListInApp(),n=[];let r=null,i=!1;const s=o.getInAppProfile();if(null!=t)for(let o=0;o<t.length;o++)s?t[o].inAppId===e.inAppId&&t[o].schema.code===e.schema.code&&t[o].profile===s?(e.profile=s,i=!0):n.push(t[o]):t[o].inAppId===e.inAppId&&t[o].schema.code===e.schema.code?i=!0:n.push(t[o]),i&&(t[o].filters&&(e.filters=t[o].filters),t[o].name&&(e.name=t[o].name),null!=t[o].properties&&(e.properties=new E(t[o].properties)),null!=t[o].inAppShow&&(e.inAppShow=new y(t[o].inAppShow)),n.push(e),r=e);return await o.setItemStorage(JSON.stringify(n)),r}static async deleteInApp(e){let t=!1;const n=await this.getListInApp(),r=[];if(null!=n)for(let i=0;i<n.length;i++)n[i].inAppId!=e.inAppId?r.push(n[i]):t=!0;return await o.setItemStorage(JSON.stringify(r)),t}static async deleteInAppIfOldVersion(e){let t=!1;const n=await this.getListInApp(),r=[];if(null!=n)for(let i=0;i<n.length;i++)n[i].inAppId!=e.inAppId?r.push(n[i]):n[i].version<=e.version?t=!0:r.push(n[i]);return t}static async findInAppsFromInAppListWithInApp(e,t){if(null!=e){const n=o.getInAppProfile();for(let r=0;r<e.length;r++)if(n){if(e[r].inAppId&&e[r].inAppId==t.inAppId&&e[r].schema.code&&e[r].schema.code==t.schema.code&&e[r].profile&&e[r].profile==n)return e[r]}else if(e[r].inAppId&&e[r].inAppId==t.inAppId&&e[r].schema.code&&e[r].schema.code==t.schema.code&&(void 0===e[r].profile||null===e[r].profile||""===e[r].profile))return e[r]}return null}static async findInAppFromInAppListWithInAppId(e,t){if(null!=e){const n=o.getInAppProfile();for(let r=0;r<e.length;r++)if(n){if(e[r].inAppId&&e[r].inAppId==t&&e[r].profile&&e[r].profile==n)return e[r]}else if(e[r].inAppId&&e[r].inAppId==t&&(void 0===e[r].profile||null===e[r].profile||""===e[r].profile))return e[r]}return null}static async findInAppFromInAppList(e,t){if(null!=e){const n=o.getInAppProfile();for(let r=0;r<e.length;r++)if(n){if(e[r].profile&&e[r].profile==n&&e[r].schema&&e[r].schema.code&&e[r].schema.code==t)return e[r]}else if(e[r].schema&&e[r].schema.code&&e[r].schema.code==t)return e[r]}return null}static async findInAppsFromInAppList(e,t){const n=[];if(null!=e){const r=o.getInAppProfile();for(let i=0;i<e.length;i++)r?e[i].schema&&e[i].schema.code&&e[i].schema.code==t&&e[i].profile&&e[i].profile==r&&n.push(e[i]):e[i].schema&&e[i].schema.code&&e[i].schema.code==t&&(void 0===e[i].profile||null===e[i].profile||""===e[i].profile)&&n.push(e[i])}return n}static async getInAppFromIdAndCode(e,t,n){let r=null;if(null!=e)for(let i=0;i<e.length;i++)e[i].schema&&e[i].schema.code&&e[i].schema.code==n&&e[i].inAppId&&e[i].inAppId==t&&(r=e[i]);return r}};class g{static TIME_CACHE=36e5;static inAppWasCached(e){const t=o.getInAppCache();for(let n=0;n<t.length;n++){const r=t[n],i=new v("string"==typeof r?JSON.parse(r):r);let s=o.getInAppProfile();if(s){if(i.schema.code===e&&i.profile===s)return i}else if(i.schema.code===e&&(void 0===i.profile||null===i.profile))return i}return null}static addNewInAppToCache(e){const t=o.getInAppCache();let n=!1;for(let r=0;r<t.length;r++)try{const i=t[r],s=new v("string"==typeof i?JSON.parse(i):i);let a=o.getInAppProfile();if(a){if(s.profile&&s.profile===a&&s.inAppId===e.inAppId&&s.schema.code===e.schema.code){n=!0;break}}else if((void 0===s.profile||null===s.profile||""===s.profile)&&s.inAppId===e.inAppId&&s.schema.code===e.schema.code){n=!0;break}}catch(e){console.log("addNewInAppToCache: JSON parse error",e)}if(!n){e.creationDate=x.getDate((new Date).getTime());let n=g.TIME_CACHE;e.cacheTtl&&(n=1e3*e.cacheTtl),e.expiredDate=x.getDate((new Date).getTime()+n),t.push(e)}o.setInAppCache(t)}static deleteInAppFromCache(e){let t=o.getInAppCache(),n=t.length;return t=t.filter(t=>{try{return!(new v("string"==typeof t?JSON.parse(t):t).schema.code===e.schema.code)}catch(e){return console.log("deleteInAppFromCache: JSON parse error",e),!0}}),o.setInAppCache(t),n>t.length}}const m=g,_=class{constructor(e){e.code&&(this.code=e.code),e.width&&(this.width=e.width),e.height&&(this.height=e.height)}},v=class{constructor(e){if(e.cacheTtl&&(this.cacheTtl=e.cacheTtl),e.inAppId&&(this.inAppId=e.inAppId),e.showOnce&&(this.showOnce=e.showOnce),e.version&&(this.version=e.version),e.customData&&(this.customData=e.customData),e.creationDate?this.creationDate=e.creationDate:this.creationDate=x.getDate((new Date).getTime()),e.expiredDate)this.expiredDate=e.expiredDate;else{let e=m.TIME_CACHE;this.cacheTtl&&(e=1e3*this.cacheTtl),this.expiredDate=x.getDate((new Date).getTime()+e)}e.schema&&(this.schema=new _(e.schema)),e.properties&&(this.properties=new E(e.properties)),this.inAppShow=new y(e.inAppShow),e.filters&&(this.filters=e.filters),e.name&&(this.name=e.name),e.profile&&(this.profile=e.profile)}},{BaseRequest:S}=n(315).Core.Api,{Config:b}=n(315).Core,T=class extends S{constructor(){super(),o.getDeviceId()?this.deviceId=o.getDeviceId():this.deviceId=x.generateDeviceId()}setEventType(e){this.eventType=e}setInAppId(e){this.inAppId=e}setActionId(e){this.actionId=e}setClickedButton(e){this.clickedButton=e}setLastVersionId(e){this.lastVersionId=e}setVersion(e){this.version=e}setDeviceId(e){this.deviceId=e}setPlatform(e){this.platform=e}postEventPrintRequest(){const e=this.fillJsonEventRequest();return this.body=e,this}postEventClickRequest(){const e=this.fillJsonEventRequest();return e.actionId=this.actionId,this.body=e,this}fillJsonEventRequest(){const e={};return e.deviceId=this.deviceId,o.getExternalId()&&(e.externalCode=o.getExternalId()),e.inAppId=this.inAppId,e.platform=b.platform,e.version=this.version,e}postEventInAppRequest(){const e={};return e.inAppId=this.inAppId,e.lastVersionId=this.lastVersionId,e.deviceId=this.deviceId,this.eventType&&(e.eventType=this.eventType),e.platform=this.platform,e.clickedButton=this.clickedButton,this.body=e,this}},{BaseRequest:O}=n(315).Core.Api,{EncryptionType:P}=n(315).Core.Models,A=class extends O{constructor(){super(),u.isValidFieldFormat(o.getExternalId())&&(this.customerId=o.getExternalId(),!0!==o.isAvoidCypher()&&o.getEncryptionType()!=P.RAW||(this.customerId=encodeURIComponent(o.getExternalId()))),null!=o.getDeviceId()&&(this.deviceId=o.getDeviceId())}setFields(e){this.fields=e}putCustomerFieldRequest(){return this.params=this.createQueryStringCustomerId(),this.body=this.createBodyJson(),this}createQueryStringCustomerId(){return this.PARAM_CUSTOMER_ID+"="+this.customerId}createBodyJson(){let e={};try{e.channel="inapp",this.deviceId&&(e.deviceId=this.deviceId),o.getExternalId()&&(e.customerId=o.getExternalId()),this.fields&&(e=this.fields)}catch(e){console.log("Error fieldNames request :"+e)}return e}},{BaseRequest:R}=n(315).Core.Api,{Config:w}=n(315).Core,N=class extends R{constructor(){super()}setInAppId(e){this.inAppId=e}setVersion(e){this.version=e}setJsonForm(e){this.jsonForm=e}postForm(){return this.body=this.createBody(),this}createBody(){const e={};return o.getDeviceId()&&(e.deviceId=o.getDeviceId()),o.getExternalId()&&(e.externalCode=o.getExternalId()),this.jsonForm&&(e.form=this.jsonForm),e.inAppId=this.inAppId,e.platform=w.platform,e.version=this.version,e}},C=class{static sendEventPrint(e){const t=new T;t.setInAppId(e.inAppId),t.setVersion(e.version),fe.postEventPrint(t)}static sendEventClick(e){const t=new T;t.setActionId(e.properties.action.actionId),t.setInAppId(e.inAppId),t.setVersion(e.version),fe.postEventClick(t)}static sendEventForm(e,t,n){const r=new N;r.setVersion(t),r.setInAppId(e),r.setJsonForm(n),fe.postEventForm(r)}static sendEventFormToCustomer(e){const t=new A;t.setFields(e),fe.putCustomerField(t)}},{DeviceStatus:D,Device:M}=n(315).Core.Models,{BaseRequest:L}=n(315).Core.Api,U=class extends L{constructor(){super(),this.device=new M}postDeviceRequest(){return this.body=this.createDeviceJson(),this.status!==D.DEFAULT&&(this.body.enabled=1===this.status),this}createDeviceJson(){let e={};try{e=this.device.toJSON()}catch(e){console.log(e)}return e}},{Log:B,CryptoUtils:k,CorePermissions:V}=n(315).Core.Utils,{EventType:j}=n(315).Core.Models,x=class{constructor(){this.MONTH=24192e5}static onClickAction(e){"false"===o.isAvoidAction()&&e.type==e.URL&&window.open(e.url)}static async addNewInApp(e){await I.addInApp(e)}static addNewInAppClick(e){e.properties.numberOfClicks&&e.properties.numberOfClicks>0&&I.addInAppNewClick(e),C.sendEventClick(e)}static addNewInApptoDismissForever(e){I.addInAppDismissForever(e)}static async isInAppDismissForever(e){const t=await I.searchInAppWithInApp(e);return!(null==t||!new v(t).inAppShow.wasDismissed)}static async registerLocation(){const e=new B("[IND]InAppUtils: ");try{if("undefined"==typeof navigator||!navigator.geolocation)return;const t=await V.getLocationPermission();"prompt"!==t.location&&"granted"!==t.location||navigator.geolocation.getCurrentPosition(e=>{o.setLatitude(e.coords.latitude),o.setLongitude(e.coords.longitude)},t=>{e.e(`error ${t?.message||t}`).writeLog();const n=o.getPermissionLocation();n||n===j.EVENT_TYPE_REJECT||o.setPermissionLocation(j.EVENT_TYPE_REJECT)})}catch(t){e.e(t).writeLog()}}static generateDeviceId(){fe.postDevice(new U,e=>e,e=>(console.log(e),null))}static async setExternalCode(e){let t=e;if(e){const n=o.getAppKey();t=await k.createHmac(n,e)}return o.setExternalId(t),t}static async setExternalCodeWithoutCypher(e){await o.setExternalId(e)}static async convertToJSONArray(e){if(e&&""!=e)return await Promise.resolve(e).then(e=>JSON.parse(e))}static getDate(e){const t=new Date(e);let n=""+(t.getMonth()+1),r=""+t.getDate();const i=t.getFullYear();let o=t.getHours(),s=t.getMinutes(),a=t.getSeconds();return n.length<2&&(n="0"+n),r.length<2&&(r="0"+r),o.length<2&&(o="0"+o),s.length<2&&(s="0"+s),a.length<2&&(a="0"+a),`${i}-${n}-${r} ${o}:${s}:${a}`}},{ErrorModel:Y,ErrorDictionary:F}=n(315).Core.Models,G=new class{showError(e,t,n,r){if(null!=e){const i=Object.values(e.ErrorCode).indexOf(t);if(i>=0){const t={code:Object.keys(e.ErrorCode)[i],errorId:Object.values(e.ErrorCode)[i]};let o=Object.values(e.ErrorMessage)[i];return o&&r&&(o=o.replaceAll("$x",r)),new Y(t,o,n)}return new Y(F.ErrorCode.GENERAL_ERROR,"general error",n)}}},{CommonUtils:W,ErrorUtils:K}=n(315).Core.Utils,{Channel:H}=n(315).Core.Models,q=class{static async listTopics(e,t){const n=[],r=this.getTopicsFromLocalStorage();if(null!=r&&""!=r){for(let e=0;e<r.length;e++)n.push({code:r[e],name:r[e],visible:!0,subscribe:!0,parentCode:r[e],channel:H.INAPP});W.isFunction(e)&&e(n)}else W.isFunction(t)&&t(G.showError(d,d.ErrorCode.INAPP_TOPIC_EMPTY))}static async saveTopics(e,t,n){try{if(e instanceof Array){let n=[];const r=this.getTopicsFromLocalStorage();if(null!=r&&""!=r&&(n=r),0!==n.length){const t=e.filter(e=>!n.includes(e));0!==t.length&&n.push(t)}else for(let t=0;t<e.length;t++)n.push(e[t]);this.setTopicsFromLocalStorage(n);const i=[];for(let e=0;e<n.length;e++)i.push({code:n[e],name:n[e],visible:!0,subscribe:!0,parentCode:"",channel:H.INAPP});W.isFunction(t)&&t(i)}else W.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_INSTANCE_TOPICS_ERROR))}catch(e){W.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_ERROR,e.message))}}static async deleteAllTopics(e,t){try{const t=[];this.setTopicsFromLocalStorage([]),W.isFunction(e)&&e(t)}catch(e){W.isFunction(t)&&t(G.showError(d,d.ErrorCode.INAPP_ERROR,e.message))}}static async deleteTopics(e,t,n){if(e instanceof Array){let n=[],r=[];const i=this.getTopicsFromLocalStorage();null!=i&&""!=i&&(n=i),0!==n.length&&(r=n.filter(t=>!e.includes(t)),this.setTopicsFromLocalStorage(r));const o=[];if(r.length>0)for(let e=0;e<r.length;e++)o.push({code:r[e],name:r[e],visible:!0,subscribe:!0,parentCode:"",channel:H.INAPP});W.isFunction(t)&&t(o)}else W.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_INSTANCE_TOPICS_ERROR))}static isSubscribe(e){let t=[],n=[];if(o.getInAppTopics()&&(n=this.getTopicsFromLocalStorage()),e&&e.length>0)if(n&&n.length>0)for(let r=0;r<e.length;r++){e[r].subscribed=!1;for(let t=0;t<n.length;t++)e[r].code===n[t]&&(e[r].subscribed=!0);t.push(e[r])}else{for(let t=0;t<e.length;t++)e[t].subscribe=!1;t=e}return t}static getTopicsFromLocalStorage(){const e=o.getInAppProfile();let t=[];const n=o.getInAppTopics();if(n&&n.length>0)if(e)for(let r=0;r<n.length;r++)n[r].startsWith(`${e}_`)&&t.push(this.removeProfile(n[r]));else t=n;return t}static async setTopicsFromLocalStorage(e){const t=o.getInAppProfile(),n=[];if(e&&e.length>0)for(let r=0;r<e.length;r++)t?n.push(`${t}_${e[r]}`):n.push(e[r]);o.setInAppTopics(n)}static removeProfile(e){const t=o.getInAppProfile();return t&&e.startsWith(`${t}_`)?e.slice(`${t}_`.length):e}},{CoreApplication:$}=n(315).Core.Models,X=class extends ${constructor(e,t=!1){if(super(e,t),e&&e.inapp){const t=e.inapp;t.enabled&&(this.enabled=t.enabled),t.clearCacheList&&(this.clearCacheList=t.clearCacheList),t.clearCacheAll&&(this.clearCacheAll=t.clearCacheAll),t.clearDatabaseList&&(this.clearDatabaseList=t.clearDatabaseList),t.clearDatabaseAll&&(this.clearDatabaseAll=t.clearDatabaseAll),t.serviceSyncTime&&(this.serviceSyncTime=t.serviceSyncTime,o.setConfigInAppV2ServiceSyncTime(this.serviceSyncTime)),t.audienceCache&&(this.audienceCache=t.audienceCache,this.audienceCache.deviceTtl&&(this.audienceCacheDeviceTtl=this.audienceCache.deviceTtl),o.setAudienceCache(this.audienceCacheDeviceTtl)),this.inAppLimitToIgnore=50,t.inAppLimitToIgnore&&(this.inAppLimitToIgnore=t.inAppLimitToIgnore),o.setInAppLimitToIgnore(this.inAppLimitToIgnore),o.setAudienceDeviceIdEnabled(!1),t.audienceDeviceIdEnabled&&o.setAudienceDeviceIdEnabled(t.audienceDeviceIdEnabled)}}async updateCache(){let e=0;if(this.clearCacheAll&&(o.setAudienceModel(""),o.setAudienceLastUpdate(""),o.setAudienceCache(0),o.setInAppAudienceDateCacheTtl(""),o.setInAppCache([])),this.clearCacheList&&this.clearCacheList.length>0)for(let t=0;t<this.clearCacheList.length;t++){const n=new v(this.clearCacheList[t]);n&&0!=n.inAppId&&m.deleteInAppFromCache(n)&&e++}if(this.clearDatabaseAll&&(e=o.getInAppCache().length,o.clearSessionStorage()),this.clearDatabaseList&&this.clearDatabaseList.length>0)for(let t=0;t<this.clearDatabaseList.length;t++){const n=new v(this.clearDatabaseList[t]);if(n&&0!=n.inAppId){let t=!1;t=0!=n.version?await I.deleteInAppIfOldVersion(n):await I.deleteInApp(n),t&&e++}}return e}},Q=class{constructor(e){e&&(e.audiences&&(this.audiences=e.audiences),e.lastUpdate&&(this.lastUpdate=e.lastUpdate))}},{Log:J}=n(315).Core.Utils,z="[IND]InAppAudienceUtils",Z=class{static isAudienceCacheFinish(){const e=new J(z+".isAudienceCacheFinish");if(o.getInAppAudienceDateCacheTtl()&&""!=o.getInAppAudienceDateCacheTtl()){const t=new Date(o.getInAppAudienceDateCacheTtl());return!!(t&&t<Date.now())||(e.d(`InApp Audience cache reload on: ${t.toISOString()}`).writeLog(),!1)}return this.saveAudienceCache(o.getAudienceCache()),!0}static saveAudienceCache(e){const t=new J(z+".saveAudienceCache");let n=216e5;e&&0!=e&&(n=1e3*e);const r=new Date(Date.now()+n).toISOString();t.d(`InApp Audience cache reload on: ${r}`).writeLog(),o.setInAppAudienceDateCacheTtl(r)}static saveAudiences(e){e&&e.audiences&&o.setAudienceModel(JSON.stringify(e))}static loadAudiences(){return o.getAudienceModel()&&""!=o.getAudienceModel()?new Q(JSON.parse(o.getAudienceModel())):null}},{CommonUtils:ee}=n(315).Core.Utils,te=class{constructor(e,t,n,r,i){this.topics=e,this.currentPage=t||0,this.totalElements=n,this.limit=o.getInAppTopicPageLimit()||20,this.totalPages=n/this.limit,this.onSuccess=r,this.onError=i}hasNextPage(){return this.currentPage+1<=this.totalPages}loadNextPage(){if(this.currentPage+1>this.totalPages)return void(ee.isFunction(onError)&&onError(G.showError(d,d.ErrorCode.INAPP_TOPIC_LIST_NO_MORE_PAGES)));this.currentPage=this.currentPage+1;const e=new t;e.page=this.currentPage,fe.getInAppTopicsFromConsole(e,this.onSuccess,this.onError)}},{BaseClient:ne}=n(315).Core.Api,{Config:re}=n(315).Core,{Channel:ie,ErrorModel:oe}=n(315).Core.Models,{TopicUtils:se,CommonUtils:ae,ErrorUtils:ue,Log:ce}=n(315).Core.Utils,le="[IND]InAppApplication: ",fe=new class extends ne{constructor(){super(),this.ENDPOINT_INAPP="/inapp",this.URL_BASE=re.client.URL_DEVICE_V2+this.ENDPOINT_INAPP,this.ENDPOINT_CAMPAIGN="/campaign",this.ENDPOINT_CAMPAIGN_TAG=this.ENDPOINT_CAMPAIGN+"/{tag}",this.ENDPOINT_DEVICE="/device",this.ENDPOINT_INAPP_AUDIENCE=this.ENDPOINT_DEVICE+"/audiences",this.ENDPOINT_EVENT_INAPP="/event",this.ENDPOINT_EVENT_INAPP_PRINT=this.ENDPOINT_EVENT_INAPP+"/print",this.ENDPOINT_EVENT_INAPP_CLICK=this.ENDPOINT_EVENT_INAPP+"/click",this.ENDPOINT_EVENT_INAPP_FORM=this.ENDPOINT_EVENT_INAPP+"/form",this.ENDPOINT_DEVICE_TOPICS="/topic",this.ENDPOINT_CUSTOMER="/customer",this.ENDPOINT_CUSTOMER_FIELD=this.ENDPOINT_CUSTOMER+"/field",this.ENDPOINT_APPLICATION="/application",this.isCustomerRequest=!1,this.isDeviceRequest=!1,this.isApplicationRequest=!1}async getURL(){if(this.isCustomerRequest){this.isCustomerRequest=!1;let e=await o.getUrlInappApi();return e?e=e.replaceAll(`/${this.ENDPOINT_INAPP}`,""):re.client.CUSTOMER_URL_BASE}if(this.isDeviceRequest){this.isDeviceRequest=!1;let e=await o.getUrlInappApi();return e?e=e.replaceAll("v2","v1"):re.client.URL_BASE}if(this.isApplicationRequest)return this.isApplicationRequest=!1,await o.getUrlInappApi()||re.client.URL_DEVICE_V2;const e=await o.getUrlInappApi();return e?e+this.ENDPOINT_INAPP:this.URL_BASE}async getCampaignTag(e,t,n){const r=await this.get(this.ENDPOINT_CAMPAIGN_TAG,e.getCampaignTagRequest());if(r&&!(r instanceof oe)&&r.data&&Object.keys(r.data).length>0){if(ae.isFunction(t)){const n=r.data,i=o.getInAppProfile();i&&(n.profile=i);const s=new v(n);s.properties.numberOfShows>0&&(s.inAppShow.timesShowed=1),s.properties.dismissForever&&(s.inAppShow.wasDismissed=!0),e.isUpdateInApp()||null!=await I.searchInAppWithInApp(s)||await x.addNewInApp(s),t(s)}}else r?r.data&&0===Object.keys(r.data).length&&r.data.constructor===Object&&200==r.statusCode?ae.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_CAMPAIGN_NOT_EXIST)):ae.isFunction(n)&&n(r):ae.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_ERROR_CONTENT_MESSAGE));return null}async getInAppTopicsFromConsole(e,t,n){if(u.isAppKeyFormat()){const r=await this.get(this.ENDPOINT_DEVICE_TOPICS,e.getTopicsRequest());if(!r||r instanceof oe)r?ae.isFunction(n)&&n(r):ae.isFunction(n)&&n();else{const i=se.setTopicChannel(r.data,ie.INAPP),o=r.count?r.count:0,s=e.page||0,a=new te(i,s,o,t,n);ae.isFunction(t)&&t(a)}}else ae.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_GENERAL_ERROR));return!0}postEventClick(e){u.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_CLICK,e.postEventClickRequest())}postEventPrint(e){u.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_PRINT,e.postEventClickRequest())}postEventForm(e){u.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_FORM,e.postForm())}putCustomerField(e){u.isAppKeyFormat()&&(this.isCustomerRequest=!0,this.put(this.ENDPOINT_CUSTOMER_FIELD,e.putCustomerFieldRequest()))}async postDevice(e,t,n){if(u.isAppKeyFormat()){this.isDeviceRequest=!0;const r=await this.post(this.ENDPOINT_DEVICE,e.postDeviceRequest(),"include");!r||r instanceof oe?r?ae.isFunction(n)&&n(r):ae.isFunction(n)&&n():(r.data.deviceId&&o.setDeviceId(r.data.deviceId),ae.isFunction(t)&&t(r.data.deviceId))}else ae.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_ERROR));return!0}async getApplicationWithInAppChannel(e,t,n){if(u.isAppKeyFormat()){const r=o.getConfigV2ServiceSyncTime(),i=new ce(le);if(null!=r&&Date.now()<new Date(r)){i.d(`InApp config cache reload on: ${new Date(r).toISOString()}`).writeLog();const e=JSON.parse(o.getConfigV2());e&&ae.isFunction(t)&&t(new X(e,!0))}else{null!=r&&i.d(`InApp config cache reload on: ${new Date(r).toISOString()}`).writeLog(),this.isApplicationRequest=!0;const o=await this.get(this.ENDPOINT_APPLICATION,e.getApplicationRequest());if(o&&!(o instanceof oe))if(o.data&&Object.keys(o.data).length>0){if(ae.isFunction(t)){const e=new X(o.data,!1);if(e.enabled){const t=await e.updateCache();t>0&&i.d(`Deleted ${t} inapp cache from database`).writeLog()}t(e)}}else o?ae.isFunction(n)&&n(o):ae.isFunction(n)&&n()}}else ae.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_ERROR));return!0}async getAudiences(e,t,n){const r=new ce(`${le}.getAudiences`),i=u.getInAppRegisterInvalidFields();if(0===i.length){const i=await this.get(this.ENDPOINT_INAPP_AUDIENCE,e.getAudiences());if(!i||i instanceof oe)i?ae.isFunction(n)&&n(i):ae.isFunction(n)&&n();else{let e;i.data?(e=new Q(i.data),e.lastUpdate&&o.setAudienceLastUpdate(e.lastUpdate),e.audiences&&Z.saveAudiences(e)):i.status&&304==i.status&&r.d("No audiences modified. No need to sync changes to the device").writeLog(),ae.isFunction(t)&&t(e)}}else{const e=`Bad request, getAudiences: audience device enabled set to ${o.isAudienceDeviceIdEnabled()} and fields ${i.join(" and ")} not found`;ae.isFunction(n)&&n(G.showError(d,d.ErrorCode.INAPP_AUDIENCES_BAD_REQUEST,e))}}},{Log:de}=n(315).Core.Utils,he=class{static async getInAppIdFromArraylistOfInAppWithSchemaCode(e){const t=[],n=await this.getAllInAppToIgnoreWithSchemaCode(e);if(n&&n.length>0)for(let e=0;e<n.length;e++)0!=n[e].inAppId&&t.push(String(n[e].inAppId));return t}static async getAllInAppToIgnoreWithSchemaCode(e){const t=new de("[IND]InAppFiltersUtils.getAllInAppToIgnoreWithSchemaCode"),n=await I.searchListInAppWithCode(e),r=[];if(n&&n.length>0)for(const e of n){const n=e.properties.numberOfShows,i=e.inAppShow.timesShowed,o=e.properties.numberOfClicks,s=e.inAppShow.timesClicked;n>0&&i>=n?(r.push(e),t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was ignored because was shown ${n} times`).writeLog()):o>0&&s>=o?(r.push(e),t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was ignored because was clicked ${o} times`).writeLog()):e.properties.dismissForever&&e.inAppShow.wasDismissed&&(r.push(e),t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was ignored because was dismissed forever`).writeLog())}else t.d(`No InApp on sessionStorage with code ${e} ${o.getInAppProfile()?`and profile ${o.getInAppProfile()}`:"without profile"}`).writeLog();return this.filterInAppToIgnoreWithInAppList(r)}static filterInAppToIgnoreWithInAppList(e){const t=o.getInAppLimitToIgnore();return e.length>t?[...e].sort((e,t)=>{const n=new Date(e.creationDate||0);return new Date(t.creationDate||0)-n}).slice(0,t):[...e]}},{BaseRequest:pe}=n(315).Core.Api,{EncryptionType:Ee}=n(315).Core.Models,ye=class extends pe{constructor(){super(),this.update=!1,this.PARAM_DEVICE_TYPE="deviceType",this.PARAM_BROWSER_NAME="browserName",this.PARAM_AUDIENCES="audiences",this.PARAM_AUDIENCES_VERSION="audiencesVersion",this.PARAM_IGNORE_INAPP_ID="ignoreInAppId",this.ignoreInAppIds=[]}setTag(e){this.tag=e}setUpdateInApp(e){this.update=e}isUpdateInApp(){return this.update}async setIgnoreInAppIds(e){this.ignoreInAppIds=await he.getInAppIdFromArraylistOfInAppWithSchemaCode(e)}getCampaignTagRequest(){return this.params=this.createQueryString(),this.pathParams["{tag}"]=this.tag,this}createQueryString(){let e="";if(null!=o.getDeviceId()?e+=`${this.PARAM_DEVICE_ID}=${o.getDeviceId()}&`:x.generateDeviceId(),u.isValidFieldFormat(o.getExternalId())){let t=o.getExternalId();!0!==o.isAvoidCypher()&&o.getEncryptionType()!=Ee.RAW||(t=encodeURIComponent(o.getExternalId())),e+=`${this.PARAM_EXTERNAL_CODE}=${t}&`}null!=o.getDeviceType()&&(e+=`${this.PARAM_DEVICE_TYPE}=${o.getDeviceType()}&`),null!=o.getBrowserName()&&(e+=`${this.PARAM_BROWSER_NAME}=${o.getBrowserName()}&`),null!=o.getLatitude()&&(e+=`${this.PARAM_LATITUDE}=${o.getLatitude()}&`),null!=o.getLongitude()&&(e+=`${this.PARAM_LONGITUDE}=${o.getLongitude()}&`);const t=q.getTopicsFromLocalStorage();null!=t&&0!==t.length&&(e+=`${this.PARAM_TOPICS}=${encodeURIComponent(t)}&`);const n=Z.loadAudiences();return null!=n&&0!==n.audiences.length&&(e+=`${this.PARAM_AUDIENCES}=${encodeURIComponent(n.audiences)}&`),e+=`${this.PARAM_AUDIENCES_VERSION}=v2&`,this.ignoreInAppIds&&this.ignoreInAppIds.length>0&&(e+=`${this.PARAM_IGNORE_INAPP_ID}=${encodeURIComponent(this.ignoreInAppIds)}&`),e+=`${this.PARAM_PLATFORM}=webpush`,e}},Ie=class{static INAPP_TIME_SLIDE_CAROUSEL=1e4;constructor(e,t){this.script=` \n\n var objectFit_${t} = "contain" ;\n var containers_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-container");\n if (containers_${t} && containers_${t}.length > 0 && containers_${t}[0] && containers_${t}[0].getAttribute("data-carousel-adjust-type")) {\n objectFit_${t} = containers_${t}[0].getAttribute("data-carousel-adjust-type"); \n }\n\n var isPartial_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-item-partial").length > 0;\n \n var slideIndex_${t} = isPartial_${t} ? 1 : 0;\n var delta_${t} = 6;\n \n var diffX_${t};\n var diffY_${t};\n var timeSlide_${t} = ${o.getTimeSlideForCarousel()};\n\n\n var ind_carouselOverlap_${t} = document.getElementById("ind_carouselOverlapContainer_${t}");\n var ind_carouselOverlapLMainView_${t} = document.getElementById("ind_carouselOverlapLMainView_${t}")\n \n var indNext_${t} = document.getElementById("${e}").getElementsByClassName("ind_next");\n var indPrev_${t} = document.getElementById("${e}").getElementsByClassName("ind_prev");\n indNext_${t}.onclick = () => plusSlides_${t}(1);\n indPrev_${t}.onclick = () => plusSlides_${t}(-1);\n\n var slides_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-item") ? document.getElementById("${e}").getElementsByClassName("ind_slideshow-item") : document.getElementById("${e}").getElementsByClassName("ind_slideshow-carousel-item");\n var slider_${t} = document.getElementById("${e}").querySelector('.ind_slider-container-actions');\n var sliderTotal_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-item").length ? document.getElementById("${e}").getElementsByClassName("ind_slideshow-item").length : document.getElementById("${e}").getElementsByClassName("ind_slideshow-carousel-item").length;\n \n var interval_${t} = setInterval(() => {\n newSlide_${t}();\n }, timeSlide_${t});\n\n var imageList_${t} = document.getElementById("${e}").getElementsByClassName("indCOImages_${t}");\n \n if (imageList_${t}) {\n setImagesCarouselOverLap_${t}();\n let docIframeHeight_${t} = document.getElementById("${e}").clientHeight;\n let docIframeWidth_${t} = document.getElementById("${e}").clientWidth;\n \n if (document.getElementById("ind_carouselOverlapLeftView_${t}")) document.getElementById("ind_carouselOverlapLeftView_${t}").style.height = (docIframeHeight_${t}-20)+"px";\n if (document.getElementById("ind_carouselOverlapLRightView_${t}")) document.getElementById("ind_carouselOverlapLRightView_${t}").style.height = (docIframeHeight_${t}-20)+"px";\n if (document.getElementById("ind_carouselOverlapLMainView_${t}")) document.getElementById("ind_carouselOverlapLMainView_${t}").style.height = docIframeHeight_${t} + "px";\n if (document.getElementById("ind_carouselOverlapLMainView_${t}")) document.getElementById("ind_carouselOverlapLMainView_${t}").style.width = docIframeWidth_${t} + "px";\n \n }\n if (document.getElementById("ind_carousel-overlap-container_${t}")) document.getElementById("ind_carousel-overlap-container_${t}").style.width = docIframeWidth_${t} + "px";\n\n function setImagesCarouselOverLap_${t}() { \n var slides_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-carousel-item");\n for (let i = 0; i < slides_${t}.length; i++) {\n if (imageList_${t}[i]) {\n slides_${t}[i].style.backgroundImage = "url('"+imageList_${t}[i].src+"')";\n if (slides_${t}[i].style) {\n \n slides_${t}[i].style.backgroundSize = "cover";\n }\n slides_${t}[i].style.backgroundPosition = "center";\n } \n }\n const mainView = document.getElementById("ind_carouselOverlapLMainView_${t}");\n if (mainView) {\n mainView.style.backgroundSize = objectFit_${t};\n if (slides_${t}[1]) slides_${t}[1].onclick = imageList_${t}[1].onclick; \n }\n }\n\n function shiftRight_${t}() {\n let newArr = new Array(imageList_${t}.length);\n for (var i = 0; i < imageList_${t}.length; i++) {\n if (i == 0) {\n newArr[i] = imageList_${t}[imageList_${t}.length-1];\n } else {\n newArr[i] = imageList_${t}[i-1];\n }\n }\n imageList_${t} = newArr;\n }\n\n function shiftLeft_${t}() {\n let newArr = new Array(imageList_${t}.length);\n for (var i = 0; i < imageList_${t}.length; i++) {\n if (i+1 == imageList_${t}.length) {\n newArr[i] = imageList_${t}[0]; \n } else {\n newArr[i] = imageList_${t}[i+1];\n }\n }\n imageList_${t} = newArr;\n }\n\n \n showSlides_${t}(slideIndex_${t});\n \n var startMove_${t} = null;\n var startMoveY_${t} = null;\n \n \n if (slider_${t} && !ind_carouselOverlap_${t}) {\n slider_${t}.addEventListener('touchstart', handleStart_${t}, false);\n slider_${t}.addEventListener('touchend', handleEnd_${t}, false);\n slider_${t}.addEventListener('mousedown', mouseStart_${t});\n slider_${t}.addEventListener('mouseup', mouseEnd_${t}); \n } else if (ind_carouselOverlap_${t} && ind_carouselOverlapLMainView_${t}) {\n ind_carouselOverlapLMainView_${t}.addEventListener('touchstart', handleStart_${t}, false);\n ind_carouselOverlapLMainView_${t}.addEventListener('touchend', handleEnd_${t}, false);\n ind_carouselOverlapLMainView_${t}.addEventListener('mousedown', mouseStart_${t});\n ind_carouselOverlapLMainView_${t}.addEventListener('mouseup', mouseEnd_${t});\n }\n\n function mouseStart_${t}(evt) {\n evt.preventDefault();\n startMove_${t} = evt.clientX;\n startMoveY_${t} = evt.clientY;\n }\n\n function mouseEnd_${t}(evt) {\n evt.preventDefault();\n var endMove = evt.clientX;\n var endMoveY = evt.clientY;\n setEndMove_${t}(endMove, endMoveY);\n }\n\n function handleStart_${t}(evt) {\n evt.preventDefault();\n startMove_${t} = evt.touches[0].clientX;\n startMoveY_${t} = evt.touches[0].clientY;\n }\n function handleEnd_${t}(evt) {\n evt.preventDefault();\n const endMove = evt.changedTouches[0].pageX;\n const endMoveY = evt.changedTouches[0].pageY;\n setEndMove_${t}(endMove, endMoveY);\n }\n\n function setEndMove_${t}(endMove, endMoveY) {\n diffX_${t} = Math.abs(endMove - startMove_${t});\n diffY_${t} = Math.abs(endMoveY - startMoveY_${t});\n \n if (startMove_${t} != null) {\n if (startMove_${t} > endMove) {\n if (ind_carouselOverlap_${t}) {\n slideIndex_${t} = -1;\n } else {\n slideIndex_${t}++;\n if (slideIndex_${t} > sliderTotal_${t}) {\n slideIndex_${t} = 1;\n }\n }\n } else {\n if (ind_carouselOverlap_${t}) {\n if (startMove_${t} == endMove) {\n slideIndex_${t} = 0;\n } else {\n slideIndex_${t} = 1;\n }\n } else {\n if (slideIndex_${t} == 0) {\n slideIndex_${t} = sliderTotal_${t};\n } else {\n slideIndex_${t}--;\n }\n }\n }\n showSlides_${t}(slideIndex_${t});\n setNewInterval_${t}();\n }\n \n }\n\n function plusSlides_${t}(n) {\n if (ind_carouselOverlap_${t}) {\n showSlides_${t}(n == 1 ? -1: 1);\n } else {\n showSlides_${t}(slideIndex_${t} += n);\n }\n setNewInterval_${t}();\n }\n\n function currentSlide_${t}(n) {\n showSlides_${t}(slideIndex_${t} = n);\n }\n\n function setNewInterval_${t}() {\n clearInterval(interval_${t});\n interval_${t} = setInterval(() => {\n newSlide_${t}();\n }, timeSlide_${t});\n }\n\n function newSlide_${t}(){\n slideIndex_${t}++;\n if (slideIndex_${t} > sliderTotal_${t}) {\n slideIndex_${t} = 1;\n }\n showSlides_${t}(slideIndex_${t});\n }\n\n function showSlides_${t}(n) {\n let view = document.getElementById("${e}") ? document.getElementById("${e}") : document;\n if (view) {\n if (ind_carouselOverlap_${t}) { \n if (n < 0) {\n shiftLeft_${t}();\n } else if (n > 0) {\n shiftRight_${t}();\n }\n setImagesCarouselOverLap_${t}();\n } else {\n let i;\n const dots = view.getElementsByClassName("ind_dot");\n if (n > slides_${t}.length) {slideIndex_${t} = 1;}\n if (n < 1) {slideIndex_${t} = slides_${t}.length;}\n for (i = 0; i < slides_${t}.length; i++) {\n slides_${t}[i].style.display = "none";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(" active", "");\n }\n if (slides_${t}[slideIndex_${t}-1]) {\n slides_${t}[slideIndex_${t}-1].style.display = "block";\n }\n if (dots[slideIndex_${t}-1]) dots[slideIndex_${t}-1].className += " active";\n }\n }\n }\n\n\n function inAppIndigitallOnClick_${t}(action) {\n if (diffX_${t} && diffY_${t}) {\n if (diffX_${t} < delta_${t} && diffY_${t} < delta_${t}) {\n indigitall.InApp.inAppOnClick(action);\n }\n } else {\n indigitall.InApp.inAppOnClick(action);\n }\n }\n\n function inAppIndigitallSubmit_${t}(formOptions) {\n const jsonForm = {}\n const jsonCustomer = {}\n const form = document.querySelector('[id="'+formOptions.formId+'"]');\n if (form) {\n formOptions.inputs.forEach((el) => {\n if (el.id !== 'undefined') {\n let value;\n if (el.type === 'text' || el.type === 'number') {\n if (form && form.querySelector('input[id^="'+el.id+'"]') && form.querySelector('input[id^="'+el.id+'"]').value !== 'undefined') {\n value = form.querySelector('input[id^="'+el.id+'"]').value;\n }\n }\n if (el.type === 'checkbox') {\n if (form && form.querySelectorAll('input[id^="'+el.id +'"]')) {\n let values = form.querySelectorAll('input[id^="'+el.id +'"]');\n var valuesChecked = [];\n for (var i = 0; i < values.length; i++) {\n if (values[i].checked && values[i].value !== 'undefined') {\n valuesChecked.push(values[i].value);\n }\n }\n value = valuesChecked;\n }\n }\n if (el.type === 'radio') {\n if (form && form.querySelectorAll('input[id^="'+el.id +'"]')) {\n let values = form.querySelectorAll('input[id^="'+el.id +'"]');\n var valuesChecked;\n for (var i = 0; i < values.length; i++) {\n if (values[i].checked && values[i].value !== 'undefined') {\n valuesChecked = values[i].value;\n }\n }\n value = valuesChecked;\n }\n }\n if (el.type === 'select') {\n if (form && form.querySelector('select[id^="'+el.id+'"]') && form.querySelector('select[id^="'+el.id+'"]').value !== 'undefined') {\n value = form.querySelector('select[id^="'+el.id+'"]').value;\n }\n }\n if (value) jsonForm[el.id] = value;\n if (el.sendToCustomer) jsonCustomer[el.id] = value;\n }\n });\n }\n indigitall.InApp.inAppSubmit(JSON.stringify(formOptions), JSON.stringify(jsonForm), JSON.stringify(jsonCustomer));\n }\n `,this.html=" "}},ge=Object.freeze({TEXT:"text",NUMBER:"number",RADIO:"radio",CHECKBOX:"checkbox",SELECT:"select"}),me=class{constructor(e){if(e.id&&(this.id=e.id),e.name&&(this.name=e.name),e.type)switch(e.type){case"text":this.type=ge.TEXT;break;case"checkbox":this.type=ge.CHECKBOX;break;case"number":this.type=ge.NUMBER;break;case"radio":this.type=ge.RADIO;break;case"select":this.type=ge.SELECT}e.required&&(this.required=e.required),e.sendToCustomer&&(this.sendToCustomer=e.sendToCustomer)}},_e=class{constructor(e){if(e.inAppId&&(this.inAppId=e.inAppId),e.formId&&(this.formId=e.formId),e.inappVersion&&(this.inappVersion=e.inappVersion),e.inputs&&Array.isArray(e.inputs)){this.inputs=[];for(let t=0;t<e.inputs.length;t++)this.inputs.push(new me(e.inputs[t]))}}},{ErrorUtils:ve}=n(315).Core.Utils,Se=class{static checkFieldsForm(e,t,n){const r=[];if(t&&e.inputs&&e.inputs.length>0)for(let n=0;n<e.inputs.length;n++){const i=this.checkInputType(e.inputs[n],t);null!=i&&r.push(i)}if(r.length>0)return r;t&&0!==Object.keys(t).length&&C.sendEventForm(e.inAppId,e.inappVersion,t),n&&0!==Object.keys(n).length&&C.sendEventFormToCustomer(n)}static checkInputType(e,t){if(null!=e.id)switch(e.type){case ge.TEXT:if(e.required){if(!t[e.id])return G.showError(d,2121,e.id);if(!t[e.id]instanceof String)return G.showError(d,2120,`The field ${e.id} is not text`)}break;case ge.NUMBER:if(e.required){if(!t[e.id])return G.showError(d,2121,e.id);if(!t[e.id]instanceof String){if(!parseInt(t[e.id]))return G.showError(d,2120,`The field ${e.id} is not number`)}else if(!t[e.id]instanceof int)return G.showError(d,2120,`The field ${e.id} is not number`)}break;default:if(e.required&&t[e.id]&&""==t[e.id])return G.showError(d,2121,e.id)}return null}static editingFormHtml(e,t){return e.replaceAll("InAppIndigitall.onClick",`inAppIndigitallOnClick_${t}`).replaceAll("InAppIndigitall.submit",`inAppIndigitallSubmit_${t}`).replaceAll("plusSlides",`plusSlides_${t}`).replaceAll("indCOImages",`indCOImages_${t}`).replaceAll("ind_carouselOverlapLeftView",`ind_carouselOverlapLeftView_${t}`).replaceAll("ind_carouselOverlapLRightView",`ind_carouselOverlapLRightView_${t}`).replaceAll("ind_carouselOverlapLMainView",`ind_carouselOverlapLMainView_${t}`).replaceAll("ind_carouselOverlapContainer",`ind_carouselOverlapContainer_${t}`).replaceAll("setImagesCarouselOverLap",`setImagesCarouselOverLap_${t}`).replaceAll("shiftRight",`shiftRight_${t}`).replaceAll("shiftLeft",`shiftLeft_${t}`).replaceAll("currentSlide",`currentSlide_${t}`).replaceAll("setNewInterval",`setNewInterval_${t}`).replaceAll("newSlide",`newSlide_${t}`).replaceAll("showSlides",`showSlides_${t}`)}},be=class{static async onClick(e){if(e){const t=JSON.parse(e);let n;t.inAppId&&(n=t.inAppId),t.inappId&&(n=t.inappId);const r=await I.searchInAppWithInAppId(n);if(r&&t.action){const e=new v(r),n=new h(t.action);if(e.properties.setAction(n),x.onClickAction(n),e){x.addNewInAppClick(e);const t=new CustomEvent("didClicked",{detail:{action:n},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(t)}}else console.log(`InApp ${t.schema} not found`)}else console.log("InApp action is empty")}static submit(e,t,n){if(e){const r=new _e(JSON.parse(e));if(t){const e=Se.checkFieldsForm(r,JSON.parse(t),JSON.parse(n));if(e&&e.length>0){const t=new CustomEvent("didFormError",{detail:{errorList:e},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(t)}else{const e=new CustomEvent("didFormSubmit",{detail:{jsonForm:JSON.parse(t)},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(e)}}}}},{Log:Te,ErrorUtils:Oe,CommonUtils:Pe}=n(315).Core.Utils,Ae="[IND]ShowInAppUtils: ";class Re{static async inAppWasGot(e,t,n,r,i,o,s,a,u){const c=m.inAppWasCached(e),l=(new Date).getTime(),f=new Te(Ae);if(null!=c){const e=new v(c),i=new Date(e.expiredDate).getTime();if(f.d(`InApp ${e.inAppId} ${e.schema.code} cache reload on: ${new Date(i).toLocaleString()}`).writeLog(),l<i){const n=await I.searchInAppWithInApp(e),i=this.wasInAppPassedFilterProperties(n);null!=i?this.setErrorFilter(n,i,o,s,a):Pe.isFunction(r)&&r(n||e,t)}else Pe.isFunction(n)&&n(e,G.showError(d,d.ErrorCode.INAPP_WAS_EXPIRED)),f.d(`InApp ${e.inAppId}: ${d.ErrorMessage.INAPP_WAS_EXPIRED}`).writeLog(),m.deleteInAppFromCache(e),Re.updateInAppGet(e.schema.code,o,s,a,e=>{Pe.isFunction(r)&&r(e,t)},e=>{Pe.isFunction(u)&&u(e)})}else Pe.isFunction(i)&&i(e,t)}static wasInAppPassedFilterProperties(e){const t=new Te(Ae);if(e&&e.properties){if(e.properties.dismissForever&&e.inAppShow.wasDismissed)return d.ErrorCode.INAPP_WAS_DISMISSED_FOREVER;{e.properties.dismissForever&&x.addNewInApptoDismissForever(e);const n=e.properties.numberOfShows,r=e.inAppShow?e.inAppShow.timesShowed:null,i=e.properties.numberOfClicks,o=e.inAppShow?e.inAppShow.timesClicked:null;if(n>0){if(!(null!=r&&r<n))return d.ErrorCode.INAPP_WAS_SHOWN_MANY_TIMES;t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was shown ${r+1} times and will stop showing after ${n} times`).writeLog(),I.addInAppNewShow(e)}if(i>0){if(null!=o&&o>=i)return d.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES;t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was clicked ${o} times and will stop showing with ${i} clicks`).writeLog()}}}return null}static async updateInAppGet(e,t,n,r,i,o){xe.getInAppWithUpdate(e,!0,async e=>{let o=await I.updateInApp(e);if(o){const e=this.wasInAppPassedFilterProperties(o);if(null!=e)return void this.setErrorFilter(o,e,t,n,r)}else await x.addNewInApp(e),o=e;m.addNewInAppToCache(o),Pe.isFunction(i)&&i(o)},e=>{e.data&&e.data=={}&&200==e.statusCode?Pe.isFunction(o)&&o(G.showError(d,d.ErrorCode.INAPP_CAMPAIGN_NOT_EXIST)):Pe.isFunction(o)&&o(e)})}static async isInAppSaveOnDDBBAndFilters(e,t,n,r){const i=await I.searchInAppWithInApp(e);if(null!=i){let o=m.TIME_CACHE;const s=this.wasInAppPassedFilterProperties(i);return null!=s?(this.setErrorFilter(i,s,t,n,r),e.cacheTtl&&(o=1e3*i.cacheTtl),i.expiredDate=x.getDate((new Date).getTime()+o),m.addNewInAppToCache(i),!1):(e.cacheTtl&&(o=1e3*i.cacheTtl),i.expiredDate=x.getDate((new Date).getTime()+o),m.addNewInAppToCache(i),!0)}return await x.addNewInApp(e),m.addNewInAppToCache(e),!0}static setErrorFilter(e,t,n,r,i){t==d.ErrorCode.INAPP_WAS_DISMISSED_FOREVER&&Pe.isFunction(n)&&n(e,G.showError(d,null,d.ErrorCode.INAPP_WAS_DISMISSED_FOREVER)),t==d.ErrorCode.INAPP_WAS_SHOWN_MANY_TIMES&&Pe.isFunction(r)&&r(e,G.showError(d,e.properties.numberOfShows,d.ErrorCode.INAPP_WAS_SHOWN_MANY_TIMES)),t==d.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES&&Pe.isFunction(i)&&i(e,G.showError(d,e.properties.numberOfClicks,d.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES))}static async inAppWasShown(e,t,n,r,i){const o=new Te(Ae);e.schema.code&&this.inAppWasGot(e.schema.code,null,t,e=>{Pe.isFunction(i)&&i(e)},()=>{Pe.isFunction(i)&&i(e)},(e,t)=>{o.d("inAppWasShown: "+e.inAppId+" with error: "+t.errorMessage).writeLog()},n,r)}}const we=Re,{BaseApplicationRequest:Ne}=n(315).Core.Api,Ce=class extends Ne{constructor(){super(["inApp"])}},{EncryptionType:De}=n(315).Core.Models,{BaseApplicationRequest:Me}=n(315).Core.Api,Le=class extends Me{constructor(){super(),this.PARAM_LAST_SYNC="lastSync"}getAudiences(){return this.params=this.createQueryString(),this}createQueryString(){const e=[];if(o.getDeviceId()&&e.push(`${this.PARAM_DEVICE_ID}=${o.getDeviceId()}`),o.getAudienceLastUpdate()&&e.push(`${this.PARAM_LAST_SYNC}=${encodeURIComponent(o.getAudienceLastUpdate())}`),u.isValidFieldFormat(o.getExternalId())){let t=o.getExternalId();!0!==o.isAvoidCypher()&&o.getEncryptionType()!=De.RAW||(t=encodeURIComponent(t)),e.push(`${this.PARAM_EXTERNAL_CODE}=${t}`)}return e.join("&")}},{ErrorUtils:Ue,CommonUtils:Be,LogLevel:ke,Log:Ve}=n(315).Core.Utils;class je{constructor(){this.LogLevel=ke,this.inAppIndigitallInterface=be}static async init(e,t,n){null!=e.appKey&&await o.setAppKey(e.appKey),e.urlInAppApi&&o.setUrlInappApi(e.urlInAppApi),o.setAvoidCypher(!!e.avoidCypher),o.setAvoidAction(!!e.avoidAction),e.logLevel&&o.setLogLevel(e.logLevel),!0===e.requestLocation&&x.registerLocation(),o.setInAppProfile(""),e.profile&&o.setInAppProfile(e.profile),o.setTimeoutRequestsInMilliseconds(0),e.timeoutRequestsInMilliseconds&&o.setTimeoutRequestsInMilliseconds(e.timeoutRequestsInMilliseconds),o.setTimeSlideForCarousel(e.timeSlideForCarousel?e.timeSlideForCarousel:Ie.INAPP_TIME_SLIDE_CAROUSEL),fe.getApplicationWithInAppChannel(new Ce,e=>{Z.isAudienceCacheFinish()?fe.getAudiences(new Le,n=>{Z.saveAudienceCache(e.audienceCacheDeviceTtl),Be.isFunction(t)&&t(e)},r=>{const i=new Ve("[IND]InAppIndigitall: .init: getApplicationWithInAppChannel");r&&r.errorMessage&&i.e(r.exceptionMessage).writeLog(),Be.isFunction(n)&&n(r),Be.isFunction(t)&&t(e)}):Be.isFunction(t)&&t(e)},n)}static async showInApp(e,t,n,r){const i={appKey:o.getAppKey(),urlInAppApi:"https://device-api.indigitall.com/v2",requestLocation:!0,logLevel:ke.DEBUG,inAppCode:e,viewId:t};this.showInAppWithConfig(i,null,null,null,null,null,null,n,r,null,null)}static async showInAppWithCallback(e,t={}){const n=["onShowTimeFinished","didExpired","didShowManyTimes","didClickOut","didDismissForever","didClicked","success","error","didFormError","didFormSubmit"].map(e=>(...n)=>{"function"==typeof t[e]&&t[e](...n)});return this.showInAppWithConfig(e,...n)}static async showInAppWithConfig(e,t,n,r,i,o,s,a,c,l,f){await this.init(e,n=>{u.isAppKeyFormat()?we.inAppWasGot(e.inAppCode,e.viewId,null,async(e,n)=>{e&&e.properties&&this.createInApp(e,n,s,a,c,t,l,f)},(e,n)=>{this.drawInApp(e,n,t,s,a,c,l,f,o,r,i)},o,r,i,c):Be.isFunction(c)&&c(G.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))},c)}static showMultipleInApp(e,t,n,r){const i={appKey:o.getAppKey(),urlInAppApi:"https://device-api.indigitall.com/v2",requestLocation:!0,logLevel:ke.DEBUG,inAppCodeList:e,divList:t};this.showMultipleInAppWithConfig(i,null,null,null,null,null,null,n,r,null,null)}static async showMultipleInAppWithCallback(e,t={}){const n=["onShowTimeFinished","didExpired","didShowManyTimes","didClickOut","didDismissForever","didClicked","success","error","didFormError","didFormSubmit"].map(e=>(...n)=>{"function"==typeof t[e]&&t[e](...n)});return this.showMultipleInAppWithConfig(e,...n)}static async showMultipleInAppWithConfig(e,t,n,r,i,o,s,a,c,l,f){await this.init(e,n=>{if(u.isAppKeyFormat()){if(e.inAppCodeList.length==e.divList.length&&e.inAppCodeList.length>0)for(var h=0;h<e.inAppCodeList.length;h++)we.inAppWasGot(e.inAppCodeList[h],e.divList[h],null,async(e,n)=>{e&&e.properties&&this.createInApp(e,n,s,a,c,t,l,f)},(e,n)=>{je.drawInApp(e,n,t,s,a,c,l,f,o,r,i)},o,r,i)}else Be.isFunction(c)&&c(G.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))},c)}static async drawInApp(e,t,n,r,i,o,s,a,u,c,l){this.getInApp(e,async e=>{e&&e.properties&&await we.isInAppSaveOnDDBBAndFilters(e,u,c,l)&&this.createInApp(e,t,r,i,o,n,s,a)},o)}static async createInApp(e,t,n,r,i,o,s,a){if(e&&e.properties&&e.properties.contentUrl)try{const i=document.getElementById(t);if(i){i.style.position="relative",i.style.overflow="hidden";const u=await fetch(e.properties.contentUrl);let c=await u.text();null!=e.customData&&Object.keys(e.customData).forEach(function(t){c=c.replaceAll(`{{${t}}}`,e.customData[t])}),e.version&&(c=c.replaceAll("'inappVersion':'{{version}}'","'inappVersion':"+e.version));const l=t.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,""),f=Se.editingFormHtml(c,l);if(i.innerHTML=f,"undefined"===document.getElementById(`script_${l}`)||null===document.getElementById(`script_${l}`)){const e=document.createElement("script");e.id=`script_${l}`,e.type="text/javascript",e.innerHTML=new Ie(t,l).script,i.appendChild(e)}if(e._eventListeners||(e._eventListeners={}),e._eventListeners.didClicked&&self.removeEventListener("didClicked",e._eventListeners.didClicked),e._eventListeners.didFormError&&self.removeEventListener("didFormError",e._eventListeners.didFormError),e._eventListeners.didFormSubmit&&self.removeEventListener("didFormSubmit",e._eventListeners.didFormSubmit),e._eventListeners.didClicked=function(t){n&&n(e,t?.detail?.action)},e._eventListeners.didFormError=function(t){s&&s(e,t?.detail?.errorList)},e._eventListeners.didFormSubmit=function(t){const n=t?.detail?.jsonForm;a&&a(e,n)},self.addEventListener("didClicked",e._eventListeners.didClicked),self.addEventListener("didFormError",e._eventListeners.didFormError),self.addEventListener("didFormSubmit",e._eventListeners.didFormSubmit),e.properties.showTime){let t=0;const n=setInterval(function(){t++,t==parseInt(e.properties.showTime)&&(i.style.display="none",clearInterval(n),Be.isFunction(o)&&o(e,i,1e3*e.properties.showTime))},1e3)}if(e.properties.layout&&e.properties.layout.borderRadius){const t=`${parseInt(e.properties.layout.borderRadius)}px`;i.style.borderRadius=t}Be.isFunction(r)&&r(e,i),C.sendEventPrint(e)}}catch(n){let r=null;e&&e.schema&&e.schema.code&&(r=e.schema.code),Be.isFunction(i)&&i(n,t,r)}}private;static topicsList(e,t){return q.listTopics(e,t),!0}static topicsListFromConsole(e,n,r){let i=20;return e&&(e.limit>20&&(i=e.limit),e.urlInAppApi&&o.setUrlInappApi(e.urlInAppApi),e.appKey&&!o.getAppKey()&&o.setAppKey(e.appKey)),o.setInAppTopicPageLimit(i),fe.getInAppTopicsFromConsole(new t,n,r),!0}static topicsSubscribe(e,t,n){q.saveTopics(e,t,n)}static topicsUnsubscribe(e,t,n){q.deleteTopics(e,t,n)}static topicsUnsubscribeAll(e,t){q.deleteAllTopics(e,t)}static inAppGet(e,t,n){this.getInApp(e,t,n)}static getInApp(e,t,n){this.getInAppWithUpdate(e,!1,t,n)}static getInAppWithUpdate(e,t,n,r){if(u.isAppKeyFormat()){const i=new ye;i.setTag(e),i.setUpdateInApp(t),i.setIgnoreInAppIds(e),fe.getCampaignTag(i,n,r)}else Be.isFunction(r)&&r(G.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}static addNewInAppToDismissForever(e){x.addNewInApptoDismissForever(e)}static async isInAppDismissForever(e){await x.isInAppDismissForever(e)}static async inAppOnClick(e){await be.onClick(e)}static async inAppSubmit(e,t,n){be.submit(e,t,n)}static async inAppWasShown(e,t,n,r,i){we.inAppWasShown(e,t,n,r,i)}static async downloadHTML(e){const t=await fetch(e,{method:"GET"});console.log(t)}static async setExternalCode(e,t,n){try{const n=await x.setExternalCode(e);t&&t(n)}catch(e){n&&n(e)}}static async logIn(e,t,n){await this.setExternalCode(e,t,n)}static async logOut(e,t){await this.setExternalCode(null,e,t)}}const xe=je;window.indigitall||(window.indigitall={}),window.indigitall.InApp=je,window.indigitall.InApp.version=o.getVersion(),window.indigitall.InApp.Utils=x,window.indigitall.LogLevel=ke})(),r})(),e.exports=t()},326(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(126));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},114(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.16.5","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>W});var i={};n.r(i),n.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>T,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>M,TopicSubscribeType:()=>L});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>x,DateUtils:()=>R,ErrorUtils:()=>b,JsonUtils:()=>Y,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>G,Validations:()=>F});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const r=n.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){const t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,r)=>{e||r(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),r(!1)}})}async put(e,t,n){return new Promise((r,i)=>{e||i(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),r(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+=`${error.errorCode}: ${error.errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(e,t,n){if(null!=e){const r=Object.values(e.ErrorCode).indexOf(t);if(r>=0){const t=Object.keys(e.ErrorCode)[r],i=Object.values(e.ErrorCode)[r];return new v({code:t,errorId:i},Object.values(e.ErrorMessage)[r],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},T=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,r){const i=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&i.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),r&&(s.credentials=r);try{const t=new AbortController;let r;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(r=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(r&&clearTimeout(r),304!=a.status){const t=await a.json();return a.ok?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),M=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),L=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let r=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,r=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):r=new Date(Date.now()+36e5),!t){const e=r.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let r=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+r+" to "+n.state).writeLog(),r=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",x=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const r=window?.crypto?.subtle;if(!r)return;const i=await r.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await r.sign(j,i,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}},Y=class{static compareJSON(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r]){if("object"!=typeof e[r]||"object"!=typeof t[r])return!1;if(!isEqual(e[r],t[r]))return!1}return!0}},F=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},G=class{static setTopicChannel(e,t){const n=[];for(let r=0;r<e.length;r++){const i=e[r];i.channel=t,n.push(i)}return n}},W={Repository:y,Config:c,Api:i,Models:o,Utils:s};return r})(),e.exports=t()},315(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(i.get||i.set)?n(o,s,i):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(254)),i=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(d(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,i,"GeneratorFunction"),d(h),d(h,i,"Generator"),d(h,r,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}d=function(e,t,n,r){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,r)}function h(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){h(o,r,i,s,a,"next",e)}function a(e){h(o,r,i,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,b;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new r.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new i.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(b=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,b));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,b));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,r){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var r=a(n(468)),i=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i;function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((i=n(237))&&i.__esModule?i:{default:i}).default);t.default=f},943(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(r=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new i.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={platform:"webpush",version:"0.0.1"},i=n(904);r.version=i.version,r=Object.assign(r,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=r},610(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}var l=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=new i.default;if(null!=t){r.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,r.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,r.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),r.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),r.setEncryptionType(this.encryptionType)}});t.default=l},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new i.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=n},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=r&&(this.exceptionMessage=r)});t.default=o},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return r.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var r=n(902),i=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,r,o,s){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return i(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,i(h,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,s,"GeneratorFunction"),i(h),i(h,s,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:p}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,n,r){function s(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,n,r)}function o(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,u,"next",e)}function u(e){o(s,r,i,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB},t=[{key:"getDB",value:(c=s(r().m(function e(){var t=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var r=t.IDB;if(r){var i=r.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){var t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(r().m(function e(t,n){var i=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(i.close(t),e(n.target.result.store.value)),r(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(r().m(function e(t,n,i){var o=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.store.put({store:{key:n,value:i}},n).onsuccess=function(n){o.close(t),e(i)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(i=s(r().m(function e(t,n){var i,o;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return i=e.v,e.a(2,this.put(i,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return i.apply(this,arguments)})},{key:"getItem",value:(n=s(r().m(function e(t){var n,i;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,i=e.v,e.a(2,i)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,i,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(122)),i=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,i,"GeneratorFunction"),f(h),f(h,i,"Generator"),f(h,r,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}function d(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){d(o,r,i,s,a,"next",e)}function a(e){d(o,r,i,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=i.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){i.default.setItem(e,t)}},{key:"getStorage",value:function(e){return i.default.getItem(e)}},{key:"clearStorage",value:function(){i.default.clear()}},{key:"setBrowserPublicKey",value:function(e){i.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return i.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){i.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return i.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return i.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(T=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return T.apply(this,arguments)})},{key:"setVAPID",value:function(e){i.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return i.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){i.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return i.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){i.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return i.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){i.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return i.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){i.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return i.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(b=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!i.default&&i.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return i.default&&i.default.getItem(this.PLATFORM)||r.default.platform}},{key:"getVersion",value:function(){return r.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return i.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){i.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return i.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return i.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){i.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return i.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){i.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return i.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){i.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return i.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){i.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return i.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){i.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return i.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){i.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return i.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){i.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==i.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){i.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return i.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){i.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return i.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default&&i.default.isLocalStorageAvailable()&&i.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!i.default||!i.default.isLocalStorageAvailable()){e.n=1;break}t=i.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){i.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return i.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,i.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){i.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return i.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){i.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return i.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,b,T,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new r.default).getServiceTimestamp()||(new r.default).getServiceSyncTime()<=(Date.now()-(new r.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new i.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}],t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(254))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(a(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,i,"GeneratorFunction"),a(h),a(h,i,"Generator"),a(h,r,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}a=function(e,t,n,r){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,r)}function u(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){u(o,r,i,s,a,"next",e)}function a(e){u(o,r,i,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(r=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return r.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var r,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(r=e.v)&&(o=r.state,"onchange"in r&&(r.onchange=function(){new i.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+r.state).writeLog(),o=r.state,n&&n({name:t,state:r.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var r=n(225),i=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,r,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function c(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new i.default).isAvoidCypher()&&(new i.default).getEncryptionType()!==r.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new i.default).getEncryptionType()!==r.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(e){c(o,r,i,s,a,"next",e)}function a(e){c(o,r,i,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var r=this.tryToParseLeniently(n);return r?this.formatCanonicalUTC(r):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=r(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.parseByFormat(e,i);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(735)),i=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new i.default(s,Object.values(e.ErrorMessage)[o],n)}return new i.default(r.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"compareJSON",value:function(e,t){var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,s=r;o<s.length;o++){var a=s[o];if(e[a]!==t[a]){if("object"!=n(e[a])||"object"!=n(t[a]))return!1;if(!isEqual(e[a],t[a]))return!1}}return!0}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=i.default.INFO,this.setLogLevel((new r.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=i.default.DEBUG&&e<=i.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=i.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=i.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=i.default.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+="".concat(error.errorCode,": ").concat(error.errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i.channel=t,n.push(i)}return n}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var r=h(n(622)),i=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.16.5","_id":"indigitall-web-core@4.16.5","_inBundle":false,"_integrity":"sha512-1rudsnXyzNLi8Syln24ZpaMlGsZsLgTWsohGi/fDboS53w4GW4+ln4E96HmoO2vom7CTNBV+gbcscpfgfMNcSw==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.16.5","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.16.5","saveSpec":null,"fetchSpec":"4.16.5"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.16.5.tgz","_shasum":"7011471d0100272867681db5a6e55f5559544aa8","_spec":"indigitall-web-core@4.16.5","_where":"/home/circleci/webpush/inbox","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.16.5"}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{default:()=>M});const{Repository:e}=n(315).Core,t=new class extends e{constructor(){super(),this.AUTH_TOKEN=this.REPOSITORY+".AUTH_TOKEN",this.INBOX_AUTH_MODE=this.REPOSITORY+".INBOX_AUTH_MODE",this.URL_INBOX_API=this.REPOSITORY+".URL_INBOX_API"}async setDeviceId(e){this.setStorage(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}setAuthToken(e){this.setStorage(this.AUTH_TOKEN,e)}getAuthToken(){return this.getStorage(this.AUTH_TOKEN)}setInboxAuthMode(e){this.setStorage(this.INBOX_AUTH_MODE,e)}getInboxAuthMode(){return this.getStorage(this.INBOX_AUTH_MODE)}async getUrlInboxApi(){return this.getStorage(this.URL_INBOX_API)}async setUrlInboxApi(e){this.setStorage(this.URL_INBOX_API,e)}};class i{constructor(e,t){e&&(e.id&&(this.id=e.id),e.externalId&&(this.externalId=e.externalId),e.sentAt&&(this.sentAt=e.sentAt),e.status&&(this.status=e.status),e.sendingId&&(this.sendingId=e.sendingId),e.message&&(this.message=e.message),e.campaignId&&(this.campaignId=e.campaignId),this.read=!1,this.sentAt&&t&&this.sentAt<t&&(this.read=!0))}}window.inboxNotification=i;const o=i,{BaseClient:s}=n(315).Core.Api,{Config:a}=n(315).Core,{ErrorModel:u}=n(315).Core.Models,{CommonUtils:c}=n(315).Core.Utils,l=new class extends s{constructor(){super(),this.URL_BASE=a.client.INBOX_URL_BASE,this.ENDPOINT_INBOX_NOTIFICATIONS="/notification",this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID=this.ENDPOINT_INBOX_NOTIFICATIONS+"/{sendingId}",this.ENDPOINT_INBOX_COUNTER="/counters",this.ENDPOINT_INBOX_AUTH="/auth/webhook"}async getURL(){return await t.getUrlInboxApi()||this.URL_BASE}async postInboxAuth(e,n,r){const i=await this.post(this.ENDPOINT_INBOX_AUTH,e.postInboxAuth());if(!i||i instanceof u||!i.data)i?c.isFunction(r)&&r(i):c.isFunction(r)&&r();else{const e=i.data.token;t.setAuthToken(e),c.isFunction(n)&&n(i)}return!0}async getInbox(e,t,n){const r=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS,e.getInboxPushRequest());return this.getInboxResponseStatus(r,t,n),!0}async putInboxPush(e,t,n){const r=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS,e.putInboxPushRequest());return this.getInboxResponseEdit(r,t,n),!0}async getInboxPushWithSendingId(e,t,n,r){const i=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,e.getInboxPushRequestWithSendingId());return this.getNotificationResponseStatus(i,t,n,r),!0}async putInboxPushWithSendingId(e,t,n,r){const i=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,e.putInboxWithSendingId());return this.getNotificationResponseStatus(i,t,n,r),!0}async getInboxCounter(e,t,n){const r=await this.get(this.ENDPOINT_INBOX_COUNTER,e.getCounter());this.getCounterStatus(r,t,n)}async getInboxResponseStatus(e,t,n){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const n=new M(e.data);c.isFunction(t)&&t(n)}else e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}async getInboxResponseEdit(e,t,n){e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300?c.isFunction(t)&&t():e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}getNotifications(e,t){const n=[];for(let r=0;r<e.length;r++){const i=new o(e[r],t);n.push(i)}return n}async getNotificationResponseStatus(e,t,n,r){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const r=new o(e.data,t);c.isFunction(n)&&n(r)}else e?c.isFunction(r)&&r(e):c.isFunction(r)&&r()}async getCounterStatus(e,t,n){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const n={click:e.data.click,sent:e.data.sent,deleted:e.data.deleted,unread:this.getUnreadCounters(e.data.unread)};c.isFunction(t)&&t(n)}else e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}getUnreadCounters(e){return{count:e.count,lastAccess:e.lastAccess}}},{BaseRequest:f}=n(315).Core.Api,d=class extends f{constructor(){super()}postInboxAuth(){return this.body=this.json,this}setJson(e){this.json=e}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}},h=Object.freeze({SENT:"sent",CLICK:"click",DELETED:"deleted"});window.inboxStatus=h;const p=h,E=Object.freeze({NONE:"none",DEFAULT:"default",WEBHOOK:"webhook"}),{BaseRequest:y}=n(315).Core.Api,{EncryptionType:I}=n(315).Core.Models,g=class extends y{constructor(){super(),this.externalId=null,this.headers={},t.getExternalId()&&(this.externalId=t.getExternalId(),!0!==t.isAvoidCypher()&&t.getEncryptionType()!=I.RAW||(this.externalId=encodeURIComponent(t.getExternalId()))),null!=t.getAuthToken()&&t.getInboxAuthMode()==E.WEBHOOK&&(this.headers.Authorization="Bearer "+t.getAuthToken()),this.sendingId="",this.sendingIds=null,this.page=0,this.pageSize=0,this.dateFrom="",this.dateTo="",this.status=p.INBOXSTATUS_SENT,this.initialStatus=p.INBOXSTATUS_SENT,this.statusList=null}getInboxPushRequest(){return this.params=this.createQueryString(),this}putInboxPushRequest(){return this.params=this.createQueryStringExternalId(),this.body=this.createBodyJson(),this}getInboxPushRequestWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this}putInboxWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this.body=this.createBodyStatusJson(),this}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}createQueryString(){let e="";if(this.page&&(e+=this.PARAM_INBOX_PAGE+"="+this.page+"&"),this.pageSize&&(e+=this.PARAM_INBOX_PAGE_SIZE+"="+this.pageSize+"&"),this.dateFrom&&(e+=this.PARAM_INBOX_DATE_FROM+"="+this.dateFrom+"&"),this.dateTo&&(e+=this.PARAM_INBOX_DATE_TO+"="+this.dateTo+"&"),this.statusList){let t="";for(let e=0;e<this.statusList.length;e++)t+=this.statusList[e],e!=this.statusList.length-1&&(t+=",");e+=this.PARAM_INBOX_STATUS+"="+t+"&"}return e+this.createQueryStringExternalId()}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}createBodyJson(){let e={};const t=[];try{if(e=this.createBodyStatusJson(),null!=this.sendingIds){for(let e=0;e<this.sendingIds.length;e++)t.push(this.sendingIds[e]);e.sendingIds=t}}catch(e){console.log("Error Inbox request :"+e)}return e}createBodyStatusJson(){const e={};return this.status&&(e.status=this.status),this.initialStatus&&(e.initialStatus=this.initialStatus),e}setSendingId(e){this.sendingId=e}setSendingIds(e){this.sendingIds=e}setPage(e){this.page=e}setPageSize(e){this.pageSize=e}setDateFrom(e){this.dateFrom=e}setDateTo(e){this.dateTo=e}setStatus(e){this.status=e}setInitialStatus(e){this.initialStatus=e}setStatusList(e){this.statusList=e}},{BaseRequest:m}=n(315).Core.Api,{EncryptionType:_}=n(315).Core.Models,v=class extends m{constructor(){super(),this.externalId=null,this.headers={},t.getExternalId()&&(this.externalId=t.getExternalId(),!0!==t.isAvoidCypher()&&t.getEncryptionType()!=_.RAW||(this.externalId=encodeURIComponent(t.getExternalId()))),null!=t.getAuthToken()&&t.getInboxAuthMode()==E.WEBHOOK&&(this.headers.Authorization="Bearer "+t.getAuthToken())}getCounter(){return this.params=this.createQueryStringExternalId(),this}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}},{ErrorDictionary:S}=n(315).Core.Models,b=S.ErrorCode;Object.assign(b,{INBOX_GET_ERROR:3001,INBOX_GET_PAGE_ERROR:3011,INBOX_EXTERNAL_ID_NO_REGISTERED:3012,INBOX_NO_MESSAGES:3013,INBOX_IS_REQUESTING_PAGE:3014,INBOX_EMPTY:3015,INBOX_GENERAL_ERROR:3600});const T=S.ErrorMessage;Object.assign(T,{INBOX_GET_ERROR:"inbox GET request error",INBOX_GET_PAGE_ERROR:"error inbox get page",INBOX_EXTERNAL_ID_NO_REGISTERED:"external Id is not registered",INBOX_NO_MESSAGES:"There are no more messages on Inbox",INBOX_IS_REQUESTING_PAGE:"Wait. Is Requesting new page",INBOX_EMPTY:"There are no messages on Inbox",INBOX_GENERAL_ERROR:"general error"});const O={ErrorCode:b,ErrorMessage:T},{Validations:P,Log:A}=n(315).Core.Utils,R=class extends P{static isAppKeyFormat(){const e=t.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFormatRequest(){const e=new A("[IND]InboxValidations: "),n=t.getDeviceId();let r=!0;return this.isAppKeyFormat()||(r=!1,e.w("appKey is null or empty").writeLog()),this.isValidFormat(n)||(r=!1,e.w("deviceId is null or empty").writeLog()),r}},{CommonUtils:w,ErrorUtils:N,Log:C}=n(315).Core.Utils;class D{constructor(e){if(e){if(e.lastAccess&&(this.lastAccess=e.lastAccess),e.numPage?this.page=e.numPage:this.page=0,e.pageSize&&(this.pageSize=e.pageSize),this.count=0,e.count&&(this.count=e.count),e.notifications){this.notifications=[];const t=e.notifications;for(let e=0;e<t.length;e++){const n=new o(t[e],this.lastAccess);this.notifications.push(n)}}this.totalPages=Math.trunc(this.count/this.pageSize)}this.dateFrom=null,this.dateTo=null,this.statusList=null,this.newNotifications=[o],this.isRequestingPage=!1}static generateAuthToken(e,t){let n={};navigator.indigitallGetAuthConfig&&w.isFunction(navigator.indigitallGetAuthConfig)&&(n=navigator.indigitallGetAuthConfig());const r=new d;r.setJson(n),l.postInboxAuth(r,e,t)}static getMessagesCountWithAuth(e,t,n){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getMessagesCount(t,n)}static setUrlInboxApi(e){t.setUrlInboxApi(e)}static setInboxAuthMode(e){t.setInboxAuthMode(e)}static getMessagesCount(e,n){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new v;l.getInboxCounter(t,e,n=>{401===n.errorCode?this.generateAuthToken(()=>{l.getInboxCounter(t,e,n)},n):w.isFunction(n)&&n(n)})}else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_GET_ERROR));else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}static getInboxWithAuth(e,t,n){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getInbox(t,n)}static getInbox(e,t){D.getInboxWithPage(null,null,null,null,null,e,t)}static getInboxWithPageAuth(e,t,n,r,i,o,s,a){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getInboxWithPage(t,n,r,i,o,s,a)}static getInboxWithPage(e,n,r,i,o,s,a){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new g;e&&t.setPage(e),n&&t.setPageSize(n),r&&(t.setDateFrom(r),this.dateFrom=r),i&&(t.setDateTo(i),this.dateTo=i),o&&(t.setStatusList(o),this.statusList=o),l.getInbox(t,e=>{this.totalPages=e.totalPages,0!==e.count?w.isFunction(s)&&s(e):w.isFunction(a)&&a(N.showError(O,O.ErrorCode.INBOX_GET_PAGE_ERROR))},e=>{401==e.errorCode?this.generateAuthToken(()=>{l.getInbox(t,e=>{this.totalPages=e.totalPages,w.isFunction(s)&&s(e)},e)},e):w.isFunction(e)&&e(e)})}else w.isFunction(a)&&a(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(a)&&a(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}getNextPage(e,n){const r=new C("[IND]Inbox: ");if(this.isRequestingPage)r.w(O.ErrorMessage.INBOX_IS_REQUESTING_PAGE).writeLog();else if(this.isRequestingPage=!0,this.page+1<this.totalPages)if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new g;(this.page||0==this.page)&&t.setPage(this.page+1),this.pageSize&&t.setPageSize(this.pageSize),this.dateFrom&&t.setDateFrom(this.dateFrom),this.dateTo&&t.setDateTo(this.dateTo),this.statusList&&t.setStatusList(this.statusList),l.getInbox(t,t=>{this.notifications=this.notifications.concat(t.notifications),this.newNotifications=t.notifications,this.lastAccess=t.lastAccess,this.count=t.count,this.page=t.page,this.pageSize=t.pageSize,this.totalPages=t.totalPages,this.isRequestingPage=!1,w.isFunction(e)&&e(this,this.newNotifications)},n=>{401===n.errorCode?this.generateAuthToken(()=>{l.getInbox(t,t=>{this.notifications=this.notifications.concat(t.notifications),this.newNotifications=t.notifications,this.lastAccess=t.lastAccess,this.count=t.count,this.page=t.page,this.pageSize=t.pageSize,this.totalPages=t.totalPages,this.isRequestingPage=!1,w.isFunction(e)&&e(this,this.newNotifications)},n)},n):(this.isRequestingPage=!1,w.isFunction(n)&&n())})}else this.isRequestingPage=!1,w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else this.isRequestingPage=!1,w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_NO_MESSAGES))}massiveEditNotifications(e,t,n,r){let i=p.SENT;t==p.CLICK&&(i=p.SENT),t==p.DELETED&&(i=p.CLICK),this.massiveEditNotifications(e,i,t,n,r)}massiveEditNotificationsWithInitialStatus(e,n,r,i,o){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(r){const t=new g;null!=e&&t.setSendingIds(e),t.setStatus(r),t.setInitialStatus(n),l.putInboxPush(t,i,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.putInboxPush(t,i,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(o)&&o(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(o)&&o(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}getInfoFromNotification(e,n,r){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(e){const t=new g;t.setSendingId(e),l.getInboxPushWithSendingId(t,this.lastAccess,n,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.getInboxPushWithSendingId(t,this.lastAccess,n,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(r)&&r(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(r)&&r(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}modifyStatusFromNotification(e,n,r,i){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(e&&n){const t=new g;t.setSendingId(e),t.setStatus(n),l.putInboxPushWithSendingId(t,this.lastAccess,r,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.putInboxPushWithSendingId(t,this.lastAccess,r,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(i)&&i(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(i)&&i(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}}const M=D})(),r})(),e.exports=t()},824(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(114));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},603(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(93));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},93(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.16.5","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>W});var i={};n.r(i),n.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>T,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>M,TopicSubscribeType:()=>L});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>x,DateUtils:()=>R,ErrorUtils:()=>b,JsonUtils:()=>Y,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>G,Validations:()=>F});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const r=n.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){const t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,r)=>{e||r(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),r(!1)}})}async put(e,t,n){return new Promise((r,i)=>{e||i(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),r(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+=`${error.errorCode}: ${error.errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(e,t,n){if(null!=e){const r=Object.values(e.ErrorCode).indexOf(t);if(r>=0){const t=Object.keys(e.ErrorCode)[r],i=Object.values(e.ErrorCode)[r];return new v({code:t,errorId:i},Object.values(e.ErrorMessage)[r],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},T=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,r){const i=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&i.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),r&&(s.credentials=r);try{const t=new AbortController;let r;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(r=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(r&&clearTimeout(r),304!=a.status){const t=await a.json();return a.ok?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),M=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),L=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let r=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,r=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):r=new Date(Date.now()+36e5),!t){const e=r.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let r=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+r+" to "+n.state).writeLog(),r=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",x=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const r=window?.crypto?.subtle;if(!r)return;const i=await r.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await r.sign(j,i,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}},Y=class{static compareJSON(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r]){if("object"!=typeof e[r]||"object"!=typeof t[r])return!1;if(!isEqual(e[r],t[r]))return!1}return!0}},F=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},G=class{static setTopicChannel(e,t){const n=[];for(let r=0;r<e.length;r++){const i=e[r];i.channel=t,n.push(i)}return n}},W={Repository:y,Config:c,Api:i,Models:o,Utils:s};return r})(),e.exports=t()},315(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(i.get||i.set)?n(o,s,i):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(254)),i=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(d(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,i,"GeneratorFunction"),d(h),d(h,i,"Generator"),d(h,r,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}d=function(e,t,n,r){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,r)}function h(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){h(o,r,i,s,a,"next",e)}function a(e){h(o,r,i,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,b;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new r.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new i.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(b=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,b));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,b));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,r){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var r=a(n(468)),i=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i;function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((i=n(237))&&i.__esModule?i:{default:i}).default);t.default=f},943(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(r=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new i.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={platform:"webpush",version:"0.0.1"},i=n(904);r.version=i.version,r=Object.assign(r,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=r},610(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}var l=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=new i.default;if(null!=t){r.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,r.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,r.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),r.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),r.setEncryptionType(this.encryptionType)}});t.default=l},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new i.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=n},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=r&&(this.exceptionMessage=r)});t.default=o},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return r.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var r=n(902),i=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,r,o,s){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return i(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,i(h,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,s,"GeneratorFunction"),i(h),i(h,s,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:p}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,n,r){function s(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,n,r)}function o(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,u,"next",e)}function u(e){o(s,r,i,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB},t=[{key:"getDB",value:(c=s(r().m(function e(){var t=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var r=t.IDB;if(r){var i=r.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){var t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(r().m(function e(t,n){var i=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(i.close(t),e(n.target.result.store.value)),r(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(r().m(function e(t,n,i){var o=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.store.put({store:{key:n,value:i}},n).onsuccess=function(n){o.close(t),e(i)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(i=s(r().m(function e(t,n){var i,o;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return i=e.v,e.a(2,this.put(i,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return i.apply(this,arguments)})},{key:"getItem",value:(n=s(r().m(function e(t){var n,i;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,i=e.v,e.a(2,i)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,i,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(122)),i=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,i,"GeneratorFunction"),f(h),f(h,i,"Generator"),f(h,r,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}function d(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){d(o,r,i,s,a,"next",e)}function a(e){d(o,r,i,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=i.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){i.default.setItem(e,t)}},{key:"getStorage",value:function(e){return i.default.getItem(e)}},{key:"clearStorage",value:function(){i.default.clear()}},{key:"setBrowserPublicKey",value:function(e){i.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return i.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){i.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return i.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return i.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(T=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return T.apply(this,arguments)})},{key:"setVAPID",value:function(e){i.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return i.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){i.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return i.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){i.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return i.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){i.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return i.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){i.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return i.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(b=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!i.default&&i.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return i.default&&i.default.getItem(this.PLATFORM)||r.default.platform}},{key:"getVersion",value:function(){return r.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return i.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){i.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return i.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return i.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){i.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return i.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){i.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return i.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){i.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return i.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){i.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return i.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){i.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return i.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){i.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return i.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){i.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==i.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){i.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return i.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){i.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return i.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default&&i.default.isLocalStorageAvailable()&&i.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!i.default||!i.default.isLocalStorageAvailable()){e.n=1;break}t=i.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){i.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return i.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,i.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){i.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return i.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){i.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return i.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,b,T,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new r.default).getServiceTimestamp()||(new r.default).getServiceSyncTime()<=(Date.now()-(new r.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new i.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}],t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(254))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(a(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,i,"GeneratorFunction"),a(h),a(h,i,"Generator"),a(h,r,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}a=function(e,t,n,r){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,r)}function u(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){u(o,r,i,s,a,"next",e)}function a(e){u(o,r,i,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(r=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return r.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var r,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(r=e.v)&&(o=r.state,"onchange"in r&&(r.onchange=function(){new i.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+r.state).writeLog(),o=r.state,n&&n({name:t,state:r.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var r=n(225),i=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,r,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function c(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new i.default).isAvoidCypher()&&(new i.default).getEncryptionType()!==r.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new i.default).getEncryptionType()!==r.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(e){c(o,r,i,s,a,"next",e)}function a(e){c(o,r,i,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var r=this.tryToParseLeniently(n);return r?this.formatCanonicalUTC(r):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=r(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.parseByFormat(e,i);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(735)),i=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new i.default(s,Object.values(e.ErrorMessage)[o],n)}return new i.default(r.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"compareJSON",value:function(e,t){var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,s=r;o<s.length;o++){var a=s[o];if(e[a]!==t[a]){if("object"!=n(e[a])||"object"!=n(t[a]))return!1;if(!isEqual(e[a],t[a]))return!1}}return!0}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=i.default.INFO,this.setLogLevel((new r.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=i.default.DEBUG&&e<=i.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=i.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=i.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=i.default.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+="".concat(error.errorCode,": ").concat(error.errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i.channel=t,n.push(i)}return n}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var r=h(n(622)),i=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},114(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.16.5","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>W});var i={};n.r(i),n.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>T,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>M,TopicSubscribeType:()=>L});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>x,DateUtils:()=>R,ErrorUtils:()=>b,JsonUtils:()=>Y,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>G,Validations:()=>F});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const r=n.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){const t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,r)=>{e||r(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),r(!1)}})}async put(e,t,n){return new Promise((r,i)=>{e||i(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),r(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+=`${error.errorCode}: ${error.errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(e,t,n){if(null!=e){const r=Object.values(e.ErrorCode).indexOf(t);if(r>=0){const t=Object.keys(e.ErrorCode)[r],i=Object.values(e.ErrorCode)[r];return new v({code:t,errorId:i},Object.values(e.ErrorMessage)[r],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},T=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,r){const i=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&i.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),r&&(s.credentials=r);try{const t=new AbortController;let r;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(r=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(r&&clearTimeout(r),304!=a.status){const t=await a.json();return a.ok?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(i.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),b.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),M=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),L=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let r=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,r=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):r=new Date(Date.now()+36e5),!t){const e=r.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let r=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+r+" to "+n.state).writeLog(),r=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",x=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const r=window?.crypto?.subtle;if(!r)return;const i=await r.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await r.sign(j,i,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}},Y=class{static compareJSON(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r]){if("object"!=typeof e[r]||"object"!=typeof t[r])return!1;if(!isEqual(e[r],t[r]))return!1}return!0}},F=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},G=class{static setTopicChannel(e,t){const n=[];for(let r=0;r<e.length;r++){const i=e[r];i.channel=t,n.push(i)}return n}},W={Repository:y,Config:c,Api:i,Models:o,Utils:s};return r})(),e.exports=t()},315(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(i.get||i.set)?n(o,s,i):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(254)),i=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(d(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,i,"GeneratorFunction"),d(h),d(h,i,"Generator"),d(h,r,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}d=function(e,t,n,r){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,r)}function h(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){h(o,r,i,s,a,"next",e)}function a(e){h(o,r,i,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,b;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new r.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new i.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(b=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,b));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+b).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,b));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,r){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,r){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,r);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var r=a(n(468)),i=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i;function o(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function s(e,t,n){return t=u(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=s(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&c(e,t)}(t,e),function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((i=n(237))&&i.__esModule?i:{default:i}).default);t.default=l},943(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function c(e,t,n){return t=f(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t)}return function(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&&d(e,t)}(t,e),n=t,(r=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.default);t.default=h},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var a=function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new i.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=a},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={platform:"webpush",version:"0.0.1"},i=n(904);r.version=i.version,r=Object.assign(r,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=r},610(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return a;if(o=t?i:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(291)),i=s(n(254)),o=s(n(164));function s(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var s=new r.default;if(null!=t){s.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,s.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,s.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new i.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),s.setConfigV2ServiceSyncTime(u)}this.encryptionType=o.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),s.setEncryptionType(this.encryptionType)}});t.default=a},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(291))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var a=function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new i.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=a},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}}},234(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=r&&(this.exceptionMessage=r)});t.default=n},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return r.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var r=n(902),i=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,r,o,s){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return i(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(i(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,i(h,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,s,"GeneratorFunction"),i(h),i(h,s,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:p}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,n,r){function s(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},i(e,t,n,r)}function o(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,u,"next",e)}function u(e){o(s,r,i,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB},t=[{key:"getDB",value:(c=s(r().m(function e(){var t=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var r=t.IDB;if(r){var i=r.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){var t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(r().m(function e(t,n){var i=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(i.close(t),e(n.target.result.store.value)),r(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(r().m(function e(t,n,i){var o=this;return r().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,r){t||r(!1),t.store.put({store:{key:n,value:i}},n).onsuccess=function(n){o.close(t),e(i)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(i=s(r().m(function e(t,n){var i,o;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return i=e.v,e.a(2,this.put(i,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return i.apply(this,arguments)})},{key:"getItem",value:(n=s(r().m(function e(t){var n,i;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,i=e.v,e.a(2,i)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,i,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==i.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.setItem(e,value),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=i},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(122)),i=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,i,"GeneratorFunction"),f(h),f(h,i,"Generator"),f(h,r,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}function d(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){d(o,r,i,s,a,"next",e)}function a(e){d(o,r,i,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=i.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){i.default.setItem(e,t)}},{key:"getStorage",value:function(e){return i.default.getItem(e)}},{key:"clearStorage",value:function(){i.default.clear()}},{key:"setBrowserPublicKey",value:function(e){i.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return i.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){i.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return i.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return i.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(T=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return T.apply(this,arguments)})},{key:"setVAPID",value:function(e){i.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return i.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){i.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return i.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){i.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return i.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){i.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return i.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){i.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return i.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(b=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!i.default&&i.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return i.default&&i.default.getItem(this.PLATFORM)||r.default.platform}},{key:"getVersion",value:function(){return r.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return i.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){i.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return i.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return i.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){i.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return i.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){i.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return i.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){i.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return i.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){i.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return i.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){i.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return i.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){i.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return i.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){i.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==i.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){i.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return i.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){i.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return i.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(i.default&&i.default.isLocalStorageAvailable()&&i.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!i.default||!i.default.isLocalStorageAvailable()){e.n=1;break}t=i.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){i.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return i.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,i.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:i.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){i.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return i.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){i.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return i.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,b,T,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==i.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=i},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new r.default).getServiceTimestamp()||(new r.default).getServiceSyncTime()<=(Date.now()-(new r.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new i.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):(e.d("Using fallback UUID generator").writeLog(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=u},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(254))&&r.__esModule?r:{default:r};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,r){for(s=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return u;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(r,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(a(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,i,"GeneratorFunction"),a(h),a(h,i,"Generator"),a(h,r,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}a=function(e,t,n,r){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,r)}function u(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){u(o,r,i,s,a,"next",e)}function a(e){u(o,r,i,s,a,"throw",e)}s(void 0)})}}function l(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var f=function(){return function(e,t,n){return n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(r=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return r.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var r,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(r=e.v)&&(o=r.state,"onchange"in r&&(r.onchange=function(){new i.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+r.state).writeLog(),o=r.state,n&&n({name:t,state:r.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}();t.default=f},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var r=n(225),i=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof c?r:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,r,i){var o,a,u,c=0,l=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=d.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,r,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function c(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function l(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var f=new(o(n(254)).default)("[IND]Crypto"),d=new TextEncoder("utf-8"),h="HMAC",p=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,p,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new i.default).isAvoidCypher()&&(new i.default).getEncryptionType()!==r.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new i.default).getEncryptionType()!==r.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",d.encode(t),{name:h,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(h,c,d.encode(n));case 4:l=e.v,p=new Uint8Array(l),o=Array.prototype.map.call(p,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),f.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,f.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(e){c(o,r,i,s,a,"next",e)}function a(e){c(o,r,i,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=p},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var r=this.tryToParseLeniently(n);return r?this.formatCanonicalUTC(r):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=r(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.parseByFormat(e,i);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();o(a,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),o(a,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=a},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(735)),i=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new i.default(s,Object.values(e.ErrorMessage)[o],n)}return new i.default(r.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new u},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"compareJSON",value:function(e,t){var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,s=r;o<s.length;o++){var a=s[o];if(e[a]!==t[a]){if("object"!=n(e[a])||"object"!=n(t[a]))return!1;if(!isEqual(e[a],t[a]))return!1}}return!0}}],t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=i},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(291)),i=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=i.default.INFO,this.setLogLevel((new r.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=i.default.DEBUG&&e<=i.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=i.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=i.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=i.default.ERROR)if(1==arguments.length&&arguments.errorCode)this.log+="".concat(error.errorCode,": ").concat(error.errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i.channel=t,n.push(i)}return n}}],t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=i},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=i},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var r=h(n(622)),i=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.16.5","_id":"indigitall-web-core@4.16.5","_inBundle":false,"_integrity":"sha512-1rudsnXyzNLi8Syln24ZpaMlGsZsLgTWsohGi/fDboS53w4GW4+ln4E96HmoO2vom7CTNBV+gbcscpfgfMNcSw==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.16.5","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.16.5","saveSpec":null,"fetchSpec":"4.16.5"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.16.5.tgz","_shasum":"7011471d0100272867681db5a6e55f5559544aa8","_spec":"indigitall-web-core@4.16.5","_where":"/home/circleci/webpush/inbox","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.16.5"}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{default:()=>M});const{Repository:e}=n(315).Core,t=new class extends e{constructor(){super(),this.AUTH_TOKEN=this.REPOSITORY+".AUTH_TOKEN",this.INBOX_AUTH_MODE=this.REPOSITORY+".INBOX_AUTH_MODE",this.URL_INBOX_API=this.REPOSITORY+".URL_INBOX_API"}async setDeviceId(e){this.setStorage(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}setAuthToken(e){this.setStorage(this.AUTH_TOKEN,e)}getAuthToken(){return this.getStorage(this.AUTH_TOKEN)}setInboxAuthMode(e){this.setStorage(this.INBOX_AUTH_MODE,e)}getInboxAuthMode(){return this.getStorage(this.INBOX_AUTH_MODE)}async getUrlInboxApi(){return this.getStorage(this.URL_INBOX_API)}async setUrlInboxApi(e){this.setStorage(this.URL_INBOX_API,e)}};class i{constructor(e,t){e&&(e.id&&(this.id=e.id),e.externalId&&(this.externalId=e.externalId),e.sentAt&&(this.sentAt=e.sentAt),e.status&&(this.status=e.status),e.sendingId&&(this.sendingId=e.sendingId),e.message&&(this.message=e.message),e.campaignId&&(this.campaignId=e.campaignId),this.read=!1,this.sentAt&&t&&this.sentAt<t&&(this.read=!0))}}window.inboxNotification=i;const o=i,{BaseClient:s}=n(315).Core.Api,{Config:a}=n(315).Core,{ErrorModel:u}=n(315).Core.Models,{CommonUtils:c}=n(315).Core.Utils,l=new class extends s{constructor(){super(),this.URL_BASE=a.client.INBOX_URL_BASE,this.ENDPOINT_INBOX_NOTIFICATIONS="/notification",this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID=this.ENDPOINT_INBOX_NOTIFICATIONS+"/{sendingId}",this.ENDPOINT_INBOX_COUNTER="/counters",this.ENDPOINT_INBOX_AUTH="/auth/webhook"}async getURL(){return await t.getUrlInboxApi()||this.URL_BASE}async postInboxAuth(e,n,r){const i=await this.post(this.ENDPOINT_INBOX_AUTH,e.postInboxAuth());if(!i||i instanceof u||!i.data)i?c.isFunction(r)&&r(i):c.isFunction(r)&&r();else{const e=i.data.token;t.setAuthToken(e),c.isFunction(n)&&n(i)}return!0}async getInbox(e,t,n){const r=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS,e.getInboxPushRequest());return this.getInboxResponseStatus(r,t,n),!0}async putInboxPush(e,t,n){const r=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS,e.putInboxPushRequest());return this.getInboxResponseEdit(r,t,n),!0}async getInboxPushWithSendingId(e,t,n,r){const i=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,e.getInboxPushRequestWithSendingId());return this.getNotificationResponseStatus(i,t,n,r),!0}async putInboxPushWithSendingId(e,t,n,r){const i=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,e.putInboxWithSendingId());return this.getNotificationResponseStatus(i,t,n,r),!0}async getInboxCounter(e,t,n){const r=await this.get(this.ENDPOINT_INBOX_COUNTER,e.getCounter());this.getCounterStatus(r,t,n)}async getInboxResponseStatus(e,t,n){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const n=new M(e.data);c.isFunction(t)&&t(n)}else e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}async getInboxResponseEdit(e,t,n){e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300?c.isFunction(t)&&t():e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}getNotifications(e,t){const n=[];for(let r=0;r<e.length;r++){const i=new o(e[r],t);n.push(i)}return n}async getNotificationResponseStatus(e,t,n,r){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const r=new o(e.data,t);c.isFunction(n)&&n(r)}else e?c.isFunction(r)&&r(e):c.isFunction(r)&&r()}async getCounterStatus(e,t,n){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const n={click:e.data.click,sent:e.data.sent,deleted:e.data.deleted,unread:this.getUnreadCounters(e.data.unread)};c.isFunction(t)&&t(n)}else e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}getUnreadCounters(e){return{count:e.count,lastAccess:e.lastAccess}}},{BaseRequest:f}=n(315).Core.Api,d=class extends f{constructor(){super()}postInboxAuth(){return this.body=this.json,this}setJson(e){this.json=e}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}},h=Object.freeze({SENT:"sent",CLICK:"click",DELETED:"deleted"});window.inboxStatus=h;const p=h,E=Object.freeze({NONE:"none",DEFAULT:"default",WEBHOOK:"webhook"}),{BaseRequest:y}=n(315).Core.Api,{EncryptionType:I}=n(315).Core.Models,g=class extends y{constructor(){super(),this.externalId=null,this.headers={},t.getExternalId()&&(this.externalId=t.getExternalId(),!0!==t.isAvoidCypher()&&t.getEncryptionType()!=I.RAW||(this.externalId=encodeURIComponent(t.getExternalId()))),null!=t.getAuthToken()&&t.getInboxAuthMode()==E.WEBHOOK&&(this.headers.Authorization="Bearer "+t.getAuthToken()),this.sendingId="",this.sendingIds=null,this.page=0,this.pageSize=0,this.dateFrom="",this.dateTo="",this.status=p.INBOXSTATUS_SENT,this.initialStatus=p.INBOXSTATUS_SENT,this.statusList=null}getInboxPushRequest(){return this.params=this.createQueryString(),this}putInboxPushRequest(){return this.params=this.createQueryStringExternalId(),this.body=this.createBodyJson(),this}getInboxPushRequestWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this}putInboxWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this.body=this.createBodyStatusJson(),this}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}createQueryString(){let e="";if(this.page&&(e+=this.PARAM_INBOX_PAGE+"="+this.page+"&"),this.pageSize&&(e+=this.PARAM_INBOX_PAGE_SIZE+"="+this.pageSize+"&"),this.dateFrom&&(e+=this.PARAM_INBOX_DATE_FROM+"="+this.dateFrom+"&"),this.dateTo&&(e+=this.PARAM_INBOX_DATE_TO+"="+this.dateTo+"&"),this.statusList){let t="";for(let e=0;e<this.statusList.length;e++)t+=this.statusList[e],e!=this.statusList.length-1&&(t+=",");e+=this.PARAM_INBOX_STATUS+"="+t+"&"}return e+this.createQueryStringExternalId()}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}createBodyJson(){let e={};const t=[];try{if(e=this.createBodyStatusJson(),null!=this.sendingIds){for(let e=0;e<this.sendingIds.length;e++)t.push(this.sendingIds[e]);e.sendingIds=t}}catch(e){console.log("Error Inbox request :"+e)}return e}createBodyStatusJson(){const e={};return this.status&&(e.status=this.status),this.initialStatus&&(e.initialStatus=this.initialStatus),e}setSendingId(e){this.sendingId=e}setSendingIds(e){this.sendingIds=e}setPage(e){this.page=e}setPageSize(e){this.pageSize=e}setDateFrom(e){this.dateFrom=e}setDateTo(e){this.dateTo=e}setStatus(e){this.status=e}setInitialStatus(e){this.initialStatus=e}setStatusList(e){this.statusList=e}},{BaseRequest:m}=n(315).Core.Api,{EncryptionType:_}=n(315).Core.Models,v=class extends m{constructor(){super(),this.externalId=null,this.headers={},t.getExternalId()&&(this.externalId=t.getExternalId(),!0!==t.isAvoidCypher()&&t.getEncryptionType()!=_.RAW||(this.externalId=encodeURIComponent(t.getExternalId()))),null!=t.getAuthToken()&&t.getInboxAuthMode()==E.WEBHOOK&&(this.headers.Authorization="Bearer "+t.getAuthToken())}getCounter(){return this.params=this.createQueryStringExternalId(),this}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}},{ErrorDictionary:S}=n(315).Core.Models,b=S.ErrorCode;Object.assign(b,{INBOX_GET_ERROR:3001,INBOX_GET_PAGE_ERROR:3011,INBOX_EXTERNAL_ID_NO_REGISTERED:3012,INBOX_NO_MESSAGES:3013,INBOX_IS_REQUESTING_PAGE:3014,INBOX_EMPTY:3015,INBOX_GENERAL_ERROR:3600});const T=S.ErrorMessage;Object.assign(T,{INBOX_GET_ERROR:"inbox GET request error",INBOX_GET_PAGE_ERROR:"error inbox get page",INBOX_EXTERNAL_ID_NO_REGISTERED:"external Id is not registered",INBOX_NO_MESSAGES:"There are no more messages on Inbox",INBOX_IS_REQUESTING_PAGE:"Wait. Is Requesting new page",INBOX_EMPTY:"There are no messages on Inbox",INBOX_GENERAL_ERROR:"general error"});const O={ErrorCode:b,ErrorMessage:T},{Validations:P,Log:A}=n(315).Core.Utils,R=class extends P{static isAppKeyFormat(){const e=t.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFormatRequest(){const e=new A("[IND]InboxValidations: "),n=t.getDeviceId();let r=!0;return this.isAppKeyFormat()||(r=!1,e.w("appKey is null or empty").writeLog()),this.isValidFormat(n)||(r=!1,e.w("deviceId is null or empty").writeLog()),r}},{CommonUtils:w,ErrorUtils:N,Log:C}=n(315).Core.Utils;class D{constructor(e){if(e){if(e.lastAccess&&(this.lastAccess=e.lastAccess),e.numPage?this.page=e.numPage:this.page=0,e.pageSize&&(this.pageSize=e.pageSize),this.count=0,e.count&&(this.count=e.count),e.notifications){this.notifications=[];const t=e.notifications;for(let e=0;e<t.length;e++){const n=new o(t[e],this.lastAccess);this.notifications.push(n)}}this.totalPages=Math.trunc(this.count/this.pageSize)}this.dateFrom=null,this.dateTo=null,this.statusList=null,this.newNotifications=[o],this.isRequestingPage=!1}static generateAuthToken(e,t){let n={};navigator.indigitallGetAuthConfig&&w.isFunction(navigator.indigitallGetAuthConfig)&&(n=navigator.indigitallGetAuthConfig());const r=new d;r.setJson(n),l.postInboxAuth(r,e,t)}static getMessagesCountWithAuth(e,t,n){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getMessagesCount(t,n)}static setUrlInboxApi(e){t.setUrlInboxApi(e)}static setInboxAuthMode(e){t.setInboxAuthMode(e)}static getMessagesCount(e,n){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new v;l.getInboxCounter(t,e,n=>{401===n.errorCode?this.generateAuthToken(()=>{l.getInboxCounter(t,e,n)},n):w.isFunction(n)&&n(n)})}else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_GET_ERROR));else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}static getInboxWithAuth(e,t,n){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getInbox(t,n)}static getInbox(e,t){D.getInboxWithPage(null,null,null,null,null,e,t)}static getInboxWithPageAuth(e,t,n,r,i,o,s,a){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getInboxWithPage(t,n,r,i,o,s,a)}static getInboxWithPage(e,n,r,i,o,s,a){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new g;e&&t.setPage(e),n&&t.setPageSize(n),r&&(t.setDateFrom(r),this.dateFrom=r),i&&(t.setDateTo(i),this.dateTo=i),o&&(t.setStatusList(o),this.statusList=o),l.getInbox(t,e=>{this.totalPages=e.totalPages,0!==e.count?w.isFunction(s)&&s(e):w.isFunction(a)&&a(N.showError(O,O.ErrorCode.INBOX_GET_PAGE_ERROR))},e=>{401==e.errorCode?this.generateAuthToken(()=>{l.getInbox(t,e=>{this.totalPages=e.totalPages,w.isFunction(s)&&s(e)},e)},e):w.isFunction(e)&&e(e)})}else w.isFunction(a)&&a(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(a)&&a(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}getNextPage(e,n){const r=new C("[IND]Inbox: ");if(this.isRequestingPage)r.w(O.ErrorMessage.INBOX_IS_REQUESTING_PAGE).writeLog();else if(this.isRequestingPage=!0,this.page+1<this.totalPages)if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new g;(this.page||0==this.page)&&t.setPage(this.page+1),this.pageSize&&t.setPageSize(this.pageSize),this.dateFrom&&t.setDateFrom(this.dateFrom),this.dateTo&&t.setDateTo(this.dateTo),this.statusList&&t.setStatusList(this.statusList),l.getInbox(t,t=>{this.notifications=this.notifications.concat(t.notifications),this.newNotifications=t.notifications,this.lastAccess=t.lastAccess,this.count=t.count,this.page=t.page,this.pageSize=t.pageSize,this.totalPages=t.totalPages,this.isRequestingPage=!1,w.isFunction(e)&&e(this,this.newNotifications)},n=>{401===n.errorCode?this.generateAuthToken(()=>{l.getInbox(t,t=>{this.notifications=this.notifications.concat(t.notifications),this.newNotifications=t.notifications,this.lastAccess=t.lastAccess,this.count=t.count,this.page=t.page,this.pageSize=t.pageSize,this.totalPages=t.totalPages,this.isRequestingPage=!1,w.isFunction(e)&&e(this,this.newNotifications)},n)},n):(this.isRequestingPage=!1,w.isFunction(n)&&n())})}else this.isRequestingPage=!1,w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else this.isRequestingPage=!1,w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_NO_MESSAGES))}massiveEditNotifications(e,t,n,r){let i=p.SENT;t==p.CLICK&&(i=p.SENT),t==p.DELETED&&(i=p.CLICK),this.massiveEditNotifications(e,i,t,n,r)}massiveEditNotificationsWithInitialStatus(e,n,r,i,o){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(r){const t=new g;null!=e&&t.setSendingIds(e),t.setStatus(r),t.setInitialStatus(n),l.putInboxPush(t,i,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.putInboxPush(t,i,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(o)&&o(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(o)&&o(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}getInfoFromNotification(e,n,r){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(e){const t=new g;t.setSendingId(e),l.getInboxPushWithSendingId(t,this.lastAccess,n,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.getInboxPushWithSendingId(t,this.lastAccess,n,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(r)&&r(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(r)&&r(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}modifyStatusFromNotification(e,n,r,i){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(e&&n){const t=new g;t.setSendingId(e),t.setStatus(n),l.putInboxPushWithSendingId(t,this.lastAccess,r,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.putInboxPushWithSendingId(t,this.lastAccess,r,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(i)&&i(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(i)&&i(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}}const M=D})(),r})(),e.exports=t()},824(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(i.get||i.set)?n(o,s,i):o[s]=e[s]);return o}(e)}(n(114));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.16.5","_id":"indigitall-web-core@4.16.5","_inBundle":false,"_integrity":"sha512-1rudsnXyzNLi8Syln24ZpaMlGsZsLgTWsohGi/fDboS53w4GW4+ln4E96HmoO2vom7CTNBV+gbcscpfgfMNcSw==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.16.5","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.16.5","saveSpec":null,"fetchSpec":"4.16.5"},"_requiredBy":["#USER","/","/indigitall-web-inbox"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.16.5.tgz","_shasum":"7011471d0100272867681db5a6e55f5559544aa8","_spec":"indigitall-web-core@4.16.5","_where":"/home/circleci/webpush/push","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.16.5"}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{default:()=>Ie});var e=n(824),t=n.n(e);const{Repository:i}=n(315).Core,o=new class extends i{constructor(){super(),this.SAFARI_WEBSITE_PUSH_ID=this.REPOSITORY+".SAFARI_WEBSITE_PUSH_ID",this.PUSH_TOKEN=this.REPOSITORY+".PUSH_TOKEN",this.PERMISSION_PUSH=this.REPOSITORY+".PERMISSION_PUSH",this.DEVICE_JSON=this.REPOSITORY+".DEVICE_JSON",this.PUT_REQUEST_TIMESTAMP=this.REPOSITORY+".PUT_REQUEST_TIMESTAMP",this.WORKER_PATH=this.REPOSITORY+".WORKER_PATH",this.TEST=this.REPOSITORY+".TEST",this.SAFARI_GESTURE_REQUEST_PERMISSION=this.REPOSITORY+".SAFARI_GESTURE_REQUEST_PERMISSION",this.UPDATE_TOPIC_SUBSCRIBE=this.REPOSITORY+".UPDATE_TOPIC_SUBSCRIBE",this.TOPIC_SYNC_TIMESTAMP=this.REPOSITORY+".TOPIC_SYNC_TIMESTAMP",this.TOPIC_SEMAPHORE=this.REPOSITORY+".TOPIC_SEMAPHORE",this.TOPIC_SYNC_IS_PROCESSING=this.REPOSITORY+".TOPIC_SYNC_IS_PROCESSING"}async getDeviceIdSync(){if(this.db&&this.db.IDB)return await this.db.getItem(this.DEVICE_ID)}setPushToken(e){this.setStorage(this.PUSH_TOKEN,e)}getPushToken(){return this.getStorage(this.PUSH_TOKEN)}setSafariWebsitePushId(e){this.setStorage(this.SAFARI_WEBSITE_PUSH_ID,e)}getSafariWebsitePushId(){return this.getStorage(this.SAFARI_WEBSITE_PUSH_ID)}setPermissionPush(e){this.setStorage(this.PERMISSION_PUSH,e)}getPermissionPush(){return this.getStorage(this.PERMISSION_PUSH)}async getDeviceJson(){return this.getStorage(this.DEVICE_JSON)}async setDeviceJson(e){this.setStorage(this.DEVICE_JSON,e)}async getPutRequestTimestamp(){return this.getStorage(this.PUT_REQUEST_TIMESTAMP)}async setPutRequestTimestamp(e){this.setStorage(this.PUT_REQUEST_TIMESTAMP,e)}setWorkerPath(e){this.setStorage(this.WORKER_PATH,e)}getWorkerPath(){return this.getStorage(this.WORKER_PATH)}setTestValue(e){this.setStorage(this.TEST,e)}getTestValue(){return this.getStorage(this.TEST)}setSafariGestureRequestPermission(e){this.setStorage(this.SAFARI_GESTURE_REQUEST_PERMISSION,e)}getSafariGestureRequestPermission(){return this.getStorage(this.SAFARI_GESTURE_REQUEST_PERMISSION)}async setUpdateTopicSubscribe(e){this.db&&this.db.IDB&&await this.db.setItem(this.UPDATE_TOPIC_SUBSCRIBE,e)}async getUpdateTopicSubscribe(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.UPDATE_TOPIC_SUBSCRIBE))}catch(e){}return e}async setTopicSyncTimestamp(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SYNC_TIMESTAMP,e)}async getTopicSyncTimestamp(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_SYNC_TIMESTAMP))}catch(e){}return e}async setTopicSemaphore(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SEMAPHORE,e)}async getTopicSemaphore(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_SEMAPHORE))}catch(e){}return e}async setTopicSyncIsProcessing(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SYNC_IS_PROCESSING,e)}async getTopicSyncIsProcessing(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_SYNC_IS_PROCESSING))}catch(e){}return e}},{ErrorDictionary:s}=n(315).Core.Models,a=s.ErrorCode;Object.assign(a,{GENERAL_ERROR_BAD_REQUEST:601,GENERAL_ERROR_APPKEY_BAD_REQUEST:602,PUSH_INITIALIZATION_ERROR:1e3,PUSH_RECEPTION_ERROR:1200,PUSH_TOPICS_ERROR:1400,PUSH_DEVICE_ERROR:1500,PUSH_EVENT_ERROR:1600,PUSH_PERMISSION_NOT_ACCEPTED:1602,API_APPKEY_NOT_VALID:1601,DISABLED_CHANNEL:4404});const u=s.ErrorMessage;Object.assign(u,{GENERAL_ERROR_BAD_REQUEST:"AppKey or DeviceId are null or empty",GENERAL_ERROR_APPKEY_BAD_REQUEST:"AppKey is null or empty",PUSH_INITIALIZATION_ERROR:"initialization error",PUSH_RECEPTION_ERROR:"push reception error",PUSH_TOPICS_ERROR:"push topics error",PUSH_DEVICE_ERROR:"device error",PUSH_EVENT_ERROR:"event error",PUSH_PERMISSION_NOT_ACCEPTED:"permission not accepted",API_APPKEY_NOT_VALID:"appKey is missing'",DISABLED_CHANNEL:"disabled channel"});const c={ErrorCode:a,ErrorMessage:u},{Device:l}=n(315).Core.Models,f=class extends l{constructor(e=null,t){super(e,t),null==e?(null!=o.getDeviceId()&&(this.deviceId=o.getDeviceId()),null!=o.getPushToken()&&(this.pushToken=o.getPushToken())):t?e.deviceId&&(this.deviceId=e.deviceId,o.setDeviceId(this.deviceId)):(e.deviceId&&(this.deviceId=e.deviceId),e.pushToken&&(this.pushToken=e.pushToken))}static setDeviceJson(e){o.setDeviceJson(JSON.stringify(e.toJSON()))}getDeviceId(){return this.deviceId}getPushToken(){return this.pushToken}toJSON(){const e=super.toJSON();return this.deviceId&&(e.deviceId=this.deviceId),this.pushToken&&(e.pushToken=this.pushToken),e}},{DeviceStatus:d}=n(315).Core.Models,{BaseRequest:h}=n(315).Core.Api,p=class extends h{constructor(e=d.DEFAULT){super(),this.device=new f,this.status=e,this.notToUpdate=!1,this.deviceUpdate=!1}isDeviceUpdated(e){this.deviceUpdate=e}setDeviceId(e){this.device&&(this.device.deviceId=e)}setAppKey(e){this.appKey=e}getDeviceRequest(){return this.params=this.createQueryString(),this}postDeviceRequest(){return this.body=this.createDeviceJson(),this.status!==d.DEFAULT&&(this.body.enabled=1===this.status),this}putDeviceRequest(e){return this.params=this.createQueryString(),this.body=this.createPUTDeviceJson(e),this.status!==d.DEFAULT&&(this.body.enabled=1===this.status),this}getDeviceTopicsRequest(){return this.params=this.createQueryString(),this}postDeviceTopicsRequest(){return this.params=this.createQueryString(),this.body=this.createTopicsJson(),this}deleteDeviceTopicsRequest(){return this.params=this.createQueryString(),this.body=this.createTopicsJson(),this}createQueryString(){return this.device.deviceId?this.PARAM_DEVICE_ID+"="+this.device.deviceId:""}createDeviceJson(){let e={};try{e=this.device.toJSON()}catch(e){}return e}createPUTDeviceJson(e){let t={};try{f.setDeviceJson(e),t=e.toJSON()}catch(e){}return t}createTopicsJson(){const e={};return this.topics&&(e.topics=this.topics),e}getDeviceId(){return this.device.getDeviceId()}setTopics(e){this.topics=e}setExternalCode(e){this.device.setExternalCode(e)}},{EventType:E}=n(315).Core.Models,{Config:y}=n(315).Core,I=class{static async requestBackgroundSync(){const e=await navigator.serviceWorker.getRegistration(o.getWorkerPath());return null!=e?e:null}static findIndigitallSW(e){for(let t=0;t<e.length;t++)if(void 0!==e[t]&&e[t].active&&e[t].active.scriptURL&&e[t].active.scriptURL.includes("worker.min.js"))return e[t];return null}static async sendEventRequest(e,t){const n=new _;n.setAppKey(e.appKey),n.setDeviceId(e.deviceId),n.setPlatform(y.platform),n.setPushId(""+e.id),n.setJsonPush(e.jsonPush),n.setSendingId(""+e.sendingId),e.campaignId&&n.setCampaingId(""+e.campaignId),e.journeyStateId&&n.setJourneyStateId(e.journeyStateId),n.setEventType(E.EVENT_TYPE_CLICK),await n.setExternalCodeRequest(),"action-1"==t.action?n.setClickedButton(1):"action-2"==t.action?n.setClickedButton(2):n.setClickedButton(0),n.setServiceWorkerRequest(!0),await M.postEventPushClick(n)}static async topicsSubscribeFromServiceWorker(e,t){const n=new p;n.setTopics(t),n.setAppKey(e.appKey),n.setDeviceId(e.deviceId),await M.postTopicsSubscribeFromServiceWorker(n)}static prepareStatistics(e,t){const n=t,r=JSON.parse(e);return Object.keys(r).forEach(function(e){"appKey"!=e&&"pushId"!=e&&"action"!=e&&"buttons"!=e&&"id"!=e&&"title"!=e&&"body"!=e&&"icon"!=e&&"image"!=e&&"gif"!=e&&"layout"!=e&&"data"!=e&&"silent"!=e&&"securedData"!=e&&"securedKey"!=e&&"sendEventAck"!=e&&"applicationId"!=e&&"timezone"!=e&&"monochrome"!=e&&"requireInteraction"!=e&&"contentState"!=e&&"sendingId"!=e&&"campaignId"!=e&&"journeyStateId"!=e&&"interruptionLevel"!=e&&"fromExternalUrl"!=e&&("string"==typeof r[e]?n[e]=r[e]:"number"==typeof r[e]?n[e]=parseInt(r[e]):"boolean"==typeof r[e]?n[e]="true"===r[e]:null!==r[e]&&void 0!==r[e]&&(n[e]=r[e]))}),n}},{BaseEventRequest:g}=n(315).Core.Api,{EventType:m}=n(315).Core.Models,_=class extends g{constructor(){super()}setEventType(e){this.eventType=e}setPushId(e){this.pushId=e}setClickedButton(e){this.clickedButton=e}setSendingId(e){this.sendingId=e}setPermissionType(e){this.permissionType=e}setLocation(e,t){this.latitude=e,this.longitude=t}setDeviceId(e){this.deviceId=e}setPlatform(e){this.platform=e}setAppKey(e){this.appKey=e}setCustomData(e){this.customData=e}async setExternalCodeRequest(){this.externalCode=await o.getExternalIdRequest()}setExternalCode(e){this.externalCode=e}setCampaingId(e){this.campaignId=e}setJourneyStateId(e){this.journeyStateId=e}setJourneyExecution(e){this.journeyExecution=e}setCjCurrentStateId(e){this.cjCurrentStateId=e}setJsonPush(e){this.jsonPush=e}postEventPushRequest(){let e={};return e.deviceId=this.deviceId,e.platform=this.platform,this.eventType&&(e.eventType=this.eventType),this.pushId&&(e.pushId=this.pushId),e.clickedButton=this.clickedButton,null!=this.externalCode&&(e.externalCode=this.externalCode),this.sendingId&&"undefined"!=this.sendingId&&(e.sendingId=this.sendingId.toString()),this.journeyStateId&&(e.journeyStateId=this.journeyStateId),this.campaignId&&(e.campaignId=this.campaignId.toString()),null!=this.jsonPush&&(e=I.prepareStatistics(this.jsonPush,e)),this.body=e,this}postEventVisitRequest(){const e={};return e.deviceId=o.getDeviceId(),e.eventType=m.EVENT_TYPE_UPDATE,this.body=e,this}postEventPermissionRequest(){const e={};return e.deviceId=o.getDeviceId(),this.eventType&&(e.eventType=this.eventType),this.permissionType&&(e.permissionType=this.permissionType),this.body=e,this}postEventLocationRequest(){const e={};return e.deviceId=o.getDeviceId(),e.eventType=m.EVENT_TYPE_UPDATE,this.latitude&&(e.latitude=this.latitude),this.longitude&&(e.longitude=this.longitude),this.body=e,this}postEventCustomRequest(){const e={};return this.deviceId&&(e.deviceId=this.deviceId),this.eventType&&(e.eventType=this.eventType),this.customData&&(e.customData=this.customData),this.externalCode&&(e.externalCode=this.externalCode),this.body=e,this}postEventJourneyCustomRequest(){const e={};return this.deviceId&&(e.deviceId=this.deviceId),this.eventType&&(e.eventType=this.eventType),this.customData&&(e.customData=this.customData),this.externalCode&&(e.externalCode=this.externalCode),this.eventId&&(e.eventId=this.eventId),this.eventAt&&(e.eventAt=this.eventAt),this.body=e,this}},v=class{static urlBase64ToUint8Array(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}static callEventPermission(e,t){const n=new _;n.setAppKey(o.getAppKey()),n.setDeviceId(o.getDeviceId()),n.setPermissionType(e),n.setEventType(t),M.postEventPermission(n)}static async getPutRequestTimestamp(){return await o.getPutRequestTimestamp()?o.getPutRequestTimestamp():Date.now()+6048e5}},{Validations:S,Log:b}=n(315).Core.Utils,T=class extends S{static isAppKeyFormat(){const e=o.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFormatRequest(){const e=new b("[IND]PushValidations: "),t=o.getDeviceId();let n=!0;return this.isAppKeyFormat()||(n=!1,e.w("appKey is null or empty").writeLog()),o.isPushDisabled()||this.isValidFormat(t)||(n=!1,e.w("deviceId is null or empty").writeLog()),n}static async isPutRequestExceed(){return await v.getPutRequestTimestamp()<=Date.now()}static isSafariBrowserDevice(){const e=window.navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);return t&&n&&!e.match(/CriOS/i)&&!e.match(/OPiOS/i)}},{Config:O}=n(315).Core,{BaseClient:P}=n(315).Core.Api,{ErrorModel:A,Channel:R}=n(315).Core.Models,{TopicUtils:w,Log:N,CommonUtils:C,ErrorUtils:D}=n(315).Core.Utils,M=new class extends P{constructor(){super(),this.URL_BASE=O.client.URL_BASE,this.ENDPOINT_APPLICATION="/application",this.ENDPOINT_APPLICATION_ALL=this.ENDPOINT_APPLICATION+"/all",this.ENDPOINT_DEVICE="/device",this.ENDPOINT_DEVICE_TOPICS=this.ENDPOINT_DEVICE+"/topics",this.ENDPOINT_PUSH="/push",this.ENDPOINT_EVENT="/event",this.ENDPOINT_EVENT_PUSH=this.ENDPOINT_EVENT+"/push",this.ENDPOINT_EVENT_VISIT=this.ENDPOINT_EVENT+"/visit",this.ENDPOINT_EVENT_PERMISSION=this.ENDPOINT_EVENT+"/permission",this.ENDPOINT_EVENT_LOCATION=this.ENDPOINT_EVENT+"/location",this.ENDPOINT_EVENT_CUSTOM=this.ENDPOINT_EVENT+"/custom",this.ENDPOINT_EVENT_CUSTOM_BEACON=this.ENDPOINT_EVENT_CUSTOM+"/beacon",this.ENDPOINT_BROWSER="/browser",this.log=new N("[IND]Client: ")}async getURL(){return await o.getUrlDeviceApi()||this.URL_BASE}async getApplicationAll(e,t,n){if(T.isAppKeyFormat()){const r=await this.get(this.ENDPOINT_APPLICATION_ALL,e.getApplicationRequest());!r||r instanceof A?r?C.isFunction(n)&&n(r):C.isFunction(n)&&n():C.isFunction(t)&&t(r)}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.BAD_REQUEST_SERVER_ERROR));return!0}async postDevice(e,t,n){if(T.isAppKeyFormat()){const r=await this.post(this.ENDPOINT_DEVICE,e.postDeviceRequest(),"include");if(!r||r instanceof A)r?C.isFunction(n)&&n(r):C.isFunction(n)&&n();else{const e={enabled:r.data.enabled,deviceId:r.data.deviceId,registeredByCookie:r.data.registeredByCookie};await o.setDeviceId(e.deviceId),C.isFunction(t)&&t(new f(e,!0))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_APPKEY_BAD_REQUEST));return!0}async putDevice(e,t,n){const r=new f,i=await T.isPutRequestExceed();if(e.deviceUpdate||null==await o.getPutRequestTimestamp()||i)if(T.isValidFormatRequest()){o.setPutRequestTimestamp(await v.getPutRequestTimestamp());const i=await this.put(this.ENDPOINT_DEVICE,e.putDeviceRequest(r),"include");if(!i||i instanceof A)i?C.isFunction(n)&&n(i):C.isFunction(n)&&n();else{const e={enabled:i.data.enabled,deviceId:i.data.deviceId,registeredByCookie:i.data.registeredByCookie};C.isFunction(t)&&t(new f(e,!0))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else C.isFunction(t)&&t(r)}async getDevice(e,t,n){if(T.isValidFormatRequest()){const r=await this.get(this.ENDPOINT_DEVICE,e.getDeviceRequest());if(!r||r instanceof A)r?C.isFunction(n)&&n(r):C.isFunction(n)&&n();else{const e={enabled:r.data.enabled,deviceId:r.data.deviceId};C.isFunction(t)&&t(new f(e,!0))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async getDeviceTopics(e,t,n){if(T.isValidFormatRequest()){const r=await this.get(this.ENDPOINT_DEVICE_TOPICS,e.getDeviceTopicsRequest());!r||r instanceof A?r?C.isFunction(n)&&n(r):C.isFunction(n)&&n():C.isFunction(t)&&t(w.setTopicChannel(r.data.topics,R.PUSH))}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postDeviceTopics(e,t,n){return T.isValidFormatRequest()?await this.postDeviceTopicsRequest(e,t,n):C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST)),!0}async postDeviceTopicsRequest(e,t,n){const r=await this.post(this.ENDPOINT_DEVICE_TOPICS,e.postDeviceTopicsRequest());if(!r||r instanceof A)r?C.isFunction(n)&&n(r):C.isFunction(n)&&n();else{const e=r.data.topics;C.isFunction(t)&&t(e)}}async deleteDeviceTopics(e,t,n){return T.isValidFormatRequest()?this.deleteDeviceTopicsRequest(e,t,n):C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST)),!0}async deleteDeviceTopicsRequest(e,t,n){const r=await this.delete(this.ENDPOINT_DEVICE_TOPICS,e.deleteDeviceTopicsRequest());if(!r||r instanceof A)r?C.isFunction(n)&&n(r):C.isFunction(n)&&n();else{const e=r.data.topics;C.isFunction(t)&&t(e)}}async postEventPush(e){T.isValidFormatRequest()&&await this.post(this.ENDPOINT_EVENT_PUSH,e.postEventPushRequest())}postEventVisit(e){T.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_VISIT,e.postEventVisitRequest())}postEventPermission(e){T.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_PERMISSION,e.postEventPermissionRequest())}postEventLocation(e){T.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_LOCATION,e.postEventLocationRequest())}async getBrowser(e,t,n){if(T.isAppKeyFormat()){const r=await this.get(this.ENDPOINT_BROWSER,e);if(!r||r instanceof A)r?C.isFunction(n)&&n(r):C.isFunction(n)&&n();else{const e={browserName:r.data.browserName,browserVersion:r.data.browserVersion,deviceType:r.data.deviceType,osName:r.data.osName,osVersion:r.data.osVersion,supported:r.data.supported,platform:r.data.platform};await o.setBrowserName(e.browserName),o.setBrowserVersion(e.browserVersion),await o.setOsName(e.osName),o.setOsVersion(e.osVersion),o.setDeviceType(e.deviceType),o.setSupported(e.supported),await o.setPlatform("webpush"),C.isFunction(t)&&t(e)}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventCustom(e,t,n){if(T.isValidFormatRequest()){const r=await this.post(this.ENDPOINT_EVENT_CUSTOM,e.postEventCustomRequest());!r||r instanceof A?r?C.isFunction(n)&&n(r):C.isFunction(n)&&n():C.isFunction(t)&&t(r)}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventCustomSync(e,t,n){if(T.isValidFormatRequest()){e=e.postEventCustomRequest();try{if(navigator&&"sendBeacon"in navigator){const n=await this.getURL()+this.ENDPOINT_EVENT_CUSTOM_BEACON+e.getParams();navigator.sendBeacon(n,JSON.stringify(e.getBody())),C.isFunction(t)&&t()}else{const r=await this.getURL()+this.ENDPOINT_EVENT_CUSTOM+e.getParams(),i=new XMLHttpRequest;i.open("POST",r,!1),i.setRequestHeader("Content-Type","application/json"),i.onreadystatechange=()=>{i.readyState===XMLHttpRequest.DONE&&(i.status>=200||i.status<300)?C.isFunction(t)&&t():C.isFunction(n)&&n()},i.send(JSON.stringify(e.getBody()))}}catch(e){C.isFunction(n)&&n(D.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventJourney(e,t,n){if(T.isValidFormatRequest()){const r=await this.post(this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM,e.postEventJourneyCustomRequest());!r||r instanceof A?r?C.isFunction(n)&&n(r):C.isFunction(n)&&n():C.isFunction(t)&&t(r)}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventJourneySync(e,t,n){if(T.isValidFormatRequest()){e=e.postEventJourneyCustomRequest();try{let r=await this.getURL();if(r=r.replace("v1","v2"),navigator&&"sendBeacon"in navigator){const n=r+this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM_BEACON+e.getParams();navigator.sendBeacon(n,JSON.stringify(e.getBody())),C.isFunction(t)&&t()}else{const r=await this.getURL().replace("v1","v2")+this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM+e.getParams(),i=new XMLHttpRequest;i.open("POST",r,!1),i.setRequestHeader("Content-Type","application/json"),i.onreadystatechange=()=>{i.readyState===XMLHttpRequest.DONE&&(i.status>=200||i.status<300)?C.isFunction(t)&&t():C.isFunction(n)&&n()},i.send(JSON.stringify(e.getBody()))}}catch(e){C.isFunction(n)&&n(D.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventPushClick(e){let t="/event/push";e.journeyStateId&&(e.setJourneyRequest(!0),t="/push/event/click"),e.setServiceWorkerRequest(!0),await this.post(t,e.postEventPushRequest())}async postTopicsSubscribeFromServiceWorker(e){e.setServiceWorkerRequest(!0),await this.post("/device/topics",e.postDeviceTopicsRequest())}},{Config:L}=n(315).Core,{BaseRequest:U}=n(315).Core.Api,B=class extends U{getApplicationRequest(){return this.params=this.PARAM_PLATFORM+"="+L.platform,this}},k=Object.freeze({PERMISSION_TYPE_PUSH:"push",PERMISSION_TYPE_LOCATION:"location"}),{CorePermissions:V}=n(315).Core.Utils,j=class{static async getPermissionState(e){const t=await V.getPermission(e);return t?t.state:"push"===e?window.Notification&&window.Notification.permission?window.Notification.permission:void 0:"geolocation"===e?navigator.geolocation?"granted":"denied":void 0}static async getPermissions(){const[e,t]=await Promise.all([this.getPermissionState("push"),this.getPermissionState("geolocation")]),n={};return void 0!==e&&(n.push=e),void 0!==t&&(n.location=t),n}static async getPushPermission(){const e=await this.getPermissionState("push");return void 0!==e?{push:e}:{}}static async getLocationPermission(){const e=await this.getPermissionState("geolocation");return void 0!==e?{location:e}:{}}static async setPermissionsCallback(){V.setPermissionsCallback(),await V.setCallback("push",navigator.indigitallRequestPushPermission)}},{Log:x,CommonUtils:Y,ErrorUtils:F}=n(315).Core.Utils,{EventType:G}=n(315).Core.Models,W="[IND]IndigitallSafari: ",K=class{static isSafariPushNotificationSupported(){return!!T.isSafariBrowserDevice()||!!window?.safari?.pushNotification}static async launchNotificationPermissionForSafari(){const e=new x(W);if(o.getSafariGestureRequestPermission()===G.EVENT_TYPE_ASK)if(o.getSafariWebsitePushId()&&o.getDeviceId())if(T.isSafariBrowserDevice()&&o.getWorkerPath()){const e=await navigator.serviceWorker.register(o.getWorkerPath());"granted"===await window.Notification.requestPermission()&&(o.setPermissionPush(G.EVENT_TYPE_ACCEPT),Ie.subscribeForPushNotification(e))}else{const e=window.safari.pushNotification.permission(o.getSafariWebsitePushId());this.checkRemotePermission(e)}else o.getSafariWebsitePushId()?e.w("error Device Id is not found").writeLog():e.w("error Safari Website Push Id is not found").writeLog();else e.w("there was not user gesture to request safari permissions").writeLog()}static async checkRemotePermission(e){const t=new x(W);try{if("default"===e.permission){const e={deviceCode:o.getDeviceId()};t.d("permission default: ",e).writeLog(),o.getPermissionPush()||v.callEventPermission(k.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_ASK),window.safari.pushNotification.requestPermission(await M.getURL()+"/safari",o.getSafariWebsitePushId(),e,window.indigitall.Push.checkRemotePermission)}else"denied"===e.permission?(t.w("permission denied: ",e).writeLog(),o.getPermissionPush()&&o.getPermissionPush()!=G.EVENT_TYPE_REJECT&&(v.callEventPermission(k.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_REJECT),o.setPermissionPush(G.EVENT_TYPE_REJECT))):"granted"===e.permission&&(t.d("permission granted: ",e).writeLog(),o.getPermissionPush()&&o.getPermissionPush()!=G.EVENT_TYPE_ACCEPT&&(v.callEventPermission(k.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_ACCEPT),o.setPermissionPush(G.EVENT_TYPE_ACCEPT)),e.deviceToken&&e.deviceToken!==o.getPushToken()&&(o.setPushToken(e.deviceToken),M.putDevice(new p,e=>{if(Y.isFunction(navigator.indigitallOnInitialized)){const e={};e.push=o.getPermissionPush(),e.location=o.getPermissionLocation(),navigator.indigitallOnInitialized(e,new f)}Y.isFunction(navigator.indigitallOnNewUserRegistered)&&!o.getNewUserTimestamp()&&(o.setNewUserTimestamp(Date.now()),navigator.indigitallOnNewUserRegistered(e)),Ie.registerLocation()},navigator.indigitallOnError),o.setServiceTimestamp(Date.now())))}catch(e){Y.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(F.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}}},H=new class{constructor(){this.TOPIC_SYNC_TIMESTAMP=3e4,this.TOPIC_SYNC_TAG="syncTopics",this.TOPIC_SYNC_SUBSCRIBE_CALLBACK="indigitallSyncTopicSubscribeOnSuccess",this.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK="indigitallSyncTopicSubscribeOnError",this.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK="indigitallSyncTopicUnsubscribeOnSuccess",this.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK="indigitallSyncTopicUnsubscribeOnError"}},q=Object.freeze({GREEN:"green",RED:"red"}),{CommonUtils:$}=n(315).Core.Utils,X=class{static async setTopicRequest(e){const t=new p;return t.setAppKey(await o.getAppKeySync()),t.setDeviceId(await o.getDeviceIdSync()),t.setServiceWorkerRequest(!0),t.setTopics(e),t}static async getTopicsList(e,t){try{const n=await o.getTopicList();n&&n.length>0?await se.isTopicTimestampExceed()?this.getDeviceTopicClient(e,t):(await o.setTopicSemaphore(q.GREEN),$.isFunction(e)&&e(n)):this.getDeviceTopicClient(e,t)}catch(e){await o.setTopicSemaphore(q.GREEN)}}static async getDeviceTopicClient(e,t){try{M.getDeviceTopics(new p,async t=>{await se.setTopicTimestamp(),await o.setTopicList(t),await o.setTopicSemaphore(q.GREEN),$.isFunction(e)&&e(t)},async e=>{await se.setTopicTimestamp(),await o.setTopicSemaphore(q.GREEN),$.isFunction(t)&&t(e)})}catch(e){await o.setTopicSemaphore(q.GREEN),$.isFunction(t)&&t(e)}}},Q=class{constructor(e,t){this.code=e,this.type=t}static getAllCodes(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].code);return t}toJSON(){const e={};return this.code&&(e.code=this.code),this.type&&(e.type=this.type),e}},{Channel:J,TopicSubscribeType:z}=n(315).Core.Models,{ErrorUtils:Z,Log:ee}=n(315).Core.Utils;class te{static async syncTopics(){if(!await o.getTopicSyncIsProcessing()){await o.setTopicSyncIsProcessing(!0);const e=setTimeout(async function(){try{await te.sendTopicSync()}catch(e){}await o.setTopicSyncIsProcessing(!1),clearTimeout(e)},H.TOPIC_SYNC_TIMESTAMP)}}static async sendTopicSync(){const e=await se.filterTopicExistingOnIDB(),t=se.topicFilter(e,z.SUBSCRIBE),n=se.topicFilter(e,z.UNSUBSCRIBE);if(t&&t.length>0)M.postDeviceTopicsRequest(await X.setTopicRequest(t),async e=>{await se.setTopicTimestamp(),e.channel=J.PUSH,await o.setTopicList(e),se.indigitallSyncTopicEvent(H.TOPIC_SYNC_SUBSCRIBE_CALLBACK,e)},async e=>{se.indigitallSyncTopicEvent(H.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK,e)});else if(n&&n.length>0)M.deleteDeviceTopicsRequest(await X.setTopicRequest(n),async e=>{await se.setTopicTimestamp(),await o.setTopicList(e),se.indigitallSyncTopicEvent(H.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK,e)},async e=>{se.indigitallSyncTopicEvent(H.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK,e)});else{const e=Z.showError(c,c.ErrorCode.PUSH_TOPICS_ERROR,"there is no topic with one of the codes in the push topic list");se.indigitallSyncTopicEvent(H.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK,e),se.indigitallSyncTopicEvent(H.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK,e)}await o.setUpdateTopicSubscribe([])}static async updateTopicAction(e,t){const n=await o.getUpdateTopicSubscribe();if(n&&n.length>0){const r=new ee("[IND]TopicSyncUtils: ");try{const r=[],i=n.filter(t=>e.includes(t.code)),s=e.filter(e=>!Q.getAllCodes(n).includes(e));if(s&&s.length>0)for(let e=0;e<s.length;e++)null!==s[e]&&r.push(new Q(s[e],t).toJSON());if(i&&i.length>0)for(let e=0;e<i.length;e++){const r=n.findIndex(t=>t.code===i[e].code),o=new Q(i[e].code,t);n[r]=o.toJSON()}r.length>0&&await o.setUpdateTopicSubscribe(r.concat(n))}catch(e){r.e("updateTopicAction: "+e).writeLog()}}else{const n=[];for(let r=0;r<e.length;r++){const i=e[r];n.push({code:i,type:t})}await o.setUpdateTopicSubscribe(n)}}}const ne=te,{TopicSubscribeType:re}=n(315).Core.Models,{CommonUtils:ie}=n(315).Core.Utils;class oe{static async updateTopic(e,t,n,r){oe.checkTopicSemaphore().then(async()=>{await o.setTopicSemaphore(q.RED),await X.getTopicsList(async i=>{await this.setTopicCallbacks(e,n,r),await this.requestTopicBackground(H.TOPIC_SYNC_TAG),await ne.updateTopicAction(t,e)},r)})}static async checkTopicSemaphore(){if(await o.getTopicSemaphore()!=q.RED)return!0;this.topicSemaphoreWaitTime(()=>!0)}static async topicSemaphoreWaitTime(e){const t=setInterval(async function(){await o.getTopicSemaphore()==q.GREEN&&(clearInterval(t),e())},1e3)}static async setTopicCallbacks(e,t,n){let r=H.TOPIC_SYNC_SUBSCRIBE_CALLBACK,i=H.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK;e===re.UNSUBSCRIBE&&(r=H.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK,i=H.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK);const o=new BroadcastChannel(r);o.onmessage=e=>{ie.isFunction(t)&&t(e.data),o.close()};const s=new BroadcastChannel(i);s.onmessage=e=>{ie.isFunction(n)&&n(e.data),s.close()}}static async requestTopicBackground(e){const t=await I.requestBackgroundSync();null!=t&&await t.sync.register(e)}static async isTopicTimestampExceed(){const e=await o.getTopicSyncTimestamp();return!(e&&e>Date.now())&&void 0!==e}static async setTopicTimestamp(){const e=Date.now()+H.TOPIC_SYNC_TIMESTAMP;await o.setTopicSyncTimestamp(e)}static indigitallSyncTopicEvent(e,t){new BroadcastChannel(e).postMessage(t)}static topicFilter(e,t){const n=[];if(e)for(let r=0;r<e.length;r++)e[r].type===t&&n.push(e[r].code);return n}static async filterTopicExistingOnIDB(){const e=await o.getUpdateTopicSubscribe(),t=await o.getTopicList(),n=[];for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)e[r]&&t[i]&&e[r].code==t[i].code&&(!0===t[i].subscribed&&e[r].type==re.UNSUBSCRIBE||!1===t[i].subscribed&&e[r].type==re.SUBSCRIBE)&&n.push(e[r]);return n}}const se=oe,{EventType:ae,DeviceStatus:ue}=n(315).Core.Models,{LogLevel:ce,Log:le,CommonUtils:fe,ErrorUtils:de,CryptoUtils:he}=n(315).Core.Utils,{Repository:pe}=n(315).Core,Ee="[IND]IndigitallPush: ";class ye{constructor(){this.config=null,this.interval=null}static async init(e){try{let n=new le(Ee);if(!e)return void n.w("config is not defined").writeLog();e.onPushPermissionChanged&&(e.requestPushPermission=e.onPushPermissionChanged),e.onLocationPermissionChanged&&(e.requestLocationPermission=e.onLocationPermissionChanged),this.config=e,this.config.logLevel?(o.setLogLevel(this.config.logLevel),n=new le(Ee)):this.config.setDebugLog&&(o.setLogLevel(ce.WARNING),n=new le(Ee));let r="https://device-api.indigitall.com/v1",i="https://inbox-api.indigitall.com/v1",s="https://device-api.indigitall.com/v2";if(this.config.urlDeviceApi&&(r=this.config.urlDeviceApi),this.config.urlInAppApi&&(s=this.config.urlInAppApi),this.config.urlInboxApi&&(i=this.config.urlInboxApi),o.setAvoidCypher(!!this.config.avoidCypher&&this.config.avoidCypher),await o.setUrlDeviceApi(r),t()&&t().setUrlInboxApi(i),fe.isFunction(this.config.requestPushPermission)&&(navigator.indigitallRequestPushPermission=this.config.requestPushPermission),fe.isFunction(this.config.requestLocationPermission)&&(navigator.indigitallRequestLocationPermission=this.config.requestLocationPermission),fe.isFunction(this.config.onNewUserRegistered)&&(navigator.indigitallOnNewUserRegistered=this.config.onNewUserRegistered),fe.isFunction(this.config.onInitialized)&&(navigator.indigitallOnInitialized=this.config.onInitialized),fe.isFunction(this.config.onError)&&(navigator.indigitallOnError=this.config.onError),fe.isFunction(this.config.onLocationUpdated)&&(navigator.indigitallOnLocationUpdated=this.config.onLocationUpdated),this.config.disabledPushService)return this.config.appKey&&await o.setAppKey(this.config.appKey),o.setPushDisabled(!0),n.i("Push Service disabled").writeLog(),fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError("Push Service disabled"),!1;o.setTimeoutRequestsInMilliseconds(0),this.config.timeoutRequestsInMilliseconds&&o.setTimeoutRequestsInMilliseconds(this.config.timeoutRequestsInMilliseconds);const a=await j.getPushPermission();if(j.setPermissionsCallback(),a&&"denied"===a.push)return n.i("Push permission denied").writeLog(),fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError("Push permission denied"),!1;if(!fe.isServiceTimestampExceed())return this.device=new f,j.getPermissions().then(e=>{fe.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(e,new f)}),n.d("Device enabled").writeLog(),!0;{let e="",r=null;if(!this.config||!this.config.appKey)return n.w("config.appKey is not defined").writeLog(),!1;if(e=this.config.appKey,this.config.requestLocation&&await o.setRequestLocation(this.config.requestLocation),this.config.workerPath&&(r=this.config.workerPath,o.setWorkerPath(r)),e){if(await o.setAppKey(e),ye.isServiceWorkerSupported()){const e=new B;return M.getBrowser(e,e=>{if(e.supported||this.isSafariBrowserDevice()){n.d("browser supported for webpush").writeLog();const i=new B;M.getApplicationAll(i,async i=>{if(n.d("application ",i).writeLog(),i&&i.data&&i.data.configuration){const e=i.data.configuration;n.d("configuration ",e).writeLog(),e.vapidPublic&&o.setVAPID(e.vapidPublic),e.safariWebsitePushId&&o.setSafariWebsitePushId(e.safariWebsitePushId),e.enabled&&o.setEnabled(e.enabled),e.serviceSyncTime&&o.setServiceSyncTime(e.serviceSyncTime),e.locationEnabled&&o.setLocationEnabled(e.locationEnabled),e.locationUpdateMinutes&&o.setLocationUpdateMinutes(e.locationUpdateMinutes),e.inboxAuthMode&&t()&&t().setInboxAuthMode(e.inboxAuthMode),e.inAppEnabled&&(o.setInAppEnabled(e.inAppEnabled),await o.setUrlInappApi(s)),e.encryptionType&&o.setEncryptionType(e.encryptionType)}const a=new p;o.getDeviceId()&&o.getPushToken()?M.putDevice(a,t=>{try{if(fe.isServiceTimestampExceed()){const e=new _;e.setAppKey(o.getAppKey()),e.setDeviceId(o.getDeviceId()),M.postEventVisit(e)}t.registeredByCookie?(o.setServiceTimestamp(Date.now()),j.getPushPermission().then(e=>{const t=new f;t.deviceId&&n.i("deviceId:",t.deviceId).writeLog(),t.pushToken&&n.i("pushToken:",t.pushToken).writeLog(),this.config&&fe.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(e,t)})):"Safari"!==e.browserName&&ye.registerForPush(r)}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}},navigator.indigitallOnError):M.postDevice(a,t=>{try{const n=new _;n.setAppKey(o.getAppKey()),n.setDeviceId(o.getDeviceId()),M.postEventVisit(n),t.registeredByCookie?o.setServiceTimestamp(Date.now()):"Safari"!==e.browserName&&ye.registerForPush(r)}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}},e=>{404===e.errorCode&&o.clearStorage(),fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(e)})},navigator.indigitallOnError)}else n.w("Browser not Supported").writeLog()},navigator.indigitallOnError),!0}n.w("ServiceWorker and SafariPushNotification not supported").writeLog()}else n.w("appKey is not found").writeLog()}}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}return!1}static deviceGet(e,t){return M.getDevice(new p,e,t),!0}static deviceEnable(e,t){const n=new p(ue.ENABLE);return n.isDeviceUpdated(!0),M.putDevice(n,e,t),!0}static deviceDisable(e,t){const n=new p(ue.DISABLE);return n.isDeviceUpdated(!0),M.putDevice(n,e,t),!0}static topicsList(e,t){return M.getDeviceTopics(new p,async t=>{fe.isFunction(e)&&e(t)},e=>{fe.isFunction(t)&&t(e)}),!0}static topicsSubscribe(e,t,n){const r=new p;return r.setTopics(e),M.postDeviceTopics(r,e=>{fe.isFunction(t)&&t(e)},e=>{fe.isFunction(n)&&n(e)}),!0}static topicsUnsubscribe(e,t,n){const r=new p;return r.setTopics(e),M.deleteDeviceTopics(r,e=>{fe.isFunction(t)&&t(e)},e=>{fe.isFunction(n)&&n(e)}),!0}static async topicsSubscribeUpdate(e,t,n,r){se.updateTopic(e,t,n,r)}static registerForPush(e){o.setWorkerPath(e),ye.isServiceWorkerSupported()&&ye.launchNotificationPermission(e)}static isSafariPushNotificationSupported(){return K.isSafariPushNotificationSupported()}static isServiceWorkerSupported(){return"serviceWorker"in navigator}static registerServiceWorker(e){const t=new le(Ee);let n="/service-worker.js";return e&&(n=e),navigator.serviceWorker.register(n).then(e=>(t.d("ServiceWorker registration successful with scope: "+e.scope).writeLog(),e)).catch(e=>(t.e("ServiceWorker registration failed: ",e).writeLog(),e))}static launchNotificationPermissionForSafari(){this.registerForPush(o.getWorkerPath())}static isSafariBrowserDevice(){return T.isSafariBrowserDevice()}static launchNotificationPermission(e){const t=new le(Ee);this.registerServiceWorker(e).then(e=>{try{let n;e.installing?n=e.installing:e.waiting?n=e.waiting:e.active&&(n=e.active),n&&(t.d("sw current state "+n.state).writeLog(),"activated"==n.state?ye.subscribeForPushNotification(e):("installed"==n.state&&o.getPushToken()&&e.update(),n.addEventListener("statechange",function(n){t.d("sw statechange : "+n.target.state).writeLog(),"activated"==n.target.state&&ye.subscribeForPushNotification(e)})))}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}})}static async subscribeForPushNotification(e){const t=new le(Ee);try{const n={userVisibleOnly:!0,applicationServerKey:v.urlBase64ToUint8Array(o.getVAPID())};t.d("Registration: ",e).writeLog(),o.getPermissionPush()||v.callEventPermission(k.PERMISSION_TYPE_PUSH,ae.EVENT_TYPE_ASK);const r=await e.pushManager.subscribe(n);t.d("Received PushSubscription: "+r).writeLog(),o.getPermissionPush()&&o.getPermissionPush()===ae.EVENT_TYPE_ACCEPT||(v.callEventPermission(k.PERMISSION_TYPE_PUSH,ae.EVENT_TYPE_ACCEPT),o.setPermissionPush(ae.EVENT_TYPE_ACCEPT));const i=r.toJSON();o.setBrowserPublicKey(i.keys.p256dh),o.setBrowserPrivateKey(i.keys.auth),o.setPushToken(i.endpoint),M.putDevice(new p,e=>{j.getPermissions().then(e=>{fe.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(e,new f)}),fe.isFunction(navigator.indigitallOnNewUserRegistered)&&!o.getNewUserTimestamp()&&(o.setNewUserTimestamp(Date.now()),navigator.indigitallOnNewUserRegistered(e)),ye.registerLocation()},navigator.indigitallOnError),o.setServiceTimestamp(Date.now())}catch(e){t.e("No Registration: "+e).writeLog(),o.getPermissionPush()&&o.getPermissionPush()===ae.EVENT_TYPE_REJECT||(v.callEventPermission(k.PERMISSION_TYPE_PUSH,ae.EVENT_TYPE_REJECT),o.setPermissionPush(ae.EVENT_TYPE_REJECT)),fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(e)}}static registerLocation(){const e=new le(Ee);try{navigator.geolocation&&o.getRequestLocation()&&o.getLocationEnabled()&&(!o.getLocationTimestamp()||o.getLocationUpdateMinutes()<=(Date.now()-o.getLocationTimestamp())/6e4)&&(o.getPermissionLocation()||v.callEventPermission(k.PERMISSION_TYPE_LOCATION,ae.EVENT_TYPE_ASK),navigator.geolocation.getCurrentPosition(e=>{o.getPermissionLocation()||o.getPermissionLocation()==ae.EVENT_TYPE_ACCEPT||(v.callEventPermission(k.PERMISSION_TYPE_LOCATION,ae.EVENT_TYPE_ACCEPT),o.setPermissionLocation(ae.EVENT_TYPE_ACCEPT));const t=new _;t.setLocation(e.coords.latitude,e.coords.longitude),M.postEventLocation(t),fe.isFunction(navigator.indigitallOnLocationUpdated)&&navigator.indigitallOnLocationUpdated(e),o.setLocationTimestamp(Date.now())},t=>{e.e("error "+t).writeLog(),o.getPermissionLocation()||o.getPermissionLocation()==ae.EVENT_TYPE_REJECT||(v.callEventPermission(k.PERMISSION_TYPE_LOCATION,ae.EVENT_TYPE_REJECT),o.setPermissionLocation(ae.EVENT_TYPE_REJECT))}))}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}static requestPushPermission(e){j.getPushPermission().then(t=>{fe.isFunction(e)&&e(t)})}static onPermissionChange(){j.setPermissionsCallback()}static requestLocationPermission(e){j.getLocationPermission().then(t=>{fe.isFunction(e)&&e(t)})}static logIn(e,t,n){ye.setExternalId(e,t,n)}static logout(e,t){ye.setExternalId(null,e,t)}static setExternalCode(e,t,n){ye.setExternalId(e,t,n)}static async setExternalId(e,t,n){try{const r=o.getAppKey();if(!r)return void(fe.isFunction(n)&&n(de.showError(c,c.ErrorCode.API_APPKEY_NOT_VALID)));if(null!=e){const i=await he.createHmac(r,e);i&&this.setExternalIdRequest(i,t,n)}else this.setExternalIdRequest(null,t,n)}catch(e){fe.isFunction(n)&&n(de.showError(c,c.ErrorCode.PUSH_DEVICE_ERROR,e))}}static async setExternalIdRequest(e,t,n){o.setExternalId(e);const r=(await j.getPushPermission()).push,i=await o.getRegisteredByCookie();if("granted"!==r&&!i)return void(fe.isFunction(n)&&n(de.showError(c,c.ErrorCode.PUSH_PERMISSION_NOT_ACCEPTED)));if(o.isPushDisabled())return void(fe.isFunction(n)&&n(de.showError(c,c.ErrorCode.DISABLED_CHANNEL)));const s=new p;await o.setExternalIdRequest(e),s.setExternalCode(e),s.isDeviceUpdated(!0),M.putDevice(s,e=>{fe.isFunction(t)&&t(new f(e))},n)}static sendCustomEvent(e,t=null,n=null,r,i){try{let s="",a={},u=!0;"string"==typeof e?s=e:"object"==typeof e&&(s=e.eventType,e.customData&&(a=e.customData),!1===e.async&&(u=e.async));const c=new _;c.setDeviceId(o.getDeviceId()),c.setEventType(s),c.setCustomData(a),null!=o.getExternalId()&&"null"!=o.getExternalId()?(c.setExternalCode(o.getExternalId()),c.setJourneyRequest(!0),c.setEventId(t),c.setEventAt(n),!1===u?M.postEventJourneySync(c,r,i):M.postEventJourney(c,r,i)):!1===u?M.postEventCustomSync(c,r,i):M.postEventCustom(c,r,i)}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}static sendJourneyEvent(e,t=null,n=null,r,i){try{let s="",a={},u=!0;"string"==typeof e?s=e:"object"==typeof e&&(s=e.eventType,e.customData&&(a=e.customData),!1===e.async&&(u=e.async));const c=new _;c.setDeviceId(o.getDeviceId()),c.setExternalCodeRequest(),c.setEventType(s),c.setCustomData(a),c.setJourneyRequest(!0),c.setEventId(t),c.setEventAt(n),!1===u?M.postEventJourneySync(c,r,i):M.postEventJourney(c,r,i)}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}}const Ie=ye;window.indigitall||(window.indigitall={}),window.indigitall.Push=ye,window.indigitall.Push.PermissionUtils=j,window.indigitall.LogLevel=ce,window.indigitall.version=o.getVersion()})(),r})(),e.exports=t()},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.16.5","_id":"indigitall-web-core@4.16.5","_inBundle":false,"_integrity":"sha512-1rudsnXyzNLi8Syln24ZpaMlGsZsLgTWsohGi/fDboS53w4GW4+ln4E96HmoO2vom7CTNBV+gbcscpfgfMNcSw==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.16.5","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.16.5","saveSpec":null,"fetchSpec":"4.16.5"},"_requiredBy":["#USER","/","/indigitall-web-notification"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.16.5.tgz","_shasum":"7011471d0100272867681db5a6e55f5559544aa8","_spec":"indigitall-web-core@4.16.5","_where":"/home/circleci/webpush/sdk","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.16.5"}')},330(e){"use strict";e.exports=JSON.parse('{"name":"indigitall-web-sdk","description":"indigitall webpush SDK","version":"4.16.5","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","dependencies":{"indigitall-web-core":"^4.16.5","indigitall-web-customer":"^4.16.5","indigitall-web-inapp":"^4.16.5","indigitall-web-inbox":"^4.16.5","indigitall-web-notification":"^4.16.5"},"devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","build-sdk":"npm run build-install-core && npm run build-install-inapp && npm run build","build-install-core":"npm uninstall indigitall-web-core && npm install ../core","build-install-inapp":"npm uninstall indigitall-web-inapp && npm install ../inapp","build-install-customer":"npm uninstall indigitall-web-customer && npm install ../customer","build-install-inbox":"npm uninstall indigitall-web-inbox && npm install ../inbox","build-install-push":"npm uninstall indigitall-web-notification && npm install ../push","install-sdk":"npm install && npm run build","release-install-core":"npm uninstall indigitall-web-core && npm install indigitall-web-core@$npm_package_version","release-install-inapp":"npm uninstall indigitall-web-inapp && npm install indigitall-web-inapp@$npm_package_version ","release-install-customer":"npm uninstall indigitall-web-customer && npm install indigitall-web-customer@$npm_package_version ","release-install-inbox":"npm uninstall indigitall-web-inbox && npm install indigitall-web-inbox@$npm_package_version ","release-install-push":"npm uninstall indigitall-web-notification && npm install indigitall-web-notification@$npm_package_version && npm run release-install-core && npm run release-install-inapp && npm run release-install-inbox && npm run release-install-customer && npm run install-sdk && npm run delete-node-modules","simulate-release-install-sdk":"npm run install-sdk && npm run delete-node-modules","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r);var e=n(326),t=n.n(e),i=n(824),o=n.n(i),s=n(960),a=n.n(s),u=n(603),c=n.n(u);const{Log:l,LogLevel:f,CommonUtils:d,ErrorUtils:h}=n(315).Core.Utils,{Repository:p}=n(315).Core,E=n(330),{Channel:y}=n(315).Core.Models,I="[IND]Indigitall: ";class g{constructor(){this.config=null}static async init(e){return c().init(e)}static deviceGet(e,t){return c().deviceGet(e,t)}static deviceEnable(e,t){return c().deviceEnable(e,t)}static deviceDisable(e,t){return c().deviceDisable(e,t)}static topicsList(e,t){return c().topicsList(t=>{this.inAppTopicList(t,e,n=>{new l(I).w(n.message).writeLog(),d.isFunction(e)&&e(t)})},n=>{new l(I).w(n).writeLog(),this.inAppTopicList(null,e,t),d.isFunction(t)&&t(n)})}static async inAppTopicList(e,n,r){"true"===(new p).isInAppEnabled()?t().topicsList(async t=>{null!=e?(await(new p).setTopicList(e),await(new p).setInAppTopicList(t),d.isFunction(n)&&n(t.concat(e))):(await(new p).setInAppTopicList(t),d.isFunction(n)&&n(t))},async t=>{null!=e?(await(new p).setTopicList(e),d.isFunction(n)&&n(e)):d.isFunction(r)&&r(t)}):null!=e?(await(new p).setTopicList(e),d.isFunction(n)&&n(e)):d.isFunction(r)&&r(h.showError(null,null,"Internal error bad topic list"))}static inAppTopicsListFromConsole(e,n,r){t().topicsListFromConsole(e,n,r)}static topicsSubscribe(e,n,r){"true"===(new p).isInAppEnabled()?t().topicsSubscribe(e,t=>{this.pushTopicsSubscribe(e,t,n,r)},async t=>{new l(I).w(t).writeLog(),this.pushTopicsSubscribe(e,null,n,r)}):this.pushTopicsSubscribe(e,null,n,r)}static pushTopicsSubscribe(e,t,n,r){c().topicsSubscribe(e,async e=>{this.topicActionOnSuccess(t,e,n)},async e=>{this.topicActionOnError(t,e,n,r)})}static async topicsUnsubscribe(e,n,r){"true"===(new p).isInAppEnabled()?t().topicsUnsubscribe(e,t=>{this.pushTopicsUnsubscribe(e,t,n,r)},async t=>{new l(I).w(t).writeLog(),this.pushTopicsUnsubscribe(e,null,n,r)}):this.pushTopicsUnsubscribe(e,null,n,r)}static pushTopicsUnsubscribe(e,t,n,r){c().topicsUnsubscribe(e,async e=>{this.topicActionOnSuccess(t,e,n)},async e=>{this.topicActionOnError(t,e,n,r)})}static async topicActionOnSuccess(e,t,n){let r=[];null!=e&&(r=e,await(new p).setInAppTopicList(e)),null!=t&&await(new p).setTopicList(t),d.isFunction(n)&&n(r.concat(t))}static async topicActionOnError(e,t,n,r){new l(I).w(`${t.errorCode}: ${t.exceptionMessage}`).writeLog(),null!=e?(await(new p).setInAppTopicList(e),d.isFunction(n)&&n(e)):d.isFunction(r)&&r(t)}static async setExternalId(e,t,n){c().setExternalId(e,t,n)}static logIn(e,t,n){g.setExternalId(e,t,n)}static logout(e,t){g.setExternalId(null,e,t)}static sendCustomEvent(e,t=null,n=null,r,i){c().sendCustomEvent(e,t,n,r,i)}static sendJourneyEvent(e,t=null,n=null,r,i){c().sendJourneyEvent(e,t,n,r,i)}static isServiceWorkerSupported(){return c().isServiceWorkerSupported()}static isSafariPushNotificationSupported(){return c().isSafariPushNotificationSupported()}static isSafariPermissionAsked(){return c().isSafariPermissionAsked()}static isSafariBrowserDevice(){return c().isSafariBrowserDevice()}static launchNotificationPermissionForSafari(){c().launchNotificationPermissionForSafari()}static getPermissionsStatus(){return c().PermissionUtils.getPermissions()}static async showInApp(e,n,r,i){t().showInApp(e,n,r,i)}static async showInAppWithCallback(e,n={}){t().showInAppWithCallback(e,n)}static async showInAppWithConfig(e,n,r,i,o,s,a,u,c,l,f){t().showInAppWithConfig(e,n,null,i,o,s,a,u,c,l,f)}static showMultipleInApp(e,n,r,i){t().showMultipleInApp(e,n,r,i)}static async showMultipleInAppWithCallback(e,n={}){t().showMultipleInAppWithCallback(e,n)}static async showMultipleInAppWithConfig(e,n,r,i,o,s,a,u,c,l,f){t().showMultipleInAppWithConfig(e,n,null,i,o,s,a,u,c,l,f)}static getInboxMessagesCount(e,t,n){o().getMessagesCountWithAuth(e,t,n)}static getInbox(e,t,n){o().getInboxWithAuth(e,t,n)}static getInboxWithPage(e,t,n,r,i,s,a,u){o().getInboxWithPage(e,t,n,r,i,s,a,u)}static getCustomer(e,t){a().getCustomer(e,t)}static getCustomerInformation(e,t){this.getCustomerInformationWithFields(null,e,t)}static getCustomerInformationWithFields(e,t,n){a().getCustomerInformation(e,t,n)}static assignOrUpdateValueToCustomerFields(e,t,n){a().assignOrUpdateValueToCustomerFields(e,t,n)}static deleteValuesFromCustomerFields(e,t,n){a().deleteValuesFromCustomerFields(e,t,n)}static link(e,t,n,r){g.logIn(e,e=>{a().link(t,n,r)},e=>{d.isFunction(r)&&r(e)})}static unlink(e,t,n){g.logout(r=>{a().unlink(e,t,n)},e=>{d.isFunction(n)&&n(e)})}static sendCustomerCustomEvent(e,t,n=null,r=null,i,o){a().sendCustomerCustomEvent(e,t,n,r,i,o)}}window.indigitall=g,window.indigitall.InApp=t(),window.indigitall.Inbox=o(),window.indigitall.Customer=a(),window.indigitall.Push=c(),window.indigitall.InApp.Utils=t().Utils,window.indigitall.Push.PermissionUtils=c().PermissionUtils,window.indigitall.Channel=y,window.indigitall.LogLevel=f,window.indigitall.version=E.version})(),r})());
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(this,()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.17.0","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{default:()=>K});var r={};n.r(r),n.d(r,{BaseApplicationRequest:()=>P,BaseClient:()=>b,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>L,TopicSubscribeType:()=>M});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>Y,DateUtils:()=>R,ErrorUtils:()=>T,JsonUtils:()=>x,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>W,Validations:()=>G});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.removeItem(e),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const i=n.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){const t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,i)=>{e||i(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),i(!1)}})}async put(e,t,n){return new Promise((i,r)=>{e||r(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),i(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){console.log("getExternalIdRequest Repository",e)}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){console.log("getInAppTopicList Repository",e)}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){console.log("getTopicList Repository",e)}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){console.log("getUrlDeviceApi Repository",e)}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+=`${arguments[0].errorCode}: ${arguments[0].errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},T=new class{constructor(){}showError(e,t,n){if(null!=e){const i=Object.values(e.ErrorCode).indexOf(t);if(i>=0){const t=Object.keys(e.ErrorCode)[i],r=Object.values(e.ErrorCode)[i];return new v({code:t,errorId:r},Object.values(e.ErrorMessage)[i],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},b=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,i){const r=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&r.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),i&&(s.credentials=i);try{const t=new AbortController;let i;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(i=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(i&&clearTimeout(i),304!=a.status){const t=await a.json();return a.ok?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))):null}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),L=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),M=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let i=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,i=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):i=new Date(Date.now()+36e5),!t){const e=i.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let i=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+i+" to "+n.state).writeLog(),i=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",Y=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const i=window?.crypto?.subtle;if(!i)return;const r=await i.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await i.sign(j,r,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}};class F{static compareJSON(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const i of n)if(e[i]!==t[i]){if("object"!=typeof e[i]||"object"!=typeof t[i])return!1;if(!F.compareJSON(e[i],t[i]))return!1}return!0}}const x=F,G=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},W=class{static setTopicChannel(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];r.channel=t,n.push(r)}return n}},K={Repository:y,Config:c,Api:r,Models:o,Utils:s};return i})(),e.exports=t()},315(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(n(254)),r=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(d(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,r,"GeneratorFunction"),d(h),d(h,r,"Generator"),d(h,i,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}d=function(e,t,n,i){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,i)}function h(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){h(o,i,r,s,a,"next",e)}function a(e){h(o,i,r,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function y(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=l(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(I=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return I.apply(this,arguments)})},{key:"call",value:(y=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,T;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new i.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new r.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(T=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,T));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,T));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,i){return y.apply(this,arguments)})},{key:"get",value:(h=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return h.apply(this,arguments)})},{key:"post",value:(d=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return d.apply(this,arguments)})},{key:"put",value:(l=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"delete",value:(c=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return c.apply(this,arguments)})}],t&&E(e.prototype,t),n&&E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y,I}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return r.default}});var i=a(n(468)),r=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var r;function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+="".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((r=n(237))&&r.__esModule?r:{default:r}).default);t.default=f},943(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(i=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,i),r&&u(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,r}(r.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var u=function(){return function(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new r.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}])}();t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={platform:"webpush",version:"0.0.1"},r=n(904);i.version=r.version,i=Object.assign(i,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}});t.default=i},610(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:r.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}var f=c(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=new r.default;if(null!=t){i.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,i.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,i.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),i.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),i.setEncryptionType(this.encryptionType)}});t.default=f},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var u=function(){return function(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new r.default).getBrowserPublicKey(),this.browserPrivateKey=(new r.default).getBrowserPrivateKey(),this.platform=(new r.default).getPlatform(),this.version=(new r.default).getVersion(),this.browserName=(new r.default).getBrowserName(),this.browserVersion=(new r.default).getBrowserVersion(),this.osName=(new r.default).getOsName(),this.osVersion=(new r.default).getOsVersion(),this.deviceId=(new r.default).getDeviceId(),this.deviceType=(new r.default).getDeviceType(),(new r.default).getEnabled()&&(this.enabled="true"===(new r.default).getEnabled()),(new r.default).getExternalId()&&(this.externalCode=(new r.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new r.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new r.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}])}();t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410};var i={ErrorCode:n,ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=i},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function r(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=r(function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=i&&(this.exceptionMessage=i)});t.default=s},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return i.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var i=n(902),r=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,i,o,s){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return r(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(r(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,r(h,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(h),r(h,s,"Generator"),r(h,o,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:p}})()}function r(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}r=function(e,t,n,i){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,i)}function o(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function a(e){o(s,i,r,a,u,"next",e)}function u(e){o(s,i,r,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB},t=[{key:"getDB",value:(l=s(i().m(function e(){var t=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var i=t.IDB;if(i){var r=i.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){var t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return l.apply(this,arguments)})},{key:"get",value:(c=s(i().m(function e(t,n){var r=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(r.close(t),e(n.target.result.store.value)),i(!1)}}))},e)})),function(e,t){return c.apply(this,arguments)})},{key:"put",value:(u=s(i().m(function e(t,n,r){var o=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.store.put({store:{key:n,value:r}},n).onsuccess=function(n){o.close(t),e(r)}}))},e)})),function(e,t,n){return u.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(o=s(i().m(function e(t,n){var r,o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return r=e.v,e.a(2,this.put(r,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return o.apply(this,arguments)})},{key:"getItem",value:(r=s(i().m(function e(t){var n,r;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,r=e.v,e.a(2,r)}},e,this,[[0,2]])})),function(e){return r.apply(this,arguments)})}],t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,u,c,l}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.removeItem(e),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(n(122)),r=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,r,"GeneratorFunction"),f(h),f(h,r,"Generator"),f(h,i,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function d(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){d(o,i,r,s,a,"next",e)}function a(e){d(o,i,r,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,E(i.key),i)}}function E(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=r.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){r.default.setItem(e,t)}},{key:"getStorage",value:function(e){return r.default.getItem(e)}},{key:"clearStorage",value:function(){r.default.clear()}},{key:"setBrowserPublicKey",value:function(e){r.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return r.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){r.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return r.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(A=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return A.apply(this,arguments)})},{key:"getAppKey",value:function(){return r.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(O=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return O.apply(this,arguments)})},{key:"setVAPID",value:function(e){r.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return r.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){r.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return r.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){r.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){var e=r.default.getItem(this.SERVICE_SYNC_TIME);return e||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){r.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return r.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){r.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){var e=r.default.getItem(this.LOCATION_UPDATE_MINUTES);return e||30}},{key:"setRequestLocation",value:(b=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!r.default&&r.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(T=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return T.apply(this,arguments)})},{key:"getPlatform",value:function(){return r.default&&r.default.getItem(this.PLATFORM)||i.default.platform}},{key:"getVersion",value:function(){return i.default.version}},{key:"setBrowserName",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getBrowserName",value:function(){return r.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){r.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return r.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getOsName",value:function(){return r.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){r.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return r.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){r.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return r.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){r.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return r.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){r.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return r.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){r.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return r.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){r.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return r.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){r.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==r.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){r.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return r.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){r.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return r.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default&&r.default.isLocalStorageAvailable()&&r.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getExternalIdRequest",value:(m=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!r.default||!r.default.isLocalStorageAvailable()){e.n=1;break}t=r.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getExternalIdRequest Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return m.apply(this,arguments)})},{key:"setExternalId",value:function(e){r.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return r.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(g=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,r.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return g.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(I=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return I.apply(this,arguments)})},{key:"setLatitude",value:function(e){r.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return r.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){r.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return r.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"getInAppTopicList",value:(E=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getInAppTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return E.apply(this,arguments)})},{key:"setTopicList",value:(d=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return d.apply(this,arguments)})},{key:"getTopicList",value:(f=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return f.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(c=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getUrlDeviceApi Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return c.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(u=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,T,b,O,P,A}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"isServiceTimestampExceed",value:function(){return!(new i.default).getServiceTimestamp()||(new i.default).getServiceSyncTime()<=(Date.now()-(new i.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new r.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})):null}}],(t=null)&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(254))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var s=i&&i.prototype instanceof c?i:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(a(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,r,"GeneratorFunction"),a(h),a(h,r,"Generator"),a(h,i,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}a=function(e,t,n,i){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,i)}function u(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){u(o,i,r,s,a,"next",e)}function a(e){u(o,i,r,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},null,[{key:"getLocationPermission",value:(i=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var i,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(i=e.v)&&(o=i.state,"onchange"in i&&(i.onchange=function(){new r.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+i.state).writeLog(),o=i.state,n&&n({name:t,state:i.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,i}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var i=n(225),r=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,r,"GeneratorFunction"),u(h),u(h,r,"Generator"),u(h,i,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}u=function(e,t,n,i){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,i)}function c(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=null,n=[{key:"createHmac",value:(o=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new r.default).isAvoidCypher()&&(new r.default).getEncryptionType()!==i.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new r.default).getEncryptionType()!==i.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),s=function(){var e=this,t=arguments;return new Promise(function(n,i){var r=o.apply(e,t);function s(e){c(r,n,i,s,a,"next",e)}function a(e){c(r,n,i,s,a,"throw",e)}s(void 0)})},function(e,t){return s.apply(this,arguments)})}],t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o,s}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var i=this.tryToParseLeniently(n);return i?this.formatCanonicalUTC(i):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=i(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=this.parseByFormat(e,r);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],(t=null)&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]);t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(735)),r=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new r.default(s,Object.values(e.ErrorMessage)[o],n)}return new r.default(i.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,o=[{key:"compareJSON",value:function(t,i){var r=Object.keys(t),o=Object.keys(i);if(r.length!==o.length)return!1;for(var s=0,a=r;s<a.length;s++){var u=a[s];if(t[u]!==i[u]){if("object"!=n(t[u])||"object"!=n(i[u]))return!1;if(!e.compareJSON(t[u],i[u]))return!1}}return!0}}],(r=null)&&i(t.prototype,r),o&&i(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,o}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=r.default.INFO,this.setLogLevel((new i.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=r.default.DEBUG&&e<=r.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=r.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=r.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=r.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=r.default.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+="".concat(arguments[0].errorCode,": ").concat(arguments[0].errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"setTopicChannel",value:function(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i];r.channel=t,n.push(r)}return n}}],(t=null)&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],(t=null)&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var i=h(n(622)),r=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},740(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.17.0","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{default:()=>K});var r={};n.r(r),n.d(r,{BaseApplicationRequest:()=>P,BaseClient:()=>b,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>L,TopicSubscribeType:()=>M});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>Y,DateUtils:()=>R,ErrorUtils:()=>T,JsonUtils:()=>x,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>W,Validations:()=>G});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.removeItem(e),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const i=n.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){const t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,i)=>{e||i(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),i(!1)}})}async put(e,t,n){return new Promise((i,r)=>{e||r(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),i(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){console.log("getExternalIdRequest Repository",e)}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){console.log("getInAppTopicList Repository",e)}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){console.log("getTopicList Repository",e)}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){console.log("getUrlDeviceApi Repository",e)}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+=`${arguments[0].errorCode}: ${arguments[0].errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},T=new class{constructor(){}showError(e,t,n){if(null!=e){const i=Object.values(e.ErrorCode).indexOf(t);if(i>=0){const t=Object.keys(e.ErrorCode)[i],r=Object.values(e.ErrorCode)[i];return new v({code:t,errorId:r},Object.values(e.ErrorMessage)[i],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},b=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,i){const r=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&r.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),i&&(s.credentials=i);try{const t=new AbortController;let i;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(i=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(i&&clearTimeout(i),304!=a.status){const t=await a.json();return a.ok?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))):null}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),L=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),M=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let i=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,i=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):i=new Date(Date.now()+36e5),!t){const e=i.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let i=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+i+" to "+n.state).writeLog(),i=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",Y=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const i=window?.crypto?.subtle;if(!i)return;const r=await i.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await i.sign(j,r,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}};class F{static compareJSON(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const i of n)if(e[i]!==t[i]){if("object"!=typeof e[i]||"object"!=typeof t[i])return!1;if(!F.compareJSON(e[i],t[i]))return!1}return!0}}const x=F,G=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},W=class{static setTopicChannel(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];r.channel=t,n.push(r)}return n}},K={Repository:y,Config:c,Api:r,Models:o,Utils:s};return i})(),e.exports=t()},315(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,r,o={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(r.get||r.set)?n(o,s,r):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(n(254)),r=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(d(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,r,"GeneratorFunction"),d(h),d(h,r,"Generator"),d(h,i,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}d=function(e,t,n,i){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,i)}function h(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){h(o,i,r,s,a,"next",e)}function a(e){h(o,i,r,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,T;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new i.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new r.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(T=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,T));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,T));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,i){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return r.default}});var i=a(n(468)),r=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var r;function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((r=n(237))&&r.__esModule?r:{default:r}).default);t.default=f},943(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(i=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(r.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new r.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={platform:"webpush",version:"0.0.1"},r=n(904);i.version=r.version,i=Object.assign(i,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=i},610(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:r.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var l=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=new r.default;if(null!=t){i.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,i.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,i.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),i.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),i.setEncryptionType(this.encryptionType)}});t.default=l},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new r.default).getBrowserPublicKey(),this.browserPrivateKey=(new r.default).getBrowserPrivateKey(),this.platform=(new r.default).getPlatform(),this.version=(new r.default).getVersion(),this.browserName=(new r.default).getBrowserName(),this.browserVersion=(new r.default).getBrowserVersion(),this.osName=(new r.default).getOsName(),this.osVersion=(new r.default).getOsVersion(),this.deviceId=(new r.default).getDeviceId(),this.deviceType=(new r.default).getDeviceType(),(new r.default).getEnabled()&&(this.enabled="true"===(new r.default).getEnabled()),(new r.default).getExternalId()&&(this.externalCode=(new r.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new r.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new r.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=n},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=i&&(this.exceptionMessage=i)});t.default=o},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return i.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var i=n(902),r=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,i,o,s){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return r(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(r(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,r(h,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(h),r(h,s,"Generator"),r(h,o,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:p}})()}function r(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}r=function(e,t,n,i){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,i)}function o(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function a(e){o(s,i,r,a,u,"next",e)}function u(e){o(s,i,r,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB},t=[{key:"getDB",value:(c=s(i().m(function e(){var t=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var i=t.IDB;if(i){var r=i.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){var t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(i().m(function e(t,n){var r=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(r.close(t),e(n.target.result.store.value)),i(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(i().m(function e(t,n,r){var o=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.store.put({store:{key:n,value:r}},n).onsuccess=function(n){o.close(t),e(r)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(r=s(i().m(function e(t,n){var r,o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return r=e.v,e.a(2,this.put(r,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return r.apply(this,arguments)})},{key:"getItem",value:(n=s(i().m(function e(t){var n,r;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,r=e.v,e.a(2,r)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.removeItem(e),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(n(122)),r=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,r,"GeneratorFunction"),f(h),f(h,r,"Generator"),f(h,i,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function d(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){d(o,i,r,s,a,"next",e)}function a(e){d(o,i,r,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,E(i.key),i)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=r.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){r.default.setItem(e,t)}},{key:"getStorage",value:function(e){return r.default.getItem(e)}},{key:"clearStorage",value:function(){r.default.clear()}},{key:"setBrowserPublicKey",value:function(e){r.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return r.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){r.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return r.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return r.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(b=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return b.apply(this,arguments)})},{key:"setVAPID",value:function(e){r.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return r.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){r.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return r.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){r.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return r.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){r.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return r.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){r.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return r.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(T=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return T.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!r.default&&r.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return r.default&&r.default.getItem(this.PLATFORM)||i.default.platform}},{key:"getVersion",value:function(){return i.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return r.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){r.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return r.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return r.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){r.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return r.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){r.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return r.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){r.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return r.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){r.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return r.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){r.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return r.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){r.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return r.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){r.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==r.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){r.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return r.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){r.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return r.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default&&r.default.isLocalStorageAvailable()&&r.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!r.default||!r.default.isLocalStorageAvailable()){e.n=1;break}t=r.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getExternalIdRequest Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){r.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return r.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,r.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){r.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return r.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){r.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return r.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getInAppTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getUrlDeviceApi Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,T,b,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new i.default).getServiceTimestamp()||(new i.default).getServiceSyncTime()<=(Date.now()-(new i.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new r.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})):null}}],t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(254))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var s=i&&i.prototype instanceof c?i:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(a(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,r,"GeneratorFunction"),a(h),a(h,r,"Generator"),a(h,i,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}a=function(e,t,n,i){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,i)}function u(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){u(o,i,r,s,a,"next",e)}function a(e){u(o,i,r,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(i=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var i,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(i=e.v)&&(o=i.state,"onchange"in i&&(i.onchange=function(){new r.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+i.state).writeLog(),o=i.state,n&&n({name:t,state:i.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,i}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var i=n(225),r=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,r,"GeneratorFunction"),u(h),u(h,r,"Generator"),u(h,i,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}u=function(e,t,n,i){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,i)}function c(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new r.default).isAvoidCypher()&&(new r.default).getEncryptionType()!==i.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new r.default).getEncryptionType()!==i.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(e){c(o,i,r,s,a,"next",e)}function a(e){c(o,i,r,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var i=this.tryToParseLeniently(n);return i?this.formatCanonicalUTC(i):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=i(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=this.parseByFormat(e,r);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(735)),r=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new r.default(s,Object.values(e.ErrorMessage)[o],n)}return new r.default(i.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"compareJSON",value:function(t,i){var r=Object.keys(t),o=Object.keys(i);if(r.length!==o.length)return!1;for(var s=0,a=r;s<a.length;s++){var u=a[s];if(t[u]!==i[u]){if("object"!=n(t[u])||"object"!=n(i[u]))return!1;if(!e.compareJSON(t[u],i[u]))return!1}}return!0}}],r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=r.default.INFO,this.setLogLevel((new i.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=r.default.DEBUG&&e<=r.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=r.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=r.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=r.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=r.default.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+="".concat(arguments[0].errorCode,": ").concat(arguments[0].errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i];r.channel=t,n.push(r)}return n}}],t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var i=h(n(622)),r=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.17.0","_id":"indigitall-web-core@4.17.0","_inBundle":false,"_integrity":"sha512-n86QFX154ZqEM49DQjVaKpqpFiEaNh2Hl26sYLJs/N+OplMmVeAW6SfLEWJtT41xzfr5Qv2+bsXbSI/z6PFiiA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.17.0","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.17.0","saveSpec":null,"fetchSpec":"4.17.0"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.17.0.tgz","_shasum":"17ad86c6550dd166e07cc8980942fc4cae87a41c","_spec":"indigitall-web-core@4.17.0","_where":"/home/circleci/webpush/customer","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.17.0"}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{default:()=>P});const{Repository:e}=n(315).Core,t=new class extends e{constructor(){super(),this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID"}async setDeviceId(e){this.setStorage(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}},{Validations:r,Log:o}=n(315).Core.Utils,s=class extends r{static isAppKeyFormat(){const e=t.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFormatRequest(){const e=new o("[IND]CustomerValidations: "),n=t.getDeviceId();let i=!0;return this.isAppKeyFormat()||(i=!1,e.w("appKey is null or empty").writeLog()),t.isPushDisabled()||this.isValidFormat(n)||(i=!1,e.w("deviceId is null or empty").writeLog()),i}},a=class{constructor(e){e.id&&(this.id=e.id),e.customerId&&(this.customerId=e.customerId),e.applicationId&&(this.applicationId=e.applicationId),e.createdAt&&(this.createdAt=e.createdAt),e.updatedAt&&(this.updatedAt=e.updatedAt)}getCustomerId(){return this.customerId}getApplicationId(){return this.applicationId}getId(){return this.id}getCreatedAt(){return this.createdAt}getUpdatedAt(){return this.updatedAt}toJSON(){return{id:this.id,customerId:this.customerId,applicationId:this.applicationId,createdAt:this.createdAt,updatedAt:this.updatedAt}}},u=class{constructor(e,t){this.customerFieldKey=e,this.customerFieldValue=t}getCustomerFieldKey(){return this.customerFieldKey}getCustomerFieldValue(){return this.customerFieldValue}toJSON(){return JSON.parse(`"${this.customerFieldKey}":"${this.customerFieldValue}"`)}},{ErrorDictionary:c}=n(315).Core.Models,l=c.ErrorCode;Object.assign(l,{CUSTOMER_GET_ERROR:4001,CUSTOMER_PARAMS_ERROR:4011,CUSTOMER_GENERAL_ERROR:4600,CUSTOMER_NO_EXTERNAL_CODE:4601,DISABLED_CHANNEL:4404});const f=c.ErrorMessage;Object.assign(f,{CUSTOMER_GET_ERROR:"customer get error",CUSTOMER_PARAMS_ERROR:"Params are not correct",CUSTOMER_GENERAL_ERROR:"general error",CUSTOMER_NO_EXTERNAL_CODE:"no external code registered",DISABLED_CHANNEL:"disabled channel"});const d={ErrorCode:l,ErrorMessage:f},{Config:h}=n(315).Core,{BaseClient:p}=n(315).Core.Api,{ErrorModel:E}=n(315).Core.Models,{CommonUtils:y,ErrorUtils:I}=n(315).Core.Utils,g=new class extends p{constructor(){super(),this.URL_BASE=h.client.CUSTOMER_URL_BASE,this.ENDPOINT_CUSTOMER="/customer",this.ENDPOINT_CUSTOMER_FIELD=this.ENDPOINT_CUSTOMER+"/field",this.ENDPOINT_CUSTOMER_LINK=this.ENDPOINT_CUSTOMER+"/link",this.ENDPOINT_EVENT="/event",this.ENDPOINT_CUSTOMER_EVENT_JOURNEY=this.ENDPOINT_CUSTOMER+this.ENDPOINT_EVENT+"/custom"}async getURL(){let e=await t.getUrlDeviceApi();return e?e=e.replaceAll("v1","v2"):h.client.CUSTOMER_URL_BASE}async getCustomer(e,n,i){if(s.isAppKeyFormat()&&s.isValidFormat(t.getExternalId())){const t=await this.get(this.ENDPOINT_CUSTOMER,e.getCustomerRequest());t&&!(t instanceof E)&&t.statusCode>=200&&t.statusCode<300?y.isFunction(n)&&n(new a(t.data)):t?y.isFunction(i)&&i(t):y.isFunction(i)&&i()}else y.isFunction(i)&&i(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async getCustomerField(e,n,i){if(s.isAppKeyFormat()&&s.isValidFormat(t.getExternalId())){const t=await this.get(this.ENDPOINT_CUSTOMER_FIELD,e.getCustomerFieldRequest()),r=[];for(const e in t.data)Object.prototype.hasOwnProperty.call(t.data,e)&&r.push(new u(e,t.data[e]));t&&r.length>0&&!(t instanceof E)&&t.statusCode>=200&&t.statusCode<300?y.isFunction(n)&&n(r):t?y.isFunction(i)&&i(t):y.isFunction(i)&&i()}else y.isFunction(i)&&i(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async putCustomerField(e,n,i){if(s.isAppKeyFormat()&&s.isValidFormat(t.getExternalId())){const t=await this.put(this.ENDPOINT_CUSTOMER_FIELD,e.putCustomerFieldRequest());this.getCustomerResponse(t,n,i)}else y.isFunction(i)&&i(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async deleteCustomerField(e,n,i){if(s.isAppKeyFormat()&&s.isValidFormat(t.getExternalId())){const t=await this.delete(this.ENDPOINT_CUSTOMER_FIELD,e.deleteCustomerFieldRequest());this.getCustomerResponse(t,n,i)}else y.isFunction(i)&&i(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async postCustomerLink(e,n,i){if(s.isValidFormatRequest()&&s.isValidFormat(t.getExternalId())){const t=await this.post(this.ENDPOINT_CUSTOMER_LINK,e.postAndDeleteCustomerLinkRequest());this.getCustomerResponse(t,n,i)}else y.isFunction(i)&&i(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async deleteCustomerLink(e,n,i){if(s.isValidFormatRequest()&&s.isValidFormat(t.getExternalId())){const t=await this.delete(this.ENDPOINT_CUSTOMER_LINK,e.postAndDeleteCustomerLinkRequest());this.getCustomerResponse(t,n,i)}else y.isFunction(i)&&i(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async getCustomerResponse(e,t,n){e&&!(e instanceof E)&&e.statusCode>=200&&e.statusCode<300?y.isFunction(t)&&(""!=e.data?t(e.data):t()):e?y.isFunction(n)&&n(e):y.isFunction(n)&&n()}async postCustomJourneyEvent(e,n,i){if(s.isValidFormatRequest()&&s.isValidFormat(t.getExternalId())){const t=await this.post(this.ENDPOINT_CUSTOMER_EVENT_JOURNEY,e.postCustomEventRequest());this.getCustomerResponse(t,n,i)}else y.isFunction(i)&&i(I.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}},{BaseEventRequest:m}=n(315).Core.Api,_=class extends m{constructor(){super(),null!=t.getExternalId()&&(this.customerId=t.getExternalId())}postCustomEventRequest(){return this.params="",this.body=this.createCustomEventBodyJson(),this}createCustomEventBodyJson(){const e={};try{e.customData=this.customData,e.eventType=this.eventType,e.externalCode=this.customerId,e.eventId=this.eventId,e.eventAt=this.eventAt}catch(e){console.log("Error creating custom event request: "+e)}return e}setEventType(e){this.eventType=e}setCustomData(e){this.customData=e}},{BaseRequest:v}=n(315).Core.Api,{Device:S}=n(315).Core.Models,T=class extends v{constructor(){super(),this.device=new S,null!=t.getExternalId()&&(this.customerId=t.getExternalId()),this.fieldNames,this.link,this.fields,this.eventType,this.customData}getCustomerRequest(){return this.params=this.createQueryStringCustomerId(),this}getCustomerFieldRequest(){return this.params=this.createQueryString(),this}putCustomerFieldRequest(){return this.params=this.createQueryStringCustomerId(),this.body=this.createBodyJson(),this}deleteCustomerFieldRequest(){return this.params=this.createQueryStringCustomerId(),this.body=this.createDeleteBodyJson(),this}postAndDeleteCustomerLinkRequest(){return this.params="",this.body=this.createBodyJson(),this}createQueryString(){let e="";return e+=this.createQueryStringCustomerId(),this.fieldNames&&(e+=`&${this.PARAM_CUSTOMER_FIELD_NAMES}=${this.fieldNames}`),this.fields&&(e+=`&${this.PARAM_CUSTOMER_FIELDS}=${this.fields}`),this.link&&(e+=`&${this.PARAM_CUSTOMER_LINK}=${this.link}`),e}createQueryStringCustomerId(){return this.PARAM_CUSTOMER_ID+"="+this.customerId}createBodyJson(){let e={};try{this.channel&&"none"!=this.channel&&(e.channel=this.channel,this.device&&this.device.deviceId&&(e.deviceId=this.device.deviceId),this.customerId&&(e.customerId=this.customerId)),this.link&&(e.link=this.link),this.fields&&(e=this.fields)}catch(e){console.log("Error fieldNames request :"+e)}return e}createDeleteBodyJson(){const e={},t=[];try{if(this.fieldNames){for(let e=0;e<this.fieldNames.length;e++)t.push(this.fieldNames[e]);e.fields=t}}catch(e){console.log("Error fieldNames request :"+e)}return e}setFields(e){this.fields=e}setFieldNames(e){this.fieldNames=e}setLink(e){this.link=e}setChannel(e){this.channel=e}setEventType(e){this.eventType=e}setCustomData(e){this.customData=e}},{CommonUtils:b,ErrorUtils:O}=n(315).Core.Utils,P=class{static async getCustomer(e,t){const n=new T;await g.getCustomer(n,e,t)}static async getCustomerInformation(e,t,n){const i=new T;null!=e&&(Array.isArray(e)?i.setFieldNames(e):b.isFunction(n)&&n(O.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))),await g.getCustomerField(i,t,n)}static async assignOrUpdateValueToCustomerFields(e,t,n){let i;try{"string"==typeof e?i=JSON.parse(i):"object"==typeof e&&(i=e)}catch(e){b.isFunction(n)&&n(O.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS,e))}if(i){const e=new T;e.setFields(i),await g.putCustomerField(e,t,n)}else b.isFunction(n)&&n(O.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))}static async deleteValuesFromCustomerFields(e,t,n){if(Array.isArray(e)){const i=new T;i.setFieldNames(e),await g.deleteCustomerField(i,t,n)}else b.isFunction(n)&&n(O.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))}static async link(e,t,n){if("none"===e)return void(b.isFunction(n)&&n(O.showError(d,d.ErrorCode.DISABLED_CHANNEL)));const i=new T;i.setChannel(e),await g.postCustomerLink(i,t,n)}static async unlink(e,t,n){if("none"==e)return void(b.isFunction(n)&&n(O.showError(d,d.ErrorCode.DISABLED_CHANNEL)));const i=new T;i.setChannel(e),await g.deleteCustomerLink(i,t,n)}static async sendCustomerCustomEvent(e,t,n=null,i=null,r,o){let s,a;try{"string"==typeof t?s=JSON.parse(t):"object"==typeof t&&(s=t),"string"==typeof e&&(a=e)}catch(e){b.isFunction(o)&&o(O.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))}if(s&&a){const e=new _;e.setCustomData(s),e.setEventType(a),e.setEventId(n),e.setEventAt(i),await g.postCustomJourneyEvent(e,r,o)}else b.isFunction(o)&&o(O.showError(d,d.ErrorCode.CUSTOMER_ERROR_PARAMS))}}})(),i})(),e.exports=t()},960(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(740));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},126(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.17.0","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{default:()=>K});var r={};n.r(r),n.d(r,{BaseApplicationRequest:()=>P,BaseClient:()=>b,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>L,TopicSubscribeType:()=>M});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>Y,DateUtils:()=>R,ErrorUtils:()=>T,JsonUtils:()=>x,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>W,Validations:()=>G});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.removeItem(e),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const i=n.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){const t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,i)=>{e||i(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),i(!1)}})}async put(e,t,n){return new Promise((i,r)=>{e||r(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),i(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){console.log("getExternalIdRequest Repository",e)}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){console.log("getInAppTopicList Repository",e)}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){console.log("getTopicList Repository",e)}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){console.log("getUrlDeviceApi Repository",e)}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+=`${arguments[0].errorCode}: ${arguments[0].errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},T=new class{constructor(){}showError(e,t,n){if(null!=e){const i=Object.values(e.ErrorCode).indexOf(t);if(i>=0){const t=Object.keys(e.ErrorCode)[i],r=Object.values(e.ErrorCode)[i];return new v({code:t,errorId:r},Object.values(e.ErrorMessage)[i],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},b=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,i){const r=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&r.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),i&&(s.credentials=i);try{const t=new AbortController;let i;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(i=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(i&&clearTimeout(i),304!=a.status){const t=await a.json();return a.ok?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))):null}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),L=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),M=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let i=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,i=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):i=new Date(Date.now()+36e5),!t){const e=i.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let i=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+i+" to "+n.state).writeLog(),i=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",Y=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const i=window?.crypto?.subtle;if(!i)return;const r=await i.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await i.sign(j,r,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}};class F{static compareJSON(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const i of n)if(e[i]!==t[i]){if("object"!=typeof e[i]||"object"!=typeof t[i])return!1;if(!F.compareJSON(e[i],t[i]))return!1}return!0}}const x=F,G=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},W=class{static setTopicChannel(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];r.channel=t,n.push(r)}return n}},K={Repository:y,Config:c,Api:r,Models:o,Utils:s};return i})(),e.exports=t()},315(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,r,o={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(r.get||r.set)?n(o,s,r):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(n(254)),r=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(d(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,r,"GeneratorFunction"),d(h),d(h,r,"Generator"),d(h,i,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}d=function(e,t,n,i){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,i)}function h(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){h(o,i,r,s,a,"next",e)}function a(e){h(o,i,r,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,T;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new i.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new r.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(T=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,T));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,T));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,i){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return r.default}});var i=a(n(468)),r=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var r;function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((r=n(237))&&r.__esModule?r:{default:r}).default);t.default=f},943(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(i=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(r.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new r.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={platform:"webpush",version:"0.0.1"},r=n(904);i.version=r.version,i=Object.assign(i,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=i},610(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:r.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var l=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=new r.default;if(null!=t){i.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,i.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,i.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),i.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),i.setEncryptionType(this.encryptionType)}});t.default=l},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new r.default).getBrowserPublicKey(),this.browserPrivateKey=(new r.default).getBrowserPrivateKey(),this.platform=(new r.default).getPlatform(),this.version=(new r.default).getVersion(),this.browserName=(new r.default).getBrowserName(),this.browserVersion=(new r.default).getBrowserVersion(),this.osName=(new r.default).getOsName(),this.osVersion=(new r.default).getOsVersion(),this.deviceId=(new r.default).getDeviceId(),this.deviceType=(new r.default).getDeviceType(),(new r.default).getEnabled()&&(this.enabled="true"===(new r.default).getEnabled()),(new r.default).getExternalId()&&(this.externalCode=(new r.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new r.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new r.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=n},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=i&&(this.exceptionMessage=i)});t.default=o},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return i.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var i=n(902),r=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,i,o,s){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return r(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(r(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,r(h,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(h),r(h,s,"Generator"),r(h,o,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:p}})()}function r(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}r=function(e,t,n,i){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,i)}function o(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function a(e){o(s,i,r,a,u,"next",e)}function u(e){o(s,i,r,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB},t=[{key:"getDB",value:(c=s(i().m(function e(){var t=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var i=t.IDB;if(i){var r=i.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){var t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(i().m(function e(t,n){var r=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(r.close(t),e(n.target.result.store.value)),i(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(i().m(function e(t,n,r){var o=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.store.put({store:{key:n,value:r}},n).onsuccess=function(n){o.close(t),e(r)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(r=s(i().m(function e(t,n){var r,o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return r=e.v,e.a(2,this.put(r,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return r.apply(this,arguments)})},{key:"getItem",value:(n=s(i().m(function e(t){var n,r;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,r=e.v,e.a(2,r)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.removeItem(e),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(n(122)),r=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,r,"GeneratorFunction"),f(h),f(h,r,"Generator"),f(h,i,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function d(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){d(o,i,r,s,a,"next",e)}function a(e){d(o,i,r,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,E(i.key),i)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=r.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){r.default.setItem(e,t)}},{key:"getStorage",value:function(e){return r.default.getItem(e)}},{key:"clearStorage",value:function(){r.default.clear()}},{key:"setBrowserPublicKey",value:function(e){r.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return r.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){r.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return r.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return r.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(b=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return b.apply(this,arguments)})},{key:"setVAPID",value:function(e){r.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return r.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){r.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return r.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){r.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return r.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){r.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return r.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){r.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return r.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(T=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return T.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!r.default&&r.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return r.default&&r.default.getItem(this.PLATFORM)||i.default.platform}},{key:"getVersion",value:function(){return i.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return r.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){r.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return r.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return r.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){r.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return r.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){r.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return r.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){r.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return r.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){r.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return r.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){r.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return r.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){r.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return r.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){r.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==r.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){r.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return r.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){r.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return r.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default&&r.default.isLocalStorageAvailable()&&r.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!r.default||!r.default.isLocalStorageAvailable()){e.n=1;break}t=r.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getExternalIdRequest Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){r.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return r.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,r.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){r.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return r.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){r.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return r.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getInAppTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getUrlDeviceApi Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,T,b,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new i.default).getServiceTimestamp()||(new i.default).getServiceSyncTime()<=(Date.now()-(new i.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new r.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})):null}}],t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(254))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var s=i&&i.prototype instanceof c?i:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(a(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,r,"GeneratorFunction"),a(h),a(h,r,"Generator"),a(h,i,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}a=function(e,t,n,i){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,i)}function u(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){u(o,i,r,s,a,"next",e)}function a(e){u(o,i,r,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(i=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var i,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(i=e.v)&&(o=i.state,"onchange"in i&&(i.onchange=function(){new r.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+i.state).writeLog(),o=i.state,n&&n({name:t,state:i.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,i}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var i=n(225),r=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,r,"GeneratorFunction"),u(h),u(h,r,"Generator"),u(h,i,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}u=function(e,t,n,i){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,i)}function c(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new r.default).isAvoidCypher()&&(new r.default).getEncryptionType()!==i.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new r.default).getEncryptionType()!==i.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(e){c(o,i,r,s,a,"next",e)}function a(e){c(o,i,r,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var i=this.tryToParseLeniently(n);return i?this.formatCanonicalUTC(i):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=i(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=this.parseByFormat(e,r);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(735)),r=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new r.default(s,Object.values(e.ErrorMessage)[o],n)}return new r.default(i.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"compareJSON",value:function(t,i){var r=Object.keys(t),o=Object.keys(i);if(r.length!==o.length)return!1;for(var s=0,a=r;s<a.length;s++){var u=a[s];if(t[u]!==i[u]){if("object"!=n(t[u])||"object"!=n(i[u]))return!1;if(!e.compareJSON(t[u],i[u]))return!1}}return!0}}],r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=r.default.INFO,this.setLogLevel((new i.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=r.default.DEBUG&&e<=r.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=r.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=r.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=r.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=r.default.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+="".concat(arguments[0].errorCode,": ").concat(arguments[0].errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i];r.channel=t,n.push(r)}return n}}],t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var i=h(n(622)),r=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.17.0","_id":"indigitall-web-core@4.17.0","_inBundle":false,"_integrity":"sha512-n86QFX154ZqEM49DQjVaKpqpFiEaNh2Hl26sYLJs/N+OplMmVeAW6SfLEWJtT41xzfr5Qv2+bsXbSI/z6PFiiA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.17.0","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.17.0","saveSpec":null,"fetchSpec":"4.17.0"},"_requiredBy":["#USER","/","/indigitall-web-customer"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.17.0.tgz","_shasum":"17ad86c6550dd166e07cc8980942fc4cae87a41c","_spec":"indigitall-web-core@4.17.0","_where":"/home/circleci/webpush/inapp","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.17.0"}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{default:()=>Be});const{BaseRequest:e}=n(315).Core.Api,t=class extends e{constructor(){super(),this.PARAM_INAPP_LIMIT="limit",this.PARAM_INAPP_PAGE="page",this.INAPP_TOPIC_LIST_LIMIT=20,this.page=0}getTopicsRequest(){return this.params=this.getTopicsQuery(),this}getTopicsQuery(){let e="";return e+=`${this.PARAM_INAPP_LIMIT}=${o.getInAppTopicPageLimit()}&`,e+=`${this.PARAM_INAPP_PAGE}=${this.page}`,e}},{Repository:r}=n(315).Core,o=new class extends r{constructor(){super(),this.INAPP_SHOW_ONCE=this.REPOSITORY+".INAPP_SHOW_ONCE",this.INAPP_TIMES_CLICKED=this.REPOSITORY+".INAPP_TIMES_CLICKED",this.INAPP_DISMISS_FOREVER=this.REPOSITORY+".INAPP_DISMISS_FOREVER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.INAPP_TOPICS_SYNC=this.REPOSITORY+".INAPP_TOPICS_SYNC",this.AVOID_ACTION=this.REPOSITORY+".AVOID_ACTION",this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_INAPP_V2_SERVICE_SYNC_TIME",this.AUDIENCE_DATE_CACHE_TTL=this.REPOSITORY+".AUDIENCE_DATE_CACHE_TTL",this.INAPP_AUDIENCES=this.REPOSITORY+".INAPP_AUDIENCES",this.INAPP_AUDIENCES_CACHE=this.REPOSITORY+".INAPP_AUDIENCES_CACHE",this.INAPP_AUDIENCES_LAST_UPDATE=this.REPOSITORY+".INAPP_AUDIENCES_LAST_UPDATE",this.INAPP_CACHE=this.REPOSITORY+".INAPP_CACHE",this.INAPP_LIMIT_TO_IGNORE=this.REPOSITORY+".INAPP_LIMIT_TO_IGNORE",this.INAPP_PROFILE=this.REPOSITORY+".INAPP_PROFILE",this.INAPP_TIME_SLIDE_CAROUSEL=this.REPOSITORY+".INAPP_TIME_SLIDE_CAROUSEL",this.INAPP_TOPIC_PAGE_LIMIT=this.REPOSITORY+".INAPP_TOPIC_PAGE_LIMIT",this.INAPP_AUDIENCE_DEVICE_ID_ENABLED=this.REPOSITORY+".INAPP_AUDIENCE_DEVICE_ID_ENABLED"}async setItemStorage(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_CACHE,e),this.setItemSessionStorage(this.REPOSITORY,e)}async getItemStorage(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()&&(e=this.getItemSessionStorage(this.REPOSITORY)),!e&&this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_CACHE))}catch(e){console.log("getItemStorage InAppRepository",e)}return e}setDeviceId(e){this.setStorage(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}getInAppShowOnce(){return this.getStorage(this.INAPP_SHOW_ONCE)}setInAppShowOnce(e){this.setStorage(this.INAPP_SHOW_ONCE,e)}getInAppTimesClicked(){return this.getStorage(this.INAPP_TIMES_CLICKED)}setInAppTimesClicked(e){this.setStorage(this.INAPP_TIMES_CLICKED,e)}getInAppDismissForever(){return this.getStorage(this.INAPP_DISMISS_FOREVER)}setInAppDismissForever(e){this.setStorage(this.INAPP_DISMISS_FOREVER,e)}getInAppTopics(){return this.getStorage(this.INAPP_TOPICS)?this.getStorage(this.INAPP_TOPICS).split(","):null}setInAppTopics(e){this.setStorage(this.INAPP_TOPICS,e)}async getInAppTopicsSync(){let e=null;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS_SYNC))}catch(e){console.log("getInAppTopicsSync InAppRepository",e)}return e}async setInAppTopicsSync(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS_SYNC,e)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){console.log("getUrlDeviceApi InAppRepository",e)}return e}isAvoidAction(){return this.getStorage(this.AVOID_ACTION)}setAvoidAction(e){this.setStorage(this.AVOID_ACTION,e)}getConfigInAppV2ServiceSyncTime(){return this.getStorage(this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME)}setConfigInAppV2ServiceSyncTime(e){this.setStorage(this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME,e)}getInAppAudienceDateCacheTtl(){return this.getStorage(this.AUDIENCE_DATE_CACHE_TTL)}setInAppAudienceDateCacheTtl(e){this.setStorage(this.AUDIENCE_DATE_CACHE_TTL,e)}getAudienceModel(){return this.getStorage(this.INAPP_AUDIENCES)}setAudienceModel(e){this.setStorage(this.INAPP_AUDIENCES,e)}getAudienceCache(){return this.getStorage(this.INAPP_AUDIENCES_CACHE)}setAudienceCache(e){this.setStorage(this.INAPP_AUDIENCES_CACHE,e)}getAudienceLastUpdate(){return this.getStorage(this.INAPP_AUDIENCES_LAST_UPDATE)}setAudienceLastUpdate(e){this.setStorage(this.INAPP_AUDIENCES_LAST_UPDATE,e)}getInAppCache(){const e=this.getStorage(this.INAPP_CACHE);try{return e?JSON.parse(e):[]}catch(e){return console.log("getInAppCache: invalid JSON in storage",e),[]}}setInAppCache(e){if(Array.isArray(e))try{const t=JSON.stringify(e);this.setStorage(this.INAPP_CACHE,t)}catch(e){console.log("setInAppCache: error stringifying value",e)}else console.log("setInAppCache: value must be a JSON array")}getInAppLimitToIgnore(){return this.getStorage(this.INAPP_LIMIT_TO_IGNORE)}setInAppLimitToIgnore(e){this.setStorage(this.INAPP_LIMIT_TO_IGNORE,e)}getInAppProfile(){const e=this.getStorage(this.INAPP_PROFILE);return null==e||""===e?null:e}setInAppProfile(e){let t="";null!==e&&(t=e),this.setStorage(this.INAPP_PROFILE,t)}getInAppTopicPageLimit(){const e=this.getStorage(this.INAPP_TOPIC_PAGE_LIMIT);return 0==e?(new t).INAPP_TOPIC_LIST_LIMIT:e}setInAppTopicPageLimit(e){this.setStorage(this.INAPP_TOPIC_PAGE_LIMIT,e)}getTimeSlideForCarousel(){return this.getStorage(this.INAPP_TIME_SLIDE_CAROUSEL)}setTimeSlideForCarousel(e){this.setStorage(this.INAPP_TIME_SLIDE_CAROUSEL,e)}isAudienceDeviceIdEnabled(){return!!this.getStorage(this.INAPP_AUDIENCE_DEVICE_ID_ENABLED)&&this.getStorage(this.INAPP_AUDIENCE_DEVICE_ID_ENABLED)}setAudienceDeviceIdEnabled(e){this.setStorage(this.INAPP_AUDIENCE_DEVICE_ID_ENABLED,e)}},{Validations:s,Log:a}=n(315).Core.Utils,u=class extends s{static isAppKeyFormat(){const e=o.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFieldFormat(e){return null!=e&&""!=e&&"null"!=e}static isValidFormatRequest(){const e=new a("[IND]InAppValidations: "),t=o.getDeviceId();let n=!0;return this.isAppKeyFormat()||(n=!1,e.w("appKey is null or empty").writeLog()),this.isValidFormat(t)||(n=!1,e.w("deviceId is null or empty").writeLog()),n}static getInAppRegisterInvalidFields(){const e=[],t=this.isValidFormatRequest(),n=this.isValidFieldFormat(o.getExternalId());return t||e.push("deviceId"),o.isAudienceDeviceIdEnabled()||n||e.push("externalCode"),e}},{ErrorDictionary:c}=n(315).Core.Models,l=c.ErrorCode;Object.assign(l,{INAPP_ERROR:2e3,INAPP_SHOW_INAPP_ERROR:2100,INAPP_WAS_EXPIRED:2101,INAPP_WAS_SHOWN_MANY_TIMES:2102,INAPP_WAS_CLICKED_MANY_TIMES:2103,INAPP_TOPIC_EMPTY:2104,INAPP_TOPIC_LIST_NO_MORE_PAGES:2005,INAPP_CAMPAIGN_NOT_EXIST:2403,INAPP_FORM_TYPE_NOT_CORRECT:2120,INAPP_FORM_FIELD_IS_EMPTY:2121,INAPP_POPUP_ERROR:2300,INAPP_WAS_DISMISSED_FOREVER:2304,INAPP_ERROR_CONTENT_MESSAGE:2305,INAPP_INSTANCE_TOPICS_ERROR:2306,INAPP_GENERAL_ERROR:2600,INAPP_AUDIENCES_BAD_REQUEST:4803,INAPP_AUDIENCE_NO_CHANGE:304});const f=c.ErrorMessage;Object.assign(f,{INAPP_ERROR:"inApp error",INAPP_SHOW_INAPP_ERROR:"error on show inApp",INAPP_WAS_EXPIRED:"InApp cache has timed out",INAPP_WAS_SHOWN_MANY_TIMES:"InApp was shown more than $x times",INAPP_WAS_CLICKED_MANY_TIMES:"InApp was clicked more than $x times",INAPP_TOPIC_EMPTY:"There is no inApp Topics subscription",INAPP_TOPIC_LIST_NO_MORE_PAGES:"No more pages for inApp topics",INAPP_CAMPAIGN_NOT_EXIST:"Campaign doesn't exist with the code",INAPP_FORM_TYPE_NOT_CORRECT:"Input type is not correct",INAPP_FORM_FIELD_IS_EMPTY:"Field is empty",INAPP_POPUP_ERROR:"error on popup",INAPP_WAS_DISMISSED_FOREVER:"InApp was dismissed forever",INAPP_ERROR_CONTENT_MESSAGE:"InApp error with content",INAPP_INSTANCE_TOPICS_ERROR:"topics instance is not correct, only string[] is valid types",INAPP_GENERAL_ERROR:"inApp general error",INAPP_AUDIENCES_BAD_REQUEST:"Audience bad request",INAPP_AUDIENCE_NO_CHANGE:"Audience with no change"});const d={ErrorCode:l,ErrorMessage:f},h=class{constructor(e){this.URL="url",e.actionId&&(this.actionId=e.actionId),e.destroy&&(this.destroy=e.destroy),e.topics&&(this.topics=e.topics),e.type&&(this.type=e.type),e.url&&(this.url=e.url),e.app&&(this.app=e.app),e.no_action&&(this.no_action=e.no_action)}},p=class{constructor(e){e.borderRadius&&(this.borderRadius=e.borderRadius)}},E=class{constructor(e){e.contentUrl&&(this.contentUrl=e.contentUrl),e.showTime&&(this.showTime=e.showTime),e.numberOfShows&&(this.numberOfShows=e.numberOfShows),e.numberOfClicks&&(this.numberOfClicks=e.numberOfClicks),e.dismissForever&&(this.dismissForever=e.dismissForever),e.layout&&(this.layout=new p(e.layout)),e.action&&(this.action=new h(e.action))}setAction(e){this.action=e}},y=class{constructor(e){this.timesShowed=0,this.timesClicked=0,this.wasDismissed=!1,e&&(e.timesShowed&&(this.timesShowed=e.timesShowed),e.timesClicked&&(this.timesClicked=e.timesClicked),e.wasDismissed&&(this.wasDismissed=e.wasDismissed))}},I=class{static async searchInApp(e){console.warn("searchInApp is deprecated. Use searchInAppWithInApp(inApp) instead.");const t=await this.getListInApp();return null==t?null:this.findInAppFromInAppList(t,e)}static async searchListInAppWithCode(e){const t=await this.getListInApp();return null==t?null:this.findInAppsFromInAppList(t,e)}static async searchInAppWithInAppIdAndSchema(e,t){console.warn("searchInAppWithInAppIdAndSchema is deprecated. Use searchInAppWithInApp(inApp) instead.");const n=await this.getListInApp();return null==n?null:this.getInAppFromIdAndCode(n,e,t)}static async searchInAppWithInAppId(e){console.warn("searchInAppWithInAppId is deprecated. Use searchInAppWithInApp(inApp) instead.");const t=await this.getListInApp();return null==t?null:this.findInAppFromInAppListWithInAppId(t,e)}static async searchInAppWithInApp(e){const t=await this.getListInApp();return null==t?null:this.findInAppsFromInAppListWithInApp(t,e)}static async addInApp(e){let t=await this.getListInApp();null!=t?t.push(e):t=[e],await o.setItemStorage(JSON.stringify(t))}static async getListInApp(){let e=null;try{const t=await o.getItemStorage();t&&(e=JSON.parse(t))}catch(e){console.log(e)}return e}static async addInAppNewClick(e){this.updateInAppField(e,!0,null,null)}static async addInAppNewShow(e){this.updateInAppField(e,null,!0,null)}static async addInAppDismissForever(e){this.updateInAppField(e,null,null,!0)}static async updateInAppField(e,t,n,i){const r=await this.getListInApp(),s=[];if(null!=r){const a=o.getInAppProfile();for(let o=0;o<r.length;o++)a?r[o].inAppId==e.inAppId&&r[o].profile&&r[o].profile==a&&(null!=t&&(r[o].inAppShow.timesClicked+=1),null!=n&&(r[o].inAppShow.timesShowed+=1),null!=i&&(r[o].inAppShow.wasDismissed=!0)):r[o].inAppId!=e.inAppId||void 0!==r[o].profile&&null!==r[o].profile&&""!==r[o].profile||(null!=t&&(r[o].inAppShow.timesClicked+=1),null!=n&&(r[o].inAppShow.timesShowed+=1),null!=i&&(r[o].inAppShow.wasDismissed=!0)),s.push(r[o])}await o.setItemStorage(JSON.stringify(s))}static async updateInApp(e){const t=await this.getListInApp(),n=[];let i=null,r=!1;const s=o.getInAppProfile();if(null!=t)for(let o=0;o<t.length;o++)s?t[o].inAppId===e.inAppId&&t[o].schema.code===e.schema.code&&t[o].profile===s?(e.profile=s,r=!0):n.push(t[o]):t[o].inAppId===e.inAppId&&t[o].schema.code===e.schema.code?r=!0:n.push(t[o]),r&&(t[o].filters&&(e.filters=t[o].filters),t[o].name&&(e.name=t[o].name),null!=t[o].properties&&(e.properties=new E(t[o].properties)),null!=t[o].inAppShow&&(e.inAppShow=new y(t[o].inAppShow)),n.push(e),i=e);return await o.setItemStorage(JSON.stringify(n)),i}static async deleteInApp(e){let t=!1;const n=await this.getListInApp(),i=[];if(null!=n)for(let r=0;r<n.length;r++)n[r].inAppId!=e.inAppId?i.push(n[r]):t=!0;return await o.setItemStorage(JSON.stringify(i)),t}static async deleteInAppIfOldVersion(e){let t=!1;const n=await this.getListInApp(),i=[];if(null!=n)for(let r=0;r<n.length;r++)n[r].inAppId!=e.inAppId?i.push(n[r]):n[r].version<=e.version?t=!0:i.push(n[r]);return t}static async findInAppsFromInAppListWithInApp(e,t){if(null!=e){const n=o.getInAppProfile();for(let i=0;i<e.length;i++)if(n){if(e[i].inAppId&&e[i].inAppId==t.inAppId&&e[i].schema.code&&e[i].schema.code==t.schema.code&&e[i].profile&&e[i].profile==n)return e[i]}else if(e[i].inAppId&&e[i].inAppId==t.inAppId&&e[i].schema.code&&e[i].schema.code==t.schema.code&&(void 0===e[i].profile||null===e[i].profile||""===e[i].profile))return e[i]}return null}static async findInAppFromInAppListWithInAppId(e,t){if(null!=e){const n=o.getInAppProfile();for(let i=0;i<e.length;i++)if(n){if(e[i].inAppId&&e[i].inAppId==t&&e[i].profile&&e[i].profile==n)return e[i]}else if(e[i].inAppId&&e[i].inAppId==t&&(void 0===e[i].profile||null===e[i].profile||""===e[i].profile))return e[i]}return null}static async findInAppFromInAppList(e,t){if(null!=e){const n=o.getInAppProfile();for(let i=0;i<e.length;i++)if(n){if(e[i].profile&&e[i].profile==n&&e[i].schema&&e[i].schema.code&&e[i].schema.code==t)return e[i]}else if(e[i].schema&&e[i].schema.code&&e[i].schema.code==t)return e[i]}return null}static async findInAppsFromInAppList(e,t){const n=[];if(null!=e){const i=o.getInAppProfile();for(let r=0;r<e.length;r++)i?e[r].schema&&e[r].schema.code&&e[r].schema.code==t&&e[r].profile&&e[r].profile==i&&n.push(e[r]):e[r].schema&&e[r].schema.code&&e[r].schema.code==t&&(void 0===e[r].profile||null===e[r].profile||""===e[r].profile)&&n.push(e[r])}return n}static async getInAppFromIdAndCode(e,t,n){let i=null;if(null!=e)for(let r=0;r<e.length;r++)e[r].schema&&e[r].schema.code&&e[r].schema.code==n&&e[r].inAppId&&e[r].inAppId==t&&(i=e[r]);return i}};class g{static TIME_CACHE=36e5;static inAppWasCached(e){const t=o.getInAppCache();for(let n=0;n<t.length;n++){const i=t[n],r=new v("string"==typeof i?JSON.parse(i):i),s=o.getInAppProfile();if(s){if(r.schema.code===e&&r.profile===s)return r}else if(r.schema.code===e&&(void 0===r.profile||null===r.profile))return r}return null}static addNewInAppToCache(e){const t=o.getInAppCache();let n=!1;for(let i=0;i<t.length;i++)try{const r=t[i],s=new v("string"==typeof r?JSON.parse(r):r),a=o.getInAppProfile();if(a){if(s.profile&&s.profile===a&&s.inAppId===e.inAppId&&s.schema.code===e.schema.code){n=!0;break}}else if((void 0===s.profile||null===s.profile||""===s.profile)&&s.inAppId===e.inAppId&&s.schema.code===e.schema.code){n=!0;break}}catch(e){console.log("addNewInAppToCache: JSON parse error",e)}if(!n){e.creationDate=Y.getDate((new Date).getTime());let n=g.TIME_CACHE;e.cacheTtl&&(n=1e3*e.cacheTtl),e.expiredDate=Y.getDate((new Date).getTime()+n),t.push(e)}o.setInAppCache(t)}static deleteInAppFromCache(e){let t=o.getInAppCache();const n=t.length;return t=t.filter(t=>{try{return!(new v("string"==typeof t?JSON.parse(t):t).schema.code===e.schema.code)}catch(e){return console.log("deleteInAppFromCache: JSON parse error",e),!0}}),o.setInAppCache(t),n>t.length}}const m=g,_=class{constructor(e){e&&(e.code&&(this.code=e.code),e.width&&(this.width=e.width),e.height&&(this.height=e.height))}},v=class{constructor(e){if(e){if(e.cacheTtl&&(this.cacheTtl=e.cacheTtl),e.inAppId&&(this.inAppId=e.inAppId),e.showOnce&&(this.showOnce=e.showOnce),e.version&&(this.version=e.version),e.customData&&(this.customData=e.customData),e.creationDate?this.creationDate=e.creationDate:this.creationDate=Y.getDate((new Date).getTime()),e.expiredDate)this.expiredDate=e.expiredDate;else{let e=m.TIME_CACHE;this.cacheTtl&&(e=1e3*this.cacheTtl),this.expiredDate=Y.getDate((new Date).getTime()+e)}e.schema&&(this.schema=new _(e.schema)),e.properties&&(this.properties=new E(e.properties)),this.inAppShow=new y(e.inAppShow),e.filters&&(this.filters=e.filters),e.name&&(this.name=e.name),e.profile&&(this.profile=e.profile)}}},{BaseRequest:S}=n(315).Core.Api,{Config:T}=n(315).Core,b=class extends S{constructor(){super(),o.getDeviceId()?this.deviceId=o.getDeviceId():this.deviceId=Y.generateDeviceId()}setEventType(e){this.eventType=e}setInAppId(e){this.inAppId=e}setActionId(e){this.actionId=e}setClickedButton(e){this.clickedButton=e}setLastVersionId(e){this.lastVersionId=e}setVersion(e){this.version=e}setDeviceId(e){this.deviceId=e}setPlatform(e){this.platform=e}postEventPrintRequest(){const e=this.fillJsonEventRequest();return this.body=e,this}postEventClickRequest(){const e=this.fillJsonEventRequest();return e.actionId=this.actionId,this.body=e,this}fillJsonEventRequest(){const e={};return e.deviceId=this.deviceId,o.getExternalId()&&(e.externalCode=o.getExternalId()),e.inAppId=this.inAppId,e.platform=T.platform,e.version=this.version,e}postEventInAppRequest(){const e={};return e.inAppId=this.inAppId,e.lastVersionId=this.lastVersionId,e.deviceId=this.deviceId,this.eventType&&(e.eventType=this.eventType),e.platform=this.platform,e.clickedButton=this.clickedButton,this.body=e,this}},{BaseRequest:O}=n(315).Core.Api,{EncryptionType:P}=n(315).Core.Models,A=class extends O{constructor(){super(),u.isValidFieldFormat(o.getExternalId())&&(this.customerId=o.getExternalId(),!0!==o.isAvoidCypher()&&o.getEncryptionType()!=P.RAW||(this.customerId=encodeURIComponent(o.getExternalId()))),null!=o.getDeviceId()&&(this.deviceId=o.getDeviceId())}setFields(e){this.fields=e}putCustomerFieldRequest(){return this.params=this.createQueryStringCustomerId(),this.body=this.createBodyJson(),this}createQueryStringCustomerId(){return this.PARAM_CUSTOMER_ID+"="+this.customerId}createBodyJson(){let e={};try{e.channel="inapp",this.deviceId&&(e.deviceId=this.deviceId),o.getExternalId()&&(e.customerId=o.getExternalId()),this.fields&&(e=this.fields)}catch(e){console.log("Error fieldNames request :"+e)}return e}},{BaseRequest:R}=n(315).Core.Api,{Config:w}=n(315).Core,N=class extends R{constructor(){super()}setInAppId(e){this.inAppId=e}setVersion(e){this.version=e}setJsonForm(e){this.jsonForm=e}postForm(){return this.body=this.createBody(),this}createBody(){const e={};return o.getDeviceId()&&(e.deviceId=o.getDeviceId()),o.getExternalId()&&(e.externalCode=o.getExternalId()),this.jsonForm&&(e.form=this.jsonForm),e.inAppId=this.inAppId,e.platform=w.platform,e.version=this.version,e}},C=class{static sendEventPrint(e){const t=new b;t.setInAppId(e.inAppId),t.setVersion(e.version),se.postEventPrint(t)}static sendEventClick(e){const t=new b;t.setActionId(e.properties.action.actionId),t.setInAppId(e.inAppId),t.setVersion(e.version),se.postEventClick(t)}static sendEventForm(e,t,n){const i=new N;i.setVersion(t),i.setInAppId(e),i.setJsonForm(n),se.postEventForm(i)}static sendEventFormToCustomer(e){const t=new A;t.setFields(e),se.putCustomerField(t)}},{DeviceStatus:D,Device:L}=n(315).Core.Models,{BaseRequest:M}=n(315).Core.Api,U=class extends M{constructor(){super(),this.device=new L}postDeviceRequest(){return this.body=this.createDeviceJson(),this.status!==D.DEFAULT&&(this.body.enabled=1===this.status),this}createDeviceJson(){let e={};try{e=this.device.toJSON()}catch(e){console.log(e)}return e}},{Log:B,CryptoUtils:k,CorePermissions:V}=n(315).Core.Utils,{EventType:j}=n(315).Core.Models,Y=class{constructor(){this.MONTH=24192e5}static onClickAction(e){"false"===o.isAvoidAction()&&e.type==e.URL&&window.open(e.url)}static async addNewInApp(e){await I.addInApp(e)}static addNewInAppClick(e){e.properties.numberOfClicks&&e.properties.numberOfClicks>0&&I.addInAppNewClick(e),C.sendEventClick(e)}static addNewInApptoDismissForever(e){I.addInAppDismissForever(e)}static async isInAppDismissForever(e){const t=await I.searchInAppWithInApp(e);return!(null==t||!new v(t).inAppShow.wasDismissed)}static async registerLocation(){const e=new B("[IND]InAppUtils: ");try{if("undefined"==typeof navigator||!navigator.geolocation)return;const t=await V.getLocationPermission();"prompt"!==t.location&&"granted"!==t.location||navigator.geolocation.getCurrentPosition(e=>{o.setLatitude(e.coords.latitude),o.setLongitude(e.coords.longitude)},t=>{e.e(`error ${t?.message||t}`).writeLog();const n=o.getPermissionLocation();n||n===j.EVENT_TYPE_REJECT||o.setPermissionLocation(j.EVENT_TYPE_REJECT)})}catch(t){e.e(t).writeLog()}}static generateDeviceId(){se.postDevice(new U,e=>e,e=>(console.log(e),null))}static async setExternalCode(e){let t=e;if(e){const n=o.getAppKey();t=await k.createHmac(n,e)}return o.setExternalId(t),t}static async setExternalCodeWithoutCypher(e){await o.setExternalId(e)}static async convertToJSONArray(e){if(e&&""!=e)return await Promise.resolve(e).then(e=>JSON.parse(e))}static getDate(e){const t=new Date(e);let n=""+(t.getMonth()+1),i=""+t.getDate();const r=t.getFullYear();let o=t.getHours(),s=t.getMinutes(),a=t.getSeconds();return n.length<2&&(n="0"+n),i.length<2&&(i="0"+i),o.length<2&&(o="0"+o),s.length<2&&(s="0"+s),a.length<2&&(a="0"+a),`${r}-${n}-${i} ${o}:${s}:${a}`}},{CoreApplication:F}=n(315).Core.Models,x=class extends F{constructor(e,t=!1){if(super(e,t),e&&e.inapp){const t=e.inapp;t.enabled&&(this.enabled=t.enabled),t.clearCacheList&&(this.clearCacheList=t.clearCacheList),t.clearCacheAll&&(this.clearCacheAll=t.clearCacheAll),t.clearDatabaseList&&(this.clearDatabaseList=t.clearDatabaseList),t.clearDatabaseAll&&(this.clearDatabaseAll=t.clearDatabaseAll),t.serviceSyncTime&&(this.serviceSyncTime=t.serviceSyncTime,o.setConfigInAppV2ServiceSyncTime(this.serviceSyncTime)),t.audienceCache&&(this.audienceCache=t.audienceCache,this.audienceCache.deviceTtl&&(this.audienceCacheDeviceTtl=this.audienceCache.deviceTtl),o.setAudienceCache(this.audienceCacheDeviceTtl)),this.inAppLimitToIgnore=50,t.inAppLimitToIgnore&&(this.inAppLimitToIgnore=t.inAppLimitToIgnore),o.setInAppLimitToIgnore(this.inAppLimitToIgnore),o.setAudienceDeviceIdEnabled(!1),t.audienceDeviceIdEnabled&&o.setAudienceDeviceIdEnabled(t.audienceDeviceIdEnabled)}}async updateCache(){let e=0;if(this.clearCacheAll&&(o.setAudienceModel(""),o.setAudienceLastUpdate(""),o.setAudienceCache(0),o.setInAppAudienceDateCacheTtl(""),o.setInAppCache([])),this.clearCacheList&&this.clearCacheList.length>0)for(let t=0;t<this.clearCacheList.length;t++){const n=new v(this.clearCacheList[t]);n&&0!=n.inAppId&&m.deleteInAppFromCache(n)&&e++}if(this.clearDatabaseAll&&(e=o.getInAppCache().length,o.clearSessionStorage()),this.clearDatabaseList&&this.clearDatabaseList.length>0)for(let t=0;t<this.clearDatabaseList.length;t++){const n=new v(this.clearDatabaseList[t]);if(n&&0!=n.inAppId){let t=!1;t=0!=n.version?await I.deleteInAppIfOldVersion(n):await I.deleteInApp(n),t&&e++}}return e}},G=class{constructor(e){e&&(e.audiences&&(this.audiences=e.audiences),e.lastUpdate&&(this.lastUpdate=e.lastUpdate))}},{Log:W}=n(315).Core.Utils,K="[IND]InAppAudienceUtils",H=class{static isAudienceCacheFinish(){const e=new W(K+".isAudienceCacheFinish");if(o.getInAppAudienceDateCacheTtl()&&""!=o.getInAppAudienceDateCacheTtl()){const t=new Date(o.getInAppAudienceDateCacheTtl());return!!(t&&t<Date.now())||(e.d(`InApp Audience cache reload on: ${t.toISOString()}`).writeLog(),!1)}return this.saveAudienceCache(o.getAudienceCache()),!0}static saveAudienceCache(e){const t=new W(K+".saveAudienceCache");let n=216e5;e&&0!=e&&(n=1e3*e);const i=new Date(Date.now()+n).toISOString();t.d(`InApp Audience cache reload on: ${i}`).writeLog(),o.setInAppAudienceDateCacheTtl(i)}static saveAudiences(e){e&&e.audiences&&o.setAudienceModel(JSON.stringify(e))}static loadAudiences(){return o.getAudienceModel()&&""!=o.getAudienceModel()?new G(JSON.parse(o.getAudienceModel())):null}},{ErrorModel:q,ErrorDictionary:$}=n(315).Core.Models,X=new class{showError(e,t,n,i){if(null!=e){const r=Object.values(e.ErrorCode).indexOf(t);if(r>=0){const t={code:Object.keys(e.ErrorCode)[r],errorId:Object.values(e.ErrorCode)[r]};let o=Object.values(e.ErrorMessage)[r];return o&&i&&(o=o.replaceAll("$x",i)),new q(t,o,n)}return new q($.ErrorCode.GENERAL_ERROR,"general error",n)}}},{CommonUtils:Q}=n(315).Core.Utils,J=class{constructor(e,t,n,i,r){this.topics=e,this.currentPage=t||0,this.totalElements=n,this.limit=o.getInAppTopicPageLimit()||20,this.totalPages=n/this.limit,this.onSuccess=i,this.onError=r}hasNextPage(){return this.currentPage+1<=this.totalPages}loadNextPage(){if(this.currentPage+1>this.totalPages)return void(Q.isFunction(this.onError)&&this.onError(X.showError(d,d.ErrorCode.INAPP_TOPIC_LIST_NO_MORE_PAGES)));this.currentPage=this.currentPage+1;const e=new t;e.page=this.currentPage,se.getInAppTopicsFromConsole(e,this.onSuccess,this.onError)}},{BaseClient:z}=n(315).Core.Api,{Config:Z}=n(315).Core,{Channel:ee,ErrorModel:te}=n(315).Core.Models,{TopicUtils:ne,CommonUtils:ie,Log:re}=n(315).Core.Utils,oe="[IND]InAppApplication: ",se=new class extends z{constructor(){super(),this.ENDPOINT_INAPP="/inapp",this.URL_BASE=Z.client.URL_DEVICE_V2+this.ENDPOINT_INAPP,this.ENDPOINT_CAMPAIGN="/campaign",this.ENDPOINT_CAMPAIGN_TAG=this.ENDPOINT_CAMPAIGN+"/{tag}",this.ENDPOINT_DEVICE="/device",this.ENDPOINT_INAPP_AUDIENCE=this.ENDPOINT_DEVICE+"/audiences",this.ENDPOINT_EVENT_INAPP="/event",this.ENDPOINT_EVENT_INAPP_PRINT=this.ENDPOINT_EVENT_INAPP+"/print",this.ENDPOINT_EVENT_INAPP_CLICK=this.ENDPOINT_EVENT_INAPP+"/click",this.ENDPOINT_EVENT_INAPP_FORM=this.ENDPOINT_EVENT_INAPP+"/form",this.ENDPOINT_DEVICE_TOPICS="/topic",this.ENDPOINT_CUSTOMER="/customer",this.ENDPOINT_CUSTOMER_FIELD=this.ENDPOINT_CUSTOMER+"/field",this.ENDPOINT_APPLICATION="/application",this.isCustomerRequest=!1,this.isDeviceRequest=!1,this.isApplicationRequest=!1}async getURL(){if(this.isCustomerRequest){this.isCustomerRequest=!1;let e=await o.getUrlInappApi();return e?e=e.replaceAll(`/${this.ENDPOINT_INAPP}`,""):Z.client.CUSTOMER_URL_BASE}if(this.isDeviceRequest){this.isDeviceRequest=!1;let e=await o.getUrlInappApi();return e?e=e.replaceAll("v2","v1"):Z.client.URL_BASE}if(this.isApplicationRequest)return this.isApplicationRequest=!1,await o.getUrlInappApi()||Z.client.URL_DEVICE_V2;const e=await o.getUrlInappApi();return e?e+this.ENDPOINT_INAPP:this.URL_BASE}async getCampaignTag(e,t,n){const i=await this.get(this.ENDPOINT_CAMPAIGN_TAG,e.getCampaignTagRequest());if(i&&!(i instanceof te)&&i.data&&Object.keys(i.data).length>0){if(ie.isFunction(t)){const n=i.data,r=o.getInAppProfile();r&&(n.profile=r);const s=new v(n);s.properties.numberOfShows>0&&(s.inAppShow.timesShowed=1),s.properties.dismissForever&&(s.inAppShow.wasDismissed=!0),e.isUpdateInApp()||null!=await I.searchInAppWithInApp(s)||await Y.addNewInApp(s),t(s)}}else i?i.data&&0===Object.keys(i.data).length&&i.data.constructor===Object&&200==i.statusCode?ie.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_CAMPAIGN_NOT_EXIST)):ie.isFunction(n)&&n(i):ie.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_ERROR_CONTENT_MESSAGE));return null}async getInAppTopicsFromConsole(e,t,n){if(u.isAppKeyFormat()){const i=await this.get(this.ENDPOINT_DEVICE_TOPICS,e.getTopicsRequest());if(!i||i instanceof te)i?ie.isFunction(n)&&n(i):ie.isFunction(n)&&n();else{const r=ne.setTopicChannel(i.data,ee.INAPP),o=i.count?i.count:0,s=e.page||0,a=new J(r,s,o,t,n);ie.isFunction(t)&&t(a)}}else ie.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_GENERAL_ERROR));return!0}postEventClick(e){u.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_CLICK,e.postEventClickRequest())}postEventPrint(e){u.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_PRINT,e.postEventClickRequest())}postEventForm(e){u.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_FORM,e.postForm())}putCustomerField(e){u.isAppKeyFormat()&&(this.isCustomerRequest=!0,this.put(this.ENDPOINT_CUSTOMER_FIELD,e.putCustomerFieldRequest()))}async postDevice(e,t,n){if(u.isAppKeyFormat()){this.isDeviceRequest=!0;const i=await this.post(this.ENDPOINT_DEVICE,e.postDeviceRequest(),"include");!i||i instanceof te?i?ie.isFunction(n)&&n(i):ie.isFunction(n)&&n():(i.data.deviceId&&o.setDeviceId(i.data.deviceId),ie.isFunction(t)&&t(i.data.deviceId))}else ie.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_ERROR));return!0}async getApplicationWithInAppChannel(e,t,n){if(u.isAppKeyFormat()){const i=o.getConfigV2ServiceSyncTime(),r=new re(oe);if(null!=i&&Date.now()<new Date(i)){r.d(`InApp config cache reload on: ${new Date(i).toISOString()}`).writeLog();const e=JSON.parse(o.getConfigV2());e&&ie.isFunction(t)&&t(new x(e,!0))}else{null!=i&&r.d(`InApp config cache reload on: ${new Date(i).toISOString()}`).writeLog(),this.isApplicationRequest=!0;const o=await this.get(this.ENDPOINT_APPLICATION,e.getApplicationRequest());if(o&&!(o instanceof te))if(o.data&&Object.keys(o.data).length>0){if(ie.isFunction(t)){const e=new x(o.data,!1);if(e.enabled){const t=await e.updateCache();t>0&&r.d(`Deleted ${t} inapp cache from database`).writeLog()}t(e)}}else o?ie.isFunction(n)&&n(o):ie.isFunction(n)&&n()}}else ie.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_ERROR));return!0}async getAudiences(e,t,n){const i=new re(`${oe}.getAudiences`),r=u.getInAppRegisterInvalidFields();if(0===r.length){const r=await this.get(this.ENDPOINT_INAPP_AUDIENCE,e.getAudiences());if(!r||r instanceof te)r?ie.isFunction(n)&&n(r):ie.isFunction(n)&&n();else{let e;r.data?(e=new G(r.data),e.lastUpdate&&o.setAudienceLastUpdate(e.lastUpdate),e.audiences&&H.saveAudiences(e)):r.status&&304==r.status&&i.d("No audiences modified. No need to sync changes to the device").writeLog(),ie.isFunction(t)&&t(e)}}else{const e=`Bad request, getAudiences: audience device enabled set to ${o.isAudienceDeviceIdEnabled()} and fields ${r.join(" and ")} not found`;ie.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_AUDIENCES_BAD_REQUEST,e))}}},{Log:ae}=n(315).Core.Utils,ue=class{static async getInAppIdFromArraylistOfInAppWithSchemaCode(e){const t=[],n=await this.getAllInAppToIgnoreWithSchemaCode(e);if(n&&n.length>0)for(let e=0;e<n.length;e++)0!=n[e].inAppId&&t.push(String(n[e].inAppId));return t}static async getAllInAppToIgnoreWithSchemaCode(e){const t=new ae("[IND]InAppFiltersUtils.getAllInAppToIgnoreWithSchemaCode"),n=await I.searchListInAppWithCode(e),i=[];if(n&&n.length>0)for(const e of n){const n=e.properties.numberOfShows,r=e.inAppShow.timesShowed,o=e.properties.numberOfClicks,s=e.inAppShow.timesClicked;n>0&&r>=n?(i.push(e),t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was ignored because was shown ${n} times`).writeLog()):o>0&&s>=o?(i.push(e),t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was ignored because was clicked ${o} times`).writeLog()):e.properties.dismissForever&&e.inAppShow.wasDismissed&&(i.push(e),t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was ignored because was dismissed forever`).writeLog())}else t.d(`No InApp on sessionStorage with code ${e} ${o.getInAppProfile()?`and profile ${o.getInAppProfile()}`:"without profile"}`).writeLog();return this.filterInAppToIgnoreWithInAppList(i)}static filterInAppToIgnoreWithInAppList(e){const t=o.getInAppLimitToIgnore();return e.length>t?[...e].sort((e,t)=>{const n=new Date(e.creationDate||0);return new Date(t.creationDate||0)-n}).slice(0,t):[...e]}},{CommonUtils:ce}=n(315).Core.Utils,{Channel:le}=n(315).Core.Models,fe=class{static async listTopics(e,t){const n=[],i=this.getTopicsFromLocalStorage();if(null!=i&&""!=i){for(let e=0;e<i.length;e++)n.push({code:i[e],name:i[e],visible:!0,subscribe:!0,parentCode:i[e],channel:le.INAPP});ce.isFunction(e)&&e(n)}else ce.isFunction(t)&&t(X.showError(d,d.ErrorCode.INAPP_TOPIC_EMPTY))}static async saveTopics(e,t,n){try{if(e instanceof Array){let n=[];const i=this.getTopicsFromLocalStorage();if(null!=i&&""!=i&&(n=i),0!==n.length){const t=e.filter(e=>!n.includes(e));0!==t.length&&n.push(t)}else for(let t=0;t<e.length;t++)n.push(e[t]);this.setTopicsFromLocalStorage(n);const r=[];for(let e=0;e<n.length;e++)r.push({code:n[e],name:n[e],visible:!0,subscribe:!0,parentCode:"",channel:le.INAPP});ce.isFunction(t)&&t(r)}else ce.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_INSTANCE_TOPICS_ERROR))}catch(e){ce.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_ERROR,e.message))}}static async deleteAllTopics(e,t){try{const t=[];this.setTopicsFromLocalStorage([]),ce.isFunction(e)&&e(t)}catch(e){ce.isFunction(t)&&t(X.showError(d,d.ErrorCode.INAPP_ERROR,e.message))}}static async deleteTopics(e,t,n){if(e instanceof Array){let n=[],i=[];const r=this.getTopicsFromLocalStorage();null!=r&&""!=r&&(n=r),0!==n.length&&(i=n.filter(t=>!e.includes(t)),this.setTopicsFromLocalStorage(i));const o=[];if(i.length>0)for(let e=0;e<i.length;e++)o.push({code:i[e],name:i[e],visible:!0,subscribe:!0,parentCode:"",channel:le.INAPP});ce.isFunction(t)&&t(o)}else ce.isFunction(n)&&n(X.showError(d,d.ErrorCode.INAPP_INSTANCE_TOPICS_ERROR))}static isSubscribe(e){let t=[],n=[];if(o.getInAppTopics()&&(n=this.getTopicsFromLocalStorage()),e&&e.length>0)if(n&&n.length>0)for(let i=0;i<e.length;i++){e[i].subscribed=!1;for(let t=0;t<n.length;t++)e[i].code===n[t]&&(e[i].subscribed=!0);t.push(e[i])}else{for(let t=0;t<e.length;t++)e[t].subscribe=!1;t=e}return t}static getTopicsFromLocalStorage(){const e=o.getInAppProfile();let t=[];const n=o.getInAppTopics();if(n&&n.length>0)if(e)for(let i=0;i<n.length;i++)n[i].startsWith(`${e}_`)&&t.push(this.removeProfile(n[i]));else t=n;return t}static async setTopicsFromLocalStorage(e){const t=o.getInAppProfile(),n=[];if(e&&e.length>0)for(let i=0;i<e.length;i++)t?n.push(`${t}_${e[i]}`):n.push(e[i]);o.setInAppTopics(n)}static removeProfile(e){const t=o.getInAppProfile();return t&&e.startsWith(`${t}_`)?e.slice(`${t}_`.length):e}},{BaseRequest:de}=n(315).Core.Api,{EncryptionType:he}=n(315).Core.Models,pe=class extends de{constructor(){super(),this.update=!1,this.PARAM_DEVICE_TYPE="deviceType",this.PARAM_BROWSER_NAME="browserName",this.PARAM_AUDIENCES="audiences",this.PARAM_AUDIENCES_VERSION="audiencesVersion",this.PARAM_IGNORE_INAPP_ID="ignoreInAppId",this.ignoreInAppIds=[]}setTag(e){this.tag=e}setUpdateInApp(e){this.update=e}isUpdateInApp(){return this.update}async setIgnoreInAppIds(e){this.ignoreInAppIds=await ue.getInAppIdFromArraylistOfInAppWithSchemaCode(e)}getCampaignTagRequest(){return this.params=this.createQueryString(),this.pathParams["{tag}"]=this.tag,this}createQueryString(){let e="";if(null!=o.getDeviceId()?e+=`${this.PARAM_DEVICE_ID}=${o.getDeviceId()}&`:Y.generateDeviceId(),u.isValidFieldFormat(o.getExternalId())){let t=o.getExternalId();!0!==o.isAvoidCypher()&&o.getEncryptionType()!=he.RAW||(t=encodeURIComponent(o.getExternalId())),e+=`${this.PARAM_EXTERNAL_CODE}=${t}&`}null!=o.getDeviceType()&&(e+=`${this.PARAM_DEVICE_TYPE}=${o.getDeviceType()}&`),null!=o.getBrowserName()&&(e+=`${this.PARAM_BROWSER_NAME}=${o.getBrowserName()}&`),null!=o.getLatitude()&&(e+=`${this.PARAM_LATITUDE}=${o.getLatitude()}&`),null!=o.getLongitude()&&(e+=`${this.PARAM_LONGITUDE}=${o.getLongitude()}&`);const t=fe.getTopicsFromLocalStorage();null!=t&&0!==t.length&&(e+=`${this.PARAM_TOPICS}=${encodeURIComponent(t)}&`);const n=H.loadAudiences();return null!=n&&0!==n.audiences.length&&(e+=`${this.PARAM_AUDIENCES}=${encodeURIComponent(n.audiences)}&`),e+=`${this.PARAM_AUDIENCES_VERSION}=v2&`,this.ignoreInAppIds&&this.ignoreInAppIds.length>0&&(e+=`${this.PARAM_IGNORE_INAPP_ID}=${encodeURIComponent(this.ignoreInAppIds)}&`),e+=`${this.PARAM_PLATFORM}=webpush`,e}},Ee=class{static INAPP_TIME_SLIDE_CAROUSEL=1e4;constructor(e,t){this.script=` \n\n var objectFit_${t} = "contain" ;\n var containers_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-container");\n if (containers_${t} && containers_${t}.length > 0 && containers_${t}[0] && containers_${t}[0].getAttribute("data-carousel-adjust-type")) {\n objectFit_${t} = containers_${t}[0].getAttribute("data-carousel-adjust-type"); \n }\n\n var isPartial_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-item-partial").length > 0;\n \n var slideIndex_${t} = isPartial_${t} ? 1 : 0;\n var delta_${t} = 6;\n \n var diffX_${t};\n var diffY_${t};\n var timeSlide_${t} = ${o.getTimeSlideForCarousel()};\n\n\n var ind_carouselOverlap_${t} = document.getElementById("ind_carouselOverlapContainer_${t}");\n var ind_carouselOverlapLMainView_${t} = document.getElementById("ind_carouselOverlapLMainView_${t}")\n \n var indNext_${t} = document.getElementById("${e}").getElementsByClassName("ind_next");\n var indPrev_${t} = document.getElementById("${e}").getElementsByClassName("ind_prev");\n indNext_${t}.onclick = () => plusSlides_${t}(1);\n indPrev_${t}.onclick = () => plusSlides_${t}(-1);\n\n var slides_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-item") ? document.getElementById("${e}").getElementsByClassName("ind_slideshow-item") : document.getElementById("${e}").getElementsByClassName("ind_slideshow-carousel-item");\n var slider_${t} = document.getElementById("${e}").querySelector('.ind_slider-container-actions');\n var sliderTotal_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-item").length ? document.getElementById("${e}").getElementsByClassName("ind_slideshow-item").length : document.getElementById("${e}").getElementsByClassName("ind_slideshow-carousel-item").length;\n \n var interval_${t} = setInterval(() => {\n newSlide_${t}();\n }, timeSlide_${t});\n\n var imageList_${t} = document.getElementById("${e}").getElementsByClassName("indCOImages_${t}");\n \n if (imageList_${t}) {\n setImagesCarouselOverLap_${t}();\n let docIframeHeight_${t} = document.getElementById("${e}").clientHeight;\n let docIframeWidth_${t} = document.getElementById("${e}").clientWidth;\n \n if (document.getElementById("ind_carouselOverlapLeftView_${t}")) document.getElementById("ind_carouselOverlapLeftView_${t}").style.height = (docIframeHeight_${t}-20)+"px";\n if (document.getElementById("ind_carouselOverlapLRightView_${t}")) document.getElementById("ind_carouselOverlapLRightView_${t}").style.height = (docIframeHeight_${t}-20)+"px";\n if (document.getElementById("ind_carouselOverlapLMainView_${t}")) document.getElementById("ind_carouselOverlapLMainView_${t}").style.height = docIframeHeight_${t} + "px";\n if (document.getElementById("ind_carouselOverlapLMainView_${t}")) document.getElementById("ind_carouselOverlapLMainView_${t}").style.width = docIframeWidth_${t} + "px";\n \n }\n if (document.getElementById("ind_carousel-overlap-container_${t}")) document.getElementById("ind_carousel-overlap-container_${t}").style.width = docIframeWidth_${t} + "px";\n\n function setImagesCarouselOverLap_${t}() { \n var slides_${t} = document.getElementById("${e}").getElementsByClassName("ind_slideshow-carousel-item");\n for (let i = 0; i < slides_${t}.length; i++) {\n if (imageList_${t}[i]) {\n slides_${t}[i].style.backgroundImage = "url('"+imageList_${t}[i].src+"')";\n if (slides_${t}[i].style) {\n \n slides_${t}[i].style.backgroundSize = "cover";\n }\n slides_${t}[i].style.backgroundPosition = "center";\n } \n }\n const mainView = document.getElementById("ind_carouselOverlapLMainView_${t}");\n if (mainView) {\n mainView.style.backgroundSize = objectFit_${t};\n if (slides_${t}[1]) slides_${t}[1].onclick = imageList_${t}[1].onclick; \n }\n }\n\n function shiftRight_${t}() {\n let newArr = new Array(imageList_${t}.length);\n for (var i = 0; i < imageList_${t}.length; i++) {\n if (i == 0) {\n newArr[i] = imageList_${t}[imageList_${t}.length-1];\n } else {\n newArr[i] = imageList_${t}[i-1];\n }\n }\n imageList_${t} = newArr;\n }\n\n function shiftLeft_${t}() {\n let newArr = new Array(imageList_${t}.length);\n for (var i = 0; i < imageList_${t}.length; i++) {\n if (i+1 == imageList_${t}.length) {\n newArr[i] = imageList_${t}[0]; \n } else {\n newArr[i] = imageList_${t}[i+1];\n }\n }\n imageList_${t} = newArr;\n }\n\n \n showSlides_${t}(slideIndex_${t});\n \n var startMove_${t} = null;\n var startMoveY_${t} = null;\n \n \n if (slider_${t} && !ind_carouselOverlap_${t}) {\n slider_${t}.addEventListener('touchstart', handleStart_${t}, false);\n slider_${t}.addEventListener('touchend', handleEnd_${t}, false);\n slider_${t}.addEventListener('mousedown', mouseStart_${t});\n slider_${t}.addEventListener('mouseup', mouseEnd_${t}); \n } else if (ind_carouselOverlap_${t} && ind_carouselOverlapLMainView_${t}) {\n ind_carouselOverlapLMainView_${t}.addEventListener('touchstart', handleStart_${t}, false);\n ind_carouselOverlapLMainView_${t}.addEventListener('touchend', handleEnd_${t}, false);\n ind_carouselOverlapLMainView_${t}.addEventListener('mousedown', mouseStart_${t});\n ind_carouselOverlapLMainView_${t}.addEventListener('mouseup', mouseEnd_${t});\n }\n\n function mouseStart_${t}(evt) {\n evt.preventDefault();\n startMove_${t} = evt.clientX;\n startMoveY_${t} = evt.clientY;\n }\n\n function mouseEnd_${t}(evt) {\n evt.preventDefault();\n var endMove = evt.clientX;\n var endMoveY = evt.clientY;\n setEndMove_${t}(endMove, endMoveY);\n }\n\n function handleStart_${t}(evt) {\n evt.preventDefault();\n startMove_${t} = evt.touches[0].clientX;\n startMoveY_${t} = evt.touches[0].clientY;\n }\n function handleEnd_${t}(evt) {\n evt.preventDefault();\n const endMove = evt.changedTouches[0].pageX;\n const endMoveY = evt.changedTouches[0].pageY;\n setEndMove_${t}(endMove, endMoveY);\n }\n\n function setEndMove_${t}(endMove, endMoveY) {\n diffX_${t} = Math.abs(endMove - startMove_${t});\n diffY_${t} = Math.abs(endMoveY - startMoveY_${t});\n \n if (startMove_${t} != null) {\n if (startMove_${t} > endMove) {\n if (ind_carouselOverlap_${t}) {\n slideIndex_${t} = -1;\n } else {\n slideIndex_${t}++;\n if (slideIndex_${t} > sliderTotal_${t}) {\n slideIndex_${t} = 1;\n }\n }\n } else {\n if (ind_carouselOverlap_${t}) {\n if (startMove_${t} == endMove) {\n slideIndex_${t} = 0;\n } else {\n slideIndex_${t} = 1;\n }\n } else {\n if (slideIndex_${t} == 0) {\n slideIndex_${t} = sliderTotal_${t};\n } else {\n slideIndex_${t}--;\n }\n }\n }\n showSlides_${t}(slideIndex_${t});\n setNewInterval_${t}();\n }\n \n }\n\n function plusSlides_${t}(n) {\n if (ind_carouselOverlap_${t}) {\n showSlides_${t}(n == 1 ? -1: 1);\n } else {\n showSlides_${t}(slideIndex_${t} += n);\n }\n setNewInterval_${t}();\n }\n\n function currentSlide_${t}(n) {\n showSlides_${t}(slideIndex_${t} = n);\n }\n\n function setNewInterval_${t}() {\n clearInterval(interval_${t});\n interval_${t} = setInterval(() => {\n newSlide_${t}();\n }, timeSlide_${t});\n }\n\n function newSlide_${t}(){\n slideIndex_${t}++;\n if (slideIndex_${t} > sliderTotal_${t}) {\n slideIndex_${t} = 1;\n }\n showSlides_${t}(slideIndex_${t});\n }\n\n function showSlides_${t}(n) {\n let view = document.getElementById("${e}") ? document.getElementById("${e}") : document;\n if (view) {\n if (ind_carouselOverlap_${t}) { \n if (n < 0) {\n shiftLeft_${t}();\n } else if (n > 0) {\n shiftRight_${t}();\n }\n setImagesCarouselOverLap_${t}();\n } else {\n let i;\n const dots = view.getElementsByClassName("ind_dot");\n if (n > slides_${t}.length) {slideIndex_${t} = 1;}\n if (n < 1) {slideIndex_${t} = slides_${t}.length;}\n for (i = 0; i < slides_${t}.length; i++) {\n slides_${t}[i].style.display = "none";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(" active", "");\n }\n if (slides_${t}[slideIndex_${t}-1]) {\n slides_${t}[slideIndex_${t}-1].style.display = "block";\n }\n if (dots[slideIndex_${t}-1]) dots[slideIndex_${t}-1].className += " active";\n }\n }\n }\n\n\n function inAppIndigitallOnClick_${t}(action) {\n if (diffX_${t} && diffY_${t}) {\n if (diffX_${t} < delta_${t} && diffY_${t} < delta_${t}) {\n indigitall.InApp.inAppOnClick(action);\n }\n } else {\n indigitall.InApp.inAppOnClick(action);\n }\n }\n\n function inAppIndigitallSubmit_${t}(formOptions) {\n const jsonForm = {}\n const jsonCustomer = {}\n const form = document.querySelector('[id="'+formOptions.formId+'"]');\n if (form) {\n formOptions.inputs.forEach((el) => {\n if (el.id !== 'undefined') {\n let value;\n if (el.type === 'text' || el.type === 'number') {\n if (form && form.querySelector('input[id^="'+el.id+'"]') && form.querySelector('input[id^="'+el.id+'"]').value !== 'undefined') {\n value = form.querySelector('input[id^="'+el.id+'"]').value;\n }\n }\n if (el.type === 'checkbox') {\n if (form && form.querySelectorAll('input[id^="'+el.id +'"]')) {\n let values = form.querySelectorAll('input[id^="'+el.id +'"]');\n var valuesChecked = [];\n for (var i = 0; i < values.length; i++) {\n if (values[i].checked && values[i].value !== 'undefined') {\n valuesChecked.push(values[i].value);\n }\n }\n value = valuesChecked;\n }\n }\n if (el.type === 'radio') {\n if (form && form.querySelectorAll('input[id^="'+el.id +'"]')) {\n let values = form.querySelectorAll('input[id^="'+el.id +'"]');\n var valuesChecked;\n for (var i = 0; i < values.length; i++) {\n if (values[i].checked && values[i].value !== 'undefined') {\n valuesChecked = values[i].value;\n }\n }\n value = valuesChecked;\n }\n }\n if (el.type === 'select') {\n if (form && form.querySelector('select[id^="'+el.id+'"]') && form.querySelector('select[id^="'+el.id+'"]').value !== 'undefined') {\n value = form.querySelector('select[id^="'+el.id+'"]').value;\n }\n }\n if (value) jsonForm[el.id] = value;\n if (el.sendToCustomer) jsonCustomer[el.id] = value;\n }\n });\n }\n indigitall.InApp.inAppSubmit(JSON.stringify(formOptions), JSON.stringify(jsonForm), JSON.stringify(jsonCustomer));\n }\n `,this.html=" "}},ye=Object.freeze({TEXT:"text",NUMBER:"number",RADIO:"radio",CHECKBOX:"checkbox",SELECT:"select"}),Ie=class{constructor(e){if(e.id&&(this.id=e.id),e.name&&(this.name=e.name),e.type)switch(e.type){case"text":this.type=ye.TEXT;break;case"checkbox":this.type=ye.CHECKBOX;break;case"number":this.type=ye.NUMBER;break;case"radio":this.type=ye.RADIO;break;case"select":this.type=ye.SELECT}e.required&&(this.required=e.required),e.sendToCustomer&&(this.sendToCustomer=e.sendToCustomer)}},ge=class{constructor(e){if(e.inAppId&&(this.inAppId=e.inAppId),e.formId&&(this.formId=e.formId),e.inappVersion&&(this.inappVersion=e.inappVersion),e.inputs&&Array.isArray(e.inputs)){this.inputs=[];for(let t=0;t<e.inputs.length;t++)this.inputs.push(new Ie(e.inputs[t]))}}},me=class{static checkFieldsForm(e,t,n){const i=[];if(t&&e.inputs&&e.inputs.length>0)for(let n=0;n<e.inputs.length;n++){const r=this.checkInputType(e.inputs[n],t);null!=r&&i.push(r)}if(i.length>0)return i;t&&0!==Object.keys(t).length&&C.sendEventForm(e.inAppId,e.inappVersion,t),n&&0!==Object.keys(n).length&&C.sendEventFormToCustomer(n)}static checkInputType(e,t){if(null!=e.id)switch(e.type){case ye.TEXT:if(e.required)return!t[e.id]||t[e.id]instanceof String?X.showError(d,2121,e.id):X.showError(d,2120,`The field ${e.id} is not text`);break;case ye.NUMBER:if(e.required){if(!t[e.id])return X.showError(d,2121,e.id);{const n=t[e.id];if(null==n||isNaN(Number(n)))return X.showError(d,2120,`The field ${e.id} is not number`)}}break;default:if(e.required&&t[e.id]&&""==t[e.id])return X.showError(d,2121,e.id)}return null}static editingFormHtml(e,t){return e.replaceAll("InAppIndigitall.onClick",`inAppIndigitallOnClick_${t}`).replaceAll("InAppIndigitall.submit",`inAppIndigitallSubmit_${t}`).replaceAll("plusSlides",`plusSlides_${t}`).replaceAll("indCOImages",`indCOImages_${t}`).replaceAll("ind_carouselOverlapLeftView",`ind_carouselOverlapLeftView_${t}`).replaceAll("ind_carouselOverlapLRightView",`ind_carouselOverlapLRightView_${t}`).replaceAll("ind_carouselOverlapLMainView",`ind_carouselOverlapLMainView_${t}`).replaceAll("ind_carouselOverlapContainer",`ind_carouselOverlapContainer_${t}`).replaceAll("setImagesCarouselOverLap",`setImagesCarouselOverLap_${t}`).replaceAll("shiftRight",`shiftRight_${t}`).replaceAll("shiftLeft",`shiftLeft_${t}`).replaceAll("currentSlide",`currentSlide_${t}`).replaceAll("setNewInterval",`setNewInterval_${t}`).replaceAll("newSlide",`newSlide_${t}`).replaceAll("showSlides",`showSlides_${t}`)}},{Log:_e}=n(315).Core.Utils,ve=class{static async onClick(e){const t=new _e("[IND]InAppIndigitallInterface: ");if(e){const n=JSON.parse(e);let i,r,o=new _;if(n.inAppId&&(i=n.inAppId),n.inappId&&(i=n.inappId),n.schema){let e=n.schema;o.code=e}if(o.code&&i){let e=new v({inAppId:i,schema:o});t.i("searching inApp with inAppId and schema",i,o).writeLog(),r=await I.searchInAppWithInApp(e)}else i&&(r=await I.searchInAppWithInAppId(i));if(r&&n.action){const e=new v(r),t=new h(n.action);if(e.properties.setAction(t),Y.onClickAction(t),e){Y.addNewInAppClick(e);const n=new CustomEvent("didClicked",{detail:{action:t},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(n)}}else console.log(`InApp ${n.schema} not found`)}else console.log("InApp action is empty")}static submit(e,t,n){if(e){const i=new ge(JSON.parse(e));if(t){const e=me.checkFieldsForm(i,JSON.parse(t),JSON.parse(n));if(e&&e.length>0){const t=new CustomEvent("didFormError",{detail:{errorList:e},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(t)}else{const e=new CustomEvent("didFormSubmit",{detail:{jsonForm:JSON.parse(t)},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(e)}}}}},{Log:Se,CommonUtils:Te}=n(315).Core.Utils,be="[IND]ShowInAppUtils: ";class Oe{static async inAppWasGot(e,t,n,i,r,o,s,a,u){const c=m.inAppWasCached(e),l=(new Date).getTime(),f=new Se(be);if(null!=c){const e=new v(c),r=new Date(e.expiredDate).getTime();if(f.d(`InApp ${e.inAppId} ${e.schema.code} cache reload on: ${new Date(r).toLocaleString()}`).writeLog(),l<r){const n=await I.searchInAppWithInApp(e),r=this.wasInAppPassedFilterProperties(n);null!=r?this.setErrorFilter(n,r,o,s,a):Te.isFunction(i)&&i(n||e,t)}else Te.isFunction(n)&&n(e,X.showError(d,d.ErrorCode.INAPP_WAS_EXPIRED)),f.d(`InApp ${e.inAppId}: ${d.ErrorMessage.INAPP_WAS_EXPIRED}`).writeLog(),m.deleteInAppFromCache(e),Oe.updateInAppGet(e.schema.code,o,s,a,e=>{Te.isFunction(i)&&i(e,t)},e=>{Te.isFunction(u)&&u(e)})}else Te.isFunction(r)&&r(e,t)}static wasInAppPassedFilterProperties(e){const t=new Se(be);if(e&&e.properties){if(e.properties.dismissForever&&e.inAppShow.wasDismissed)return d.ErrorCode.INAPP_WAS_DISMISSED_FOREVER;{e.properties.dismissForever&&Y.addNewInApptoDismissForever(e);const n=e.properties.numberOfShows,i=e.inAppShow?e.inAppShow.timesShowed:null,r=e.properties.numberOfClicks,o=e.inAppShow?e.inAppShow.timesClicked:null;if(n>0){if(!(null!=i&&i<n))return d.ErrorCode.INAPP_WAS_SHOWN_MANY_TIMES;t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was shown ${i+1} times and will stop showing after ${n} times`).writeLog(),I.addInAppNewShow(e)}if(r>0){if(null!=o&&o>=r)return d.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES;t.d(`inApp ${e.inAppId} ${e.profile?`with profile ${e.profile}`:"without profile"} was clicked ${o} times and will stop showing with ${r} clicks`).writeLog()}}}return null}static async updateInAppGet(e,t,n,i,r,o){Be.getInAppWithUpdate(e,!0,async e=>{let o=await I.updateInApp(e);if(o){const e=this.wasInAppPassedFilterProperties(o);if(null!=e)return void this.setErrorFilter(o,e,t,n,i)}else await Y.addNewInApp(e),o=e;m.addNewInAppToCache(o),Te.isFunction(r)&&r(o)},e=>{e.data&&e.data=={}&&200==e.statusCode?Te.isFunction(o)&&o(X.showError(d,d.ErrorCode.INAPP_CAMPAIGN_NOT_EXIST)):Te.isFunction(o)&&o(e)})}static async isInAppSaveOnDDBBAndFilters(e,t,n,i){const r=await I.searchInAppWithInApp(e);if(null!=r){let o=m.TIME_CACHE;const s=this.wasInAppPassedFilterProperties(r);return null!=s?(this.setErrorFilter(r,s,t,n,i),e.cacheTtl&&(o=1e3*r.cacheTtl),r.expiredDate=Y.getDate((new Date).getTime()+o),m.addNewInAppToCache(r),!1):(e.cacheTtl&&(o=1e3*r.cacheTtl),r.expiredDate=Y.getDate((new Date).getTime()+o),m.addNewInAppToCache(r),!0)}return await Y.addNewInApp(e),m.addNewInAppToCache(e),!0}static setErrorFilter(e,t,n,i,r){t==d.ErrorCode.INAPP_WAS_DISMISSED_FOREVER&&Te.isFunction(n)&&n(e,X.showError(d,null,d.ErrorCode.INAPP_WAS_DISMISSED_FOREVER)),t==d.ErrorCode.INAPP_WAS_SHOWN_MANY_TIMES&&Te.isFunction(i)&&i(e,X.showError(d,e.properties.numberOfShows,d.ErrorCode.INAPP_WAS_SHOWN_MANY_TIMES)),t==d.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES&&Te.isFunction(r)&&r(e,X.showError(d,e.properties.numberOfClicks,d.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES))}static async inAppWasShown(e,t,n,i,r){const o=new Se(be);e.schema.code&&this.inAppWasGot(e.schema.code,null,t,e=>{Te.isFunction(r)&&r(e)},()=>{Te.isFunction(r)&&r(e)},(e,t)=>{o.d("inAppWasShown: "+e.inAppId+" with error: "+t.errorMessage).writeLog()},n,i)}}const Pe=Oe,{BaseApplicationRequest:Ae}=n(315).Core.Api,Re=class extends Ae{constructor(){super(["inApp"])}},{EncryptionType:we}=n(315).Core.Models,{BaseApplicationRequest:Ne}=n(315).Core.Api,Ce=class extends Ne{constructor(){super(),this.PARAM_LAST_SYNC="lastSync"}getAudiences(){return this.params=this.createQueryString(),this}createQueryString(){const e=[];if(o.getDeviceId()&&e.push(`${this.PARAM_DEVICE_ID}=${o.getDeviceId()}`),o.getAudienceLastUpdate()&&e.push(`${this.PARAM_LAST_SYNC}=${encodeURIComponent(o.getAudienceLastUpdate())}`),u.isValidFieldFormat(o.getExternalId())){let t=o.getExternalId();!0!==o.isAvoidCypher()&&o.getEncryptionType()!=we.RAW||(t=encodeURIComponent(t)),e.push(`${this.PARAM_EXTERNAL_CODE}=${t}`)}return e.join("&")}},{CommonUtils:De,LogLevel:Le,Log:Me}=n(315).Core.Utils;class Ue{constructor(){this.LogLevel=Le,this.inAppIndigitallInterface=ve}static async init(e,t,n){null!=e.appKey&&await o.setAppKey(e.appKey),e.urlInAppApi&&o.setUrlInappApi(e.urlInAppApi),o.setAvoidCypher(!!e.avoidCypher),o.setAvoidAction(!!e.avoidAction),e.logLevel&&o.setLogLevel(e.logLevel),!0===e.requestLocation&&Y.registerLocation(),o.setInAppProfile(""),e.profile&&o.setInAppProfile(e.profile),o.setTimeoutRequestsInMilliseconds(0),e.timeoutRequestsInMilliseconds&&o.setTimeoutRequestsInMilliseconds(e.timeoutRequestsInMilliseconds),o.setTimeSlideForCarousel(e.timeSlideForCarousel?e.timeSlideForCarousel:Ee.INAPP_TIME_SLIDE_CAROUSEL),se.getApplicationWithInAppChannel(new Re,e=>{H.isAudienceCacheFinish()?se.getAudiences(new Ce,n=>{H.saveAudienceCache(e.audienceCacheDeviceTtl),De.isFunction(t)&&t(e)},i=>{const r=new Me("[IND]InAppIndigitall: .init: getApplicationWithInAppChannel");i&&i.errorMessage&&r.e(i.exceptionMessage).writeLog(),De.isFunction(n)&&n(i),De.isFunction(t)&&t(e)}):De.isFunction(t)&&t(e)},n)}static async showInApp(e,t,n,i){const r={appKey:o.getAppKey(),urlInAppApi:"https://device-api.indigitall.com/v2",requestLocation:!0,logLevel:Le.DEBUG,inAppCode:e,viewId:t};this.showInAppWithConfig(r,null,null,null,null,null,null,n,i,null,null)}static async showInAppWithCallback(e,t={}){const n=["onShowTimeFinished","didExpired","didShowManyTimes","didClickOut","didDismissForever","didClicked","success","error","didFormError","didFormSubmit"].map(e=>(...n)=>{"function"==typeof t[e]&&t[e](...n)});return this.showInAppWithConfig(e,...n)}static async showInAppWithConfig(e,t,n,i,r,o,s,a,c,l,f){await this.init(e,n=>{u.isAppKeyFormat()?Pe.inAppWasGot(e.inAppCode,e.viewId,null,async(e,n)=>{e&&e.properties&&this.createInApp(e,n,s,a,c,t,l,f)},(e,n)=>{this.drawInApp(e,n,t,s,a,c,l,f,o,i,r)},o,i,r,c):De.isFunction(c)&&c(X.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))},c)}static showMultipleInApp(e,t,n,i){const r={appKey:o.getAppKey(),urlInAppApi:"https://device-api.indigitall.com/v2",requestLocation:!0,logLevel:Le.DEBUG,inAppCodeList:e,divList:t};this.showMultipleInAppWithConfig(r,null,null,null,null,null,null,n,i,null,null)}static async showMultipleInAppWithCallback(e,t={}){const n=["onShowTimeFinished","didExpired","didShowManyTimes","didClickOut","didDismissForever","didClicked","success","error","didFormError","didFormSubmit"].map(e=>(...n)=>{"function"==typeof t[e]&&t[e](...n)});return this.showMultipleInAppWithConfig(e,...n)}static async showMultipleInAppWithConfig(e,t,n,i,r,o,s,a,c,l,f){await this.init(e,n=>{if(u.isAppKeyFormat()){if(e.inAppCodeList.length==e.divList.length&&e.inAppCodeList.length>0)for(var h=0;h<e.inAppCodeList.length;h++)Pe.inAppWasGot(e.inAppCodeList[h],e.divList[h],null,async(e,n)=>{e&&e.properties&&this.createInApp(e,n,s,a,c,t,l,f)},(e,n)=>{Ue.drawInApp(e,n,t,s,a,c,l,f,o,i,r)},o,i,r)}else De.isFunction(c)&&c(X.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))},c)}static async drawInApp(e,t,n,i,r,o,s,a,u,c,l){this.getInApp(e,async e=>{e&&e.properties&&await Pe.isInAppSaveOnDDBBAndFilters(e,u,c,l)&&this.createInApp(e,t,i,r,o,n,s,a)},o)}static async createInApp(e,t,n,i,r,o,s,a){if(e&&e.properties&&e.properties.contentUrl)try{const r=document.getElementById(t);if(r){r.style.position="relative",r.style.overflow="hidden";const u=await fetch(e.properties.contentUrl);let c=await u.text();null!=e.customData&&Object.keys(e.customData).forEach(function(t){c=c.replaceAll(`{{${t}}}`,e.customData[t])}),e.version&&(c=c.replaceAll("'inappVersion':'{{version}}'","'inappVersion':"+e.version));const l=t.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]/gi,""),f=me.editingFormHtml(c,l);if(r.innerHTML=f,"undefined"===document.getElementById(`script_${l}`)||null===document.getElementById(`script_${l}`)){const e=document.createElement("script");e.id=`script_${l}`,e.type="text/javascript",e.innerHTML=new Ee(t,l).script,r.appendChild(e)}if(e._eventListeners||(e._eventListeners={}),e._eventListeners.didClicked&&self.removeEventListener("didClicked",e._eventListeners.didClicked),e._eventListeners.didFormError&&self.removeEventListener("didFormError",e._eventListeners.didFormError),e._eventListeners.didFormSubmit&&self.removeEventListener("didFormSubmit",e._eventListeners.didFormSubmit),e._eventListeners.didClicked=function(t){n&&n(e,t?.detail?.action)},e._eventListeners.didFormError=function(t){s&&s(e,t?.detail?.errorList)},e._eventListeners.didFormSubmit=function(t){const n=t?.detail?.jsonForm;a&&a(e,n)},self.addEventListener("didClicked",e._eventListeners.didClicked),self.addEventListener("didFormError",e._eventListeners.didFormError),self.addEventListener("didFormSubmit",e._eventListeners.didFormSubmit),e.properties.showTime){let t=0;const n=setInterval(function(){t++,t==parseInt(e.properties.showTime)&&(r.style.display="none",clearInterval(n),De.isFunction(o)&&o(e,r,1e3*e.properties.showTime))},1e3)}if(e.properties.layout&&e.properties.layout.borderRadius){const t=`${parseInt(e.properties.layout.borderRadius)}px`;r.style.borderRadius=t}De.isFunction(i)&&i(e,r),C.sendEventPrint(e)}}catch(n){let i=null;e&&e.schema&&e.schema.code&&(i=e.schema.code),De.isFunction(r)&&r(n,t,i)}}private;static topicsList(e,t){return fe.listTopics(e,t),!0}static topicsListFromConsole(e,n,i){let r=20;return e&&(e.limit>20&&(r=e.limit),e.urlInAppApi&&o.setUrlInappApi(e.urlInAppApi),e.appKey&&!o.getAppKey()&&o.setAppKey(e.appKey)),o.setInAppTopicPageLimit(r),se.getInAppTopicsFromConsole(new t,n,i),!0}static topicsSubscribe(e,t,n){fe.saveTopics(e,t,n)}static topicsUnsubscribe(e,t,n){fe.deleteTopics(e,t,n)}static topicsUnsubscribeAll(e,t){fe.deleteAllTopics(e,t)}static inAppGet(e,t,n){this.getInApp(e,t,n)}static getInApp(e,t,n){this.getInAppWithUpdate(e,!1,t,n)}static getInAppWithUpdate(e,t,n,i){if(u.isAppKeyFormat()){const r=new pe;r.setTag(e),r.setUpdateInApp(t),r.setIgnoreInAppIds(e),se.getCampaignTag(r,n,i)}else De.isFunction(i)&&i(X.showError(d,d.ErrorCode.BAD_REQUEST_SERVER_ERROR))}static addNewInAppToDismissForever(e){Y.addNewInApptoDismissForever(e)}static async isInAppDismissForever(e){await Y.isInAppDismissForever(e)}static async inAppOnClick(e){await ve.onClick(e)}static async inAppSubmit(e,t,n){ve.submit(e,t,n)}static async inAppWasShown(e,t,n,i,r){Pe.inAppWasShown(e,t,n,i,r)}static async downloadHTML(e){const t=await fetch(e,{method:"GET"});console.log(t)}static async setExternalCode(e,t,n){try{const n=await Y.setExternalCode(e);t&&t(n)}catch(e){n&&n(e)}}static async logIn(e,t,n){await this.setExternalCode(e,t,n)}static async logOut(e,t){await this.setExternalCode(null,e,t)}}const Be=Ue;window.indigitall||(window.indigitall={}),window.indigitall.InApp=Ue,window.indigitall.InApp.version=o.getVersion(),window.indigitall.InApp.Utils=Y,window.indigitall.LogLevel=Le})(),i})(),e.exports=t()},326(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(126));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},114(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.17.0","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{default:()=>K});var r={};n.r(r),n.d(r,{BaseApplicationRequest:()=>P,BaseClient:()=>b,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>L,TopicSubscribeType:()=>M});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>Y,DateUtils:()=>R,ErrorUtils:()=>T,JsonUtils:()=>x,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>W,Validations:()=>G});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.removeItem(e),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const i=n.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){const t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,i)=>{e||i(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),i(!1)}})}async put(e,t,n){return new Promise((i,r)=>{e||r(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),i(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){console.log("getExternalIdRequest Repository",e)}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){console.log("getInAppTopicList Repository",e)}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){console.log("getTopicList Repository",e)}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){console.log("getUrlDeviceApi Repository",e)}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+=`${arguments[0].errorCode}: ${arguments[0].errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},T=new class{constructor(){}showError(e,t,n){if(null!=e){const i=Object.values(e.ErrorCode).indexOf(t);if(i>=0){const t=Object.keys(e.ErrorCode)[i],r=Object.values(e.ErrorCode)[i];return new v({code:t,errorId:r},Object.values(e.ErrorMessage)[i],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},b=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,i){const r=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&r.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),i&&(s.credentials=i);try{const t=new AbortController;let i;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(i=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(i&&clearTimeout(i),304!=a.status){const t=await a.json();return a.ok?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))):null}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),L=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),M=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let i=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,i=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):i=new Date(Date.now()+36e5),!t){const e=i.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let i=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+i+" to "+n.state).writeLog(),i=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",Y=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const i=window?.crypto?.subtle;if(!i)return;const r=await i.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await i.sign(j,r,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}};class F{static compareJSON(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const i of n)if(e[i]!==t[i]){if("object"!=typeof e[i]||"object"!=typeof t[i])return!1;if(!F.compareJSON(e[i],t[i]))return!1}return!0}}const x=F,G=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},W=class{static setTopicChannel(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];r.channel=t,n.push(r)}return n}},K={Repository:y,Config:c,Api:r,Models:o,Utils:s};return i})(),e.exports=t()},315(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,r,o={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(r.get||r.set)?n(o,s,r):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(n(254)),r=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(d(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,r,"GeneratorFunction"),d(h),d(h,r,"Generator"),d(h,i,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}d=function(e,t,n,i){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,i)}function h(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){h(o,i,r,s,a,"next",e)}function a(e){h(o,i,r,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,T;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new i.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new r.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(T=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,T));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,T));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,i){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return r.default}});var i=a(n(468)),r=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var r;function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((r=n(237))&&r.__esModule?r:{default:r}).default);t.default=f},943(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(i=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(r.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new r.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={platform:"webpush",version:"0.0.1"},r=n(904);i.version=r.version,i=Object.assign(i,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=i},610(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:r.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var l=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=new r.default;if(null!=t){i.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,i.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,i.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),i.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),i.setEncryptionType(this.encryptionType)}});t.default=l},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new r.default).getBrowserPublicKey(),this.browserPrivateKey=(new r.default).getBrowserPrivateKey(),this.platform=(new r.default).getPlatform(),this.version=(new r.default).getVersion(),this.browserName=(new r.default).getBrowserName(),this.browserVersion=(new r.default).getBrowserVersion(),this.osName=(new r.default).getOsName(),this.osVersion=(new r.default).getOsVersion(),this.deviceId=(new r.default).getDeviceId(),this.deviceType=(new r.default).getDeviceType(),(new r.default).getEnabled()&&(this.enabled="true"===(new r.default).getEnabled()),(new r.default).getExternalId()&&(this.externalCode=(new r.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new r.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new r.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=n},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=i&&(this.exceptionMessage=i)});t.default=o},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return i.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var i=n(902),r=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,i,o,s){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return r(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(r(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,r(h,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(h),r(h,s,"Generator"),r(h,o,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:p}})()}function r(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}r=function(e,t,n,i){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,i)}function o(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function a(e){o(s,i,r,a,u,"next",e)}function u(e){o(s,i,r,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB},t=[{key:"getDB",value:(c=s(i().m(function e(){var t=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var i=t.IDB;if(i){var r=i.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){var t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(i().m(function e(t,n){var r=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(r.close(t),e(n.target.result.store.value)),i(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(i().m(function e(t,n,r){var o=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.store.put({store:{key:n,value:r}},n).onsuccess=function(n){o.close(t),e(r)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(r=s(i().m(function e(t,n){var r,o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return r=e.v,e.a(2,this.put(r,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return r.apply(this,arguments)})},{key:"getItem",value:(n=s(i().m(function e(t){var n,r;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,r=e.v,e.a(2,r)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.removeItem(e),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(n(122)),r=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,r,"GeneratorFunction"),f(h),f(h,r,"Generator"),f(h,i,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function d(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){d(o,i,r,s,a,"next",e)}function a(e){d(o,i,r,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,E(i.key),i)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=r.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){r.default.setItem(e,t)}},{key:"getStorage",value:function(e){return r.default.getItem(e)}},{key:"clearStorage",value:function(){r.default.clear()}},{key:"setBrowserPublicKey",value:function(e){r.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return r.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){r.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return r.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return r.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(b=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return b.apply(this,arguments)})},{key:"setVAPID",value:function(e){r.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return r.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){r.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return r.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){r.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return r.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){r.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return r.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){r.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return r.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(T=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return T.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!r.default&&r.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return r.default&&r.default.getItem(this.PLATFORM)||i.default.platform}},{key:"getVersion",value:function(){return i.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return r.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){r.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return r.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return r.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){r.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return r.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){r.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return r.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){r.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return r.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){r.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return r.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){r.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return r.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){r.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return r.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){r.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==r.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){r.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return r.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){r.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return r.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default&&r.default.isLocalStorageAvailable()&&r.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!r.default||!r.default.isLocalStorageAvailable()){e.n=1;break}t=r.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getExternalIdRequest Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){r.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return r.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,r.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){r.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return r.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){r.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return r.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getInAppTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getUrlDeviceApi Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,T,b,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new i.default).getServiceTimestamp()||(new i.default).getServiceSyncTime()<=(Date.now()-(new i.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new r.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})):null}}],t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(254))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var s=i&&i.prototype instanceof c?i:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(a(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,r,"GeneratorFunction"),a(h),a(h,r,"Generator"),a(h,i,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}a=function(e,t,n,i){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,i)}function u(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){u(o,i,r,s,a,"next",e)}function a(e){u(o,i,r,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(i=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var i,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(i=e.v)&&(o=i.state,"onchange"in i&&(i.onchange=function(){new r.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+i.state).writeLog(),o=i.state,n&&n({name:t,state:i.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,i}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var i=n(225),r=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,r,"GeneratorFunction"),u(h),u(h,r,"Generator"),u(h,i,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}u=function(e,t,n,i){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,i)}function c(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new r.default).isAvoidCypher()&&(new r.default).getEncryptionType()!==i.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new r.default).getEncryptionType()!==i.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(e){c(o,i,r,s,a,"next",e)}function a(e){c(o,i,r,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var i=this.tryToParseLeniently(n);return i?this.formatCanonicalUTC(i):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=i(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=this.parseByFormat(e,r);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(735)),r=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new r.default(s,Object.values(e.ErrorMessage)[o],n)}return new r.default(i.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"compareJSON",value:function(t,i){var r=Object.keys(t),o=Object.keys(i);if(r.length!==o.length)return!1;for(var s=0,a=r;s<a.length;s++){var u=a[s];if(t[u]!==i[u]){if("object"!=n(t[u])||"object"!=n(i[u]))return!1;if(!e.compareJSON(t[u],i[u]))return!1}}return!0}}],r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=r.default.INFO,this.setLogLevel((new i.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=r.default.DEBUG&&e<=r.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=r.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=r.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=r.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=r.default.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+="".concat(arguments[0].errorCode,": ").concat(arguments[0].errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i];r.channel=t,n.push(r)}return n}}],t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var i=h(n(622)),r=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.17.0","_id":"indigitall-web-core@4.17.0","_inBundle":false,"_integrity":"sha512-n86QFX154ZqEM49DQjVaKpqpFiEaNh2Hl26sYLJs/N+OplMmVeAW6SfLEWJtT41xzfr5Qv2+bsXbSI/z6PFiiA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.17.0","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.17.0","saveSpec":null,"fetchSpec":"4.17.0"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.17.0.tgz","_shasum":"17ad86c6550dd166e07cc8980942fc4cae87a41c","_spec":"indigitall-web-core@4.17.0","_where":"/home/circleci/webpush/inbox","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.17.0"}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{default:()=>L});const{Repository:e}=n(315).Core,t=new class extends e{constructor(){super(),this.AUTH_TOKEN=this.REPOSITORY+".AUTH_TOKEN",this.INBOX_AUTH_MODE=this.REPOSITORY+".INBOX_AUTH_MODE",this.URL_INBOX_API=this.REPOSITORY+".URL_INBOX_API"}async setDeviceId(e){this.setStorage(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}setAuthToken(e){this.setStorage(this.AUTH_TOKEN,e)}getAuthToken(){return this.getStorage(this.AUTH_TOKEN)}setInboxAuthMode(e){this.setStorage(this.INBOX_AUTH_MODE,e)}getInboxAuthMode(){return this.getStorage(this.INBOX_AUTH_MODE)}async getUrlInboxApi(){return this.getStorage(this.URL_INBOX_API)}async setUrlInboxApi(e){this.setStorage(this.URL_INBOX_API,e)}};class r{constructor(e,t){e&&(e.id&&(this.id=e.id),e.externalId&&(this.externalId=e.externalId),e.sentAt&&(this.sentAt=e.sentAt),e.status&&(this.status=e.status),e.sendingId&&(this.sendingId=e.sendingId),e.message&&(this.message=e.message),e.campaignId&&(this.campaignId=e.campaignId),this.read=!1,this.sentAt&&t&&this.sentAt<t&&(this.read=!0))}}window.inboxNotification=r;const o=r,{BaseClient:s}=n(315).Core.Api,{Config:a}=n(315).Core,{ErrorModel:u}=n(315).Core.Models,{CommonUtils:c}=n(315).Core.Utils,l=new class extends s{constructor(){super(),this.URL_BASE=a.client.INBOX_URL_BASE,this.ENDPOINT_INBOX_NOTIFICATIONS="/notification",this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID=this.ENDPOINT_INBOX_NOTIFICATIONS+"/{sendingId}",this.ENDPOINT_INBOX_COUNTER="/counters",this.ENDPOINT_INBOX_AUTH="/auth/webhook"}async getURL(){return await t.getUrlInboxApi()||this.URL_BASE}async postInboxAuth(e,n,i){const r=await this.post(this.ENDPOINT_INBOX_AUTH,e.postInboxAuth());if(!r||r instanceof u||!r.data)r?c.isFunction(i)&&i(r):c.isFunction(i)&&i();else{const e=r.data.token;t.setAuthToken(e),c.isFunction(n)&&n(r)}return!0}async getInbox(e,t,n){const i=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS,e.getInboxPushRequest());return this.getInboxResponseStatus(i,t,n),!0}async putInboxPush(e,t,n){const i=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS,e.putInboxPushRequest());return this.getInboxResponseEdit(i,t,n),!0}async getInboxPushWithSendingId(e,t,n,i){const r=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,e.getInboxPushRequestWithSendingId());return this.getNotificationResponseStatus(r,t,n,i),!0}async putInboxPushWithSendingId(e,t,n,i){const r=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,e.putInboxWithSendingId());return this.getNotificationResponseStatus(r,t,n,i),!0}async getInboxCounter(e,t,n){const i=await this.get(this.ENDPOINT_INBOX_COUNTER,e.getCounter());this.getCounterStatus(i,t,n)}async getInboxResponseStatus(e,t,n){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const n=new L(e.data);c.isFunction(t)&&t(n)}else e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}async getInboxResponseEdit(e,t,n){e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300?c.isFunction(t)&&t():e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}getNotifications(e,t){const n=[];for(let i=0;i<e.length;i++){const r=new o(e[i],t);n.push(r)}return n}async getNotificationResponseStatus(e,t,n,i){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const i=new o(e.data,t);c.isFunction(n)&&n(i)}else e?c.isFunction(i)&&i(e):c.isFunction(i)&&i()}async getCounterStatus(e,t,n){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const n={click:e.data.click,sent:e.data.sent,deleted:e.data.deleted,unread:this.getUnreadCounters(e.data.unread)};c.isFunction(t)&&t(n)}else e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}getUnreadCounters(e){return{count:e.count,lastAccess:e.lastAccess}}},{BaseRequest:f}=n(315).Core.Api,d=class extends f{constructor(){super()}postInboxAuth(){return this.body=this.json,this}setJson(e){this.json=e}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}},h=Object.freeze({SENT:"sent",CLICK:"click",DELETED:"deleted"});window.inboxStatus=h;const p=h,E=Object.freeze({NONE:"none",DEFAULT:"default",WEBHOOK:"webhook"}),{BaseRequest:y}=n(315).Core.Api,{EncryptionType:I}=n(315).Core.Models,g=class extends y{constructor(){super(),this.externalId=null,this.headers={},t.getExternalId()&&(this.externalId=t.getExternalId(),!0!==t.isAvoidCypher()&&t.getEncryptionType()!=I.RAW||(this.externalId=encodeURIComponent(t.getExternalId()))),null!=t.getAuthToken()&&t.getInboxAuthMode()==E.WEBHOOK&&(this.headers.Authorization="Bearer "+t.getAuthToken()),this.sendingId="",this.sendingIds=null,this.page=0,this.pageSize=0,this.dateFrom="",this.dateTo="",this.status=p.INBOXSTATUS_SENT,this.initialStatus=p.INBOXSTATUS_SENT,this.statusList=null}getInboxPushRequest(){return this.params=this.createQueryString(),this}putInboxPushRequest(){return this.params=this.createQueryStringExternalId(),this.body=this.createBodyJson(),this}getInboxPushRequestWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this}putInboxWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this.body=this.createBodyStatusJson(),this}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}createQueryString(){let e="";if(this.page&&(e+=this.PARAM_INBOX_PAGE+"="+this.page+"&"),this.pageSize&&(e+=this.PARAM_INBOX_PAGE_SIZE+"="+this.pageSize+"&"),this.dateFrom&&(e+=this.PARAM_INBOX_DATE_FROM+"="+this.dateFrom+"&"),this.dateTo&&(e+=this.PARAM_INBOX_DATE_TO+"="+this.dateTo+"&"),this.statusList){let t="";for(let e=0;e<this.statusList.length;e++)t+=this.statusList[e],e!=this.statusList.length-1&&(t+=",");e+=this.PARAM_INBOX_STATUS+"="+t+"&"}return e+this.createQueryStringExternalId()}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}createBodyJson(){let e={};const t=[];try{if(e=this.createBodyStatusJson(),null!=this.sendingIds){for(let e=0;e<this.sendingIds.length;e++)t.push(this.sendingIds[e]);e.sendingIds=t}}catch(e){console.log("Error Inbox request :"+e)}return e}createBodyStatusJson(){const e={};return this.status&&(e.status=this.status),this.initialStatus&&(e.initialStatus=this.initialStatus),e}setSendingId(e){this.sendingId=e}setSendingIds(e){this.sendingIds=e}setPage(e){this.page=e}setPageSize(e){this.pageSize=e}setDateFrom(e){this.dateFrom=e}setDateTo(e){this.dateTo=e}setStatus(e){this.status=e}setInitialStatus(e){this.initialStatus=e}setStatusList(e){this.statusList=e}},{BaseRequest:m}=n(315).Core.Api,{EncryptionType:_}=n(315).Core.Models,v=class extends m{constructor(){super(),this.externalId=null,this.headers={},t.getExternalId()&&(this.externalId=t.getExternalId(),!0!==t.isAvoidCypher()&&t.getEncryptionType()!=_.RAW||(this.externalId=encodeURIComponent(t.getExternalId()))),null!=t.getAuthToken()&&t.getInboxAuthMode()==E.WEBHOOK&&(this.headers.Authorization="Bearer "+t.getAuthToken())}getCounter(){return this.params=this.createQueryStringExternalId(),this}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}},{ErrorDictionary:S}=n(315).Core.Models,T=S.ErrorCode;Object.assign(T,{INBOX_GET_ERROR:3001,INBOX_GET_PAGE_ERROR:3011,INBOX_EXTERNAL_ID_NO_REGISTERED:3012,INBOX_NO_MESSAGES:3013,INBOX_IS_REQUESTING_PAGE:3014,INBOX_EMPTY:3015,INBOX_GENERAL_ERROR:3600});const b=S.ErrorMessage;Object.assign(b,{INBOX_GET_ERROR:"inbox GET request error",INBOX_GET_PAGE_ERROR:"error inbox get page",INBOX_EXTERNAL_ID_NO_REGISTERED:"external Id is not registered",INBOX_NO_MESSAGES:"There are no more messages on Inbox",INBOX_IS_REQUESTING_PAGE:"Wait. Is Requesting new page",INBOX_EMPTY:"There are no messages on Inbox",INBOX_GENERAL_ERROR:"general error"});const O={ErrorCode:T,ErrorMessage:b},{Validations:P,Log:A}=n(315).Core.Utils,R=class extends P{static isAppKeyFormat(){const e=t.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFormatRequest(){const e=new A("[IND]InboxValidations: "),n=t.getDeviceId();let i=!0;return this.isAppKeyFormat()||(i=!1,e.w("appKey is null or empty").writeLog()),this.isValidFormat(n)||(i=!1,e.w("deviceId is null or empty").writeLog()),i}},{CommonUtils:w,ErrorUtils:N,Log:C}=n(315).Core.Utils;class D{constructor(e){if(e){if(e.lastAccess&&(this.lastAccess=e.lastAccess),e.numPage?this.page=e.numPage:this.page=0,e.pageSize&&(this.pageSize=e.pageSize),this.count=0,e.count&&(this.count=e.count),e.notifications){this.notifications=[];const t=e.notifications;for(let e=0;e<t.length;e++){const n=new o(t[e],this.lastAccess);this.notifications.push(n)}}this.totalPages=Math.trunc(this.count/this.pageSize)}this.dateFrom=null,this.dateTo=null,this.statusList=null,this.newNotifications=[o],this.isRequestingPage=!1}static generateAuthToken(e,t){let n={};navigator.indigitallGetAuthConfig&&w.isFunction(navigator.indigitallGetAuthConfig)&&(n=navigator.indigitallGetAuthConfig());const i=new d;i.setJson(n),l.postInboxAuth(i,e,t)}static getMessagesCountWithAuth(e,t,n){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getMessagesCount(t,n)}static setUrlInboxApi(e){t.setUrlInboxApi(e)}static setInboxAuthMode(e){t.setInboxAuthMode(e)}static getMessagesCount(e,n){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new v;l.getInboxCounter(t,e,n=>{401===n.errorCode?this.generateAuthToken(()=>{l.getInboxCounter(t,e,n)},n):w.isFunction(n)&&n(n)})}else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_GET_ERROR));else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}static getInboxWithAuth(e,t,n){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getInbox(t,n)}static getInbox(e,t){D.getInboxWithPage(null,null,null,null,null,e,t)}static getInboxWithPageAuth(e,t,n,i,r,o,s,a){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getInboxWithPage(t,n,i,r,o,s,a)}static getInboxWithPage(e,n,i,r,o,s,a){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new g;e&&t.setPage(e),n&&t.setPageSize(n),i&&(t.setDateFrom(i),this.dateFrom=i),r&&(t.setDateTo(r),this.dateTo=r),o&&(t.setStatusList(o),this.statusList=o),l.getInbox(t,e=>{this.totalPages=e.totalPages,0!==e.count?w.isFunction(s)&&s(e):w.isFunction(a)&&a(N.showError(O,O.ErrorCode.INBOX_GET_PAGE_ERROR))},e=>{401==e.errorCode?this.generateAuthToken(()=>{l.getInbox(t,e=>{this.totalPages=e.totalPages,w.isFunction(s)&&s(e)},e)},e):w.isFunction(e)&&e(e)})}else w.isFunction(a)&&a(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(a)&&a(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}getNextPage(e,n){const i=new C("[IND]Inbox: ");if(this.isRequestingPage)i.w(O.ErrorMessage.INBOX_IS_REQUESTING_PAGE).writeLog();else if(this.isRequestingPage=!0,this.page+1<this.totalPages)if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new g;(this.page||0==this.page)&&t.setPage(this.page+1),this.pageSize&&t.setPageSize(this.pageSize),this.dateFrom&&t.setDateFrom(this.dateFrom),this.dateTo&&t.setDateTo(this.dateTo),this.statusList&&t.setStatusList(this.statusList),l.getInbox(t,t=>{this.notifications=this.notifications.concat(t.notifications),this.newNotifications=t.notifications,this.lastAccess=t.lastAccess,this.count=t.count,this.page=t.page,this.pageSize=t.pageSize,this.totalPages=t.totalPages,this.isRequestingPage=!1,w.isFunction(e)&&e(this,this.newNotifications)},n=>{401===n.errorCode?this.generateAuthToken(()=>{l.getInbox(t,t=>{this.notifications=this.notifications.concat(t.notifications),this.newNotifications=t.notifications,this.lastAccess=t.lastAccess,this.count=t.count,this.page=t.page,this.pageSize=t.pageSize,this.totalPages=t.totalPages,this.isRequestingPage=!1,w.isFunction(e)&&e(this,this.newNotifications)},n)},n):(this.isRequestingPage=!1,w.isFunction(n)&&n())})}else this.isRequestingPage=!1,w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else this.isRequestingPage=!1,w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_NO_MESSAGES))}massiveEditNotifications(e,t,n,i){let r=p.SENT;t==p.CLICK&&(r=p.SENT),t==p.DELETED&&(r=p.CLICK),this.massiveEditNotifications(e,r,t,n,i)}massiveEditNotificationsWithInitialStatus(e,n,i,r,o){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(i){const t=new g;null!=e&&t.setSendingIds(e),t.setStatus(i),t.setInitialStatus(n),l.putInboxPush(t,r,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.putInboxPush(t,r,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(o)&&o(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(o)&&o(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}getInfoFromNotification(e,n,i){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(e){const t=new g;t.setSendingId(e),l.getInboxPushWithSendingId(t,this.lastAccess,n,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.getInboxPushWithSendingId(t,this.lastAccess,n,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(i)&&i(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(i)&&i(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}modifyStatusFromNotification(e,n,i,r){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(e&&n){const t=new g;t.setSendingId(e),t.setStatus(n),l.putInboxPushWithSendingId(t,this.lastAccess,i,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.putInboxPushWithSendingId(t,this.lastAccess,i,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(r)&&r(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(r)&&r(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}}const L=D})(),i})(),e.exports=t()},824(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(114));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},603(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a}(e,t)}(n(93));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},93(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.17.0","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{default:()=>K});var r={};n.r(r),n.d(r,{BaseApplicationRequest:()=>P,BaseClient:()=>b,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>L,TopicSubscribeType:()=>M});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>Y,DateUtils:()=>R,ErrorUtils:()=>T,JsonUtils:()=>x,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>W,Validations:()=>G});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.removeItem(e),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const i=n.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){const t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,i)=>{e||i(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),i(!1)}})}async put(e,t,n){return new Promise((i,r)=>{e||r(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),i(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){console.log("getExternalIdRequest Repository",e)}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){console.log("getInAppTopicList Repository",e)}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){console.log("getTopicList Repository",e)}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){console.log("getUrlDeviceApi Repository",e)}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+=`${arguments[0].errorCode}: ${arguments[0].errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},T=new class{constructor(){}showError(e,t,n){if(null!=e){const i=Object.values(e.ErrorCode).indexOf(t);if(i>=0){const t=Object.keys(e.ErrorCode)[i],r=Object.values(e.ErrorCode)[i];return new v({code:t,errorId:r},Object.values(e.ErrorMessage)[i],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},b=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,i){const r=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&r.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),i&&(s.credentials=i);try{const t=new AbortController;let i;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(i=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(i&&clearTimeout(i),304!=a.status){const t=await a.json();return a.ok?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))):null}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),L=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),M=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let i=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,i=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):i=new Date(Date.now()+36e5),!t){const e=i.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let i=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+i+" to "+n.state).writeLog(),i=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",Y=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const i=window?.crypto?.subtle;if(!i)return;const r=await i.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await i.sign(j,r,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}};class F{static compareJSON(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const i of n)if(e[i]!==t[i]){if("object"!=typeof e[i]||"object"!=typeof t[i])return!1;if(!F.compareJSON(e[i],t[i]))return!1}return!0}}const x=F,G=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},W=class{static setTopicChannel(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];r.channel=t,n.push(r)}return n}},K={Repository:y,Config:c,Api:r,Models:o,Utils:s};return i})(),e.exports=t()},315(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,r,o={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(r.get||r.set)?n(o,s,r):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(n(254)),r=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(d(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,r,"GeneratorFunction"),d(h),d(h,r,"Generator"),d(h,i,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}d=function(e,t,n,i){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,i)}function h(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){h(o,i,r,s,a,"next",e)}function a(e){h(o,i,r,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,T;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new i.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new r.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(T=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,T));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,T));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,i){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return r.default}});var i=a(n(468)),r=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var r;function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function a(e,t,n){return t=c(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&l(e,t)}(t,e),function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((r=n(237))&&r.__esModule?r:{default:r}).default);t.default=f},943(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t)}return function(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&&h(e,t)}(t,e),n=t,(i=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&u(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(r.default);t.default=p},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new r.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=u},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={platform:"webpush",version:"0.0.1"},r=n(904);i.version=r.version,i=Object.assign(i,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=i},610(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:r.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(291)),o=a(n(254)),s=a(n(164));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var l=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=new r.default;if(null!=t){i.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,i.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,i.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),i.setConfigV2ServiceSyncTime(u)}this.encryptionType=s.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),i.setEncryptionType(this.encryptionType)}});t.default=l},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var u=function(e,t){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new r.default).getBrowserPublicKey(),this.browserPrivateKey=(new r.default).getBrowserPrivateKey(),this.platform=(new r.default).getPlatform(),this.version=(new r.default).getVersion(),this.browserName=(new r.default).getBrowserName(),this.browserVersion=(new r.default).getBrowserVersion(),this.osName=(new r.default).getOsName(),this.osVersion=(new r.default).getOsVersion(),this.deviceId=(new r.default).getDeviceId(),this.deviceType=(new r.default).getDeviceType(),(new r.default).getEnabled()&&(this.enabled="true"===(new r.default).getEnabled()),(new r.default).getExternalId()&&(this.externalCode=(new r.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new r.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new r.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=u},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};t.default=n},234(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=i&&(this.exceptionMessage=i)});t.default=o},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return i.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var i=n(902),r=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,i,o,s){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return r(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(r(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,r(h,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(h),r(h,s,"Generator"),r(h,o,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:p}})()}function r(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}r=function(e,t,n,i){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,i)}function o(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function a(e){o(s,i,r,a,u,"next",e)}function u(e){o(s,i,r,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB},t=[{key:"getDB",value:(c=s(i().m(function e(){var t=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var i=t.IDB;if(i){var r=i.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){var t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(i().m(function e(t,n){var r=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(r.close(t),e(n.target.result.store.value)),i(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(i().m(function e(t,n,r){var o=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.store.put({store:{key:n,value:r}},n).onsuccess=function(n){o.close(t),e(r)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(r=s(i().m(function e(t,n){var r,o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return r=e.v,e.a(2,this.put(r,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return r.apply(this,arguments)})},{key:"getItem",value:(n=s(i().m(function e(t){var n,r;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,r=e.v,e.a(2,r)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.removeItem(e),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(n(122)),r=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,r,"GeneratorFunction"),f(h),f(h,r,"Generator"),f(h,i,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function d(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){d(o,i,r,s,a,"next",e)}function a(e){d(o,i,r,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,E(i.key),i)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=r.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){r.default.setItem(e,t)}},{key:"getStorage",value:function(e){return r.default.getItem(e)}},{key:"clearStorage",value:function(){r.default.clear()}},{key:"setBrowserPublicKey",value:function(e){r.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return r.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){r.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return r.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return r.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(b=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return b.apply(this,arguments)})},{key:"setVAPID",value:function(e){r.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return r.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){r.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return r.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){r.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return r.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){r.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return r.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){r.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return r.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(T=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return T.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!r.default&&r.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return r.default&&r.default.getItem(this.PLATFORM)||i.default.platform}},{key:"getVersion",value:function(){return i.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return r.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){r.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return r.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return r.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){r.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return r.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){r.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return r.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){r.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return r.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){r.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return r.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){r.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return r.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){r.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return r.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){r.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==r.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){r.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return r.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){r.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return r.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default&&r.default.isLocalStorageAvailable()&&r.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!r.default||!r.default.isLocalStorageAvailable()){e.n=1;break}t=r.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getExternalIdRequest Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){r.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return r.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,r.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){r.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return r.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){r.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return r.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getInAppTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getUrlDeviceApi Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,T,b,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==o.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=o},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new i.default).getServiceTimestamp()||(new i.default).getServiceSyncTime()<=(Date.now()-(new i.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new r.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})):null}}],t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=c},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(254))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var s=i&&i.prototype instanceof c?i:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(a(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,r,"GeneratorFunction"),a(h),a(h,r,"Generator"),a(h,i,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}a=function(e,t,n,i){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,i)}function u(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){u(o,i,r,s,a,"next",e)}function a(e){u(o,i,r,s,a,"throw",e)}s(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var d=function(){return function(e,t,n){return n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(i=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var i,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(i=e.v)&&(o=i.state,"onchange"in i&&(i.onchange=function(){new r.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+i.state).writeLog(),o=i.state,n&&n({name:t,state:i.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,i}();t.default=d},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var i=n(225),r=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,r,"GeneratorFunction"),u(h),u(h,r,"Generator"),u(h,i,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}u=function(e,t,n,i){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,i)}function c(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var d=new(o(n(254)).default)("[IND]Crypto"),h=new TextEncoder("utf-8"),p="HMAC",E=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,f,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new r.default).isAvoidCypher()&&(new r.default).getEncryptionType()!==i.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new r.default).getEncryptionType()!==i.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",h.encode(t),{name:p,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(p,c,h.encode(n));case 4:l=e.v,f=new Uint8Array(l),o=Array.prototype.map.call(f,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),d.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,d.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(e){c(o,i,r,s,a,"next",e)}function a(e){c(o,i,r,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=E},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var i=this.tryToParseLeniently(n);return i?this.formatCanonicalUTC(i):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=i(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=this.parseByFormat(e,r);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&o(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();s(u,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),s(u,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=u},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(735)),r=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new r.default(s,Object.values(e.ErrorMessage)[o],n)}return new r.default(i.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new c},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"compareJSON",value:function(t,i){var r=Object.keys(t),o=Object.keys(i);if(r.length!==o.length)return!1;for(var s=0,a=r;s<a.length;s++){var u=a[s];if(t[u]!==i[u]){if("object"!=n(t[u])||"object"!=n(i[u]))return!1;if(!e.compareJSON(t[u],i[u]))return!1}}return!0}}],r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=r.default.INFO,this.setLogLevel((new i.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=r.default.DEBUG&&e<=r.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=r.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=r.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=r.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=r.default.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+="".concat(arguments[0].errorCode,": ").concat(arguments[0].errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i];r.channel=t,n.push(r)}return n}}],t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=o},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var i=h(n(622)),r=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},114(e){var t;t=()=>(()=>{var e={710(e){var t;t=()=>(()=>{"use strict";var e={330(e){e.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.17.0","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{default:()=>K});var r={};n.r(r),n.d(r,{BaseApplicationRequest:()=>P,BaseClient:()=>b,BaseEventRequest:()=>w,BaseRequest:()=>O});var o={};n.r(o),n.d(o,{Channel:()=>N,CoreApplication:()=>U,Device:()=>C,DeviceStatus:()=>D,EncryptionType:()=>E,ErrorDictionary:()=>S,ErrorModel:()=>v,EventType:()=>L,TopicSubscribeType:()=>M});var s={};n.r(s),n.d(s,{CommonUtils:()=>A,CorePermissions:()=>B,CryptoUtils:()=>Y,DateUtils:()=>R,ErrorUtils:()=>T,JsonUtils:()=>x,Log:()=>_,LogLevel:()=>I,TopicUtils:()=>W,Validations:()=>G});var a={platform:"webpush",version:"0.0.1"};const u=n(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==l.length}return!1}setItem(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}getItem(e){return null!=this.storage?this.storage.getItem(e):null}deleteItem(e){return!!this.storage&&(this.storage.removeItem(e),!0)}clear(){this.storage&&this.storage.clear()}},f=l,d=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB}async getDB(){return new Promise((e,t)=>{const n=this.IDB;if(n){const i=n.open("indigitall.indexedDB",1);i.onupgradeneeded=function(){i.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},i.onsuccess=function(){const t=i.result,n=t.transaction("indigitallStore","readwrite"),r=n.objectStore("indigitallStore"),o=r.index("storeIndex");e({db:t,tx:n,store:r,index:o})},i.onerror=function(e){t(e)}}else t(!1)})}async get(e,t){return new Promise((n,i)=>{e||i(!1),e.index.get(t).onsuccess=t=>{t.target.result&&(this.close(e),n(t.target.result.store.value)),i(!1)}})}async put(e,t,n){return new Promise((i,r)=>{e||r(!1),e.store.put({store:{key:t,value:n}},t).onsuccess=t=>{this.close(e),i(n)}})}close(e){if(e.tx)try{e.tx.oncomplete=()=>{e.db.close()}}catch(e){console.log(this.TAG,e)}}async setItem(e,t){try{const n=await this.getDB();return this.put(n,e,t)}catch(e){return e}}async getItem(e){try{const t=await this.getDB();return this.get(t,e)}catch(e){return e}}},h=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==h.length}return!1}getItem(e){return null!=this.session?this.session.getItem(e):null}setItem(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=h,E=Object.freeze({RAW:"raw",HASH:"hash"}),y=class{constructor(){this.storage=f,this.db=d,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(e,t){p.setItem(e,t)}getItemSessionStorage(e){return p.getItem(e)}clearSessionStorage(){p.clearMessages()}setStorage(e,t){f.setItem(e,t)}getStorage(e){return f.getItem(e)}clearStorage(){f.clear()}setBrowserPublicKey(e){f.setItem(this.BROWSER_PUBLIC_KEY,e)}getBrowserPublicKey(){return f.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(e){f.setItem(this.BROWSER_PRIVATE_KEY,e)}getBrowserPrivateKey(){return f.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(e){f.setItem(this.APP_KEY,e),d&&d.IDB&&await d.setItem(this.APP_KEY,e)}getAppKey(){return f.getItem(this.APP_KEY)}async setDeviceId(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,e),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(d&&d.IDB)return await d.getItem(this.APP_KEY)}setVAPID(e){f.setItem(this.VAPID_PUBLIC,e)}getVAPID(){return f.getItem(this.VAPID_PUBLIC)}setEnabled(e){f.setItem(this.ENABLED,e)}getEnabled(){return f.getItem(this.ENABLED)}setServiceSyncTime(e){f.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}getServiceSyncTime(){return f.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(e){f.setItem(this.LOCATION_ENABLED,e)}getLocationEnabled(){return f.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(e){f.setItem(this.LOCATION_UPDATE_MINUTES,e)}getLocationUpdateMinutes(){return f.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(e){f.setItem(this.REQUEST_LOCATION,e)}getRequestLocation(){return!!f&&f.getItem(this.REQUEST_LOCATION)}async setPlatform(e){f.setItem(this.PLATFORM,e)}getPlatform(){return f&&f.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(e){f.setItem(this.BROWSER_NAME,e)}getBrowserName(){return f.getItem(this.BROWSER_NAME)}setBrowserVersion(e){f.setItem(this.BROWSER_VERSION,e)}getBrowserVersion(){return f.getItem(this.BROWSER_VERSION)}async setOsName(e){f.setItem(this.OS_NAME,e)}getOsName(){return f.getItem(this.OS_NAME)}setOsVersion(e){f.setItem(this.OS_VERSION,e)}getOsVersion(){return f.getItem(this.OS_VERSION)}setDeviceType(e){f.setItem(this.DEVICE_TYPE,e)}getDeviceType(){return f.getItem(this.DEVICE_TYPE)}setSupported(e){f.setItem(this.SUPPORTED,e)}getSupported(){return f.getItem(this.SUPPORTED)}setServiceTimestamp(e){f.setItem(this.SERVICE_TIMESTAMP,e)}getServiceTimestamp(){return f.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(e){f.setItem(this.LOCATION_TIMESTAMP,e)}getLocationTimestamp(){return f.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(e){f.setItem(this.PERMISSION_LOCATION,e)}getPermissionLocation(){return f.getItem(this.PERMISSION_LOCATION)}setDebugLog(e){f.setItem(this.SET_LOG_DEBUG,e)}getDebugLog(){return"false"!==f.getItem(this.SET_LOG_DEBUG)}setLogLevel(e){f.setItem(this.LOG_LEVEL,e)}getLogLevel(){return f.getItem(this.LOG_LEVEL)}setNewUserTimestamp(e){f.setItem(this.NEW_USER_TIMESTAMP,e)}getNewUserTimestamp(){return f.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(e){f&&f.isLocalStorageAvailable()&&f.setItem(this.EXTERNAL_ID,e),d&&d.IDB&&await d.setItem(this.EXTERNAL_ID,e)}async getExternalIdRequest(){let e;try{f&&f.isLocalStorageAvailable()?e=f.getItem(this.EXTERNAL_ID):d&&d.IDB&&(e=await d.getItem(this.EXTERNAL_ID))}catch(e){console.log("getExternalIdRequest Repository",e)}return e}setExternalId(e){f.setItem(this.EXTERNAL_ID,e)}getExternalId(){return f.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return f.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(e){f.setItem(this.REGISTERED_BY_COOKIE,e)}setLatitude(e){f.setItem(this.LATITUDE,e)}getLatitude(){return f.getItem(this.LATITUDE)}setLongitude(e){f.setItem(this.LONGITUDE,e)}getLongitude(){return f.getItem(this.LONGITUDE)}async setInAppTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,e)}async getInAppTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.INAPP_TOPICS))}catch(e){console.log("getInAppTopicList Repository",e)}return e}async setTopicList(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,e)}async getTopicList(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_LIST))}catch(e){console.log("getTopicList Repository",e)}return e}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(e){this.setStorage(this.URL_INAPP_API,e)}setInAppEnabled(e){this.setStorage(this.INAPP_ENABLED,e)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(e){this.setStorage(this.AVOID_CYPHER,!0===e)}isAvoidCypher(){return"true"===this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let e;try{this.storage&&this.storage.isLocalStorageAvailable()?e=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(e=await this.db.getItem(this.URL_DEVICE_API))}catch(e){console.log("getUrlDeviceApi Repository",e)}return e}async setUrlDeviceApi(e){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,e),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,e)}setPushDisabled(e){this.setStorage(this.PUSH_DISABLED,e)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(e){this.setStorage(this.CONFIG_V2,e)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}getTimeoutRequestsInMilliseconds(){return this.getStorage(this.TIMEOUT_REQUESTS)}setTimeoutRequestsInMilliseconds(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}getEncryptionType(){const e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?E.HASH:e}setEncryptionType(e){this.setStorage(this.ENCRYPTION_TYPE,e)}},I=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),g=I;class m{constructor(e){this.tag="[IND]",e&&(this.tag=e),this.level=g.INFO,this.setLogLevel((new y).getLogLevel()),this.log=[]}setLogLevel(e){e&&e>=g.DEBUG&&e<=g.ERROR&&(this.level=e)}static addedAsString(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}d(){if(this.level<=g.DEBUG)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}i(){if(this.level<=g.INFO)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}w(){if(this.level<=g.WARNING)for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}e(){if(this.level<=g.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+=`${arguments[0].errorCode}: ${arguments[0].errorMessage}`;else for(let e=0;e<arguments.length;e++)this.log+=m.addedAsString(arguments[e]);return this}writeLog(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const _=m,v=class{constructor(e,t,n){this.errorCode=e,this.errorMessage=t,null!=n&&(this.exceptionMessage=n)}},S={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},T=new class{constructor(){}showError(e,t,n){if(null!=e){const i=Object.values(e.ErrorCode).indexOf(t);if(i>=0){const t=Object.keys(e.ErrorCode)[i],r=Object.values(e.ErrorCode)[i];return new v({code:t,errorId:r},Object.values(e.ErrorMessage)[i],n)}return new v(S.ErrorCode.GENERAL_ERROR,"general error",n)}}},b=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(e,t,n,i){const r=new _("[IND]BaseClient: ");n.isServiceWorkerRequest()&&r.setLogLevel(g.DEBUG);let o=await this.getURL()+n.getPath(t)+n.getParams();n.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:e,headers:n.addHeaders()};e!==this.GET&&(s.body=JSON.stringify(n.getBody())),i&&(s.credentials=i);try{const t=new AbortController;let i;(new y).getTimeoutRequestsInMilliseconds()&&0!=(new y).getTimeoutRequestsInMilliseconds()&&(i=setTimeout(()=>t.abort(),(new y).getTimeoutRequestsInMilliseconds()),s.signal=t.signal);const a=await fetch(o,s);if(i&&clearTimeout(i),304!=a.status){const t=await a.json();return a.ok?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\nResponse Body:",JSON.stringify(t.data,null,"\t")).writeLog(),t):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+t.statusCode+"\nResponse Message: "+t.message+"\n").writeLog(),new v(t.statusCode,t.message))}return r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Response Code: "+a.status+"\n").writeLog(),a}catch(t){return"AbortError"===t.name?(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.TIMEOUT_REQUEST,t)):(r.d("Method: "+e+"\nURL: "+o+"\n"+(e!==this.GET?"Request Body: "+JSON.stringify(n.getBody(),null,"\t")+"\n":"")+"Error: "+t).writeLog(),T.showError(S,S.ErrorCode.GENERAL_ERROR,t))}}async get(e,t){return await this.call(this.GET,e,t)}async post(e,t,n){return await this.call(this.POST,e,t,n)}async put(e,t,n){return await this.call(this.PUT,e,t,n)}async delete(e,t){return await this.call(this.DELETE,e,t)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new y).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(e){let t=e;return Object.keys(this.pathParams).forEach(e=>{t=t.replace(e,this.pathParams[e])}),t}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(e){this.serviceWorkerRequest=e}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(e){this.journeyRequest=e}},P=class extends O{constructor(e=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=e}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let e="";if(this.channels&&this.channels.length>0)for(let t=0;t<this.channels.length;t++)e+=`${this.PARAM_APPLICATION_CHANNEL}=${this.channels[t].toLowerCase()}&`;return e+=`${this.PARAM_PLATFORM}=webpush`,e}},A=class{static isServiceTimestampExceed(){return!(new y).getServiceTimestamp()||(new y).getServiceSyncTime()<=(Date.now()-(new y).getServiceTimestamp())/6e4}static isFunction(e){return!(!e||"function"!=typeof e)}static generateUUID(){const e=new _("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))):null}},R=class{static DATE_FORMAT_PATTERN="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";static LENIENT_DATE_FORMATS=["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"];static normalizeDateString(e){if("number"==typeof e||e instanceof Date){const t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;const t=e.trim();if(this.isCanonicalFormat(t))return t;const n=this.tryToParseLeniently(t);return n?this.formatCanonicalUTC(n):null}static isCanonicalFormat(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}static tryToParseLeniently(e){for(const t of this.LENIENT_DATE_FORMATS){const n=this.parseByFormat(e,t);if(n&&!isNaN(n.getTime()))return n}return null}static parseByFormat(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}static formatCanonicalUTC(e){return e.toISOString()}},w=class extends O{constructor(){super()}setEventId(e){this.eventId=e,null==e&&(this.eventId=A.generateUUID())}setEventAt(e){this.eventAt=e,null==e&&(this.eventAt=R.normalizeDateString(Date.now()))}},N=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"}),C=class{constructor(e=null,t){null==e?(this.browserPublicKey=(new y).getBrowserPublicKey(),this.browserPrivateKey=(new y).getBrowserPrivateKey(),this.platform=(new y).getPlatform(),this.version=(new y).getVersion(),this.browserName=(new y).getBrowserName(),this.browserVersion=(new y).getBrowserVersion(),this.osName=(new y).getOsName(),this.osVersion=(new y).getOsVersion(),this.deviceId=(new y).getDeviceId(),this.deviceType=(new y).getDeviceType(),(new y).getEnabled()&&(this.enabled="true"===(new y).getEnabled()),(new y).getExternalId()&&(this.externalCode=(new y).getExternalId())):t?(e.enabled&&(this.enabled=e.enabled,(new y).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new y).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}getDeviceId(){return this.deviceId}setDeviceId(e){this.deviceId=e}setExternalCode(e){this.externalCode=e}toJSON(){const e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}},D=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0}),L=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"}),M=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"}),U=class{constructor(e,t=!1){const n=new y;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);let i=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,i=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):i=new Date(Date.now()+36e5),!t){const e=i.toString();new _("[IND]CoreApplication").d("ServiceSyncTime defined on: "+e).writeLog(),n.setConfigV2ServiceSyncTime(e)}this.encryptionType=E.HASH,e.encryptionType&&(this.encryptionType=e.encryptionType),n.setEncryptionType(this.encryptionType)}}},B=class{static async getLocationPermission(){const e=await this.getPermission("geolocation"),t={};return e&&(t.location=e.state),t}static async getPermission(e){try{if(navigator&&navigator.permissions&&navigator.permissions.query&&e)return await navigator.permissions.query({name:e,userVisibleOnly:!0})}catch(e){return null}return null}static async setPermissionsCallback(){await this.setCallback("geolocation",navigator.indigitallRequestLocationPermission)}static async setCallback(e,t){const n=await this.getPermission(e);if(n){let i=n.state;"onchange"in n&&(n.onchange=()=>{new _("[IND]CorePermissions: ").d(e+" permission state has changed from "+i+" to "+n.state).writeLog(),i=n.state,t&&t({name:e,state:n.state})})}}},k=new _("[IND]Crypto"),V=new TextEncoder("utf-8"),j="HMAC",Y=class{static async createHmac(e,t){try{let n=t;if(!0===(new y).isAvoidCypher()||(new y).getEncryptionType()===E.RAW)return t;if((new y).getEncryptionType()===E.HASH){const i=window?.crypto?.subtle;if(!i)return;const r=await i.importKey("raw",V.encode(e),{name:j,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await i.sign(j,r,V.encode(t)),s=new Uint8Array(o);n=Array.prototype.map.call(s,e=>("00"+e.toString(16)).slice(-2)).join(""),k.d("hmac: ",n).writeLog()}return n}catch(e){return void k.e("error:",e).writeLog()}}};class F{static compareJSON(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const i of n)if(e[i]!==t[i]){if("object"!=typeof e[i]||"object"!=typeof t[i])return!1;if(!F.compareJSON(e[i],t[i]))return!1}return!0}}const x=F,G=class{static isValidFormat(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}},W=class{static setTopicChannel(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];r.channel=t,n.push(r)}return n}},K={Repository:y,Config:c,Api:r,Models:o,Utils:s};return i})(),e.exports=t()},315(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={Core:!0};Object.defineProperty(t,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,r,o={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(r.get||r.set)?n(o,s,r):o[s]=e[s]);return o}(e)}(n(710));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var s,a=(s=n(610))&&s.__esModule?s:{default:s}},468(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(n(254)),r=c(n(234)),o=c(n(457)),s=c(n(735)),a=c(n(630)),u=c(n(291));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return d(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(d(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,d(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,d(h,"constructor",c),d(c,"constructor",u),u.displayName="GeneratorFunction",d(c,r,"GeneratorFunction"),d(h),d(h,r,"Generator"),d(h,i,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:p}})()}function d(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}d=function(e,t,n,i){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,i)}function h(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){h(o,i,r,s,a,"next",e)}function a(e){h(o,i,r,s,a,"throw",e)}s(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function y(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"},t=[{key:"getURL",value:(y=p(f().m(function e(){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,this.URL_BASE)},e,this)})),function(){return y.apply(this,arguments)})},{key:"call",value:(h=p(f().m(function e(t,n,c,l){var d,h,p,E,y,I,g,m,_,v,S,T;return f().w(function(e){for(;;)switch(e.p=e.n){case 0:return d=new i.default("[IND]BaseClient: "),c.isServiceWorkerRequest()&&d.setLogLevel(a.default.DEBUG),e.n=1,this.getURL();case 1:return m=e.v,_=c.getPath(n),v=m+_,S=c.getParams(),h=v+S,c.isJourneyRequest()&&(h=h.replace("v1","v2")),p={method:t,headers:c.addHeaders()},t!==this.GET&&(p.body=JSON.stringify(c.getBody())),l&&(p.credentials=l),e.p=2,E=new AbortController,(new u.default).getTimeoutRequestsInMilliseconds()&&0!=(new u.default).getTimeoutRequestsInMilliseconds()&&(y=setTimeout(function(){return E.abort()},(new u.default).getTimeoutRequestsInMilliseconds()),p.signal=E.signal),e.n=3,fetch(h,p);case 3:if(I=e.v,y&&clearTimeout(y),304==I.status){e.n=6;break}return e.n=4,I.json();case 4:if(g=e.v,!I.ok){e.n=5;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\nResponse Body:",JSON.stringify(g.data,null,"\t")).writeLog(),e.a(2,g);case 5:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+g.statusCode+"\nResponse Message: "+g.message+"\n").writeLog(),e.a(2,new r.default(g.statusCode,g.message));case 6:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Response Code: "+I.status+"\n").writeLog(),e.a(2,I);case 7:e.n=10;break;case 8:if(e.p=8,"AbortError"!==(T=e.v).name){e.n=9;break}return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.TIMEOUT_REQUEST,T));case 9:return d.d("Method: "+t+"\nURL: "+h+"\n"+"".concat(t!==this.GET?"Request Body: "+JSON.stringify(c.getBody(),null,"\t")+"\n":"")+"Error: "+T).writeLog(),e.a(2,o.default.showError(s.default,s.default.ErrorCode.GENERAL_ERROR,T));case 10:return e.a(2)}},e,this,[[2,8]])})),function(e,t,n,i){return h.apply(this,arguments)})},{key:"get",value:(d=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.GET,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return d.apply(this,arguments)})},{key:"post",value:(l=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.POST,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return l.apply(this,arguments)})},{key:"put",value:(c=p(f().m(function e(t,n,i){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.PUT,t,n,i);case 1:return e.a(2,e.v)}},e,this)})),function(e,t,n){return c.apply(this,arguments)})},{key:"delete",value:(n=p(f().m(function e(t,n){return f().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.call(this.DELETE,t,n);case 1:return e.a(2,e.v)}},e,this)})),function(e,t){return n.apply(this,arguments)})}],t&&E(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,c,l,d,h,y}();t.default=I},545(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BaseClient",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"BaseEventRequest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"BaseRequest",{enumerable:!0,get:function(){return r.default}});var i=a(n(468)),r=a(n(237)),o=a(n(773)),s=a(n(943));function a(e){return e&&e.__esModule?e:{default:e}}},773(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var r;function o(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function s(e,t,n){return t=u(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=s(this,t)).PARAM_APPLICATION_CHANNEL="channel",e.channels=n,e}return function(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&&c(e,t)}(t,e),function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var e="";if(this.channels&&this.channels.length>0)for(var t=0;t<this.channels.length;t++)e+="".concat(this.PARAM_APPLICATION_CHANNEL,"=").concat(this.channels[t].toLowerCase(),"&");return e+"".concat(this.PARAM_PLATFORM,"=webpush")}}])}(((r=n(237))&&r.__esModule?r:{default:r}).default);t.default=l},943(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(237)),o=a(n(622)),s=a(n(497));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function c(e,t,n){return t=f(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t)}return function(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&&d(e,t)}(t,e),n=t,(i=[{key:"setEventId",value:function(e){this.eventId=e,null==e&&(this.eventId=o.default.generateUUID())}},{key:"setEventAt",value:function(e){this.eventAt=e,null==e&&(this.eventAt=s.default.normalizeDateString(Date.now()))}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(r.default);t.default=h},237(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var a=function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_EVENT_ID="eventId",this.PARAM_EVENT_AT="eventAt",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new r.default).getAppKey(),this.params=null,this.pathParams={},this.headers={}},[{key:"getParams",value:function(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}},{key:"getBody",value:function(){return this.body?this.body:""}},{key:"getPath",value:function(e){var t=this,n=e;return Object.keys(this.pathParams).forEach(function(e){n=n.replace(e,t.pathParams[e])}),n}},{key:"addHeaders",value:function(){var e=this,t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(function(n){t.append(n,e.headers[n])}),t}},{key:"isServiceWorkerRequest",value:function(){return this.serviceWorkerRequest}},{key:"setServiceWorkerRequest",value:function(e){this.serviceWorkerRequest=e}},{key:"isJourneyRequest",value:function(){return this.journeyRequest}},{key:"setJourneyRequest",value:function(e){this.journeyRequest=e}}]);t.default=a},122(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={platform:"webpush",version:"0.0.1"},r=n(904);i.version=r.version,i=Object.assign(i,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),t.default=i},610(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(122)),o=l(n(291)),s=c(n(545)),a=c(n(225)),u=c(n(628));function c(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var o,s,a={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(var u in e)"default"!==u&&{}.hasOwnProperty.call(e,u)&&((s=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,u))&&(s.get||s.set)?o(a,u,s):a[u]=e[u]);return a})(e,t)}function l(e){return e&&e.__esModule?e:{default:e}}t.default={Repository:o.default,Config:r.default,Api:s,Models:a,Utils:u}},902(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Channel=void 0;var n=t.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});t.default=n},174(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(291)),r=s(n(254)),o=s(n(164));function s(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var s=new i.default;if(null!=t){s.setConfigV2(JSON.stringify(t)),t.contentAvailable&&(this.contentAvailable=t.contentAvailable),t.locationAccuracy&&(this.locationAccuracy=t.locationAccuracy),t.locationDistance&&(this.locationDistance=t.locationDistance),t.locationEnabled&&(this.locationEnabled=t.locationEnabled),t.locationUpdateMinutes&&(this.locationUpdateMinutes=t.locationUpdateMinutes),t.maintenanceWindow&&(this.maintenanceWindow=t.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,s.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,s.setMaintenanceEnd(this.maintenanceWindow.end))),t.networkEventsEnabled&&(this.networkEventsEnabled=t.networkEventsEnabled),t.networkUpdateMinutes&&(this.networkUpdateMinutes=t.networkUpdateMinutes);var a=Date.now();if(t.serviceSyncTime?(this.serviceSyncTime=t.serviceSyncTime,a=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):a=new Date(Date.now()+36e5),!n){var u=a.toString();new r.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+u).writeLog(),s.setConfigV2ServiceSyncTime(u)}this.encryptionType=o.default.HASH,t.encryptionType&&(this.encryptionType=t.encryptionType),s.setEncryptionType(this.encryptionType)}});t.default=a},395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(291))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var a=function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==t?(this.browserPublicKey=(new r.default).getBrowserPublicKey(),this.browserPrivateKey=(new r.default).getBrowserPrivateKey(),this.platform=(new r.default).getPlatform(),this.version=(new r.default).getVersion(),this.browserName=(new r.default).getBrowserName(),this.browserVersion=(new r.default).getBrowserVersion(),this.osName=(new r.default).getOsName(),this.osVersion=(new r.default).getOsVersion(),this.deviceId=(new r.default).getDeviceId(),this.deviceType=(new r.default).getDeviceType(),(new r.default).getEnabled()&&(this.enabled="true"===(new r.default).getEnabled()),(new r.default).getExternalId()&&(this.externalCode=(new r.default).getExternalId())):n?(t.enabled&&(this.enabled=t.enabled,(new r.default).setEnabled(this.enabled)),t.registeredByCookie&&(this.registeredByCookie=t.registeredByCookie,(new r.default).setRegisteredByCookie(this.registeredByCookie))):(t.browserPublicKey&&(this.browserPublicKey=t.browserPublicKey),t.browserPrivateKey&&(this.browserPrivateKey=t.browserPrivateKey),t.platform&&(this.platform=t.platform),t.version&&(this.version=t.version),t.osVersion&&(this.osVersion=t.osVersion),t.browserName&&(this.browserName=t.browserName),t.browserVersion&&(this.browserVersion=t.browserVersion),t.osName&&(this.osName=t.osName),t.deviceType&&(this.deviceType=t.deviceType),t.enabled&&(this.enabled=t.enabled),t.externalCode&&(this.externalCode=t.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()},[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(e){this.deviceId=e}},{key:"setExternalCode",value:function(e){this.externalCode=e}},{key:"toJSON",value:function(){var e={};return this.platform&&(e.platform=this.platform),this.version&&(e.version=this.version),this.productName&&(e.productName=this.productName),this.productVersion&&(e.productVersion=this.productVersion),this.browserName&&(e.browserName=this.browserName),this.browserVersion&&(e.browserVersion=this.browserVersion),this.osName&&(e.osName=this.osName),this.osVersion&&(e.osVersion=this.osVersion),this.deviceType&&(e.deviceType=this.deviceType),this.locale&&(e.locale=this.locale),this.timeZone&&(e.timeZome=this.timeZone),this.timeOffset&&(e.timeOffset=this.timeOffset),this.deviceId&&(e.deviceId=this.deviceId),this.enabled&&(e.enabled=this.enabled),this.browserPublicKey&&(e.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(e.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(e.externalCode=this.externalCode),e}}]);t.default=a},89(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});t.default=n},164(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EncryptionType=void 0;var n=t.EncryptionType=Object.freeze({RAW:"raw",HASH:"hash"});t.default=n},735(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={ErrorCode:{GENERAL_ERROR:600,TIMEOUT_REQUEST:605,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",TIMEOUT_REQUEST:"connection timeout",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}}},234(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorCode=t,this.errorMessage=n,null!=i&&(this.exceptionMessage=i)});t.default=n},953(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});t.default=n},72(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});t.default=n},225(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return i.Channel}}),Object.defineProperty(t,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Device",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"EncryptionType",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var i=n(902),r=d(n(395)),o=d(n(89)),s=d(n(735)),a=d(n(234)),u=d(n(953)),c=d(n(72)),l=d(n(174)),f=d(n(164));function d(e){return e&&e.__esModule?e:{default:e}}},672(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,i,o,s){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return r(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,o,s),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(r(t={},o,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,r(h,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(h),r(h,s,"Generator"),r(h,o,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:p}})()}function r(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}r=function(e,t,n,i){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,i)}function o(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function a(e){o(s,i,r,a,u,"next",e)}function u(e){o(s,i,r,a,u,"throw",e)}a(void 0)})}}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB},t=[{key:"getDB",value:(c=s(i().m(function e(){var t=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){var i=t.IDB;if(i){var r=i.open("indigitall.indexedDB",1);r.onupgradeneeded=function(){r.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},r.onsuccess=function(){var t=r.result,n=t.transaction("indigitallStore","readwrite"),i=n.objectStore("indigitallStore"),o=i.index("storeIndex");e({db:t,tx:n,store:i,index:o})},r.onerror=function(e){n(e)}}else n(!1)}))},e)})),function(){return c.apply(this,arguments)})},{key:"get",value:(u=s(i().m(function e(t,n){var r=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.index.get(n).onsuccess=function(n){n.target.result&&(r.close(t),e(n.target.result.store.value)),i(!1)}}))},e)})),function(e,t){return u.apply(this,arguments)})},{key:"put",value:(o=s(i().m(function e(t,n,r){var o=this;return i().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,i){t||i(!1),t.store.put({store:{key:n,value:r}},n).onsuccess=function(n){o.close(t),e(r)}}))},e)})),function(e,t,n){return o.apply(this,arguments)})},{key:"close",value:function(e){if(e.tx)try{e.tx.oncomplete=function(){e.db.close()}}catch(e){console.log(this.TAG,e)}}},{key:"setItem",value:(r=s(i().m(function e(t,n){var r,o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return r=e.v,e.a(2,this.put(r,t,n));case 2:return e.p=2,o=e.v,e.a(2,o)}},e,this,[[0,2]])})),function(e,t){return r.apply(this,arguments)})},{key:"getItem",value:(n=s(i().m(function e(t){var n,r;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getDB();case 1:return n=e.v,e.a(2,this.get(n,t));case 2:return e.p=2,r=e.v,e.a(2,r)}},e,this,[[0,2]])})),function(e){return n.apply(this,arguments)})}],t&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,u,c}();t.default=new c},87(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},t=[{key:"isLocalStorageAvailable",value:function(){try{var e=window.localStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==r.length}return!1}},{key:"setItem",value:function(e,t){return null!=this.storage&&(this.storage.setItem(e,t),!0)}},{key:"getItem",value:function(e){return null!=this.storage?this.storage.getItem(e):null}},{key:"deleteItem",value:function(e){return!!this.storage&&(this.storage.removeItem(e),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=r},291(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(n(122)),r=u(n(87)),o=u(n(672)),s=u(n(238)),a=u(n(164));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return f(c,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),h=c.prototype=a.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=c,f(h,"constructor",c),f(c,"constructor",u),u.displayName="GeneratorFunction",f(c,r,"GeneratorFunction"),f(h),f(h,r,"Generator"),f(h,i,function(){return this}),f(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function d(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){d(o,i,r,s,a,"next",e)}function a(e){d(o,i,r,s,a,"throw",e)}s(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,E(i.key),i)}}function E(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storage=r.default,this.db=o.default,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.TIMEOUT_REQUESTS=this.REPOSITORY+".TIMEOUT_REQUESTS",this.ENCRYPTION_TYPE=this.REPOSITORY+".ENCRYPTION_TYPE",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"},t=[{key:"setItemSessionStorage",value:function(e,t){s.default.setItem(e,t)}},{key:"getItemSessionStorage",value:function(e){return s.default.getItem(e)}},{key:"clearSessionStorage",value:function(){s.default.clearMessages()}},{key:"setStorage",value:function(e,t){r.default.setItem(e,t)}},{key:"getStorage",value:function(e){return r.default.getItem(e)}},{key:"clearStorage",value:function(){r.default.clear()}},{key:"setBrowserPublicKey",value:function(e){r.default.setItem(this.BROWSER_PUBLIC_KEY,e)}},{key:"getBrowserPublicKey",value:function(){return r.default.getItem(this.BROWSER_PUBLIC_KEY)}},{key:"setBrowserPrivateKey",value:function(e){r.default.setItem(this.BROWSER_PRIVATE_KEY,e)}},{key:"getBrowserPrivateKey",value:function(){return r.default.getItem(this.BROWSER_PRIVATE_KEY)}},{key:"setAppKey",value:(P=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default.setItem(this.APP_KEY,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.APP_KEY,t);case 1:return e.a(2)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"getAppKey",value:function(){return r.default.getItem(this.APP_KEY)}},{key:"setDeviceId",value:(O=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.DEVICE_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"getDeviceId",value:function(){return this.getStorage(this.DEVICE_ID)}},{key:"getAppKeySync",value:(b=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!o.default||!o.default.IDB){e.n=2;break}return e.n=1,o.default.getItem(this.APP_KEY);case 1:return e.a(2,e.v);case 2:return e.a(2)}},e,this)})),function(){return b.apply(this,arguments)})},{key:"setVAPID",value:function(e){r.default.setItem(this.VAPID_PUBLIC,e)}},{key:"getVAPID",value:function(){return r.default.getItem(this.VAPID_PUBLIC)}},{key:"setEnabled",value:function(e){r.default.setItem(this.ENABLED,e)}},{key:"getEnabled",value:function(){return r.default.getItem(this.ENABLED)}},{key:"setServiceSyncTime",value:function(e){r.default.setItem(this.SERVICE_SYNC_TIME,e*this.BASE_TIME)}},{key:"getServiceSyncTime",value:function(){return r.default.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}},{key:"setLocationEnabled",value:function(e){r.default.setItem(this.LOCATION_ENABLED,e)}},{key:"getLocationEnabled",value:function(){return r.default.getItem(this.LOCATION_ENABLED)}},{key:"setLocationUpdateMinutes",value:function(e){r.default.setItem(this.LOCATION_UPDATE_MINUTES,e)}},{key:"getLocationUpdateMinutes",value:function(){return r.default.getItem(this.LOCATION_UPDATE_MINUTES)||30}},{key:"setRequestLocation",value:(T=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REQUEST_LOCATION,t);case 1:return e.a(2)}},e,this)})),function(e){return T.apply(this,arguments)})},{key:"getRequestLocation",value:function(){return!!r.default&&r.default.getItem(this.REQUEST_LOCATION)}},{key:"setPlatform",value:(S=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.PLATFORM,t);case 1:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getPlatform",value:function(){return r.default&&r.default.getItem(this.PLATFORM)||i.default.platform}},{key:"getVersion",value:function(){return i.default.version}},{key:"setBrowserName",value:(v=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.BROWSER_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"getBrowserName",value:function(){return r.default.getItem(this.BROWSER_NAME)}},{key:"setBrowserVersion",value:function(e){r.default.setItem(this.BROWSER_VERSION,e)}},{key:"getBrowserVersion",value:function(){return r.default.getItem(this.BROWSER_VERSION)}},{key:"setOsName",value:(_=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.OS_NAME,t);case 1:return e.a(2)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"getOsName",value:function(){return r.default.getItem(this.OS_NAME)}},{key:"setOsVersion",value:function(e){r.default.setItem(this.OS_VERSION,e)}},{key:"getOsVersion",value:function(){return r.default.getItem(this.OS_VERSION)}},{key:"setDeviceType",value:function(e){r.default.setItem(this.DEVICE_TYPE,e)}},{key:"getDeviceType",value:function(){return r.default.getItem(this.DEVICE_TYPE)}},{key:"setSupported",value:function(e){r.default.setItem(this.SUPPORTED,e)}},{key:"getSupported",value:function(){return r.default.getItem(this.SUPPORTED)}},{key:"setServiceTimestamp",value:function(e){r.default.setItem(this.SERVICE_TIMESTAMP,e)}},{key:"getServiceTimestamp",value:function(){return r.default.getItem(this.SERVICE_TIMESTAMP)}},{key:"setLocationTimestamp",value:function(e){r.default.setItem(this.LOCATION_TIMESTAMP,e)}},{key:"getLocationTimestamp",value:function(){return r.default.getItem(this.LOCATION_TIMESTAMP)}},{key:"setPermissionLocation",value:function(e){r.default.setItem(this.PERMISSION_LOCATION,e)}},{key:"getPermissionLocation",value:function(){return r.default.getItem(this.PERMISSION_LOCATION)}},{key:"setDebugLog",value:function(e){r.default.setItem(this.SET_LOG_DEBUG,e)}},{key:"getDebugLog",value:function(){return"false"!==r.default.getItem(this.SET_LOG_DEBUG)}},{key:"setLogLevel",value:function(e){r.default.setItem(this.LOG_LEVEL,e)}},{key:"getLogLevel",value:function(){return r.default.getItem(this.LOG_LEVEL)}},{key:"setNewUserTimestamp",value:function(e){r.default.setItem(this.NEW_USER_TIMESTAMP,e)}},{key:"getNewUserTimestamp",value:function(){return r.default.getItem(this.NEW_USER_TIMESTAMP)}},{key:"setExternalIdRequest",value:(m=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(r.default&&r.default.isLocalStorageAvailable()&&r.default.setItem(this.EXTERNAL_ID,t),!o.default||!o.default.IDB){e.n=1;break}return e.n=1,o.default.setItem(this.EXTERNAL_ID,t);case 1:return e.a(2)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getExternalIdRequest",value:(g=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!r.default||!r.default.isLocalStorageAvailable()){e.n=1;break}t=r.default.getItem(this.EXTERNAL_ID),e.n=3;break;case 1:if(!o.default||!o.default.IDB){e.n=3;break}return e.n=2,o.default.getItem(this.EXTERNAL_ID);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getExternalIdRequest Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return g.apply(this,arguments)})},{key:"setExternalId",value:function(e){r.default.setItem(this.EXTERNAL_ID,e)}},{key:"getExternalId",value:function(){return r.default.getItem(this.EXTERNAL_ID)}},{key:"getRegisteredByCookie",value:(I=h(l().m(function e(){return l().w(function(e){for(;;)if(0===e.n)return e.a(2,r.default.getItem(this.REGISTERED_BY_COOKIE))},e,this)})),function(){return I.apply(this,arguments)})},{key:"setRegisteredByCookie",value:(y=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:r.default.setItem(this.REGISTERED_BY_COOKIE,t);case 1:return e.a(2)}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"setLatitude",value:function(e){r.default.setItem(this.LATITUDE,e)}},{key:"getLatitude",value:function(){return r.default.getItem(this.LATITUDE)}},{key:"setLongitude",value:function(e){r.default.setItem(this.LONGITUDE,e)}},{key:"getLongitude",value:function(){return r.default.getItem(this.LONGITUDE)}},{key:"setInAppTopicList",value:(E=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.INAPP_TOPICS,t);case 1:return e.a(2)}},e,this)})),function(e){return E.apply(this,arguments)})},{key:"getInAppTopicList",value:(d=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.INAPP_TOPICS);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getInAppTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return d.apply(this,arguments)})},{key:"setTopicList",value:(f=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.TOPIC_LIST,t);case 1:return e.a(2)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"getTopicList",value:(c=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.db||!this.db.IDB){e.n=2;break}return e.n=1,this.db.getItem(this.TOPIC_LIST);case 1:t=e.v;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.log("getTopicList Repository",n);case 4:return e.a(2,t)}},e,this,[[0,3]])})),function(){return c.apply(this,arguments)})},{key:"getUrlInappApi",value:function(){return this.getStorage(this.URL_INAPP_API)}},{key:"setUrlInappApi",value:function(e){this.setStorage(this.URL_INAPP_API,e)}},{key:"setInAppEnabled",value:function(e){this.setStorage(this.INAPP_ENABLED,e)}},{key:"isInAppEnabled",value:function(){return this.getStorage(this.INAPP_ENABLED)}},{key:"setAvoidCypher",value:function(e){this.setStorage(this.AVOID_CYPHER,!0===e)}},{key:"isAvoidCypher",value:function(){return"true"===this.getStorage(this.AVOID_CYPHER)}},{key:"getUrlDeviceApi",value:(u=h(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.storage||!this.storage.isLocalStorageAvailable()){e.n=1;break}t=this.getStorage(this.URL_DEVICE_API),e.n=3;break;case 1:if(!this.db||!this.db.IDB){e.n=3;break}return e.n=2,this.db.getItem(this.URL_DEVICE_API);case 2:t=e.v;case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.log("getUrlDeviceApi Repository",n);case 5:return e.a(2,t)}},e,this,[[0,4]])})),function(){return u.apply(this,arguments)})},{key:"setUrlDeviceApi",value:(n=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),!this.db||!this.db.IDB){e.n=1;break}return e.n=1,this.db.setItem(this.URL_DEVICE_API,t);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setPushDisabled",value:function(e){this.setStorage(this.PUSH_DISABLED,e)}},{key:"isPushDisabled",value:function(){return this.getStorage(this.PUSH_DISABLED)}},{key:"getConfigV2ServiceSyncTime",value:function(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}},{key:"setConfigV2ServiceSyncTime",value:function(e){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,e)}},{key:"getConfigV2",value:function(){return this.getStorage(this.CONFIG_V2)}},{key:"setConfigV2",value:function(e){this.setStorage(this.CONFIG_V2,e)}},{key:"getMaintenanceEnd",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}},{key:"setMaintenanceEnd",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,e)}},{key:"getMaintenanceStart",value:function(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}},{key:"setMaintenanceStart",value:function(e){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,e)}},{key:"getTimeoutRequestsInMilliseconds",value:function(){return this.getStorage(this.TIMEOUT_REQUESTS)}},{key:"setTimeoutRequestsInMilliseconds",value:function(e){this.setStorage(this.TIMEOUT_REQUESTS,e)}},{key:"getEncryptionType",value:function(){var e=this.getStorage(this.ENCRYPTION_TYPE);return null===e?a.default.HASH:e}},{key:"setEncryptionType",value:function(e){this.setStorage(this.ENCRYPTION_TYPE,e)}}],t&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,u,c,f,d,E,y,I,g,m,_,v,S,T,b,O,P}();t.default=y},238(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},t=[{key:"isSessionStorageAvailable",value:function(){try{var e=window.sessionStorage,t="__storage_test__";if(e)return e.setItem(t,t),e.removeItem(t),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==r.length}return!1}},{key:"getItem",value:function(e){return null!=this.session?this.session.getItem(e):null}},{key:"setItem",value:function(e,t){return null!=this.session&&(this.session.setItem(e,t),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());t.default=r},622(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(254));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isServiceTimestampExceed",value:function(){return!(new i.default).getServiceTimestamp()||(new i.default).getServiceSyncTime()<=(Date.now()-(new i.default).getServiceTimestamp())/6e4}},{key:"isFunction",value:function(e){return!(!e||"function"!=typeof e)}},{key:"generateUUID",value:function(){var e=new r.default("[IND]CommonUtils: ");return"undefined"!=typeof crypto&&crypto.randomUUID?(e.d("Using crypto.randomUUID to generate UUID").writeLog(),crypto.randomUUID()):"undefined"!=typeof crypto&&crypto.getRandomValues?(e.d("Using crypto.getRandomValues to generate UUID").writeLog(),([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})):null}}],t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=u},429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,r=(i=n(254))&&i.__esModule?i:{default:i};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var s=i&&i.prototype instanceof c?i:c,l=Object.create(s.prototype);return a(l,"_invoke",function(n,i,r){var o,s,a,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,a=e,d.n=n,u}};function h(n,i){for(s=n,a=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(s=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return u;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(t=s<2?e:a)||!f;){o||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(f=d.n<0)?a:n.call(i,d))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(a(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,r,"GeneratorFunction"),a(h),a(h,r,"Generator"),a(h,i,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function a(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}a=function(e,t,n,i){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,i)}function u(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){u(o,i,r,s,a,"next",e)}function a(e){u(o,i,r,s,a,"throw",e)}s(void 0)})}}function l(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var f=function(){return function(e,t,n){return n&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"getLocationPermission",value:(i=c(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission("geolocation");case 1:return t=e.v,n={},t&&(n.location=t.state),e.a(2,n)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"getPermission",value:(n=c(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(navigator&&navigator.permissions&&navigator.permissions.query&&t)){e.n=2;break}return e.n=1,navigator.permissions.query({name:t,userVisibleOnly:!0});case 1:return e.a(2,e.v);case 2:e.n=4;break;case 3:return e.p=3,e.v,e.a(2,null);case 4:return e.a(2,null)}},e,null,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"setPermissionsCallback",value:(t=c(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.setCallback("geolocation",navigator.indigitallRequestLocationPermission);case 1:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"setCallback",value:(e=c(s().m(function e(t,n){var i,o;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getPermission(t);case 1:(i=e.v)&&(o=i.state,"onchange"in i&&(i.onchange=function(){new r.default("[IND]CorePermissions: ").d(t+" permission state has changed from "+o+" to "+i.state).writeLog(),o=i.state,n&&n({name:t,state:i.state})}));case 2:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,i}();t.default=f},170(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CryptoUtils=void 0;var i=n(225),r=o(n(291));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var a=i&&i.prototype instanceof c?i:c,l=Object.create(a.prototype);return u(l,"_invoke",function(n,i,r){var o,a,u,c=0,l=r||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,d.n=n,s}};function h(n,i){for(a=n,u=i,t=0;!f&&c&&!r&&t<l.length;t++){var r,o=l[t],h=d.p,p=o[2];n>3?(r=p===i)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((r=n<2&&h<o[1])?(a=0,d.v=i,d.n=o[1]):h<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,a=0))}if(r||n>1)return s;throw f=!0,i}return function(r,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,u=p;(t=a<2?e:u)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(f=d.n<0)?u:n.call(i,d))!==s)break}catch(t){o=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,o),!0),l}var s={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),h=f.prototype=c.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,r,"GeneratorFunction"),u(h),u(h,r,"Generator"),u(h,i,function(){return this}),u(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:o,m:p}})()}function u(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}u=function(e,t,n,i){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,i)}function c(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function l(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var f=new(o(n(254)).default)("[IND]Crypto"),d=new TextEncoder("utf-8"),h="HMAC",p=t.CryptoUtils=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"createHmac",value:(n=a().m(function e(t,n){var o,s,u,c,l,p,E;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=n,!0!==(new r.default).isAvoidCypher()&&(new r.default).getEncryptionType()!==i.EncryptionType.RAW){e.n=1;break}return e.a(2,n);case 1:if((new r.default).getEncryptionType()!==i.EncryptionType.HASH){e.n=5;break}if(u=null===(s=window)||void 0===s||null===(s=s.crypto)||void 0===s?void 0:s.subtle){e.n=2;break}return e.a(2);case 2:return e.n=3,u.importKey("raw",d.encode(t),{name:h,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 3:return c=e.v,e.n=4,u.sign(h,c,d.encode(n));case 4:l=e.v,p=new Uint8Array(l),o=Array.prototype.map.call(p,function(e){return("00"+e.toString(16)).slice(-2)}).join(""),f.d("hmac: ",o).writeLog();case 5:return e.a(2,o);case 6:return e.p=6,E=e.v,f.e("error:",E).writeLog(),e.a(2)}},e,null,[[0,6]])}),o=function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(e){c(o,i,r,s,a,"next",e)}function a(e){c(o,i,r,s,a,"throw",e)}s(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,o}();t.default=p},497(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 s,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function o(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"normalizeDateString",value:function(e){if("number"==typeof e||e instanceof Date){var t=new Date(e);return isNaN(t.getTime())?null:this.formatCanonicalUTC(t)}if(!e||"string"!=typeof e)return null;var n=e.trim();if(this.isCanonicalFormat(n))return n;var i=this.tryToParseLeniently(n);return i?this.formatCanonicalUTC(i):null}},{key:"isCanonicalFormat",value:function(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e)}},{key:"tryToParseLeniently",value:function(e){var t,n=i(this.LENIENT_DATE_FORMATS);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=this.parseByFormat(e,r);if(o&&!isNaN(o.getTime()))return o}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"parseByFormat",value:function(e,t){switch(t){case"yyyy-MM-dd'T'HH:mm:ss.SSSZ":return new Date(e);case"yyyy-MM-dd'T'HH:mm:ssZ":return e.endsWith("Z")?new Date(e):new Date(e.replaceAll(/([+-]\d{2})(\d{2})$/g,"$1:$2"));case"yyyy-MM-dd'T'HH:mm:ss":return new Date(e+"Z");case"yyyy-MM-dd HH:mm:ss":return new Date(e.replaceAll(" ","T")+"Z");case"yyyy-MM-dd":return new Date(e+"T00:00:00Z");default:return null}}},{key:"formatCanonicalUTC",value:function(e){return e.toISOString()}}],t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();o(a,"DATE_FORMAT_PATTERN","yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),o(a,"LENIENT_DATE_FORMATS",["yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd"]),t.default=a},457(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(735)),r=o(n(234));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"showError",value:function(e,t,n){if(null!=e){var o=Object.values(e.ErrorCode).indexOf(t);if(o>=0){var s={code:Object.keys(e.ErrorCode)[o],errorId:Object.values(e.ErrorCode)[o]};return new r.default(s,Object.values(e.ErrorMessage)[o],n)}return new r.default(i.default.ErrorCode.GENERAL_ERROR,"general error",n)}}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=new u},325(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,r=[{key:"compareJSON",value:function(t,i){var r=Object.keys(t),o=Object.keys(i);if(r.length!==o.length)return!1;for(var s=0,a=r;s<a.length;s++){var u=a[s];if(t[u]!==i[u]){if("object"!=n(t[u])||"object"!=n(i[u]))return!1;if(!e.compareJSON(t[u],i[u]))return!1}}return!0}}],r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();t.default=o},254(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(291)),r=o(n(630));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag="[IND]",t&&(this.tag=t),this.level=r.default.INFO,this.setLogLevel((new i.default).getLogLevel()),this.log=[]}return t=e,n=[{key:"setLogLevel",value:function(e){e&&e>=r.default.DEBUG&&e<=r.default.ERROR&&(this.level=e)}},{key:"d",value:function(){if(this.level<=r.default.DEBUG)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"i",value:function(){if(this.level<=r.default.INFO)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"w",value:function(){if(this.level<=r.default.WARNING)for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"e",value:function(){if(this.level<=r.default.ERROR)if(1==arguments.length&&arguments[0].errorCode)this.log+="".concat(arguments[0].errorCode,": ").concat(arguments[0].errorMessage);else for(var t=0;t<arguments.length;t++)this.log+=e.addedAsString(arguments[t]);return this}},{key:"writeLog",value:function(){this.log.length>0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(e){return"string"==typeof e?e:JSON.stringify(e,null,2)}}],n&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();t.default=c},630(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.LogLevel=void 0;var n=t.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});t.default=n},662(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setTopicChannel",value:function(e,t){for(var n=[],i=0;i<e.length;i++){var r=e[i];r.channel=t,n.push(r)}return n}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=r},332(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"isValidFormat",value:function(e){return null!=e&&""!=e&&"null"!=e&&e.length>8}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=r},628(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CommonUtils",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"CorePermissions",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"DateUtils",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(t,"TopicUtils",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"Validations",{enumerable:!0,get:function(){return l.default}});var i=h(n(622)),r=h(n(429)),o=h(n(170)),s=h(n(457)),a=h(n(325)),u=h(n(254)),c=n(630),l=h(n(332)),f=h(n(662)),d=h(n(497));function h(e){return e&&e.__esModule?e:{default:e}}},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.17.0","_id":"indigitall-web-core@4.17.0","_inBundle":false,"_integrity":"sha512-n86QFX154ZqEM49DQjVaKpqpFiEaNh2Hl26sYLJs/N+OplMmVeAW6SfLEWJtT41xzfr5Qv2+bsXbSI/z6PFiiA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.17.0","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.17.0","saveSpec":null,"fetchSpec":"4.17.0"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.17.0.tgz","_shasum":"17ad86c6550dd166e07cc8980942fc4cae87a41c","_spec":"indigitall-web-core@4.17.0","_where":"/home/circleci/webpush/inbox","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.17.0"}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{default:()=>L});const{Repository:e}=n(315).Core,t=new class extends e{constructor(){super(),this.AUTH_TOKEN=this.REPOSITORY+".AUTH_TOKEN",this.INBOX_AUTH_MODE=this.REPOSITORY+".INBOX_AUTH_MODE",this.URL_INBOX_API=this.REPOSITORY+".URL_INBOX_API"}async setDeviceId(e){this.setStorage(this.DEVICE_ID,e)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}setAuthToken(e){this.setStorage(this.AUTH_TOKEN,e)}getAuthToken(){return this.getStorage(this.AUTH_TOKEN)}setInboxAuthMode(e){this.setStorage(this.INBOX_AUTH_MODE,e)}getInboxAuthMode(){return this.getStorage(this.INBOX_AUTH_MODE)}async getUrlInboxApi(){return this.getStorage(this.URL_INBOX_API)}async setUrlInboxApi(e){this.setStorage(this.URL_INBOX_API,e)}};class r{constructor(e,t){e&&(e.id&&(this.id=e.id),e.externalId&&(this.externalId=e.externalId),e.sentAt&&(this.sentAt=e.sentAt),e.status&&(this.status=e.status),e.sendingId&&(this.sendingId=e.sendingId),e.message&&(this.message=e.message),e.campaignId&&(this.campaignId=e.campaignId),this.read=!1,this.sentAt&&t&&this.sentAt<t&&(this.read=!0))}}window.inboxNotification=r;const o=r,{BaseClient:s}=n(315).Core.Api,{Config:a}=n(315).Core,{ErrorModel:u}=n(315).Core.Models,{CommonUtils:c}=n(315).Core.Utils,l=new class extends s{constructor(){super(),this.URL_BASE=a.client.INBOX_URL_BASE,this.ENDPOINT_INBOX_NOTIFICATIONS="/notification",this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID=this.ENDPOINT_INBOX_NOTIFICATIONS+"/{sendingId}",this.ENDPOINT_INBOX_COUNTER="/counters",this.ENDPOINT_INBOX_AUTH="/auth/webhook"}async getURL(){return await t.getUrlInboxApi()||this.URL_BASE}async postInboxAuth(e,n,i){const r=await this.post(this.ENDPOINT_INBOX_AUTH,e.postInboxAuth());if(!r||r instanceof u||!r.data)r?c.isFunction(i)&&i(r):c.isFunction(i)&&i();else{const e=r.data.token;t.setAuthToken(e),c.isFunction(n)&&n(r)}return!0}async getInbox(e,t,n){const i=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS,e.getInboxPushRequest());return this.getInboxResponseStatus(i,t,n),!0}async putInboxPush(e,t,n){const i=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS,e.putInboxPushRequest());return this.getInboxResponseEdit(i,t,n),!0}async getInboxPushWithSendingId(e,t,n,i){const r=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,e.getInboxPushRequestWithSendingId());return this.getNotificationResponseStatus(r,t,n,i),!0}async putInboxPushWithSendingId(e,t,n,i){const r=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,e.putInboxWithSendingId());return this.getNotificationResponseStatus(r,t,n,i),!0}async getInboxCounter(e,t,n){const i=await this.get(this.ENDPOINT_INBOX_COUNTER,e.getCounter());this.getCounterStatus(i,t,n)}async getInboxResponseStatus(e,t,n){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const n=new L(e.data);c.isFunction(t)&&t(n)}else e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}async getInboxResponseEdit(e,t,n){e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300?c.isFunction(t)&&t():e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}getNotifications(e,t){const n=[];for(let i=0;i<e.length;i++){const r=new o(e[i],t);n.push(r)}return n}async getNotificationResponseStatus(e,t,n,i){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const i=new o(e.data,t);c.isFunction(n)&&n(i)}else e?c.isFunction(i)&&i(e):c.isFunction(i)&&i()}async getCounterStatus(e,t,n){if(e&&!(e instanceof u)&&e.statusCode>=200&&e.statusCode<300){const n={click:e.data.click,sent:e.data.sent,deleted:e.data.deleted,unread:this.getUnreadCounters(e.data.unread)};c.isFunction(t)&&t(n)}else e?c.isFunction(n)&&n(e):c.isFunction(n)&&n()}getUnreadCounters(e){return{count:e.count,lastAccess:e.lastAccess}}},{BaseRequest:f}=n(315).Core.Api,d=class extends f{constructor(){super()}postInboxAuth(){return this.body=this.json,this}setJson(e){this.json=e}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}},h=Object.freeze({SENT:"sent",CLICK:"click",DELETED:"deleted"});window.inboxStatus=h;const p=h,E=Object.freeze({NONE:"none",DEFAULT:"default",WEBHOOK:"webhook"}),{BaseRequest:y}=n(315).Core.Api,{EncryptionType:I}=n(315).Core.Models,g=class extends y{constructor(){super(),this.externalId=null,this.headers={},t.getExternalId()&&(this.externalId=t.getExternalId(),!0!==t.isAvoidCypher()&&t.getEncryptionType()!=I.RAW||(this.externalId=encodeURIComponent(t.getExternalId()))),null!=t.getAuthToken()&&t.getInboxAuthMode()==E.WEBHOOK&&(this.headers.Authorization="Bearer "+t.getAuthToken()),this.sendingId="",this.sendingIds=null,this.page=0,this.pageSize=0,this.dateFrom="",this.dateTo="",this.status=p.INBOXSTATUS_SENT,this.initialStatus=p.INBOXSTATUS_SENT,this.statusList=null}getInboxPushRequest(){return this.params=this.createQueryString(),this}putInboxPushRequest(){return this.params=this.createQueryStringExternalId(),this.body=this.createBodyJson(),this}getInboxPushRequestWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this}putInboxWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this.body=this.createBodyStatusJson(),this}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}createQueryString(){let e="";if(this.page&&(e+=this.PARAM_INBOX_PAGE+"="+this.page+"&"),this.pageSize&&(e+=this.PARAM_INBOX_PAGE_SIZE+"="+this.pageSize+"&"),this.dateFrom&&(e+=this.PARAM_INBOX_DATE_FROM+"="+this.dateFrom+"&"),this.dateTo&&(e+=this.PARAM_INBOX_DATE_TO+"="+this.dateTo+"&"),this.statusList){let t="";for(let e=0;e<this.statusList.length;e++)t+=this.statusList[e],e!=this.statusList.length-1&&(t+=",");e+=this.PARAM_INBOX_STATUS+"="+t+"&"}return e+this.createQueryStringExternalId()}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}createBodyJson(){let e={};const t=[];try{if(e=this.createBodyStatusJson(),null!=this.sendingIds){for(let e=0;e<this.sendingIds.length;e++)t.push(this.sendingIds[e]);e.sendingIds=t}}catch(e){console.log("Error Inbox request :"+e)}return e}createBodyStatusJson(){const e={};return this.status&&(e.status=this.status),this.initialStatus&&(e.initialStatus=this.initialStatus),e}setSendingId(e){this.sendingId=e}setSendingIds(e){this.sendingIds=e}setPage(e){this.page=e}setPageSize(e){this.pageSize=e}setDateFrom(e){this.dateFrom=e}setDateTo(e){this.dateTo=e}setStatus(e){this.status=e}setInitialStatus(e){this.initialStatus=e}setStatusList(e){this.statusList=e}},{BaseRequest:m}=n(315).Core.Api,{EncryptionType:_}=n(315).Core.Models,v=class extends m{constructor(){super(),this.externalId=null,this.headers={},t.getExternalId()&&(this.externalId=t.getExternalId(),!0!==t.isAvoidCypher()&&t.getEncryptionType()!=_.RAW||(this.externalId=encodeURIComponent(t.getExternalId()))),null!=t.getAuthToken()&&t.getInboxAuthMode()==E.WEBHOOK&&(this.headers.Authorization="Bearer "+t.getAuthToken())}getCounter(){return this.params=this.createQueryStringExternalId(),this}addHeaders(){const e=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach(t=>{e.append(t,this.headers[t])}),e}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}},{ErrorDictionary:S}=n(315).Core.Models,T=S.ErrorCode;Object.assign(T,{INBOX_GET_ERROR:3001,INBOX_GET_PAGE_ERROR:3011,INBOX_EXTERNAL_ID_NO_REGISTERED:3012,INBOX_NO_MESSAGES:3013,INBOX_IS_REQUESTING_PAGE:3014,INBOX_EMPTY:3015,INBOX_GENERAL_ERROR:3600});const b=S.ErrorMessage;Object.assign(b,{INBOX_GET_ERROR:"inbox GET request error",INBOX_GET_PAGE_ERROR:"error inbox get page",INBOX_EXTERNAL_ID_NO_REGISTERED:"external Id is not registered",INBOX_NO_MESSAGES:"There are no more messages on Inbox",INBOX_IS_REQUESTING_PAGE:"Wait. Is Requesting new page",INBOX_EMPTY:"There are no messages on Inbox",INBOX_GENERAL_ERROR:"general error"});const O={ErrorCode:T,ErrorMessage:b},{Validations:P,Log:A}=n(315).Core.Utils,R=class extends P{static isAppKeyFormat(){const e=t.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFormatRequest(){const e=new A("[IND]InboxValidations: "),n=t.getDeviceId();let i=!0;return this.isAppKeyFormat()||(i=!1,e.w("appKey is null or empty").writeLog()),this.isValidFormat(n)||(i=!1,e.w("deviceId is null or empty").writeLog()),i}},{CommonUtils:w,ErrorUtils:N,Log:C}=n(315).Core.Utils;class D{constructor(e){if(e){if(e.lastAccess&&(this.lastAccess=e.lastAccess),e.numPage?this.page=e.numPage:this.page=0,e.pageSize&&(this.pageSize=e.pageSize),this.count=0,e.count&&(this.count=e.count),e.notifications){this.notifications=[];const t=e.notifications;for(let e=0;e<t.length;e++){const n=new o(t[e],this.lastAccess);this.notifications.push(n)}}this.totalPages=Math.trunc(this.count/this.pageSize)}this.dateFrom=null,this.dateTo=null,this.statusList=null,this.newNotifications=[o],this.isRequestingPage=!1}static generateAuthToken(e,t){let n={};navigator.indigitallGetAuthConfig&&w.isFunction(navigator.indigitallGetAuthConfig)&&(n=navigator.indigitallGetAuthConfig());const i=new d;i.setJson(n),l.postInboxAuth(i,e,t)}static getMessagesCountWithAuth(e,t,n){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getMessagesCount(t,n)}static setUrlInboxApi(e){t.setUrlInboxApi(e)}static setInboxAuthMode(e){t.setInboxAuthMode(e)}static getMessagesCount(e,n){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new v;l.getInboxCounter(t,e,n=>{401===n.errorCode?this.generateAuthToken(()=>{l.getInboxCounter(t,e,n)},n):w.isFunction(n)&&n(n)})}else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_GET_ERROR));else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}static getInboxWithAuth(e,t,n){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getInbox(t,n)}static getInbox(e,t){D.getInboxWithPage(null,null,null,null,null,e,t)}static getInboxWithPageAuth(e,t,n,i,r,o,s,a){w.isFunction(e.getAuthConfig)&&(navigator.indigitallGetAuthConfig=e.getAuthConfig),D.getInboxWithPage(t,n,i,r,o,s,a)}static getInboxWithPage(e,n,i,r,o,s,a){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new g;e&&t.setPage(e),n&&t.setPageSize(n),i&&(t.setDateFrom(i),this.dateFrom=i),r&&(t.setDateTo(r),this.dateTo=r),o&&(t.setStatusList(o),this.statusList=o),l.getInbox(t,e=>{this.totalPages=e.totalPages,0!==e.count?w.isFunction(s)&&s(e):w.isFunction(a)&&a(N.showError(O,O.ErrorCode.INBOX_GET_PAGE_ERROR))},e=>{401==e.errorCode?this.generateAuthToken(()=>{l.getInbox(t,e=>{this.totalPages=e.totalPages,w.isFunction(s)&&s(e)},e)},e):w.isFunction(e)&&e(e)})}else w.isFunction(a)&&a(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(a)&&a(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}getNextPage(e,n){const i=new C("[IND]Inbox: ");if(this.isRequestingPage)i.w(O.ErrorMessage.INBOX_IS_REQUESTING_PAGE).writeLog();else if(this.isRequestingPage=!0,this.page+1<this.totalPages)if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){const t=new g;(this.page||0==this.page)&&t.setPage(this.page+1),this.pageSize&&t.setPageSize(this.pageSize),this.dateFrom&&t.setDateFrom(this.dateFrom),this.dateTo&&t.setDateTo(this.dateTo),this.statusList&&t.setStatusList(this.statusList),l.getInbox(t,t=>{this.notifications=this.notifications.concat(t.notifications),this.newNotifications=t.notifications,this.lastAccess=t.lastAccess,this.count=t.count,this.page=t.page,this.pageSize=t.pageSize,this.totalPages=t.totalPages,this.isRequestingPage=!1,w.isFunction(e)&&e(this,this.newNotifications)},n=>{401===n.errorCode?this.generateAuthToken(()=>{l.getInbox(t,t=>{this.notifications=this.notifications.concat(t.notifications),this.newNotifications=t.notifications,this.lastAccess=t.lastAccess,this.count=t.count,this.page=t.page,this.pageSize=t.pageSize,this.totalPages=t.totalPages,this.isRequestingPage=!1,w.isFunction(e)&&e(this,this.newNotifications)},n)},n):(this.isRequestingPage=!1,w.isFunction(n)&&n())})}else this.isRequestingPage=!1,w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(n)&&n(N.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else this.isRequestingPage=!1,w.isFunction(n)&&n(N.showError(O,O.ErrorCode.INBOX_NO_MESSAGES))}massiveEditNotifications(e,t,n,i){let r=p.SENT;t==p.CLICK&&(r=p.SENT),t==p.DELETED&&(r=p.CLICK),this.massiveEditNotifications(e,r,t,n,i)}massiveEditNotificationsWithInitialStatus(e,n,i,r,o){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(i){const t=new g;null!=e&&t.setSendingIds(e),t.setStatus(i),t.setInitialStatus(n),l.putInboxPush(t,r,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.putInboxPush(t,r,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(o)&&o(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(o)&&o(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}getInfoFromNotification(e,n,i){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(e){const t=new g;t.setSendingId(e),l.getInboxPushWithSendingId(t,this.lastAccess,n,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.getInboxPushWithSendingId(t,this.lastAccess,n,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(i)&&i(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(i)&&i(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}modifyStatusFromNotification(e,n,i,r){if(R.isValidFormatRequest())if(R.isValidFormat(t.getExternalId())){if(e&&n){const t=new g;t.setSendingId(e),t.setStatus(n),l.putInboxPushWithSendingId(t,this.lastAccess,i,e=>{401===e.errorCode?this.generateAuthToken(()=>{l.putInboxPushWithSendingId(t,this.lastAccess,i,e)},e):w.isFunction(e)&&e(e)})}}else w.isFunction(r)&&r(N.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else w.isFunction(r)&&r(N.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}}const L=D})(),i})(),e.exports=t()},824(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0});var r={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var o=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,r,o={__proto__:null,default:e};if(null===e||"object"!=i(e)&&"function"!=typeof e)return o;if(n=t){if(n.has(e))return n.get(e);n.set(e,o)}for(var s in e)"default"!==s&&{}.hasOwnProperty.call(e,s)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(r.get||r.set)?n(o,s,r):o[s]=e[s]);return o}(e)}(n(114));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.17.0","_id":"indigitall-web-core@4.17.0","_inBundle":false,"_integrity":"sha512-n86QFX154ZqEM49DQjVaKpqpFiEaNh2Hl26sYLJs/N+OplMmVeAW6SfLEWJtT41xzfr5Qv2+bsXbSI/z6PFiiA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.17.0","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.17.0","saveSpec":null,"fetchSpec":"4.17.0"},"_requiredBy":["#USER","/","/indigitall-web-inbox"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.17.0.tgz","_shasum":"17ad86c6550dd166e07cc8980942fc4cae87a41c","_spec":"indigitall-web-core@4.17.0","_where":"/home/circleci/webpush/push","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.17.0"}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{default:()=>ye});var e=n(824),t=n.n(e);const{Repository:r}=n(315).Core,o=new class extends r{constructor(){super(),this.SAFARI_WEBSITE_PUSH_ID=this.REPOSITORY+".SAFARI_WEBSITE_PUSH_ID",this.PUSH_TOKEN=this.REPOSITORY+".PUSH_TOKEN",this.PERMISSION_PUSH=this.REPOSITORY+".PERMISSION_PUSH",this.DEVICE_JSON=this.REPOSITORY+".DEVICE_JSON",this.PUT_REQUEST_TIMESTAMP=this.REPOSITORY+".PUT_REQUEST_TIMESTAMP",this.WORKER_PATH=this.REPOSITORY+".WORKER_PATH",this.TEST=this.REPOSITORY+".TEST",this.SAFARI_GESTURE_REQUEST_PERMISSION=this.REPOSITORY+".SAFARI_GESTURE_REQUEST_PERMISSION",this.UPDATE_TOPIC_SUBSCRIBE=this.REPOSITORY+".UPDATE_TOPIC_SUBSCRIBE",this.TOPIC_SYNC_TIMESTAMP=this.REPOSITORY+".TOPIC_SYNC_TIMESTAMP",this.TOPIC_SEMAPHORE=this.REPOSITORY+".TOPIC_SEMAPHORE",this.TOPIC_SYNC_IS_PROCESSING=this.REPOSITORY+".TOPIC_SYNC_IS_PROCESSING"}async getDeviceIdSync(){if(this.db&&this.db.IDB)return await this.db.getItem(this.DEVICE_ID)}setPushToken(e){this.setStorage(this.PUSH_TOKEN,e)}getPushToken(){return this.getStorage(this.PUSH_TOKEN)}setSafariWebsitePushId(e){this.setStorage(this.SAFARI_WEBSITE_PUSH_ID,e)}getSafariWebsitePushId(){return this.getStorage(this.SAFARI_WEBSITE_PUSH_ID)}setPermissionPush(e){this.setStorage(this.PERMISSION_PUSH,e)}getPermissionPush(){return this.getStorage(this.PERMISSION_PUSH)}async getDeviceJson(){return this.getStorage(this.DEVICE_JSON)}async setDeviceJson(e){this.setStorage(this.DEVICE_JSON,e)}async getPutRequestTimestamp(){return this.getStorage(this.PUT_REQUEST_TIMESTAMP)}async setPutRequestTimestamp(e){this.setStorage(this.PUT_REQUEST_TIMESTAMP,e)}setWorkerPath(e){this.setStorage(this.WORKER_PATH,e)}getWorkerPath(){return this.getStorage(this.WORKER_PATH)}setTestValue(e){this.setStorage(this.TEST,e)}getTestValue(){return this.getStorage(this.TEST)}setSafariGestureRequestPermission(e){this.setStorage(this.SAFARI_GESTURE_REQUEST_PERMISSION,e)}getSafariGestureRequestPermission(){return this.getStorage(this.SAFARI_GESTURE_REQUEST_PERMISSION)}async setUpdateTopicSubscribe(e){this.db&&this.db.IDB&&await this.db.setItem(this.UPDATE_TOPIC_SUBSCRIBE,e)}async getUpdateTopicSubscribe(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.UPDATE_TOPIC_SUBSCRIBE))}catch(e){console.log("getUpdateTopicSubscribe PushRepository",e)}return e}async setTopicSyncTimestamp(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SYNC_TIMESTAMP,e)}async getTopicSyncTimestamp(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_SYNC_TIMESTAMP))}catch(e){console.log("getTopicSyncTimestamp PushRepository",e)}return e}async setTopicSemaphore(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SEMAPHORE,e)}async getTopicSemaphore(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_SEMAPHORE))}catch(e){console.log("getTopicSemaphore PushRepository",e)}return e}async setTopicSyncIsProcessing(e){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SYNC_IS_PROCESSING,e)}async getTopicSyncIsProcessing(){let e;try{this.db&&this.db.IDB&&(e=await this.db.getItem(this.TOPIC_SYNC_IS_PROCESSING))}catch(e){console.log("getTopicSyncIsProcessing PushRepository",e)}return e}},{ErrorDictionary:s}=n(315).Core.Models,a=s.ErrorCode;Object.assign(a,{GENERAL_ERROR_BAD_REQUEST:601,GENERAL_ERROR_APPKEY_BAD_REQUEST:602,PUSH_INITIALIZATION_ERROR:1e3,PUSH_RECEPTION_ERROR:1200,PUSH_TOPICS_ERROR:1400,PUSH_DEVICE_ERROR:1500,PUSH_EVENT_ERROR:1600,PUSH_PERMISSION_NOT_ACCEPTED:1602,API_APPKEY_NOT_VALID:1601,DISABLED_CHANNEL:4404});const u=s.ErrorMessage;Object.assign(u,{GENERAL_ERROR_BAD_REQUEST:"AppKey or DeviceId are null or empty",GENERAL_ERROR_APPKEY_BAD_REQUEST:"AppKey is null or empty",PUSH_INITIALIZATION_ERROR:"initialization error",PUSH_RECEPTION_ERROR:"push reception error",PUSH_TOPICS_ERROR:"push topics error",PUSH_DEVICE_ERROR:"device error",PUSH_EVENT_ERROR:"event error",PUSH_PERMISSION_NOT_ACCEPTED:"permission not accepted",API_APPKEY_NOT_VALID:"appKey is missing'",DISABLED_CHANNEL:"disabled channel"});const c={ErrorCode:a,ErrorMessage:u},{Device:l}=n(315).Core.Models,f=class extends l{constructor(e=null,t){super(e,t),null==e?(null!=o.getDeviceId()&&(this.deviceId=o.getDeviceId()),null!=o.getPushToken()&&(this.pushToken=o.getPushToken())):t?e.deviceId&&(this.deviceId=e.deviceId,o.setDeviceId(this.deviceId)):(e.deviceId&&(this.deviceId=e.deviceId),e.pushToken&&(this.pushToken=e.pushToken))}static setDeviceJson(e){o.setDeviceJson(JSON.stringify(e.toJSON()))}getDeviceId(){return this.deviceId}getPushToken(){return this.pushToken}toJSON(){const e=super.toJSON();return this.deviceId&&(e.deviceId=this.deviceId),this.pushToken&&(e.pushToken=this.pushToken),e}},{DeviceStatus:d}=n(315).Core.Models,{BaseRequest:h}=n(315).Core.Api,p=class extends h{constructor(e=d.DEFAULT){super(),this.device=new f,this.status=e,this.notToUpdate=!1,this.deviceUpdate=!1}isDeviceUpdated(e){this.deviceUpdate=e}setDeviceId(e){this.device&&(this.device.deviceId=e)}setAppKey(e){this.appKey=e}getDeviceRequest(){return this.params=this.createQueryString(),this}postDeviceRequest(){return this.body=this.createDeviceJson(),this.status!==d.DEFAULT&&(this.body.enabled=1===this.status),this}putDeviceRequest(e){return this.params=this.createQueryString(),this.body=this.createPUTDeviceJson(e),this.status!==d.DEFAULT&&(this.body.enabled=1===this.status),this}getDeviceTopicsRequest(){return this.params=this.createQueryString(),this}postDeviceTopicsRequest(){return this.params=this.createQueryString(),this.body=this.createTopicsJson(),this}deleteDeviceTopicsRequest(){return this.params=this.createQueryString(),this.body=this.createTopicsJson(),this}createQueryString(){return this.device.deviceId?this.PARAM_DEVICE_ID+"="+this.device.deviceId:""}createDeviceJson(){let e={};try{e=this.device.toJSON()}catch(e){console.log("Error creating device request: "+e)}return e}createPUTDeviceJson(e){let t={};try{f.setDeviceJson(e),t=e.toJSON()}catch(e){console.log("Error creating device request: "+e)}return t}createTopicsJson(){const e={};return this.topics&&(e.topics=this.topics),e}getDeviceId(){return this.device.getDeviceId()}setTopics(e){this.topics=e}setExternalCode(e){this.device.setExternalCode(e)}},{EventType:E}=n(315).Core.Models,{Config:y}=n(315).Core,I=class{static async requestBackgroundSync(){const e=await navigator.serviceWorker.getRegistration(o.getWorkerPath());return null!=e?e:null}static findIndigitallSW(e){for(let t=0;t<e.length;t++)if(void 0!==e[t]&&e[t].active&&e[t].active.scriptURL&&e[t].active.scriptURL.includes("worker.min.js"))return e[t];return null}static async sendEventRequest(e,t){const n=new _;n.setAppKey(e.appKey),n.setDeviceId(e.deviceId),n.setPlatform(y.platform),n.setPushId(""+e.id),n.setJsonPush(e.jsonPush),n.setSendingId(""+e.sendingId),e.campaignId&&n.setCampaingId(""+e.campaignId),e.journeyStateId&&n.setJourneyStateId(e.journeyStateId),n.setEventType(E.EVENT_TYPE_CLICK),await n.setExternalCodeRequest(),"action-1"==t.action?n.setClickedButton(1):"action-2"==t.action?n.setClickedButton(2):n.setClickedButton(0),n.setServiceWorkerRequest(!0),await L.postEventPushClick(n)}static async topicsSubscribeFromServiceWorker(e,t){const n=new p;n.setTopics(t),n.setAppKey(e.appKey),n.setDeviceId(e.deviceId),await L.postTopicsSubscribeFromServiceWorker(n)}static prepareStatistics(e,t){const n=t,i=JSON.parse(e);return Object.keys(i).forEach(function(e){"appKey"!=e&&"pushId"!=e&&"action"!=e&&"buttons"!=e&&"id"!=e&&"title"!=e&&"body"!=e&&"icon"!=e&&"image"!=e&&"gif"!=e&&"layout"!=e&&"data"!=e&&"silent"!=e&&"securedData"!=e&&"securedKey"!=e&&"sendEventAck"!=e&&"applicationId"!=e&&"timezone"!=e&&"monochrome"!=e&&"requireInteraction"!=e&&"contentState"!=e&&"sendingId"!=e&&"campaignId"!=e&&"journeyStateId"!=e&&"interruptionLevel"!=e&&"fromExternalUrl"!=e&&("string"==typeof i[e]?n[e]=i[e]:"number"==typeof i[e]?n[e]=parseInt(i[e]):"boolean"==typeof i[e]?n[e]="true"===i[e]:null!==i[e]&&void 0!==i[e]&&(n[e]=i[e]))}),n}},{BaseEventRequest:g}=n(315).Core.Api,{EventType:m}=n(315).Core.Models,_=class extends g{constructor(){super()}setEventType(e){this.eventType=e}setPushId(e){this.pushId=e}setClickedButton(e){this.clickedButton=e}setSendingId(e){this.sendingId=e}setPermissionType(e){this.permissionType=e}setLocation(e,t){this.latitude=e,this.longitude=t}setDeviceId(e){this.deviceId=e}setPlatform(e){this.platform=e}setAppKey(e){this.appKey=e}setCustomData(e){this.customData=e}async setExternalCodeRequest(){this.externalCode=await o.getExternalIdRequest()}setExternalCode(e){this.externalCode=e}setCampaingId(e){this.campaignId=e}setJourneyStateId(e){this.journeyStateId=e}setJourneyExecution(e){this.journeyExecution=e}setCjCurrentStateId(e){this.cjCurrentStateId=e}setJsonPush(e){this.jsonPush=e}postEventPushRequest(){let e={};return e.deviceId=this.deviceId,e.platform=this.platform,this.eventType&&(e.eventType=this.eventType),this.pushId&&(e.pushId=this.pushId),e.clickedButton=this.clickedButton,null!=this.externalCode&&(e.externalCode=this.externalCode),this.sendingId&&"undefined"!=this.sendingId&&(e.sendingId=this.sendingId.toString()),this.journeyStateId&&(e.journeyStateId=this.journeyStateId),this.campaignId&&(e.campaignId=this.campaignId.toString()),null!=this.jsonPush&&(e=I.prepareStatistics(this.jsonPush,e)),this.body=e,this}postEventVisitRequest(){const e={};return e.deviceId=o.getDeviceId(),e.eventType=m.EVENT_TYPE_UPDATE,this.body=e,this}postEventPermissionRequest(){const e={};return e.deviceId=o.getDeviceId(),this.eventType&&(e.eventType=this.eventType),this.permissionType&&(e.permissionType=this.permissionType),this.body=e,this}postEventLocationRequest(){const e={};return e.deviceId=o.getDeviceId(),e.eventType=m.EVENT_TYPE_UPDATE,this.latitude&&(e.latitude=this.latitude),this.longitude&&(e.longitude=this.longitude),this.body=e,this}postEventCustomRequest(){const e={};return this.deviceId&&(e.deviceId=this.deviceId),this.eventType&&(e.eventType=this.eventType),this.customData&&(e.customData=this.customData),this.externalCode&&(e.externalCode=this.externalCode),this.body=e,this}postEventJourneyCustomRequest(){const e={};return this.deviceId&&(e.deviceId=this.deviceId),this.eventType&&(e.eventType=this.eventType),this.customData&&(e.customData=this.customData),this.externalCode&&(e.externalCode=this.externalCode),this.eventId&&(e.eventId=this.eventId),this.eventAt&&(e.eventAt=this.eventAt),this.body=e,this}},v=class{static urlBase64ToUint8Array(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),n=window.atob(t),i=new Uint8Array(n.length);for(let e=0;e<n.length;++e)i[e]=n.charCodeAt(e);return i}static callEventPermission(e,t){const n=new _;n.setAppKey(o.getAppKey()),n.setDeviceId(o.getDeviceId()),n.setPermissionType(e),n.setEventType(t),L.postEventPermission(n)}static async getPutRequestTimestamp(){return await o.getPutRequestTimestamp()?o.getPutRequestTimestamp():Date.now()+6048e5}},{Validations:S,Log:T}=n(315).Core.Utils,b=class extends S{static isAppKeyFormat(){const e=o.getAppKey();return null!=e&&""!=e&&"null"!=e&&e.length>3}static isValidFormatRequest(){const e=new T("[IND]PushValidations: "),t=o.getDeviceId();let n=!0;return this.isAppKeyFormat()||(n=!1,e.w("appKey is null or empty").writeLog()),o.isPushDisabled()||this.isValidFormat(t)||(n=!1,e.w("deviceId is null or empty").writeLog()),n}static async isPutRequestExceed(){return await v.getPutRequestTimestamp()<=Date.now()}static isSafariBrowserDevice(){const e=window.navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);return t&&n&&!e.match(/CriOS/i)&&!e.match(/OPiOS/i)}},{Config:O}=n(315).Core,{BaseClient:P}=n(315).Core.Api,{ErrorModel:A,Channel:R}=n(315).Core.Models,{TopicUtils:w,Log:N,CommonUtils:C,ErrorUtils:D}=n(315).Core.Utils,L=new class extends P{constructor(){super(),this.URL_BASE=O.client.URL_BASE,this.ENDPOINT_APPLICATION="/application",this.ENDPOINT_APPLICATION_ALL=this.ENDPOINT_APPLICATION+"/all",this.ENDPOINT_DEVICE="/device",this.ENDPOINT_DEVICE_TOPICS=this.ENDPOINT_DEVICE+"/topics",this.ENDPOINT_PUSH="/push",this.ENDPOINT_EVENT="/event",this.ENDPOINT_EVENT_PUSH=this.ENDPOINT_EVENT+"/push",this.ENDPOINT_EVENT_VISIT=this.ENDPOINT_EVENT+"/visit",this.ENDPOINT_EVENT_PERMISSION=this.ENDPOINT_EVENT+"/permission",this.ENDPOINT_EVENT_LOCATION=this.ENDPOINT_EVENT+"/location",this.ENDPOINT_EVENT_CUSTOM=this.ENDPOINT_EVENT+"/custom",this.ENDPOINT_EVENT_CUSTOM_BEACON=this.ENDPOINT_EVENT_CUSTOM+"/beacon",this.ENDPOINT_BROWSER="/browser",this.log=new N("[IND]Client: ")}async getURL(){return await o.getUrlDeviceApi()||this.URL_BASE}async getApplicationAll(e,t,n){if(b.isAppKeyFormat()){const i=await this.get(this.ENDPOINT_APPLICATION_ALL,e.getApplicationRequest());!i||i instanceof A?i?C.isFunction(n)&&n(i):C.isFunction(n)&&n():C.isFunction(t)&&t(i)}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.BAD_REQUEST_SERVER_ERROR));return!0}async postDevice(e,t,n){if(b.isAppKeyFormat()){const i=await this.post(this.ENDPOINT_DEVICE,e.postDeviceRequest(),"include");if(!i||i instanceof A)i?C.isFunction(n)&&n(i):C.isFunction(n)&&n();else{const e={enabled:i.data.enabled,deviceId:i.data.deviceId,registeredByCookie:i.data.registeredByCookie};await o.setDeviceId(e.deviceId),C.isFunction(t)&&t(new f(e,!0))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_APPKEY_BAD_REQUEST));return!0}async putDevice(e,t,n){const i=new f,r=await b.isPutRequestExceed();if(e.deviceUpdate||null==await o.getPutRequestTimestamp()||r)if(b.isValidFormatRequest()){o.setPutRequestTimestamp(await v.getPutRequestTimestamp());const r=await this.put(this.ENDPOINT_DEVICE,e.putDeviceRequest(i),"include");if(!r||r instanceof A)r?C.isFunction(n)&&n(r):C.isFunction(n)&&n();else{const e={enabled:r.data.enabled,deviceId:r.data.deviceId,registeredByCookie:r.data.registeredByCookie};C.isFunction(t)&&t(new f(e,!0))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else C.isFunction(t)&&t(i)}async getDevice(e,t,n){if(b.isValidFormatRequest()){const i=await this.get(this.ENDPOINT_DEVICE,e.getDeviceRequest());if(!i||i instanceof A)i?C.isFunction(n)&&n(i):C.isFunction(n)&&n();else{const e={enabled:i.data.enabled,deviceId:i.data.deviceId};C.isFunction(t)&&t(new f(e,!0))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async getDeviceTopics(e,t,n){if(b.isValidFormatRequest()){const i=await this.get(this.ENDPOINT_DEVICE_TOPICS,e.getDeviceTopicsRequest());!i||i instanceof A?i?C.isFunction(n)&&n(i):C.isFunction(n)&&n():C.isFunction(t)&&t(w.setTopicChannel(i.data.topics,R.PUSH))}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postDeviceTopics(e,t,n){return b.isValidFormatRequest()?await this.postDeviceTopicsRequest(e,t,n):C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST)),!0}async postDeviceTopicsRequest(e,t,n){const i=await this.post(this.ENDPOINT_DEVICE_TOPICS,e.postDeviceTopicsRequest());if(!i||i instanceof A)i?C.isFunction(n)&&n(i):C.isFunction(n)&&n();else{const e=i.data.topics;C.isFunction(t)&&t(e)}}async deleteDeviceTopics(e,t,n){return b.isValidFormatRequest()?this.deleteDeviceTopicsRequest(e,t,n):C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST)),!0}async deleteDeviceTopicsRequest(e,t,n){const i=await this.delete(this.ENDPOINT_DEVICE_TOPICS,e.deleteDeviceTopicsRequest());if(!i||i instanceof A)i?C.isFunction(n)&&n(i):C.isFunction(n)&&n();else{const e=i.data.topics;C.isFunction(t)&&t(e)}}async postEventPush(e){b.isValidFormatRequest()&&await this.post(this.ENDPOINT_EVENT_PUSH,e.postEventPushRequest())}postEventVisit(e){b.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_VISIT,e.postEventVisitRequest())}postEventPermission(e){b.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_PERMISSION,e.postEventPermissionRequest())}postEventLocation(e){b.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_LOCATION,e.postEventLocationRequest())}async getBrowser(e,t,n){if(b.isAppKeyFormat()){const i=await this.get(this.ENDPOINT_BROWSER,e);if(!i||i instanceof A)i?C.isFunction(n)&&n(i):C.isFunction(n)&&n();else{const e={browserName:i.data.browserName,browserVersion:i.data.browserVersion,deviceType:i.data.deviceType,osName:i.data.osName,osVersion:i.data.osVersion,supported:i.data.supported,platform:i.data.platform};await o.setBrowserName(e.browserName),o.setBrowserVersion(e.browserVersion),await o.setOsName(e.osName),o.setOsVersion(e.osVersion),o.setDeviceType(e.deviceType),o.setSupported(e.supported),await o.setPlatform("webpush"),C.isFunction(t)&&t(e)}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventCustom(e,t,n){if(b.isValidFormatRequest()){const i=await this.post(this.ENDPOINT_EVENT_CUSTOM,e.postEventCustomRequest());!i||i instanceof A?i?C.isFunction(n)&&n(i):C.isFunction(n)&&n():C.isFunction(t)&&t(i)}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventCustomSync(e,t,n){if(b.isValidFormatRequest()){e=e.postEventCustomRequest();try{if(navigator&&"sendBeacon"in navigator){const n=await this.getURL()+this.ENDPOINT_EVENT_CUSTOM_BEACON+e.getParams();navigator.sendBeacon(n,JSON.stringify(e.getBody())),C.isFunction(t)&&t()}else{const i=await this.getURL()+this.ENDPOINT_EVENT_CUSTOM+e.getParams(),r=new XMLHttpRequest;r.open("POST",i,!1),r.setRequestHeader("Content-Type","application/json"),r.onreadystatechange=()=>{r.readyState===XMLHttpRequest.DONE&&(r.status>=200||r.status<300)?C.isFunction(t)&&t():C.isFunction(n)&&n()},r.send(JSON.stringify(e.getBody()))}}catch(e){C.isFunction(n)&&n(D.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventJourney(e,t,n){if(b.isValidFormatRequest()){const i=await this.post(this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM,e.postEventJourneyCustomRequest());!i||i instanceof A?i?C.isFunction(n)&&n(i):C.isFunction(n)&&n():C.isFunction(t)&&t(i)}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventJourneySync(e,t,n){if(b.isValidFormatRequest()){e=e.postEventJourneyCustomRequest();try{let i=await this.getURL();if(i=i.replace("v1","v2"),navigator&&"sendBeacon"in navigator){const n=i+this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM_BEACON+e.getParams();navigator.sendBeacon(n,JSON.stringify(e.getBody())),C.isFunction(t)&&t()}else{const i=await this.getURL().replace("v1","v2")+this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM+e.getParams(),r=new XMLHttpRequest;r.open("POST",i,!1),r.setRequestHeader("Content-Type","application/json"),r.onreadystatechange=()=>{r.readyState===XMLHttpRequest.DONE&&(r.status>=200||r.status<300)?C.isFunction(t)&&t():C.isFunction(n)&&n()},r.send(JSON.stringify(e.getBody()))}}catch(e){C.isFunction(n)&&n(D.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}else C.isFunction(n)&&n(D.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventPushClick(e){let t="/event/push";e.journeyStateId&&(e.setJourneyRequest(!0),t="/push/event/click"),e.setServiceWorkerRequest(!0),await this.post(t,e.postEventPushRequest())}async postTopicsSubscribeFromServiceWorker(e){e.setServiceWorkerRequest(!0),await this.post("/device/topics",e.postDeviceTopicsRequest())}},{Config:M}=n(315).Core,{BaseRequest:U}=n(315).Core.Api,B=class extends U{getApplicationRequest(){return this.params=this.PARAM_PLATFORM+"="+M.platform,this}},k=Object.freeze({PERMISSION_TYPE_PUSH:"push",PERMISSION_TYPE_LOCATION:"location"}),{CorePermissions:V}=n(315).Core.Utils,j=class{static async getPermissionState(e){const t=await V.getPermission(e);return t?t.state:"push"===e?window.Notification&&window.Notification.permission?window.Notification.permission:void 0:"geolocation"===e?navigator.geolocation?"granted":"denied":void 0}static async getPermissions(){const[e,t]=await Promise.all([this.getPermissionState("push"),this.getPermissionState("geolocation")]),n={};return void 0!==e&&(n.push=e),void 0!==t&&(n.location=t),n}static async getPushPermission(){const e=await this.getPermissionState("push");return void 0!==e?{push:e}:{}}static async getLocationPermission(){const e=await this.getPermissionState("geolocation");return void 0!==e?{location:e}:{}}static async setPermissionsCallback(){V.setPermissionsCallback(),await V.setCallback("push",navigator.indigitallRequestPushPermission)}},{Log:Y,CommonUtils:F,ErrorUtils:x}=n(315).Core.Utils,{EventType:G}=n(315).Core.Models,W="[IND]IndigitallSafari: ",K=class{static isSafariPushNotificationSupported(){return!!b.isSafariBrowserDevice()||!!window?.safari?.pushNotification}static async launchNotificationPermissionForSafari(){const e=new Y(W);if(o.getSafariGestureRequestPermission()===G.EVENT_TYPE_ASK)if(o.getSafariWebsitePushId()&&o.getDeviceId())if(b.isSafariBrowserDevice()&&o.getWorkerPath()){const e=await navigator.serviceWorker.register(o.getWorkerPath());"granted"===await window.Notification.requestPermission()&&(o.setPermissionPush(G.EVENT_TYPE_ACCEPT),ye.subscribeForPushNotification(e))}else{const e=window.safari.pushNotification.permission(o.getSafariWebsitePushId());this.checkRemotePermission(e)}else o.getSafariWebsitePushId()?e.w("error Device Id is not found").writeLog():e.w("error Safari Website Push Id is not found").writeLog();else e.w("there was not user gesture to request safari permissions").writeLog()}static async checkRemotePermission(e){const t=new Y(W);try{if("default"===e.permission){const e={deviceCode:o.getDeviceId()};t.d("permission default: ",e).writeLog(),o.getPermissionPush()||v.callEventPermission(k.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_ASK),window.safari.pushNotification.requestPermission(await L.getURL()+"/safari",o.getSafariWebsitePushId(),e,window.indigitall.Push.checkRemotePermission)}else"denied"===e.permission?(t.w("permission denied: ",e).writeLog(),o.getPermissionPush()&&o.getPermissionPush()!=G.EVENT_TYPE_REJECT&&(v.callEventPermission(k.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_REJECT),o.setPermissionPush(G.EVENT_TYPE_REJECT))):"granted"===e.permission&&(t.d("permission granted: ",e).writeLog(),o.getPermissionPush()&&o.getPermissionPush()!=G.EVENT_TYPE_ACCEPT&&(v.callEventPermission(k.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_ACCEPT),o.setPermissionPush(G.EVENT_TYPE_ACCEPT)),e.deviceToken&&e.deviceToken!==o.getPushToken()&&(o.setPushToken(e.deviceToken),L.putDevice(new p,e=>{if(F.isFunction(navigator.indigitallOnInitialized)){const e={};e.push=o.getPermissionPush(),e.location=o.getPermissionLocation(),navigator.indigitallOnInitialized(e,new f)}F.isFunction(navigator.indigitallOnNewUserRegistered)&&!o.getNewUserTimestamp()&&(o.setNewUserTimestamp(Date.now()),navigator.indigitallOnNewUserRegistered(e)),ye.registerLocation()},navigator.indigitallOnError),o.setServiceTimestamp(Date.now())))}catch(e){F.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(x.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}}},H=new class{constructor(){this.TOPIC_SYNC_TIMESTAMP=3e4,this.TOPIC_SYNC_TAG="syncTopics",this.TOPIC_SYNC_SUBSCRIBE_CALLBACK="indigitallSyncTopicSubscribeOnSuccess",this.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK="indigitallSyncTopicSubscribeOnError",this.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK="indigitallSyncTopicUnsubscribeOnSuccess",this.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK="indigitallSyncTopicUnsubscribeOnError"}},q=Object.freeze({GREEN:"green",RED:"red"}),{CommonUtils:$}=n(315).Core.Utils,X=class{static async setTopicRequest(e){const t=new p;return t.setAppKey(await o.getAppKeySync()),t.setDeviceId(await o.getDeviceIdSync()),t.setServiceWorkerRequest(!0),t.setTopics(e),t}static async getTopicsList(e,t){try{const n=await o.getTopicList();n&&n.length>0?await se.isTopicTimestampExceed()?this.getDeviceTopicClient(e,t):(await o.setTopicSemaphore(q.GREEN),$.isFunction(e)&&e(n)):this.getDeviceTopicClient(e,t)}catch(e){await o.setTopicSemaphore(q.GREEN)}}static async getDeviceTopicClient(e,t){try{L.getDeviceTopics(new p,async t=>{await se.setTopicTimestamp(),await o.setTopicList(t),await o.setTopicSemaphore(q.GREEN),$.isFunction(e)&&e(t)},async e=>{await se.setTopicTimestamp(),await o.setTopicSemaphore(q.GREEN),$.isFunction(t)&&t(e)})}catch(e){await o.setTopicSemaphore(q.GREEN),$.isFunction(t)&&t(e)}}},Q=class{constructor(e,t){this.code=e,this.type=t}static getAllCodes(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].code);return t}toJSON(){const e={};return this.code&&(e.code=this.code),this.type&&(e.type=this.type),e}},{Channel:J,TopicSubscribeType:z}=n(315).Core.Models,{ErrorUtils:Z,Log:ee}=n(315).Core.Utils;class te{static async syncTopics(){if(!await o.getTopicSyncIsProcessing()){await o.setTopicSyncIsProcessing(!0);const e=setTimeout(async function(){try{await te.sendTopicSync()}catch(e){console.log("syncTopics TopicSyncUtils",e)}await o.setTopicSyncIsProcessing(!1),clearTimeout(e)},H.TOPIC_SYNC_TIMESTAMP)}}static async sendTopicSync(){const e=await se.filterTopicExistingOnIDB(),t=se.topicFilter(e,z.SUBSCRIBE),n=se.topicFilter(e,z.UNSUBSCRIBE);if(t&&t.length>0)L.postDeviceTopicsRequest(await X.setTopicRequest(t),async e=>{await se.setTopicTimestamp(),e.channel=J.PUSH,await o.setTopicList(e),se.indigitallSyncTopicEvent(H.TOPIC_SYNC_SUBSCRIBE_CALLBACK,e)},async e=>{se.indigitallSyncTopicEvent(H.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK,e)});else if(n&&n.length>0)L.deleteDeviceTopicsRequest(await X.setTopicRequest(n),async e=>{await se.setTopicTimestamp(),await o.setTopicList(e),se.indigitallSyncTopicEvent(H.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK,e)},async e=>{se.indigitallSyncTopicEvent(H.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK,e)});else{const e=Z.showError(c,c.ErrorCode.PUSH_TOPICS_ERROR,"there is no topic with one of the codes in the push topic list");se.indigitallSyncTopicEvent(H.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK,e),se.indigitallSyncTopicEvent(H.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK,e)}await o.setUpdateTopicSubscribe([])}static async updateTopicAction(e,t){const n=await o.getUpdateTopicSubscribe();if(n&&n.length>0){const i=new ee("[IND]TopicSyncUtils: ");try{const i=[],r=n.filter(t=>e.includes(t.code)),s=e.filter(e=>!Q.getAllCodes(n).includes(e));if(s&&s.length>0)for(let e=0;e<s.length;e++)null!==s[e]&&i.push(new Q(s[e],t).toJSON());if(r&&r.length>0)for(let e=0;e<r.length;e++){const i=n.findIndex(t=>t.code===r[e].code),o=new Q(r[e].code,t);n[i]=o.toJSON()}i.length>0&&await o.setUpdateTopicSubscribe(i.concat(n))}catch(e){i.e("updateTopicAction: "+e).writeLog()}}else{const n=[];for(let i=0;i<e.length;i++){const r=e[i];n.push({code:r,type:t})}await o.setUpdateTopicSubscribe(n)}}}const ne=te,{TopicSubscribeType:ie}=n(315).Core.Models,{CommonUtils:re}=n(315).Core.Utils;class oe{static async updateTopic(e,t,n,i){oe.checkTopicSemaphore().then(async()=>{await o.setTopicSemaphore(q.RED),await X.getTopicsList(async r=>{await this.setTopicCallbacks(e,n,i),await this.requestTopicBackground(H.TOPIC_SYNC_TAG),await ne.updateTopicAction(t,e)},i)})}static async checkTopicSemaphore(){if(await o.getTopicSemaphore()!=q.RED)return!0;this.topicSemaphoreWaitTime(()=>!0)}static async topicSemaphoreWaitTime(e){const t=setInterval(async function(){await o.getTopicSemaphore()==q.GREEN&&(clearInterval(t),e())},1e3)}static async setTopicCallbacks(e,t,n){let i=H.TOPIC_SYNC_SUBSCRIBE_CALLBACK,r=H.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK;e===ie.UNSUBSCRIBE&&(i=H.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK,r=H.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK);const o=new BroadcastChannel(i);o.onmessage=e=>{re.isFunction(t)&&t(e.data),o.close()};const s=new BroadcastChannel(r);s.onmessage=e=>{re.isFunction(n)&&n(e.data),s.close()}}static async requestTopicBackground(e){const t=await I.requestBackgroundSync();null!=t&&await t.sync.register(e)}static async isTopicTimestampExceed(){const e=await o.getTopicSyncTimestamp();return!(e&&e>Date.now())&&void 0!==e}static async setTopicTimestamp(){const e=Date.now()+H.TOPIC_SYNC_TIMESTAMP;await o.setTopicSyncTimestamp(e)}static indigitallSyncTopicEvent(e,t){new BroadcastChannel(e).postMessage(t)}static topicFilter(e,t){const n=[];if(e)for(let i=0;i<e.length;i++)e[i].type===t&&n.push(e[i].code);return n}static async filterTopicExistingOnIDB(){const e=await o.getUpdateTopicSubscribe(),t=await o.getTopicList(),n=[];for(let i=0;i<e.length;i++)for(let r=0;r<t.length;r++)e[i]&&t[r]&&e[i].code==t[r].code&&(!0===t[r].subscribed&&e[i].type==ie.UNSUBSCRIBE||!1===t[r].subscribed&&e[i].type==ie.SUBSCRIBE)&&n.push(e[i]);return n}}const se=oe,{EventType:ae,DeviceStatus:ue}=n(315).Core.Models,{LogLevel:ce,Log:le,CommonUtils:fe,ErrorUtils:de,CryptoUtils:he}=n(315).Core.Utils,pe="[IND]IndigitallPush: ";class Ee{constructor(){this.config=null,this.interval=null}static async init(e){try{let n=new le(pe);if(!e)return void n.w("config is not defined").writeLog();e.onPushPermissionChanged&&(e.requestPushPermission=e.onPushPermissionChanged),e.onLocationPermissionChanged&&(e.requestLocationPermission=e.onLocationPermissionChanged),this.config=e,this.config.logLevel?(o.setLogLevel(this.config.logLevel),n=new le(pe)):this.config.setDebugLog&&(o.setLogLevel(ce.WARNING),n=new le(pe));let i="https://device-api.indigitall.com/v1",r="https://inbox-api.indigitall.com/v1",s="https://device-api.indigitall.com/v2";if(this.config.urlDeviceApi&&(i=this.config.urlDeviceApi),this.config.urlInAppApi&&(s=this.config.urlInAppApi),this.config.urlInboxApi&&(r=this.config.urlInboxApi),o.setAvoidCypher(!!this.config.avoidCypher&&this.config.avoidCypher),await o.setUrlDeviceApi(i),t()&&t().setUrlInboxApi(r),fe.isFunction(this.config.requestPushPermission)&&(navigator.indigitallRequestPushPermission=this.config.requestPushPermission),fe.isFunction(this.config.requestLocationPermission)&&(navigator.indigitallRequestLocationPermission=this.config.requestLocationPermission),fe.isFunction(this.config.onNewUserRegistered)&&(navigator.indigitallOnNewUserRegistered=this.config.onNewUserRegistered),fe.isFunction(this.config.onInitialized)&&(navigator.indigitallOnInitialized=this.config.onInitialized),fe.isFunction(this.config.onError)&&(navigator.indigitallOnError=this.config.onError),fe.isFunction(this.config.onLocationUpdated)&&(navigator.indigitallOnLocationUpdated=this.config.onLocationUpdated),this.config.disabledPushService)return this.config.appKey&&await o.setAppKey(this.config.appKey),o.setPushDisabled(!0),n.i("Push Service disabled").writeLog(),fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError("Push Service disabled"),!1;o.setTimeoutRequestsInMilliseconds(0),this.config.timeoutRequestsInMilliseconds&&o.setTimeoutRequestsInMilliseconds(this.config.timeoutRequestsInMilliseconds);const a=await j.getPushPermission();if(j.setPermissionsCallback(),a&&"denied"===a.push)return n.i("Push permission denied").writeLog(),fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError("Push permission denied"),!1;if(!fe.isServiceTimestampExceed())return this.device=new f,j.getPermissions().then(e=>{fe.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(e,new f)}),n.d("Device enabled").writeLog(),!0;{let e="",i=null;if(!this.config||!this.config.appKey)return n.w("config.appKey is not defined").writeLog(),!1;if(e=this.config.appKey,this.config.requestLocation&&await o.setRequestLocation(this.config.requestLocation),this.config.workerPath&&(i=this.config.workerPath,o.setWorkerPath(i)),e){if(await o.setAppKey(e),Ee.isServiceWorkerSupported()){const e=new B;return L.getBrowser(e,e=>{if(e.supported||this.isSafariBrowserDevice()){n.d("browser supported for webpush").writeLog();const r=new B;L.getApplicationAll(r,async r=>{if(n.d("application ",r).writeLog(),r&&r.data&&r.data.configuration){const e=r.data.configuration;n.d("configuration ",e).writeLog(),e.vapidPublic&&o.setVAPID(e.vapidPublic),e.safariWebsitePushId&&o.setSafariWebsitePushId(e.safariWebsitePushId),e.enabled&&o.setEnabled(e.enabled),e.serviceSyncTime&&o.setServiceSyncTime(e.serviceSyncTime),e.locationEnabled&&o.setLocationEnabled(e.locationEnabled),e.locationUpdateMinutes&&o.setLocationUpdateMinutes(e.locationUpdateMinutes),e.inboxAuthMode&&t()&&t().setInboxAuthMode(e.inboxAuthMode),e.inAppEnabled&&(o.setInAppEnabled(e.inAppEnabled),await o.setUrlInappApi(s)),e.encryptionType&&o.setEncryptionType(e.encryptionType)}const a=new p;o.getDeviceId()&&o.getPushToken()?L.putDevice(a,t=>{try{if(fe.isServiceTimestampExceed()){const e=new _;e.setAppKey(o.getAppKey()),e.setDeviceId(o.getDeviceId()),L.postEventVisit(e)}t.registeredByCookie?(o.setServiceTimestamp(Date.now()),j.getPushPermission().then(e=>{const t=new f;t.deviceId&&n.i("deviceId:",t.deviceId).writeLog(),t.pushToken&&n.i("pushToken:",t.pushToken).writeLog(),this.config&&fe.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(e,t)})):"Safari"!==e.browserName&&Ee.registerForPush(i)}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}},navigator.indigitallOnError):L.postDevice(a,t=>{try{const n=new _;n.setAppKey(o.getAppKey()),n.setDeviceId(o.getDeviceId()),L.postEventVisit(n),t.registeredByCookie?o.setServiceTimestamp(Date.now()):"Safari"!==e.browserName&&Ee.registerForPush(i)}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}},e=>{404===e.errorCode&&o.clearStorage(),fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(e)})},navigator.indigitallOnError)}else n.w("Browser not Supported").writeLog()},navigator.indigitallOnError),!0}n.w("ServiceWorker and SafariPushNotification not supported").writeLog()}else n.w("appKey is not found").writeLog()}}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}return!1}static deviceGet(e,t){return L.getDevice(new p,e,t),!0}static deviceEnable(e,t){const n=new p(ue.ENABLE);return n.isDeviceUpdated(!0),L.putDevice(n,e,t),!0}static deviceDisable(e,t){const n=new p(ue.DISABLE);return n.isDeviceUpdated(!0),L.putDevice(n,e,t),!0}static topicsList(e,t){return L.getDeviceTopics(new p,async t=>{fe.isFunction(e)&&e(t)},e=>{fe.isFunction(t)&&t(e)}),!0}static topicsSubscribe(e,t,n){const i=new p;return i.setTopics(e),L.postDeviceTopics(i,e=>{fe.isFunction(t)&&t(e)},e=>{fe.isFunction(n)&&n(e)}),!0}static topicsUnsubscribe(e,t,n){const i=new p;return i.setTopics(e),L.deleteDeviceTopics(i,e=>{fe.isFunction(t)&&t(e)},e=>{fe.isFunction(n)&&n(e)}),!0}static async topicsSubscribeUpdate(e,t,n,i){se.updateTopic(e,t,n,i)}static registerForPush(e){o.setWorkerPath(e),Ee.isServiceWorkerSupported()&&Ee.launchNotificationPermission(e)}static isSafariPushNotificationSupported(){return K.isSafariPushNotificationSupported()}static isServiceWorkerSupported(){return"serviceWorker"in navigator}static registerServiceWorker(e){const t=new le(pe);let n="/service-worker.js";return e&&(n=e),navigator.serviceWorker.register(n).then(e=>(t.d("ServiceWorker registration successful with scope: "+e.scope).writeLog(),e)).catch(e=>(t.e("ServiceWorker registration failed: ",e).writeLog(),e))}static launchNotificationPermissionForSafari(){this.registerForPush(o.getWorkerPath())}static isSafariBrowserDevice(){return b.isSafariBrowserDevice()}static launchNotificationPermission(e){const t=new le(pe);this.registerServiceWorker(e).then(e=>{try{let n;e.installing?n=e.installing:e.waiting?n=e.waiting:e.active&&(n=e.active),n&&(t.d("sw current state "+n.state).writeLog(),"activated"==n.state?Ee.subscribeForPushNotification(e):("installed"==n.state&&o.getPushToken()&&e.update(),n.addEventListener("statechange",function(n){t.d("sw statechange : "+n.target.state).writeLog(),"activated"==n.target.state&&Ee.subscribeForPushNotification(e)})))}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,e))}})}static async subscribeForPushNotification(e){const t=new le(pe);try{const n={userVisibleOnly:!0,applicationServerKey:v.urlBase64ToUint8Array(o.getVAPID())};t.d("Registration: ",e).writeLog(),o.getPermissionPush()||v.callEventPermission(k.PERMISSION_TYPE_PUSH,ae.EVENT_TYPE_ASK);const i=await e.pushManager.subscribe(n);t.d("Received PushSubscription: "+i).writeLog(),o.getPermissionPush()&&o.getPermissionPush()===ae.EVENT_TYPE_ACCEPT||(v.callEventPermission(k.PERMISSION_TYPE_PUSH,ae.EVENT_TYPE_ACCEPT),o.setPermissionPush(ae.EVENT_TYPE_ACCEPT));const r=i.toJSON();o.setBrowserPublicKey(r.keys.p256dh),o.setBrowserPrivateKey(r.keys.auth),o.setPushToken(r.endpoint),L.putDevice(new p,e=>{j.getPermissions().then(e=>{fe.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(e,new f)}),fe.isFunction(navigator.indigitallOnNewUserRegistered)&&!o.getNewUserTimestamp()&&(o.setNewUserTimestamp(Date.now()),navigator.indigitallOnNewUserRegistered(e)),Ee.registerLocation()},navigator.indigitallOnError),o.setServiceTimestamp(Date.now())}catch(e){t.e("No Registration: "+e).writeLog(),o.getPermissionPush()&&o.getPermissionPush()===ae.EVENT_TYPE_REJECT||(v.callEventPermission(k.PERMISSION_TYPE_PUSH,ae.EVENT_TYPE_REJECT),o.setPermissionPush(ae.EVENT_TYPE_REJECT)),fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(e)}}static registerLocation(){const e=new le(pe);try{navigator.geolocation&&o.getRequestLocation()&&o.getLocationEnabled()&&(!o.getLocationTimestamp()||o.getLocationUpdateMinutes()<=(Date.now()-o.getLocationTimestamp())/6e4)&&(o.getPermissionLocation()||v.callEventPermission(k.PERMISSION_TYPE_LOCATION,ae.EVENT_TYPE_ASK),navigator.geolocation.getCurrentPosition(e=>{o.getPermissionLocation()||o.getPermissionLocation()==ae.EVENT_TYPE_ACCEPT||(v.callEventPermission(k.PERMISSION_TYPE_LOCATION,ae.EVENT_TYPE_ACCEPT),o.setPermissionLocation(ae.EVENT_TYPE_ACCEPT));const t=new _;t.setLocation(e.coords.latitude,e.coords.longitude),L.postEventLocation(t),fe.isFunction(navigator.indigitallOnLocationUpdated)&&navigator.indigitallOnLocationUpdated(e),o.setLocationTimestamp(Date.now())},t=>{e.e("error "+t).writeLog(),o.getPermissionLocation()||o.getPermissionLocation()==ae.EVENT_TYPE_REJECT||(v.callEventPermission(k.PERMISSION_TYPE_LOCATION,ae.EVENT_TYPE_REJECT),o.setPermissionLocation(ae.EVENT_TYPE_REJECT))}))}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}static requestPushPermission(e){j.getPushPermission().then(t=>{fe.isFunction(e)&&e(t)})}static onPermissionChange(){j.setPermissionsCallback()}static requestLocationPermission(e){j.getLocationPermission().then(t=>{fe.isFunction(e)&&e(t)})}static logIn(e,t,n){Ee.setExternalId(e,t,n)}static logout(e,t){Ee.setExternalId(null,e,t)}static setExternalCode(e,t,n){Ee.setExternalId(e,t,n)}static async setExternalId(e,t,n){try{const i=o.getAppKey();if(!i)return void(fe.isFunction(n)&&n(de.showError(c,c.ErrorCode.API_APPKEY_NOT_VALID)));if(null!=e){const r=await he.createHmac(i,e);r&&this.setExternalIdRequest(r,t,n)}else this.setExternalIdRequest(null,t,n)}catch(e){fe.isFunction(n)&&n(de.showError(c,c.ErrorCode.PUSH_DEVICE_ERROR,e))}}static async setExternalIdRequest(e,t,n){o.setExternalId(e);const i=(await j.getPushPermission()).push,r=await o.getRegisteredByCookie();if("granted"!==i&&!r)return void(fe.isFunction(n)&&n(de.showError(c,c.ErrorCode.PUSH_PERMISSION_NOT_ACCEPTED)));if(o.isPushDisabled())return void(fe.isFunction(n)&&n(de.showError(c,c.ErrorCode.DISABLED_CHANNEL)));const s=new p;await o.setExternalIdRequest(e),s.setExternalCode(e),s.isDeviceUpdated(!0),L.putDevice(s,e=>{fe.isFunction(t)&&t(new f(e))},n)}static sendCustomEvent(e,t=null,n=null,i,r){try{let s="",a={},u=!0;"string"==typeof e?s=e:"object"==typeof e&&(s=e.eventType,e.customData&&(a=e.customData),!1===e.async&&(u=e.async));const c=new _;c.setDeviceId(o.getDeviceId()),c.setEventType(s),c.setCustomData(a),null!=o.getExternalId()&&"null"!=o.getExternalId()?(c.setExternalCode(o.getExternalId()),c.setJourneyRequest(!0),c.setEventId(t),c.setEventAt(n),!1===u?L.postEventJourneySync(c,i,r):L.postEventJourney(c,i,r)):!1===u?L.postEventCustomSync(c,i,r):L.postEventCustom(c,i,r)}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}static sendJourneyEvent(e,t=null,n=null,i,r){try{let s="",a={},u=!0;"string"==typeof e?s=e:"object"==typeof e&&(s=e.eventType,e.customData&&(a=e.customData),!1===e.async&&(u=e.async));const c=new _;c.setDeviceId(o.getDeviceId()),c.setExternalCodeRequest(),c.setEventType(s),c.setCustomData(a),c.setJourneyRequest(!0),c.setEventId(t),c.setEventAt(n),!1===u?L.postEventJourneySync(c,i,r):L.postEventJourney(c,i,r)}catch(e){fe.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(de.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,e))}}}const ye=Ee;window.indigitall||(window.indigitall={}),window.indigitall.Push=Ee,window.indigitall.Push.PermissionUtils=j,window.indigitall.LogLevel=ce,window.indigitall.version=o.getVersion()})(),i})(),e.exports=t()},904(e){"use strict";e.exports=JSON.parse('{"_from":"indigitall-web-core@4.17.0","_id":"indigitall-web-core@4.17.0","_inBundle":false,"_integrity":"sha512-n86QFX154ZqEM49DQjVaKpqpFiEaNh2Hl26sYLJs/N+OplMmVeAW6SfLEWJtT41xzfr5Qv2+bsXbSI/z6PFiiA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.17.0","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.17.0","saveSpec":null,"fetchSpec":"4.17.0"},"_requiredBy":["#USER","/","/indigitall-web-notification"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.17.0.tgz","_shasum":"17ad86c6550dd166e07cc8980942fc4cae87a41c","_spec":"indigitall-web-core@4.17.0","_where":"/home/circleci/webpush/sdk","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.17.0"}')},330(e){"use strict";e.exports=JSON.parse('{"name":"indigitall-web-sdk","description":"indigitall webpush SDK","version":"4.17.0","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","dependencies":{"indigitall-web-core":"^4.17.0","indigitall-web-customer":"^4.17.0","indigitall-web-inapp":"^4.17.0","indigitall-web-inbox":"^4.17.0","indigitall-web-notification":"^4.17.0"},"devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","build-sdk":"npm run build-install-core && npm run build-install-inapp && npm run build","build-install-core":"npm uninstall indigitall-web-core && npm install ../core","build-install-inapp":"npm uninstall indigitall-web-inapp && npm install ../inapp","build-install-customer":"npm uninstall indigitall-web-customer && npm install ../customer","build-install-inbox":"npm uninstall indigitall-web-inbox && npm install ../inbox","build-install-push":"npm uninstall indigitall-web-notification && npm install ../push","install-sdk":"npm install && npm run build","release-install-core":"npm uninstall indigitall-web-core && npm install indigitall-web-core@$npm_package_version","release-install-inapp":"npm uninstall indigitall-web-inapp && npm install indigitall-web-inapp@$npm_package_version ","release-install-customer":"npm uninstall indigitall-web-customer && npm install indigitall-web-customer@$npm_package_version ","release-install-inbox":"npm uninstall indigitall-web-inbox && npm install indigitall-web-inbox@$npm_package_version ","release-install-push":"npm uninstall indigitall-web-notification && npm install indigitall-web-notification@$npm_package_version && npm run release-install-core && npm run release-install-inapp && npm run release-install-inbox && npm run release-install-customer && npm run install-sdk && npm run delete-node-modules","simulate-release-install-sdk":"npm run install-sdk && npm run delete-node-modules","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json"}}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i);var e=n(326),t=n.n(e),r=n(824),o=n.n(r),s=n(960),a=n.n(s),u=n(603),c=n.n(u);const{Log:l,LogLevel:f,CommonUtils:d,ErrorUtils:h}=n(315).Core.Utils,{Repository:p}=n(315).Core,E=n(330),{Channel:y}=n(315).Core.Models,I="[IND]Indigitall: ";class g{constructor(){this.config=null}static async init(e){return c().init(e)}static deviceGet(e,t){return c().deviceGet(e,t)}static deviceEnable(e,t){return c().deviceEnable(e,t)}static deviceDisable(e,t){return c().deviceDisable(e,t)}static topicsList(e,t){return c().topicsList(t=>{this.inAppTopicList(t,e,n=>{new l(I).w(n.message).writeLog(),d.isFunction(e)&&e(t)})},n=>{new l(I).w(n).writeLog(),this.inAppTopicList(null,e,t),d.isFunction(t)&&t(n)})}static async inAppTopicList(e,n,i){"true"===(new p).isInAppEnabled()?t().topicsList(async t=>{null!=e?(await(new p).setTopicList(e),await(new p).setInAppTopicList(t),d.isFunction(n)&&n(t.concat(e))):(await(new p).setInAppTopicList(t),d.isFunction(n)&&n(t))},async t=>{null!=e?(await(new p).setTopicList(e),d.isFunction(n)&&n(e)):d.isFunction(i)&&i(t)}):null!=e?(await(new p).setTopicList(e),d.isFunction(n)&&n(e)):d.isFunction(i)&&i(h.showError(null,null,"Internal error bad topic list"))}static inAppTopicsListFromConsole(e,n,i){t().topicsListFromConsole(e,n,i)}static topicsSubscribe(e,n,i){"true"===(new p).isInAppEnabled()?t().topicsSubscribe(e,t=>{this.pushTopicsSubscribe(e,t,n,i)},async t=>{new l(I).w(t).writeLog(),this.pushTopicsSubscribe(e,null,n,i)}):this.pushTopicsSubscribe(e,null,n,i)}static pushTopicsSubscribe(e,t,n,i){c().topicsSubscribe(e,async e=>{this.topicActionOnSuccess(t,e,n)},async e=>{this.topicActionOnError(t,e,n,i)})}static async topicsUnsubscribe(e,n,i){"true"===(new p).isInAppEnabled()?t().topicsUnsubscribe(e,t=>{this.pushTopicsUnsubscribe(e,t,n,i)},async t=>{new l(I).w(t).writeLog(),this.pushTopicsUnsubscribe(e,null,n,i)}):this.pushTopicsUnsubscribe(e,null,n,i)}static pushTopicsUnsubscribe(e,t,n,i){c().topicsUnsubscribe(e,async e=>{this.topicActionOnSuccess(t,e,n)},async e=>{this.topicActionOnError(t,e,n,i)})}static async topicActionOnSuccess(e,t,n){let i=[];null!=e&&(i=e,await(new p).setInAppTopicList(e)),null!=t&&await(new p).setTopicList(t),d.isFunction(n)&&n(i.concat(t))}static async topicActionOnError(e,t,n,i){new l(I).w(`${t.errorCode}: ${t.exceptionMessage}`).writeLog(),null!=e?(await(new p).setInAppTopicList(e),d.isFunction(n)&&n(e)):d.isFunction(i)&&i(t)}static async setExternalId(e,t,n){c().setExternalId(e,t,n)}static logIn(e,t,n){g.setExternalId(e,t,n)}static logout(e,t){g.setExternalId(null,e,t)}static sendCustomEvent(e,t=null,n=null,i,r){c().sendCustomEvent(e,t,n,i,r)}static sendJourneyEvent(e,t=null,n=null,i,r){c().sendJourneyEvent(e,t,n,i,r)}static isServiceWorkerSupported(){return c().isServiceWorkerSupported()}static isSafariPushNotificationSupported(){return c().isSafariPushNotificationSupported()}static isSafariPermissionAsked(){return c().isSafariPermissionAsked()}static isSafariBrowserDevice(){return c().isSafariBrowserDevice()}static launchNotificationPermissionForSafari(){c().launchNotificationPermissionForSafari()}static getPermissionsStatus(){return c().PermissionUtils.getPermissions()}static async showInApp(e,n,i,r){t().showInApp(e,n,i,r)}static async showInAppWithCallback(e,n={}){t().showInAppWithCallback(e,n)}static async showInAppWithConfig(e,n,i,r,o,s,a,u,c,l,f){t().showInAppWithConfig(e,n,null,r,o,s,a,u,c,l,f)}static showMultipleInApp(e,n,i,r){t().showMultipleInApp(e,n,i,r)}static async showMultipleInAppWithCallback(e,n={}){t().showMultipleInAppWithCallback(e,n)}static async showMultipleInAppWithConfig(e,n,i,r,o,s,a,u,c,l,f){t().showMultipleInAppWithConfig(e,n,null,r,o,s,a,u,c,l,f)}static getInboxMessagesCount(e,t,n){o().getMessagesCountWithAuth(e,t,n)}static getInbox(e,t,n){o().getInboxWithAuth(e,t,n)}static getInboxWithPage(e,t,n,i,r,s,a,u){o().getInboxWithPage(e,t,n,i,r,s,a,u)}static getCustomer(e,t){a().getCustomer(e,t)}static getCustomerInformation(e,t){this.getCustomerInformationWithFields(null,e,t)}static getCustomerInformationWithFields(e,t,n){a().getCustomerInformation(e,t,n)}static assignOrUpdateValueToCustomerFields(e,t,n){a().assignOrUpdateValueToCustomerFields(e,t,n)}static deleteValuesFromCustomerFields(e,t,n){a().deleteValuesFromCustomerFields(e,t,n)}static link(e,t,n,i){g.logIn(e,e=>{a().link(t,n,i)},e=>{d.isFunction(i)&&i(e)})}static unlink(e,t,n){g.logout(i=>{a().unlink(e,t,n)},e=>{d.isFunction(n)&&n(e)})}static sendCustomerCustomEvent(e,t,n=null,i=null,r,o){a().sendCustomerCustomEvent(e,t,n,i,r,o)}}window.indigitall=g,window.indigitall.InApp=t(),window.indigitall.Inbox=o(),window.indigitall.Customer=a(),window.indigitall.Push=c(),window.indigitall.InApp.Utils=t().Utils,window.indigitall.Push.PermissionUtils=c().PermissionUtils,window.indigitall.Channel=y,window.indigitall.LogLevel=f,window.indigitall.version=E.version})(),i})());
|