@letscooee/web-sdk 0.0.2 → 0.0.6
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/CHANGELOG.md +15 -1
- package/README.md +4 -2
- package/dist/constants.js +10 -2
- package/dist/index-preview.js +3 -0
- package/dist/init/object-meddler.js +3 -0
- package/dist/models/event/event-response.js +1 -0
- package/dist/models/trigger/action/click-action-executor.js +260 -0
- package/dist/models/trigger/blocks/background.js +33 -0
- package/dist/models/trigger/blocks/border.js +49 -0
- package/dist/models/trigger/blocks/click-action.js +9 -0
- package/dist/models/trigger/blocks/color.js +48 -0
- package/dist/models/trigger/blocks/colour.js +1 -0
- package/dist/models/trigger/blocks/flex.js +1 -0
- package/dist/models/trigger/blocks/font.js +1 -0
- package/dist/models/trigger/blocks/glossy.js +25 -0
- package/dist/models/trigger/blocks/gradient.js +1 -0
- package/dist/models/trigger/blocks/image.js +1 -0
- package/dist/models/trigger/blocks/index.js +5 -0
- package/dist/models/trigger/blocks/position.js +1 -0
- package/dist/models/trigger/blocks/shadow.js +1 -0
- package/dist/models/trigger/blocks/spacing.js +1 -0
- package/dist/models/trigger/blocks/transform.js +13 -0
- package/dist/models/trigger/elements/base-element.js +50 -0
- package/dist/models/trigger/elements/base-text-element.js +1 -0
- package/dist/models/trigger/elements/group-element.js +1 -0
- package/dist/models/trigger/elements/image-element.js +26 -0
- package/dist/models/trigger/elements/index.js +4 -0
- package/dist/models/trigger/elements/shape-element.js +24 -0
- package/dist/models/trigger/elements/text-element.js +81 -0
- package/dist/models/trigger/inapp/container.js +24 -0
- package/dist/models/trigger/inapp/in-app-trigger.js +32 -0
- package/dist/models/trigger/inapp/layer.js +1 -0
- package/dist/models/trigger/trigger-data.js +7 -1
- package/dist/renderer/base-text-renderer.js +77 -0
- package/dist/renderer/block-processor.js +234 -0
- package/dist/renderer/block-renderer.js +44 -0
- package/dist/renderer/container-renderer.js +45 -0
- package/dist/renderer/group-renderer.js +44 -0
- package/dist/renderer/iFrame-renderer.js +85 -0
- package/dist/renderer/image-renderer.js +44 -0
- package/dist/renderer/in-app-renderer.js +76 -0
- package/dist/renderer/index.js +22 -0
- package/dist/renderer/renderer.js +77 -0
- package/dist/renderer/root-container-renderer.js +46 -0
- package/dist/renderer/shape-renderer.js +39 -0
- package/dist/renderer/text-renderer.js +48 -0
- package/dist/sdk-preview.min.js +2 -0
- package/dist/sdk-preview.min.js.LICENSE.txt +8 -0
- package/dist/sdk.min.js +1 -1
- package/dist/services/http-api.service.js +5 -1
- package/dist/utils/log.js +14 -10
- package/dist/utils/runtime-data.js +0 -1
- package/package.json +5 -3
- package/webpack-preview.config.js +10 -0
package/dist/sdk.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see sdk.min.js.LICENSE.txt */
|
|
2
|
-
!function(){var e={489:function(e){for(var t=Math.floor(16777215*Math.random()),i=c.index=parseInt(16777215*Math.random(),10),n=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,r=function(e){return!(null==e||!e.constructor||"function"!=typeof e.constructor.isBuffer||!e.constructor.isBuffer(e))},o=[],s=0;s<256;s++)o[s]=(s<=15?"0":"")+s.toString(16);var a=new RegExp("^[0-9a-fA-F]{24}$"),u=[];for(s=0;s<10;)u[48+s]=s++;for(;s<16;)u[55+s]=u[87+s]=s++;function c(e){if(!(this instanceof c))return new c(e);if(e&&(e instanceof c||"ObjectID"===e._bsontype))return e;if(this._bsontype="ObjectID",null!=e&&"number"!=typeof e){var t=c.isValid(e);if(!t&&null!=e)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(t&&"string"==typeof e&&24===e.length)return c.createFromHexString(e);if(null==e||12!==e.length){if(null!=e&&"function"==typeof e.toHexString)return e;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=e}else this.id=this.generate(e)}e.exports=c,c.default=c,c.createFromTime=function(e){return new c((8,(8===(t=(t=e=parseInt(e,10)%4294967295).toString(16)).length?t:"00000000".substring(t.length,8)+t)+"0000000000000000"));var t},c.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var t="",i=0;i<24;)t+=String.fromCharCode(u[e.charCodeAt(i++)]<<4|u[e.charCodeAt(i++)]);return new c(t)},c.isValid=function(e){return null!=e&&("number"==typeof e||("string"==typeof e?12===e.length||24===e.length&&a.test(e):e instanceof c||!!r(e)||"function"==typeof e.toHexString&&(e.id instanceof _Buffer||"string"==typeof e.id)&&(12===e.id.length||24===e.id.length&&a.test(e.id))))},c.prototype={constructor:c,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(r(this.id))return this.id.toString("hex");for(var e="",t=0;t<this.id.length;t++)e+=o[this.id.charCodeAt(t)];return e},equals:function(e){return e instanceof c?this.toString()===e.toString():"string"==typeof e&&c.isValid(e)&&12===e.length&&r(this.id)?e===this.id.toString("binary"):"string"==typeof e&&c.isValid(e)&&24===e.length?e.toLowerCase()===this.toHexString():"string"==typeof e&&c.isValid(e)&&12===e.length?e===this.id:!(null==e||!(e instanceof c||e.toHexString))&&e.toHexString()===this.toHexString()},getTimestamp:function(){var e,t=new Date;return e=r(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(1e3*Math.floor(e)),t},generate:function(e){"number"!=typeof e&&(e=~~(Date.now()/1e3)),e=parseInt(e,10)%4294967295;var r=i=(i+1)%16777215;return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e,t>>16&255,t>>8&255,255&t,n>>8&255,255&n,r>>16&255,r>>8&255,255&r)}};var l=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";c.prototype[l]=function(){return"ObjectID("+this+")"},c.prototype.toJSON=c.prototype.toHexString,c.prototype.toString=c.prototype.toHexString},238:function(e,t,i){var n;!function(r,o){"use strict";var s="function",a="undefined",u="object",c="string",l="model",p="name",f="type",h="vendor",d="version",b="architecture",v="console",w="mobile",g="tablet",S="smarttv",m="wearable",y="embedded",E={extend:function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i},has:function(e,t){return typeof e===c&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===c?e.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(e,t){return e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),typeof t===a?e:e.substring(0,255)}},T={rgx:function(e,t){for(var i,n,r,a,c,l,p=0;p<t.length&&!c;){var f=t[p],h=t[p+1];for(i=n=0;i<f.length&&!c;)if(c=f[i++].exec(e))for(r=0;r<h.length;r++)l=c[++n],typeof(a=h[r])===u&&a.length>0?2==a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3==a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):o:this[a[0]]=l?a[1].call(this,l,a[2]):o:4==a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):o):this[a]=l||o;p+=2}},str:function(e,t){for(var i in t)if(typeof t[i]===u&&t[i].length>0){for(var n=0;n<t[i].length;n++)if(E.has(t[i][n],e))return"?"===i?o:i}else if(E.has(t[i],e))return"?"===i?o:i;return e}},_={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},I={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[p,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[p,d],[/opios[\/\s]+([\w\.]+)/i],[d,[p,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[d,[p,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,d],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[d,[p,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[d,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[p,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[d,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure Browser"],d],[/focus\/([\w\.]+)/i],[d,[p,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[d,[p,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[d,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[p,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[p,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[d,[p,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[p,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],d],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[p,d],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[p],[/;fbav\/([\w\.]+);/i],[d,[p,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[p,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[p,d],[/\bgsa\/([\w\.]+)\s.*safari\//i],[d,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[p,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],d],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[d,[p,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[p,d],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[p,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[p,[d,T.str,_.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[p,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[p,"Netscape"],d],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[d,[p,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[p,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,E.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[b,/ower/,"",E.lowerize]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,E.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[l,[h,"Samsung"],[f,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[l,[h,"Samsung"],[f,w]],[/\((ip(?:hone|od)[\s\w]*);/i],[l,[h,"Apple"],[f,w]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[h,"Apple"],[f,g]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[l,[h,"Huawei"],[f,g]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[l,[h,"Huawei"],[f,w]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[l,/_/g," "],[h,"Xiaomi"],[f,w]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[l,/_/g," "],[h,"Xiaomi"],[f,g]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[h,"OPPO"],[f,w]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[l,[h,"Vivo"],[f,w]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[l,[h,"Realme"],[f,w]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[l,[h,"Motorola"],[f,w]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[h,"Motorola"],[f,g]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[l,[h,"LG"],[f,g]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[l,[h,"LG"],[f,w]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[l,[h,"Lenovo"],[f,g]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[l,/_/g," "],[h,"Nokia"],[f,w]],[/droid.+;\s(pixel\sc)[\s)]/i],[l,[h,"Google"],[f,g]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[l,[h,"Google"],[f,w]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,"Sony"],[f,w]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[l,"Xperia Tablet"],[h,"Sony"],[f,g]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[l,[h,"OnePlus"],[f,w]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[l,[h,"Amazon"],[f,g]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[l,"Fire Phone"],[h,"Amazon"],[f,w]],[/\((playbook);[\w\s\),;-]+(rim)/i],[l,h,[f,g]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[l,[h,"BlackBerry"],[f,w]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[l,[h,"ASUS"],[f,g]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[l,[h,"ASUS"],[f,w]],[/(nexus\s9)/i],[l,[h,"HTC"],[f,g]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[h,[l,/_/g," "],[f,w]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[l,[h,"Acer"],[f,g]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[l,[h,"Meizu"],[f,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[h,l,[f,w]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[h,l,[f,g]],[/\s(surface\sduo)\s/i],[l,[h,"Microsoft"],[f,g]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[l,[h,"Fairphone"],[f,w]],[/\s(u304aa)\sbuild/i],[l,[h,"AT&T"],[f,w]],[/sie-(\w*)/i],[l,[h,"Siemens"],[f,w]],[/[;\/]\s?(rct\w+)\sbuild/i],[l,[h,"RCA"],[f,g]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[l,[h,"Dell"],[f,g]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[l,[h,"Verizon"],[f,g]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[l,[h,"Barnes & Noble"],[f,g]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[l,[h,"NuVision"],[f,g]],[/;\s(k88)\sbuild/i],[l,[h,"ZTE"],[f,g]],[/;\s(nx\d{3}j)\sbuild/i],[l,[h,"ZTE"],[f,w]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[l,[h,"Swiss"],[f,w]],[/[;\/]\s?(zur\d{3})\sbuild/i],[l,[h,"Swiss"],[f,g]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[l,[h,"Zeki"],[f,g]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[h,"Dragon Touch"],l,[f,g]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[l,[h,"Insignia"],[f,g]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[l,[h,"NextBook"],[f,g]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[h,"Voice"],l,[f,w]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[h,"LvTel"],l,[f,w]],[/;\s(ph-1)\s/i],[l,[h,"Essential"],[f,w]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[l,[h,"Envizen"],[f,g]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[l,[h,"MachSpeed"],[f,g]],[/[;\/]\s?tu_(1491)\sbuild/i],[l,[h,"Rotor"],[f,g]],[/(shield[\w\s]+)\sbuild/i],[l,[h,"Nvidia"],[f,g]],[/(sprint)\s(\w+)/i],[h,l,[f,w]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,"Microsoft"],[f,w]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,"Zebra"],[f,g]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,"Zebra"],[f,w]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[h,l,[f,v]],[/droid.+;\s(shield)\sbuild/i],[l,[h,"Nvidia"],[f,v]],[/(playstation\s[345portablevi]+)/i],[l,[h,"Sony"],[f,v]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[l,[h,"Microsoft"],[f,v]],[/smart-tv.+(samsung)/i],[h,[f,S]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,"Samsung"],[f,S]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[h,"LG"],[f,S]],[/(apple)\s?tv/i],[h,[l,"Apple TV"],[f,S]],[/crkey/i],[[l,"Chromecast"],[h,"Google"],[f,S]],[/droid.+aft([\w])(\sbuild\/|\))/i],[l,[h,"Amazon"],[f,S]],[/\(dtv[\);].+(aquos)/i],[l,[h,"Sharp"],[f,S]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[h,E.trim],[l,E.trim],[f,S]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[f,S]],[/((pebble))app\/[\d\.]+\s/i],[h,l,[f,m]],[/droid.+;\s(glass)\s\d/i],[l,[h,"Google"],[f,m]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[l,[h,"Zebra"],[f,m]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[h,[f,y]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[l,[f,w]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[l,[f,g]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[f,E.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[h,"Generic"]],[/(phone)/i],[[f,w]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[p,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,p]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[p,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[p,[d,T.str,_.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[p,"Windows"],[d,T.str,_.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[p,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[p,"Mac OS"],[d,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[p,d],[/\(bb(10);/i],[d,[p,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[d,[p,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[p,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[p,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[p,"Chromium OS"],d],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[p,d],[/(sunos)\s?([\w\.\d]*)/i],[[p,"Solaris"],d],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[p,d]]},x=function(e,t){if("object"==typeof e&&(t=e,e=o),!(this instanceof x))return new x(e,t).getResult();var i=e||(void 0!==r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),n=t?E.extend(I,t):I;return this.getBrowser=function(){var e={name:o,version:o};return T.rgx.call(e,i,n.browser),e.major=E.major(e.version),e},this.getCPU=function(){var e={architecture:o};return T.rgx.call(e,i,n.cpu),e},this.getDevice=function(){var e={vendor:o,model:o,type:o};return T.rgx.call(e,i,n.device),e},this.getEngine=function(){var e={name:o,version:o};return T.rgx.call(e,i,n.engine),e},this.getOS=function(){var e={name:o,version:o};return T.rgx.call(e,i,n.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===c&&e.length>255?E.trim(e,255):e,this},this.setUA(i),this};x.VERSION="0.7.28",x.BROWSER={NAME:p,MAJOR:"major",VERSION:d},x.CPU={ARCHITECTURE:b},x.DEVICE={MODEL:l,VENDOR:h,TYPE:f,CONSOLE:v,MOBILE:w,SMARTTV:S,TABLET:g,WEARABLE:m,EMBEDDED:y},x.ENGINE={NAME:p,VERSION:d},x.OS={NAME:p,VERSION:d},typeof t!==a?(e.exports&&(t=e.exports=x),t.UAParser=x):(n=function(){return x}.call(t,i,t,e))===o||(e.exports=n);var A=void 0!==r&&(r.jQuery||r.Zepto);if(A&&!A.ua){var D=new x;A.ua=D.getResult(),A.ua.get=function(){return D.getUA()},A.ua.set=function(e){D.setUA(e);var t=D.getResult();for(var i in t)A.ua[i]=t[i]}}}("object"==typeof window?window:this)}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};!function(){"use strict";i.d(n,{default:function(){return Ee}});var e=function(e,t){void 0===t&&(t={}),this.name=e,this.properties=t,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.activeTriggers=[],this.occurred=(new Date).toISOString()},t=i(489),r=i.n(t),o=function(){function e(){}return e.getString=function(t,i){return e.LOCAL_STORAGE.getItem(t)||i},e.setString=function(t,i){i||(i=""),e.LOCAL_STORAGE.setItem(t,i)},e.getNumber=function(t,i){return+e.getString(t,"")||i},e.setNumber=function(t,i){e.setString(t,i.toString())},e.getBoolean=function(e,t){var i=this.LOCAL_STORAGE.getItem(e);return i?JSON.parse(i):t},e.setBoolean=function(t,i){e.setString(t,JSON.stringify(i))},e.remove=function(t){e.LOCAL_STORAGE.removeItem(t)},e.LOCAL_STORAGE=window.localStorage,e}(),s=function(){function e(){}return e.API_URL="https://api.sdk.letscooee.com",e.SDK_VERSION="0.0.2",e.SDK_VERSION_CODE=2,e.SDK_DEBUG=!1,e.SDK="WEB",e.LOG_PREFIX="CooeeSDK",e.STORAGE_USER_ID="uid",e.STORAGE_SDK_TOKEN="st",e.STORAGE_DEVICE_UUID="uuid",e.STORAGE_SESSION_ID="sid",e.STORAGE_SESSION_NUMBER="sn",e.STORAGE_SESSION_START_TIME="sst",e.STORAGE_SESSION_START_EVENT_SENT="sses",e.STORAGE_FIRST_TIME_LAUNCH="ifl",e.STORAGE_LAST_ACTIVE="la",e.IDLE_TIME_IN_SECONDS=1800,e}(),a=function(){function e(){this.inInactive=!0,this.lastEnterActive=new Date,this.lastEnterInactive=null,this.webAppVersion="",this.isDebug=!1}return e.getInstance=function(){return this.INSTANCE},e.prototype.getWebAppVersion=function(){var e;return null!==(e=this.webAppVersion)&&void 0!==e?e:"0.0.1+1"},e.prototype.setWebAppVersion=function(e){this.webAppVersion=e},e.prototype.isDebugWebApp=function(){return this.isDebug},e.prototype.setDebugWebApp=function(e){this.isDebug=e},e.prototype.isInactive=function(){return this.inInactive},e.prototype.setInactive=function(){this.inInactive=!0,this.lastEnterInactive=new Date,o.setNumber(s.STORAGE_LAST_ACTIVE,this.lastEnterInactive.getTime())},e.prototype.setActive=function(){this.inInactive=!1,this.lastEnterActive=new Date},e.prototype.isFirstActive=function(){return null==this.lastEnterInactive},e.prototype.getLastEnterInactive=function(){return this.lastEnterInactive},e.prototype.getTimeForActiveInSeconds=function(){var e,t;return((null===(e=this.lastEnterInactive)||void 0===e?void 0:e.getTime())-(null===(t=this.lastEnterActive)||void 0===t?void 0:t.getTime()))/1e3},e.prototype.getTimeForInactiveInSeconds=function(){return null==this.lastEnterInactive?0:((new Date).getTime()-this.lastEnterInactive.getTime())/1e3},e.INSTANCE=new e,e}(),u=function(e,t){for(var i=0,n=t.length,r=e.length;i<n;i++,r++)e[r]=t[i];return e},c=function(){function e(){}return e.l=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.log.apply(console,u([s.LOG_PREFIX,":"],e))},e.e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,u([s.LOG_PREFIX,":"],e))},e.w=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.warn.apply(console,u([s.LOG_PREFIX,":"],e))},e}(),l=function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},p=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},f=function(){function e(){this.runtimeData=a.getInstance(),this.apiToken="",this.userID=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.doHTTP=function(e,t,i,n){return l(this,void 0,void 0,(function(){var r;return p(this,(function(o){switch(o.label){case 0:return t.startsWith("http")||(t=s.API_URL+t),[4,fetch(t,{method:e,body:JSON.stringify(i),headers:n})];case 1:if(!(r=o.sent()).ok)throw r;return[2,r.json()]}}))}))},e.prototype.registerDevice=function(e){return l(this,void 0,void 0,(function(){return p(this,(function(t){return[2,this.doHTTP("POST","/v1/device/validate",e,this.getDefaultHeaders())]}))}))},e.prototype.sendEvent=function(e){var t=this.getDefaultHeaders();t.append("x-sdk-token",this.apiToken),this.doHTTP("POST","/v1/event/track",e,t).then((function(){c.l("Sent",e.name)})).catch((function(e){c.e("Error sending event",e)}))},e.prototype.updateUserData=function(e){var t=this.getDefaultHeaders();t.append("x-sdk-token",this.apiToken),this.doHTTP("PUT","/v1/user/update",e,t).then((function(){c.l("Updated user profile")})).catch((function(e){c.e("Error saving user profile",e)}))},e.prototype.concludeSession=function(e){var t=this.getDefaultHeaders();t.append("x-sdk-token",this.apiToken),this.doHTTP("POST","/v1/session/conclude",e,t).then((function(e){c.l("Conclude Session",e)})).catch((function(e){c.e(e)}))},e.prototype.getDefaultHeaders=function(){var e=new Headers;return e.set("sdk-version",s.SDK_VERSION),e.set("sdk-version-code",s.SDK_VERSION_CODE.toString()),e.set("app-version",this.runtimeData.getWebAppVersion()),e.set("user-id",this.userID),s.SDK_DEBUG&&e.set("sdk-debug",String(1)),this.runtimeData.isDebugWebApp()&&e.set("app-debug",String(1)),e},e.prototype.setAPIToken=function(e){this.apiToken=null!=e?e:""},e.prototype.setUserId=function(e){this.userID=null!=e?e:""},e.INSTANCE=new e,e}(),h=function(){function e(){this.sessionManager=d.getInstance(),this.httpApiService=f.getInstance()}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.sendEvent=function(e){var t=this;de.replaySubject.subscribe((function(){t.addEventVariable(e),t.httpApiService.sendEvent(e)}))},e.prototype.updateProfile=function(e){var t=this;de.replaySubject.subscribe((function(){t.httpApiService.updateUserData(e)}))},e.prototype.concludeSession=function(e){var t=this;de.replaySubject.subscribe((function(){t.httpApiService.concludeSession(e)}))},e.prototype.addEventVariable=function(e){e.screenName=location.pathname,e.properties.path=location.pathname,e.sessionID=this.sessionManager.getCurrentSessionID(),e.sessionNumber=this.sessionManager.getCurrentSessionNumber()},e}(),d=function(){function e(){}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.getCurrentSessionID=function(){return this.currentSessionID||null},e.prototype.isNewSessionRequired=function(){if(!o.getString(s.STORAGE_SESSION_ID,""))return!0;var e=o.getNumber(s.STORAGE_SESSION_START_TIME,0);return((new Date).getTime()-e)/1e3>s.IDLE_TIME_IN_SECONDS},e.prototype.checkForNewSession=function(){this.isNewSessionRequired()?this.startNewSession():this.initializeSessionFromStorage()},e.prototype.startNewSession=function(){this.currentSessionID||(o.setBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!1),this.currentSessionStartTime=new Date,this.currentSessionID=(new(r())).toHexString(),o.setNumber(s.STORAGE_SESSION_START_TIME,this.currentSessionStartTime.getTime()),o.setString(s.STORAGE_SESSION_ID,this.currentSessionID),this.bumpSessionNumber())},e.prototype.bumpSessionNumber=function(){this.currentSessionNumber=o.getNumber(s.STORAGE_SESSION_NUMBER,0),this.currentSessionNumber+=1,o.setNumber(s.STORAGE_SESSION_NUMBER,this.currentSessionNumber)},e.prototype.getCurrentSessionNumber=function(){return this.currentSessionNumber||0},e.prototype.getTotalDurationInSeconds=function(){if(a.getInstance().isFirstActive())throw new Error("This is the first time in foreground after launch");return(this.getLastActive()-this.currentSessionStartTime.getTime())/1e3},e.prototype.conclude=function(){var e={sessionID:this.currentSessionID,occurred:new Date,duration:this.getTotalDurationInSeconds()};h.getInstance().concludeSession(e),this.destroySession()},e.prototype.destroySession=function(){this.currentSessionID=void 0,this.currentSessionNumber=void 0,this.currentSessionStartTime=void 0,o.remove(s.STORAGE_SESSION_ID),o.remove(s.STORAGE_SESSION_START_TIME)},e.prototype.initializeSessionFromStorage=function(){this.currentSessionStartTime=new Date(o.getNumber(s.STORAGE_SESSION_START_TIME,0)),this.currentSessionID=o.getString(s.STORAGE_SESSION_ID,""),this.currentSessionNumber=o.getNumber(s.STORAGE_SESSION_NUMBER,0)},e.prototype.getLastActive=function(){return o.getNumber(s.STORAGE_LAST_ACTIVE,0)},e}(),b=function(e,t,i,n){this.appID=e,this.appSecret=t,this.uuid=i,this.props=n,this.sdk=s.SDK},v=i(238),w=i.n(v),g=function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},S=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},m=function(){function e(){this.parser=new(w()),this.result={}}return e.prototype.get=function(){return g(this,void 0,void 0,(function(){var e;return S(this,(function(t){switch(t.label){case 0:return e=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return t.sent(),[4,this.getLocation()];case 2:return t.sent(),e.locale=navigator.language,e.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},e.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},e.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},e.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},e.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,e]}}))}))},e.prototype.getDeviceMemory=function(){var e=navigator;if(e.deviceMemory){var t=e.deviceMemory;this.result.mem={tot:1024*t}}},e.prototype.getNetworkType=function(){var e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;(null==t?void 0:t.effectiveType)&&(this.result.net={type:t.effectiveType})},e.prototype.getOrientation=function(){var e,t=null===(e=screen.orientation)||void 0===e?void 0:e.type;t&&(this.result.orientation=t)},e.prototype.getDPI=function(){var e=document.createElement("div");e.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(e);var t=window.devicePixelRatio||1,i=e.offsetWidth*t;return document.body.removeChild(e),i},e.prototype.getLocation=function(){return g(this,void 0,void 0,(function(){var e=this;return S(this,(function(t){switch(t.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=t.sent().state?[2]:[2,new Promise((function(t){navigator.geolocation.getCurrentPosition((function(i){e.result.coords=[i.coords.latitude,i.coords.longitude],t()}),(function(){return t()}))}))]}}))}))},e.prototype.getBatteryInfo=function(){return g(this,void 0,void 0,(function(){var e;return S(this,(function(t){switch(t.label){case 0:if(!("getBattery"in navigator))return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return e=t.sent(),this.result.bat={l:100*e.level,c:e.charging},[3,4];case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},e}(),y=function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},E=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},T=function(){function e(){this.apiService=f.getInstance(),this.sdkToken="",this.userID="",this.appID="",this.appSecret=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.init=function(e,t){return this.appID=e,this.appSecret=t,this.acquireSDKToken()},e.prototype.hasToken=function(){return!!o.getString(s.STORAGE_SDK_TOKEN,"")},e.prototype.getUserID=function(){return this.userID},e.prototype.populateUserDataFromStorage=function(){return y(this,void 0,void 0,(function(){return E(this,(function(e){return this.sdkToken=o.getString(s.STORAGE_SDK_TOKEN,""),this.sdkToken||c.l("No SDK token found in local storage"),this.userID=o.getString(s.STORAGE_USER_ID,""),this.userID||c.l("No user ID found in local storage"),this.updateAPIClient(),[2]}))}))},e.prototype.updateAPIClient=function(){c.l("SDK Token:",this.sdkToken),c.l("User ID:",this.userID),this.apiService.setAPIToken(this.sdkToken),this.apiService.setUserId(this.userID)},e.prototype.acquireSDKToken=function(){return y(this,void 0,void 0,(function(){return E(this,(function(e){return this.hasToken()?[2,this.populateUserDataFromStorage()]:(c.l("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}))}))},e.prototype.getSDKTokenFromServer=function(){return y(this,void 0,void 0,(function(){var e,t,i,n;return E(this,(function(r){switch(r.label){case 0:return[4,this.getUserAuthRequest()];case 1:e=r.sent(),t=this.apiService.registerDevice(e),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,t];case 3:return i=r.sent(),c.l("Register Device Response",i),this.saveUserDataInStorage(i),[3,5];case 4:throw n=r.sent(),c.e(n),n;case 5:return[2]}}))}))},e.prototype.saveUserDataInStorage=function(e){this.sdkToken=e.sdkToken,this.userID=e.id,this.updateAPIClient(),o.setString(s.STORAGE_SDK_TOKEN,this.sdkToken),o.setString(s.STORAGE_USER_ID,this.userID)},e.prototype.getUserAuthRequest=function(){return y(this,void 0,void 0,(function(){var e;return E(this,(function(t){switch(t.label){case 0:return[4,(new m).get()];case 1:return e=t.sent(),[2,new b(this.appID,this.appSecret,this.getOrCreateUUID(),e)]}}))}))},e.prototype.getOrCreateUUID=function(){var e=o.getString(s.STORAGE_DEVICE_UUID,"");return e||(e=(new(r())).toHexString(),o.setString(s.STORAGE_DEVICE_UUID,e)),e},e.INSTANCE=new e,e}(),_=function(e,t){return(_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function I(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function x(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function D(e,t){for(var i=0,n=t.length,r=e.length;i<n;i++,r++)e[r]=t[i];return e}function O(e){return"function"==typeof e}function N(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Object.create,Object.create;var k=N((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function C(e,t){if(e){var i=e.indexOf(t);0<=i&&e.splice(i,1)}}var R=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}var t;return e.prototype.unsubscribe=function(){var e,t,i,n,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=x(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(O(u))try{u()}catch(e){r=e instanceof k?e.errors:[e]}var c=this._teardowns;if(c){this._teardowns=null;try{for(var l=x(c),p=l.next();!p.done;p=l.next()){var f=p.value;try{M(f)}catch(e){r=null!=r?r:[],e instanceof k?r=D(D([],A(r)),A(e.errors)):r.push(e)}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}}if(r)throw new k(r)}},e.prototype.add=function(t){var i;if(t&&t!==this)if(this.closed)M(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._teardowns=null!==(i=this._teardowns)&&void 0!==i?i:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&C(t,e)},e.prototype.remove=function(t){var i=this._teardowns;i&&C(i,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),P=R.EMPTY;function G(e){return e instanceof R||e&&"closed"in e&&O(e.remove)&&O(e.add)&&O(e.unsubscribe)}function M(e){O(e)?e():e.unsubscribe()}var U=null,j=null,L=void 0,B=!1,V=!1,F={setTimeout:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=F.delegate;return((null==i?void 0:i.setTimeout)||setTimeout).apply(void 0,D([],A(e)))},clearTimeout:function(e){var t=F.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function H(e){F.setTimeout((function(){if(!U)throw e;U(e)}))}function K(){}var z=W("C",void 0,void 0);function W(e,t,i){return{kind:e,value:t,error:i}}var q=null;function X(e){if(B){var t=!q;if(t&&(q={errorThrown:!1,error:null}),e(),t){var i=q,n=i.errorThrown,r=i.error;if(q=null,n)throw r}}else e()}function Z(e){B&&q&&(q.errorThrown=!0,q.error=e)}var J=function(e){function t(t){var i=e.call(this)||this;return i.isStopped=!1,t?(i.destination=t,G(t)&&t.add(i)):i.destination=te,i}return I(t,e),t.create=function(e,t,i){return new $(e,t,i)},t.prototype.next=function(e){this.isStopped?ee(function(e){return W("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?ee(W("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?ee(z,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(R),$=function(e){function t(t,i,n){var r,o=e.call(this)||this;if(O(t))r=t;else if(t){var s;r=t.next,i=t.error,n=t.complete,o&&V?(s=Object.create(t)).unsubscribe=function(){return o.unsubscribe()}:s=t,r=null==r?void 0:r.bind(s),i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s)}return o.destination={next:r?Y(r):K,error:Y(null!=i?i:Q),complete:n?Y(n):K},o}return I(t,e),t}(J);function Y(e,t){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];try{e.apply(void 0,D([],A(t)))}catch(e){B?Z(e):H(e)}}}function Q(e){throw e}function ee(e,t){var i=j;i&&F.setTimeout((function(){return i(e,t)}))}var te={closed:!0,next:K,error:Q,complete:K},ie="function"==typeof Symbol&&Symbol.observable||"@@observable";function ne(e){return e}function re(e){return 0===e.length?ne:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var oe=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var i=new e;return i.source=this,i.operator=t,i},e.prototype.subscribe=function(e,t,i){var n,r=this,o=(n=e)&&n instanceof J||function(e){return e&&O(e.next)&&O(e.error)&&O(e.complete)}(n)&&G(n)?e:new $(e,t,i);return X((function(){var e=r,t=e.operator,i=e.source;o.add(t?t.call(o,i):i?r._subscribe(o):r._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var i=this;return new(t=se(t))((function(t,n){var r;r=i.subscribe((function(t){try{e(t)}catch(e){n(e),null==r||r.unsubscribe()}}),n,t)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[ie]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return re(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=se(e))((function(e,i){var n;t.subscribe((function(e){return n=e}),(function(e){return i(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function se(e){var t;return null!==(t=null!=e?e:L)&&void 0!==t?t:Promise}var ae=N((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),ue=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return I(t,e),t.prototype.lift=function(e){var t=new ce(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new ae},t.prototype.next=function(e){var t=this;X((function(){var i,n;if(t._throwIfClosed(),!t.isStopped){var r=t.observers.slice();try{for(var o=x(r),s=o.next();!s.done;s=o.next())s.value.next(e)}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}}}))},t.prototype.error=function(e){var t=this;X((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var i=t.observers;i.length;)i.shift().error(e)}}))},t.prototype.complete=function(){var e=this;X((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,i=t.hasError,n=t.isStopped,r=t.observers;return i||n?P:(r.push(e),new R((function(){return C(r,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,i=t.hasError,n=t.thrownError,r=t.isStopped;i?e.error(n):r&&e.complete()},t.prototype.asObservable=function(){var e=new oe;return e.source=this,e},t.create=function(e,t){return new ce(e,t)},t}(oe),ce=function(e){function t(t,i){var n=e.call(this)||this;return n.destination=t,n.source=i,n}return I(t,e),t.prototype.next=function(e){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===i||i.call(t,e)},t.prototype.error=function(e){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===i||i.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,i;return null!==(i=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==i?i:P},t}(ue),le={now:function(){return(le.delegate||Date).now()},delegate:void 0},pe=function(e){function t(t,i,n){void 0===t&&(t=1/0),void 0===i&&(i=1/0),void 0===n&&(n=le);var r=e.call(this)||this;return r._bufferSize=t,r._windowTime=i,r._timestampProvider=n,r._buffer=[],r._infiniteTimeWindow=!0,r._infiniteTimeWindow=i===1/0,r._bufferSize=Math.max(1,t),r._windowTime=Math.max(1,i),r}return I(t,e),t.prototype.next=function(t){var i=this,n=i.isStopped,r=i._buffer,o=i._infiniteTimeWindow,s=i._timestampProvider,a=i._windowTime;n||(r.push(t),!o&&r.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),i=this._infiniteTimeWindow,n=this._buffer.slice(),r=0;r<n.length&&!e.closed;r+=i?1:2)e.next(n[r]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,i=e._timestampProvider,n=e._buffer,r=e._infiniteTimeWindow,o=(r?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!r){for(var s=i.now(),a=0,u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}},t}(ue),fe=function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},he=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},de=function(){function t(){this.sessionManager=d.getInstance(),this.safeHttpCallService=h.getInstance(),this.userAuthService=T.getInstance()}return t.prototype.init=function(e,i){var n=this;this.userAuthService.init(e,i).then((function(){t.replaySubject.next(!0),t.replaySubject.complete()})).catch((function(){setTimeout((function(){n.init(e,i)}),3e4)})),this.execute()},t.prototype.execute=function(){this.sessionManager.checkForNewSession(),o.getBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!1)||(o.setBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!0),this.isAppFirstTimeLaunch()?this.sendFirstLaunchEvent():this.sendSuccessiveLaunchEvent())},t.prototype.isAppFirstTimeLaunch=function(){return!!o.getBoolean(s.STORAGE_FIRST_TIME_LAUNCH,!0)&&(o.setBoolean(s.STORAGE_FIRST_TIME_LAUNCH,!1),!0)},t.prototype.sendFirstLaunchEvent=function(){return fe(this,void 0,void 0,(function(){var t,i;return he(this,(function(n){switch(n.label){case 0:return t=new e("CE Web Installed",{}),i=t,[4,(new m).get()];case 1:return i.deviceProps=n.sent(),this.safeHttpCallService.sendEvent(t),[2]}}))}))},t.prototype.sendSuccessiveLaunchEvent=function(){return fe(this,void 0,void 0,(function(){var t,i;return he(this,(function(n){switch(n.label){case 0:return t=new e("CE Web Launched",{}),i=t,[4,(new m).get()];case 1:return i.deviceProps=n.sent(),this.safeHttpCallService.sendEvent(t),[2]}}))}))},t.replaySubject=new pe(1),t}(),be=function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},ve=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},we=function(){function t(){this.apiService=h.getInstance(),this.runtimeData=a.getInstance()}return t.prototype.listen=function(){var e=this;document.onvisibilitychange=function(){"visible"===document.visibilityState?e.onVisible():"hidden"===document.visibilityState&&e.onHidden()}},t.prototype.onVisible=function(){return be(this,void 0,void 0,(function(){var i,n,r,o;return ve(this,(function(a){switch(a.label){case 0:return this.runtimeData.setActive(),(i=this.runtimeData.getTimeForInactiveInSeconds())>s.IDLE_TIME_IN_SECONDS&&(d.getInstance().conclude(),(new de).execute()),(n={})[t.INACTIVE_DURATION]=i,r=new e("CE Web Active",n),o=r,[4,(new m).get()];case 1:return o.deviceProps=a.sent(),this.apiService.sendEvent(r),[2]}}))}))},t.prototype.onHidden=function(){return be(this,void 0,void 0,(function(){var i,n;return ve(this,(function(r){return this.runtimeData.setInactive(),i=this.runtimeData.getTimeForActiveInSeconds(),(n={})[t.ACTIVE_DURATION]=i,this.apiService.sendEvent(new e("CE Web Inactive",n)),[2]}))}))},t.ACTIVE_DURATION="aDur",t.INACTIVE_DURATION="iaDur",t}(),ge=function(){function t(){this.apiService=h.getInstance()}return t.prototype.listen=function(){var t=this;window.onpageshow=function(){t.apiService.sendEvent(new e("CE Screen View",{screenName:location.pathname}))}},t}(),Se=function(){function e(){this.existingSDKObject=window.CooeeSDK}return e.prototype.meddle=function(){var e,t,i;this.existingSDKObject.account=null!==(e=this.existingSDKObject.account)&&void 0!==e?e:[],this.existingSDKObject.profile=null!==(t=this.existingSDKObject.profile)&&void 0!==t?t:[],this.existingSDKObject.events=null!==(i=this.existingSDKObject.events)&&void 0!==i?i:[],this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.existingSDKObject.account.forEach(this.processAccount),this.existingSDKObject.events.forEach(this.processEvent),this.existingSDKObject.profile.forEach(this.processProfile)},e.prototype.overwritePush=function(e,t){Object.defineProperty(e,"push",{enumerable:!1,configurable:!1,writable:!1,value:t})},e.prototype.meddleAccount=function(){var e=this;this.overwritePush(this.existingSDKObject.account,(function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];e.processAccount(t[0])}))},e.prototype.meddleEvents=function(){var e=this;this.overwritePush(this.existingSDKObject.events,(function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];e.processEvent(t[0])}))},e.prototype.meddleProfile=function(){var e=this;this.overwritePush(this.existingSDKObject.profile,(function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];e.processProfile(t[0])}))},e.prototype.processAccount=function(e){if(e){var t=Object.keys(e);t.includes("appID")?ye.init(e.appID,e.appSecret):t.includes("appVersion")?ye.setWebAppVersion(e.appVersion):t.includes("debug")&&ye.setDebug(e.debug)}},e.prototype.processEvent=function(e){e&&ye.sendEvent(e[0],e[1])},e.prototype.processProfile=function(e){e&&ye.updateProfile(e)},e}(),me=function(){function e(){}return e.prototype.init=function(){(new we).listen(),(new ge).listen(),(new Se).meddle()},e}(),ye=function(){function t(){this.runtimeData=a.getInstance(),this.safeHttpCallService=h.getInstance(),this.newSessionExecutor=new de}return t.init=function(e,t){this.INSTANCE.newSessionExecutor.init(e,t)},t.setWebAppVersion=function(e){this.INSTANCE.runtimeData.setWebAppVersion(e)},t.setDebug=function(e){this.INSTANCE.runtimeData.setDebugWebApp(e)},t.sendEvent=function(t,i){for(var n in i)if(n.length>3&&n.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");this.INSTANCE.safeHttpCallService.sendEvent(new e(t,i))},t.updateProfile=function(e){for(var t in e)if(t.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");this.INSTANCE.safeHttpCallService.updateProfile(e)},t.INSTANCE=new t,t}();(new me).init();var Ee=ye}();var r=CooeeSDK="undefined"==typeof CooeeSDK?{}:CooeeSDK,o=n.default;for(var s in o)r[s]=o[s];o.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})}();
|
|
2
|
+
!function(){var t={489:function(t){for(var e=Math.floor(16777215*Math.random()),n=u.index=parseInt(16777215*Math.random(),10),r=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,i=function(t){return!(null==t||!t.constructor||"function"!=typeof t.constructor.isBuffer||!t.constructor.isBuffer(t))},o=[],s=0;s<256;s++)o[s]=(s<=15?"0":"")+s.toString(16);var a=new RegExp("^[0-9a-fA-F]{24}$"),c=[];for(s=0;s<10;)c[48+s]=s++;for(;s<16;)c[55+s]=c[87+s]=s++;function u(t){if(!(this instanceof u))return new u(t);if(t&&(t instanceof u||"ObjectID"===t._bsontype))return t;if(this._bsontype="ObjectID",null!=t&&"number"!=typeof t){var e=u.isValid(t);if(!e&&null!=t)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&"string"==typeof t&&24===t.length)return u.createFromHexString(t);if(null==t||12!==t.length){if(null!=t&&"function"==typeof t.toHexString)return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=t}else this.id=this.generate(t)}t.exports=u,u.default=u,u.createFromTime=function(t){return new u((8,(8===(e=(e=t=parseInt(t,10)%4294967295).toString(16)).length?e:"00000000".substring(e.length,8)+e)+"0000000000000000"));var e},u.createFromHexString=function(t){if(void 0===t||null!=t&&24!==t.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",n=0;n<24;)e+=String.fromCharCode(c[t.charCodeAt(n++)]<<4|c[t.charCodeAt(n++)]);return new u(e)},u.isValid=function(t){return null!=t&&("number"==typeof t||("string"==typeof t?12===t.length||24===t.length&&a.test(t):t instanceof u||!!i(t)||"function"==typeof t.toHexString&&(t.id instanceof _Buffer||"string"==typeof t.id)&&(12===t.id.length||24===t.id.length&&a.test(t.id))))},u.prototype={constructor:u,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=o[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof u?this.toString()===t.toString():"string"==typeof t&&u.isValid(t)&&12===t.length&&i(this.id)?t===this.id.toString("binary"):"string"==typeof t&&u.isValid(t)&&24===t.length?t.toLowerCase()===this.toHexString():"string"==typeof t&&u.isValid(t)&&12===t.length?t===this.id:!(null==t||!(t instanceof u||t.toHexString))&&t.toHexString()===this.toHexString()},getTimestamp:function(){var t,e=new Date;return t=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,e.setTime(1e3*Math.floor(t)),e},generate:function(t){"number"!=typeof t&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var i=n=(n+1)%16777215;return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t,e>>16&255,e>>8&255,255&e,r>>8&255,255&r,i>>16&255,i>>8&255,255&i)}};var l=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";u.prototype[l]=function(){return"ObjectID("+this+")"},u.prototype.toJSON=u.prototype.toHexString,u.prototype.toString=u.prototype.toHexString},238:function(t,e,n){var r;!function(i,o){"use strict";var s="function",a="undefined",c="object",u="string",l="model",p="name",h="type",f="vendor",d="version",b="architecture",v="console",y="mobile",g="tablet",w="smarttv",m="wearable",S="embedded",E={extend:function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n},has:function(t,e){return typeof t===u&&-1!==e.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return typeof t===u?t.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(t,e){return t=t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),typeof e===a?t:t.substring(0,255)}},T={rgx:function(t,e){for(var n,r,i,a,u,l,p=0;p<e.length&&!u;){var h=e[p],f=e[p+1];for(n=r=0;n<h.length&&!u;)if(u=h[n++].exec(t))for(i=0;i<f.length;i++)l=u[++r],typeof(a=f[i])===c&&a.length>0?2==a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3==a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):o:this[a[0]]=l?a[1].call(this,l,a[2]):o:4==a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):o):this[a]=l||o;p+=2}},str:function(t,e){for(var n in e)if(typeof e[n]===c&&e[n].length>0){for(var r=0;r<e[n].length;r++)if(E.has(e[n][r],t))return"?"===n?o:n}else if(E.has(e[n],t))return"?"===n?o:n;return t}},_={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},A={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[p,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[p,d],[/opios[\/\s]+([\w\.]+)/i],[d,[p,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[d,[p,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,d],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[d,[p,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[d,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[p,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[d,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure Browser"],d],[/focus\/([\w\.]+)/i],[d,[p,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[d,[p,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[d,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[p,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[p,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[d,[p,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[p,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],d],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[p,d],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[p],[/;fbav\/([\w\.]+);/i],[d,[p,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[p,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[p,d],[/\bgsa\/([\w\.]+)\s.*safari\//i],[d,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[p,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],d],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[d,[p,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[p,d],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[p,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[p,[d,T.str,_.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[p,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[p,"Netscape"],d],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[d,[p,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[p,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,E.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[b,/ower/,"",E.lowerize]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,E.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[l,[f,"Samsung"],[h,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[l,[f,"Samsung"],[h,y]],[/\((ip(?:hone|od)[\s\w]*);/i],[l,[f,"Apple"],[h,y]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,"Apple"],[h,g]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[l,[f,"Huawei"],[h,g]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[l,[f,"Huawei"],[h,y]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[l,/_/g," "],[f,"Xiaomi"],[h,y]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[l,/_/g," "],[f,"Xiaomi"],[h,g]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[f,"OPPO"],[h,y]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[l,[f,"Vivo"],[h,y]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[l,[f,"Realme"],[h,y]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[l,[f,"Motorola"],[h,y]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[f,"Motorola"],[h,g]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[l,[f,"LG"],[h,g]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[l,[f,"LG"],[h,y]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[l,[f,"Lenovo"],[h,g]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[l,/_/g," "],[f,"Nokia"],[h,y]],[/droid.+;\s(pixel\sc)[\s)]/i],[l,[f,"Google"],[h,g]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[l,[f,"Google"],[h,y]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,"Sony"],[h,y]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[l,"Xperia Tablet"],[f,"Sony"],[h,g]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[l,[f,"OnePlus"],[h,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[l,[f,"Amazon"],[h,g]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[l,"Fire Phone"],[f,"Amazon"],[h,y]],[/\((playbook);[\w\s\),;-]+(rim)/i],[l,f,[h,g]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[l,[f,"BlackBerry"],[h,y]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[l,[f,"ASUS"],[h,g]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[l,[f,"ASUS"],[h,y]],[/(nexus\s9)/i],[l,[f,"HTC"],[h,g]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[l,/_/g," "],[h,y]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[l,[f,"Acer"],[h,g]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[l,[f,"Meizu"],[h,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,l,[h,y]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[f,l,[h,g]],[/\s(surface\sduo)\s/i],[l,[f,"Microsoft"],[h,g]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[l,[f,"Fairphone"],[h,y]],[/\s(u304aa)\sbuild/i],[l,[f,"AT&T"],[h,y]],[/sie-(\w*)/i],[l,[f,"Siemens"],[h,y]],[/[;\/]\s?(rct\w+)\sbuild/i],[l,[f,"RCA"],[h,g]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[l,[f,"Dell"],[h,g]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[l,[f,"Verizon"],[h,g]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[l,[f,"Barnes & Noble"],[h,g]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[l,[f,"NuVision"],[h,g]],[/;\s(k88)\sbuild/i],[l,[f,"ZTE"],[h,g]],[/;\s(nx\d{3}j)\sbuild/i],[l,[f,"ZTE"],[h,y]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[l,[f,"Swiss"],[h,y]],[/[;\/]\s?(zur\d{3})\sbuild/i],[l,[f,"Swiss"],[h,g]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[l,[f,"Zeki"],[h,g]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[f,"Dragon Touch"],l,[h,g]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[l,[f,"Insignia"],[h,g]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[l,[f,"NextBook"],[h,g]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[f,"Voice"],l,[h,y]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[f,"LvTel"],l,[h,y]],[/;\s(ph-1)\s/i],[l,[f,"Essential"],[h,y]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[l,[f,"Envizen"],[h,g]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[l,[f,"MachSpeed"],[h,g]],[/[;\/]\s?tu_(1491)\sbuild/i],[l,[f,"Rotor"],[h,g]],[/(shield[\w\s]+)\sbuild/i],[l,[f,"Nvidia"],[h,g]],[/(sprint)\s(\w+)/i],[f,l,[h,y]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,"Microsoft"],[h,y]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,"Zebra"],[h,g]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,"Zebra"],[h,y]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[f,l,[h,v]],[/droid.+;\s(shield)\sbuild/i],[l,[f,"Nvidia"],[h,v]],[/(playstation\s[345portablevi]+)/i],[l,[f,"Sony"],[h,v]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[l,[f,"Microsoft"],[h,v]],[/smart-tv.+(samsung)/i],[f,[h,w]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,"Samsung"],[h,w]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[f,"LG"],[h,w]],[/(apple)\s?tv/i],[f,[l,"Apple TV"],[h,w]],[/crkey/i],[[l,"Chromecast"],[f,"Google"],[h,w]],[/droid.+aft([\w])(\sbuild\/|\))/i],[l,[f,"Amazon"],[h,w]],[/\(dtv[\);].+(aquos)/i],[l,[f,"Sharp"],[h,w]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,E.trim],[l,E.trim],[h,w]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[h,w]],[/((pebble))app\/[\d\.]+\s/i],[f,l,[h,m]],[/droid.+;\s(glass)\s\d/i],[l,[f,"Google"],[h,m]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[l,[f,"Zebra"],[h,m]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[f,[h,S]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[l,[h,y]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[l,[h,g]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,E.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[f,"Generic"]],[/(phone)/i],[[h,y]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[p,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,p]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[p,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[p,[d,T.str,_.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[p,"Windows"],[d,T.str,_.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[p,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[p,"Mac OS"],[d,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[p,d],[/\(bb(10);/i],[d,[p,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[d,[p,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[p,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[p,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[p,"Chromium OS"],d],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[p,d],[/(sunos)\s?([\w\.\d]*)/i],[[p,"Solaris"],d],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[p,d]]},I=function(t,e){if("object"==typeof t&&(e=t,t=o),!(this instanceof I))return new I(t,e).getResult();var n=t||(void 0!==i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=e?E.extend(A,e):A;return this.getBrowser=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.browser),t.major=E.major(t.version),t},this.getCPU=function(){var t={architecture:o};return T.rgx.call(t,n,r.cpu),t},this.getDevice=function(){var t={vendor:o,model:o,type:o};return T.rgx.call(t,n,r.device),t},this.getEngine=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.engine),t},this.getOS=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(t){return n=typeof t===u&&t.length>255?E.trim(t,255):t,this},this.setUA(n),this};I.VERSION="0.7.28",I.BROWSER={NAME:p,MAJOR:"major",VERSION:d},I.CPU={ARCHITECTURE:b},I.DEVICE={MODEL:l,VENDOR:f,TYPE:h,CONSOLE:v,MOBILE:y,SMARTTV:w,TABLET:g,WEARABLE:m,EMBEDDED:S},I.ENGINE={NAME:p,VERSION:d},I.OS={NAME:p,VERSION:d},typeof e!==a?(t.exports&&(e=t.exports=I),e.UAParser=I):(r=function(){return I}.call(e,n,e,t))===o||(t.exports=r);var x=void 0!==i&&(i.jQuery||i.Zepto);if(x&&!x.ua){var O=new I;x.ua=O.getResult(),x.ua.get=function(){return O.getUA()},x.ua.set=function(t){O.setUA(t);var e=O.getResult();for(var n in e)x.ua[n]=e[n]}}}("object"==typeof window?window:this)},306:function(t){"use strict";t.exports={i8:"0.0.6"}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};!function(){"use strict";n.d(r,{default:function(){return se}});var t=function(t,e){void 0===e&&(e={}),this.name=t,this.properties=e,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.activeTriggers=[],this.occurred=(new Date).toISOString()},e=n(489),i=n.n(e),o=function(){function t(){}return t.getString=function(e,n){return t.LOCAL_STORAGE.getItem(e)||n},t.setString=function(e,n){n||(n=""),t.LOCAL_STORAGE.setItem(e,n)},t.getNumber=function(e,n){return+t.getString(e,"")||n},t.setNumber=function(e,n){t.setString(e,n.toString())},t.getBoolean=function(t,e){var n=this.LOCAL_STORAGE.getItem(t);return n?JSON.parse(n):e},t.setBoolean=function(e,n){t.setString(e,JSON.stringify(n))},t.remove=function(e){t.LOCAL_STORAGE.removeItem(e)},t.LOCAL_STORAGE=window.localStorage,t}(),s=function(){function t(){}var e;return t.API_URL="https://api.sdk.letscooee.com",t.SDK_VERSION=n(306).i8,t.SDK_DEBUG=!1,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.CANVAS_WIDTH=1080,t.CANVAS_HEIGHT=1920,t.STORAGE_USER_ID="uid",t.STORAGE_SDK_TOKEN="st",t.STORAGE_DEVICE_UUID="uuid",t.STORAGE_SESSION_ID="sid",t.STORAGE_SESSION_NUMBER="sn",t.STORAGE_SESSION_START_TIME="sst",t.STORAGE_SESSION_START_EVENT_SENT="sses",t.STORAGE_FIRST_TIME_LAUNCH="ifl",t.STORAGE_LAST_ACTIVE="la",t.STORAGE_TRIGGER_START_TIME="tst",t.STORAGE_ACTIVE_TRIGGER_ID="atid",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_CONTAINER_NAME="cooee-wrapper",e=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(e,10),t}(),a=function(){function t(){this.inInactive=!0,this.lastEnterActive=new Date,this.lastEnterInactive=null,this.isDebug=!1}return t.getInstance=function(){return this.INSTANCE},t.prototype.getWebAppVersion=function(){var t;return null!==(t=this.webAppVersion)&&void 0!==t?t:"0.0.1+1"},t.prototype.setWebAppVersion=function(t){this.webAppVersion=t},t.prototype.isDebugWebApp=function(){return this.isDebug},t.prototype.setDebugWebApp=function(t){this.isDebug=t},t.prototype.isInactive=function(){return this.inInactive},t.prototype.setInactive=function(){this.inInactive=!0,this.lastEnterInactive=new Date,o.setNumber(s.STORAGE_LAST_ACTIVE,this.lastEnterInactive.getTime())},t.prototype.setActive=function(){this.inInactive=!1,this.lastEnterActive=new Date},t.prototype.isFirstActive=function(){return null==this.lastEnterInactive},t.prototype.getLastEnterInactive=function(){return this.lastEnterInactive},t.prototype.getTimeForActiveInSeconds=function(){var t,e;return((null===(t=this.lastEnterInactive)||void 0===t?void 0:t.getTime())-(null===(e=this.lastEnterActive)||void 0===e?void 0:e.getTime()))/1e3},t.prototype.getTimeForInactiveInSeconds=function(){return null==this.lastEnterInactive?0:((new Date).getTime()-this.lastEnterInactive.getTime())/1e3},t.INSTANCE=new t,t}(),c=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},u=function(){function t(){}return t.l=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.log.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t.e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t.w=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.warn.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t}(),l=function(){function t(t){t.s&&(this.s=new d(t.s)),t.g&&(this.g=new y(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const p=new RegExp("[^#a-f\\d]","gi"),h=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var f,d=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||p.test(t)||!h.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const r=Number.parseInt(t,16),i=r>>16,o=r>>8&255,s=255&r,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[i,o,s,a]:"css"===e.format?`rgb(${i} ${o} ${s}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:i,green:o,blue:s,alpha:a}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),b=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new d(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return f[null!==(t=this.s)&&void 0!==t?t:f.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(f||(f={}));var v,y=function(){function t(t){this.r=t.r,t.c&&(this.c=new d(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),t}(),g=(Object.defineProperty(function(){}.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),function(){function t(t){this.t=t.t,t.bg&&(this.bg=new l(t.bg)),t.br&&(this.br=new b(t.br)),this.clc=t.clc,this.shd=t.shd,this.spc=t.spc,this.trf=t.trf,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y}return Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return v[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}());!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(v||(v={}));var w,m,S=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){return t.call(this,e)||this}return S(e,t),e}(g),T=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t){function e(e){var n=t.call(this,e)||this;return n.src=e.src,n}return T(e,t),e}(g),A=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),I=function(t){function e(e){var n=t.call(this,e)||this;return n.alg=w.START,n.prs=e.prs,n.alg=e.alg,e.f&&(n.f=e.f),e.c&&(n.c=new d(e.c)),n}return A(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(g);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(w||(w={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(m||(m={}));var x,O=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(t){function e(e){return t.call(this,e)||this}return O(e,t),e}(g),D=function(t){var e=this;this.elems=[],this.cont=new N(t.cont),t.elems.forEach((function(t){t.t===v.IMAGE?e.elems.push(new _(t)):t.t===v.TEXT||t.t===v.BUTTON?e.elems.push(new I(t)):t.t===v.SHAPE&&e.elems.push(new E(t))}))},k=function(t){this.duration=0,this.id=t.id,this.duration=t.duration,this.version=t.version,this.engagementID=t.engagementID,this.internal=t.internal,this.pn=t.pn,this.ian=new D(t.ian)},C=function(){function t(){this.doc=document}return t.prototype.getWidth=function(){return document.documentElement.clientWidth},t.prototype.getHeight=function(){return document.documentElement.clientHeight},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,n){e&&(n?t.style.setProperty(e,n):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},t.prototype.getElementById=function(t){return this.doc.getElementById(t)},t}(),P=n(238),R=n.n(P);!function(t){t.Location="LOCATION",t.Push="PUSH",t.Camera="CAMERA"}(x||(x={}));var M=function(){function e(t){this.action=t,this.apiService=Q.getInstance()}return e.prototype.execute=function(){this.externalAction(),this.iabAction(),this.upAction(),this.kvAction(),this.prompt(),this.closeAction(),this.shareAction()},e.prototype.externalAction=function(){var t;this.action.ext&&(null===(t=window.open(this.action.ext.u,"_blank"))||void 0===t||t.focus())},e.prototype.iabAction=function(){this.action.iab&&(new W).render(this.action.iab.u)},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.kvAction=function(){this.action.kv&&document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:this.action.kv}))},e.prototype.prompt=function(){var t=this.action.prompt;t&&(t===x.Location&&this.promptLocationPermission(),t===x.Push&&this.promptPushNotificationPermission(),t===x.Camera&&this.promptCameraPermission())},e.prototype.closeAction=function(){if(this.action.close){(new K).removeInApp();var e=o.getNumber(s.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),n={triggerID:o.getString(s.STORAGE_ACTIVE_TRIGGER_ID,""),"Close Behaviour":"CTA",Duration:((new Date).getTime()-e)/1e3};this.apiService.sendEvent(new t("CE Trigger Closed",n)),o.remove(s.STORAGE_TRIGGER_START_TIME),o.remove(s.STORAGE_ACTIVE_TRIGGER_ID)}},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):u.w("Navigator.share is not compatible with this browser"))},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateProfile({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateProfile({pnPerm:Notification.permission}):u.w("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return t=this,e=void 0,r=function(){var t,e,n;return function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(r){switch(r.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=r.sent(),[4,this.checkPermission("geolocation")];case 2:return e=r.sent(),n=Notification.permission,[2,{camera:t,location:e,notification:n}]}}))},new((n=void 0)||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateProfile({perm:e})}))},e}(),L=function(){function t(t,e){var n,r;this.screenWidth=0,this.screenHeight=0,this.scalingFactor=(n=document.documentElement.clientWidth)<(r=document.documentElement.clientHeight)?n/Math.min(s.CANVAS_WIDTH,s.CANVAS_HEIGHT):r/Math.max(s.CANVAS_WIDTH,s.CANVAS_HEIGHT),this.parentHTMLEl=t,this.inappElement=e,this.renderer=new C,this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return t.prototype.getHTMLElement=function(){return this.inappHTMLEl},t.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},t.prototype.processCommonBlocks=function(){this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"overflow","visible"),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},t.prototype.processWidthAndHeight=function(){this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},t.prototype.getSizePx=function(t){return t*this.scalingFactor+"px"},t.prototype.processPositionBlock=function(){this.inappElement.x&&(this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)))},t.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},t.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.p&&this.renderer.setStyle(this.inappHTMLEl,"padding",this.getSizePx(t.p)),t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},t.prototype.processTransformBlock=function(){var t=this.inappElement.trf;t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate("+t.rotate+"deg)")},t.prototype.registerAction=function(){var t=this.inappElement.clc;t&&this.inappHTMLEl.addEventListener("click",(function(){new M(t).execute()}))},t.prototype.processBackgroundBlock=function(){var t,e=this.inappElement.bg;if(e){var n=this.inappHTMLEl;this.inappElement instanceof N&&(n=n.parentElement);var r="";if((null===(t=(new(R())).getBrowser().name)||void 0===t?void 0:t.toLowerCase().includes("safari"))&&(r="-webkit-"),e.glossy)this.renderer.setStyle(n,r+"backdrop-filter","blur("+e.glossy.radius+"px)"),e.glossy.color&&this.processColourBlock(e.glossy.color,"background",n);else if(e.solid)e.solid.grad?this.processGradient(e.solid.grad,"background"):e.solid.hex&&this.renderer.setStyle(n,"background",e.solid.rgba);else if(e.img){if(!e.img.src)return;var i='url("'+e.img.src+'") no-repeat center';this.renderer.setStyle(n,"background",i),this.renderer.setStyle(n,"background-size","cover"),e.img.a&&this.renderer.setStyle(n,r+"backdrop-filter","opacity("+e.img.a+")")}}},t.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var n="linear-gradient("+t.ang+"deg, "+t.c1+", "+t.c2;t.c3&&(n+=", "+t.c3),t.c4&&(n+=", "+t.c4),t.c5&&(n+=", "+t.c5);var r=n+=")";this.renderer.setStyle(this.inappHTMLEl,e,r)}},t.prototype.processColourBlock=function(t,e,n){void 0===e&&(e="color"),void 0===n&&(n=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(n,e,t.rgba))},t}(),H=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),j=function(t){function e(e,n){return t.call(this,e,n)||this}return H(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t=this.inappElement.font;t&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(t.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",t.ff),this.renderer.setStyle(this.inappHTMLEl,"line-height",t.lh))},e.prototype.processPart=function(t,e){var n,r=[];e.u&&r.push("underline"),e.st&&r.push("line-through"),r.length||r.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",r.join(" ")),this.renderer.setStyle(t,"color",null!==(n=e.c)&&void 0!==n?n:"inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=w[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(L),G=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),B=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("div"),r.insertElement(),r}return G(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var n,r,i=e.renderer.createElement("span");i.innerHTML=null===(r=null===(n=t.txt)||void 0===n?void 0:n.toString())||void 0===r?void 0:r.replace(/\n/g,"<br />"),e.processPart(i,t),e.renderer.appendChild(e.inappHTMLEl,i)})),this.processCommonBlocks()},e}(j),U=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),V=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("div"),r.insertElement(),r}return U(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(L),F=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),z=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("img"),r.insertElement(),r}return F(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","100%"),this.renderer.setStyle(this.inappHTMLEl,"max-height","100%"),this.renderer.setStyle(this.inappHTMLEl,"display","block"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(L),K=function(){function t(){this.renderer=new C}return t.prototype.render=function(){this.removeInApp();var t=this.renderer.createElement("div");return t.id=s.IN_APP_CONTAINER_NAME,t.classList.add(s.IN_APP_CONTAINER_NAME),this.renderer.setStyle(t,"z-index","10000000"),this.renderer.setStyle(t,"position","fixed"),this.renderer.setStyle(t,"top","0"),this.renderer.setStyle(t,"left","0"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"display","flex"),this.renderer.setStyle(t,"justify-content","center"),this.renderer.setStyle(t,"align-items","center"),this.renderer.appendChild(document.body,t),t},t.prototype.removeInApp=function(){var t=document.getElementById(s.IN_APP_CONTAINER_NAME);t&&t.parentElement.removeChild(t)},t}(),W=function(){function t(){this.renderer=new C}return t.prototype.render=function(t){var e=this.renderer.getElementById(s.IN_APP_CONTAINER_NAME),n=this.createIFrameContainer();return this.createIFrameElement(n,t),this.createAnchorElement(e,n),this.renderer.appendChild(e,n),n},t.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},t.prototype.createIFrameElement=function(t,e){var n=this.renderer.createElement("iframe");return this.renderer.setStyle(n,"width","100%"),this.renderer.setStyle(n,"height","100%"),this.renderer.setAttribute(n,"src",e),this.renderer.setAttribute(n,"frameBorder","0"),this.renderer.appendChild(t,n),n},t.prototype.createAnchorElement=function(t,e){var n=this.renderer.createElement("a");return this.renderer.setStyle(n,"position","absolute"),this.renderer.setStyle(n,"top","0px"),this.renderer.setStyle(n,"right","0px"),n.href="#",n.innerHTML="Close",n.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,n),n},t}(),q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappElement.w=1080,r.inappElement.h=1920,r}return q(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this},e}(V),X=function(){function t(){this.rootContainer=(new K).render()}return t.prototype.render=function(t){t=new k(t),this.ian=t.ian;try{this.renderContainer(),o.setNumber(s.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),o.setString(s.STORAGE_ACTIVE_TRIGGER_ID,t.id)}catch(t){u.e(t)}},t.prototype.renderElement=function(t,e){e instanceof I?new B(t,e).render():e instanceof _?new z(t,e).render():e instanceof E?new V(t,e).render():u.e("Unsupported element type- "+e.type)},t.prototype.renderContainer=function(){var t,e,n=this,r=null===(t=this.ian)||void 0===t?void 0:t.cont;if(r){var i=new $(this.rootContainer,r).render().getHTMLElement();null===(e=this.ian.elems)||void 0===e||e.forEach((function(t){n.renderElement(i,t)}))}},t}(),J=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},Z=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Y=function(){function t(){this.runtimeData=a.getInstance(),this.apiToken="",this.userID=""}return t.getInstance=function(){return this.INSTANCE},t.prototype.doHTTP=function(t,e,n,r){return J(this,void 0,void 0,(function(){var i;return Z(this,(function(o){switch(o.label){case 0:return e.startsWith("http")||(e=s.API_URL+e),[4,fetch(e,{method:t,body:JSON.stringify(n),headers:r})];case 1:if(!(i=o.sent()).ok)throw i;return[2,i.json()]}}))}))},t.prototype.registerDevice=function(t){return J(this,void 0,void 0,(function(){return Z(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",t,this.getDefaultHeaders())]}))}))},t.prototype.sendEvent=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("POST","/v1/event/track",t,e).then((function(e){u.l("Sent",t.name),e.triggerData&&(new X).render(e.triggerData)})).catch((function(t){u.e("Error sending event",t)}))},t.prototype.updateUserData=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("PUT","/v1/user/update",t,e).then((function(){u.l("Updated user profile")})).catch((function(t){u.e("Error saving user profile",t)}))},t.prototype.concludeSession=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("POST","/v1/session/conclude",t,e).then((function(t){u.l("Conclude Session",t)})).catch((function(t){u.e(t)}))},t.prototype.getDefaultHeaders=function(){var t=new Headers;return t.set("sdk-version",s.SDK_VERSION),t.set("sdk-version-code",s.SDK_VERSION_CODE.toString()),t.set("app-version",this.runtimeData.getWebAppVersion()),t.set("user-id",this.userID),s.SDK_DEBUG&&t.set("sdk-debug",String(1)),this.runtimeData.isDebugWebApp()&&t.set("app-debug",String(1)),t},t.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},t.prototype.setUserId=function(t){this.userID=null!=t?t:""},t.INSTANCE=new t,t}(),Q=function(){function t(){this.sessionManager=tt.getInstance(),this.httpApiService=Y.getInstance()}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.sendEvent=function(t){var e=this;Yt.replaySubject.subscribe((function(){e.addEventVariable(t),e.httpApiService.sendEvent(t)}))},t.prototype.updateProfile=function(t){var e=this;Yt.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},t.prototype.concludeSession=function(t){var e=this;Yt.replaySubject.subscribe((function(){e.httpApiService.concludeSession(t)}))},t.prototype.addEventVariable=function(t){t.screenName=location.pathname,t.properties.path=location.pathname,t.sessionID=this.sessionManager.getCurrentSessionID(),t.sessionNumber=this.sessionManager.getCurrentSessionNumber()},t}(),tt=function(){function t(){}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.getCurrentSessionID=function(){return this.currentSessionID||null},t.prototype.isNewSessionRequired=function(){if(!o.getString(s.STORAGE_SESSION_ID,""))return!0;var t=o.getNumber(s.STORAGE_SESSION_START_TIME,0);return((new Date).getTime()-t)/1e3>s.IDLE_TIME_IN_SECONDS},t.prototype.checkForNewSession=function(){this.isNewSessionRequired()?this.startNewSession():this.initializeSessionFromStorage()},t.prototype.startNewSession=function(){this.currentSessionID||(o.setBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!1),this.currentSessionStartTime=new Date,this.currentSessionID=(new(i())).toHexString(),o.setNumber(s.STORAGE_SESSION_START_TIME,this.currentSessionStartTime.getTime()),o.setString(s.STORAGE_SESSION_ID,this.currentSessionID),this.bumpSessionNumber())},t.prototype.bumpSessionNumber=function(){this.currentSessionNumber=o.getNumber(s.STORAGE_SESSION_NUMBER,0),this.currentSessionNumber+=1,o.setNumber(s.STORAGE_SESSION_NUMBER,this.currentSessionNumber)},t.prototype.getCurrentSessionNumber=function(){return this.currentSessionNumber||0},t.prototype.getTotalDurationInSeconds=function(){if(a.getInstance().isFirstActive())throw new Error("This is the first time in foreground after launch");return(this.getLastActive()-this.currentSessionStartTime.getTime())/1e3},t.prototype.conclude=function(){var t={sessionID:this.currentSessionID,occurred:new Date,duration:this.getTotalDurationInSeconds()};Q.getInstance().concludeSession(t),this.destroySession()},t.prototype.destroySession=function(){this.currentSessionID=void 0,this.currentSessionNumber=void 0,this.currentSessionStartTime=void 0,o.remove(s.STORAGE_SESSION_ID),o.remove(s.STORAGE_SESSION_START_TIME)},t.prototype.initializeSessionFromStorage=function(){this.currentSessionStartTime=new Date(o.getNumber(s.STORAGE_SESSION_START_TIME,0)),this.currentSessionID=o.getString(s.STORAGE_SESSION_ID,""),this.currentSessionNumber=o.getNumber(s.STORAGE_SESSION_NUMBER,0)},t.prototype.getLastActive=function(){return o.getNumber(s.STORAGE_LAST_ACTIVE,0)},t}(),et=function(t,e,n,r){this.appID=t,this.appSecret=e,this.uuid=n,this.props=r,this.sdk=s.SDK},nt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},rt=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},it=function(){function t(){this.parser=new(R()),this.result={}}return t.prototype.get=function(){return nt(this,void 0,void 0,(function(){var t;return rt(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,n=t.offsetWidth*e;return document.body.removeChild(t),n},t.prototype.getLocation=function(){return nt(this,void 0,void 0,(function(){var t=this;return rt(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(n){t.result.coords=[n.coords.latitude,n.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return nt(this,void 0,void 0,(function(){var t;return rt(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),ot=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},st=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},at=function(){function t(){this.apiService=Y.getInstance(),this.sdkToken="",this.userID="",this.appID="",this.appSecret=""}return t.getInstance=function(){return this.INSTANCE},t.prototype.init=function(t,e){return this.appID=t,this.appSecret=e,this.acquireSDKToken()},t.prototype.hasToken=function(){return!!o.getString(s.STORAGE_SDK_TOKEN,"")},t.prototype.getUserID=function(){return this.userID},t.prototype.populateUserDataFromStorage=function(){return ot(this,void 0,void 0,(function(){return st(this,(function(t){return this.sdkToken=o.getString(s.STORAGE_SDK_TOKEN,""),this.sdkToken||u.l("No SDK token found in local storage"),this.userID=o.getString(s.STORAGE_USER_ID,""),this.userID||u.l("No user ID found in local storage"),this.updateAPIClient(),[2]}))}))},t.prototype.updateAPIClient=function(){u.l("SDK Token:",this.sdkToken),u.l("User ID:",this.userID),this.apiService.setAPIToken(this.sdkToken),this.apiService.setUserId(this.userID)},t.prototype.acquireSDKToken=function(){return ot(this,void 0,void 0,(function(){return st(this,(function(t){return this.hasToken()?[2,this.populateUserDataFromStorage()]:(u.l("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}))}))},t.prototype.getSDKTokenFromServer=function(){return ot(this,void 0,void 0,(function(){var t,e,n,r;return st(this,(function(i){switch(i.label){case 0:return[4,this.getUserAuthRequest()];case 1:t=i.sent(),e=this.apiService.registerDevice(t),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e];case 3:return n=i.sent(),u.l("Register Device Response",n),this.saveUserDataInStorage(n),[3,5];case 4:throw r=i.sent(),u.e(r),r;case 5:return[2]}}))}))},t.prototype.saveUserDataInStorage=function(t){this.sdkToken=t.sdkToken,this.userID=t.id,this.updateAPIClient(),o.setString(s.STORAGE_SDK_TOKEN,this.sdkToken),o.setString(s.STORAGE_USER_ID,this.userID)},t.prototype.getUserAuthRequest=function(){return ot(this,void 0,void 0,(function(){var t;return st(this,(function(e){switch(e.label){case 0:return[4,(new it).get()];case 1:return t=e.sent(),[2,new et(this.appID,this.appSecret,this.getOrCreateUUID(),t)]}}))}))},t.prototype.getOrCreateUUID=function(){var t=o.getString(s.STORAGE_DEVICE_UUID,"");return t||(t=(new(i())).toHexString(),o.setString(s.STORAGE_DEVICE_UUID,t)),t},t.INSTANCE=new t,t}(),ct=function(t,e){return(ct=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function ut(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ct(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function lt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function pt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function ht(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function ft(t){return"function"==typeof t}function dt(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var bt=dt((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function vt(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var yt=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=lt(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(ft(c))try{c()}catch(t){i=t instanceof bt?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var l=lt(u),p=l.next();!p.done;p=l.next()){var h=p.value;try{mt(h)}catch(t){i=null!=i?i:[],t instanceof bt?i=ht(ht([],pt(i)),pt(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new bt(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)mt(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&vt(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&vt(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),gt=yt.EMPTY;function wt(t){return t instanceof yt||t&&"closed"in t&&ft(t.remove)&&ft(t.add)&&ft(t.unsubscribe)}function mt(t){ft(t)?t():t.unsubscribe()}var St=null,Et=null,Tt=void 0,_t=!1,At=!1,It={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=It.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,ht([],pt(t)))},clearTimeout:function(t){var e=It.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function xt(t){It.setTimeout((function(){if(!St)throw t;St(t)}))}function Ot(){}var Nt=Dt("C",void 0,void 0);function Dt(t,e,n){return{kind:t,value:e,error:n}}var kt=null;function Ct(t){if(_t){var e=!kt;if(e&&(kt={errorThrown:!1,error:null}),t(),e){var n=kt,r=n.errorThrown,i=n.error;if(kt=null,r)throw i}}else t()}function Pt(t){_t&&kt&&(kt.errorThrown=!0,kt.error=t)}var Rt=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,wt(e)&&e.add(n)):n.destination=Gt,n}return ut(e,t),e.create=function(t,e,n){return new Mt(t,e,n)},e.prototype.next=function(t){this.isStopped?jt(function(t){return Dt("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?jt(Dt("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?jt(Nt,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(yt),Mt=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(ft(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&At?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s),r=null==r?void 0:r.bind(s)}return o.destination={next:i?Lt(i):Ot,error:Lt(null!=n?n:Ht),complete:r?Lt(r):Ot},o}return ut(e,t),e}(Rt);function Lt(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,ht([],pt(e)))}catch(t){_t?Pt(t):xt(t)}}}function Ht(t){throw t}function jt(t,e){var n=Et;n&&It.setTimeout((function(){return n(t,e)}))}var Gt={closed:!0,next:Ot,error:Ht,complete:Ot},Bt="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ut(t){return t}function Vt(t){return 0===t.length?Ut:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Ft=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Rt||function(t){return t&&ft(t.next)&&ft(t.error)&&ft(t.complete)}(r)&&wt(r)?t:new Mt(t,e,n);return Ct((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=zt(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),null==i||i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Bt]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Vt(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=zt(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function zt(t){var e;return null!==(e=null!=t?t:Tt)&&void 0!==e?e:Promise}var Kt=dt((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Wt=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return ut(e,t),e.prototype.lift=function(t){var e=new qt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Kt},e.prototype.next=function(t){var e=this;Ct((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=lt(i),s=o.next();!s.done;s=o.next())s.value.next(t)}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Ct((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Ct((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=e.hasError,r=e.isStopped,i=e.observers;return n||r?gt:(i.push(t),new yt((function(){return vt(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new Ft;return t.source=this,t},e.create=function(t,e){return new qt(t,e)},e}(Ft),qt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return ut(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:gt},e}(Wt),$t={now:function(){return($t.delegate||Date).now()},delegate:void 0},Xt=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=$t);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return ut(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,c=1;c<r.length&&r[c]<=s;c+=2)a=c;a&&r.splice(0,a+1)}},e}(Wt),Jt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},Zt=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Yt=function(){function e(){this.sessionManager=tt.getInstance(),this.safeHttpCallService=Q.getInstance(),this.userAuthService=at.getInstance()}return e.prototype.init=function(t,n){var r=this;this.userAuthService.init(t,n).then((function(){e.replaySubject.next(!0),e.replaySubject.complete()})).catch((function(){setTimeout((function(){r.init(t,n)}),3e4)})),this.execute()},e.prototype.execute=function(){this.sessionManager.checkForNewSession(),o.getBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!1)||(o.setBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!0),this.isAppFirstTimeLaunch()?this.sendFirstLaunchEvent():this.sendSuccessiveLaunchEvent())},e.prototype.isAppFirstTimeLaunch=function(){return!!o.getBoolean(s.STORAGE_FIRST_TIME_LAUNCH,!0)&&(o.setBoolean(s.STORAGE_FIRST_TIME_LAUNCH,!1),!0)},e.prototype.sendFirstLaunchEvent=function(){return Jt(this,void 0,void 0,(function(){var e,n;return Zt(this,(function(r){switch(r.label){case 0:return e=new t("CE Web Installed",{}),n=e,[4,(new it).get()];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return Jt(this,void 0,void 0,(function(){var e,n;return Zt(this,(function(r){switch(r.label){case 0:return e=new t("CE Web Launched",{}),n=e,[4,(new it).get()];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.replaySubject=new Xt(1),e}(),Qt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},te=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},ee=function(){function e(){this.apiService=Q.getInstance(),this.runtimeData=a.getInstance()}return e.prototype.listen=function(){var t=this;document.onvisibilitychange=function(){"visible"===document.visibilityState?t.onVisible():"hidden"===document.visibilityState&&t.onHidden()}},e.prototype.onVisible=function(){return Qt(this,void 0,void 0,(function(){var n,r,i,o;return te(this,(function(a){switch(a.label){case 0:return this.runtimeData.setActive(),(n=this.runtimeData.getTimeForInactiveInSeconds())>s.IDLE_TIME_IN_SECONDS&&(tt.getInstance().conclude(),(new Yt).execute()),(r={})[e.INACTIVE_DURATION]=n,i=new t("CE Web Active",r),o=i,[4,(new it).get()];case 1:return o.deviceProps=a.sent(),this.apiService.sendEvent(i),[2]}}))}))},e.prototype.onHidden=function(){return Qt(this,void 0,void 0,(function(){var n,r;return te(this,(function(i){return this.runtimeData.setInactive(),n=this.runtimeData.getTimeForActiveInSeconds(),(r={})[e.ACTIVE_DURATION]=n,this.apiService.sendEvent(new t("CE Web Inactive",r)),[2]}))}))},e.ACTIVE_DURATION="aDur",e.INACTIVE_DURATION="iaDur",e}(),ne=function(){function e(){this.apiService=Q.getInstance()}return e.prototype.listen=function(){var e=this;window.onpageshow=function(){e.apiService.sendEvent(new t("CE Screen View",{screenName:location.pathname}))}},e}(),re=function(){function t(){this.existingSDKObject=window.CooeeSDK}return t.prototype.meddle=function(){var t,e,n;this.existingSDKObject||(this.existingSDKObject=window.CooeeSDK={events:[],profile:[],account:[]}),this.existingSDKObject.account=null!==(t=this.existingSDKObject.account)&&void 0!==t?t:[],this.existingSDKObject.profile=null!==(e=this.existingSDKObject.profile)&&void 0!==e?e:[],this.existingSDKObject.events=null!==(n=this.existingSDKObject.events)&&void 0!==n?n:[],this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.existingSDKObject.account.forEach(this.processAccount),this.existingSDKObject.events.forEach(this.processEvent),this.existingSDKObject.profile.forEach(this.processProfile)},t.prototype.overwritePush=function(t,e){Object.defineProperty(t,"push",{enumerable:!1,configurable:!1,writable:!1,value:e})},t.prototype.meddleAccount=function(){var t=this;this.overwritePush(this.existingSDKObject.account,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processAccount(e[0])}))},t.prototype.meddleEvents=function(){var t=this;this.overwritePush(this.existingSDKObject.events,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processEvent(e[0])}))},t.prototype.meddleProfile=function(){var t=this;this.overwritePush(this.existingSDKObject.profile,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processProfile(e[0])}))},t.prototype.processAccount=function(t){if(t){var e=Object.keys(t);e.includes("appID")?oe.init(t.appID,t.appSecret):e.includes("appVersion")?oe.setWebAppVersion(t.appVersion):e.includes("debug")&&oe.setDebug(t.debug)}},t.prototype.processEvent=function(t){t&&oe.sendEvent(t[0],t[1])},t.prototype.processProfile=function(t){t&&oe.updateProfile(t)},t}(),ie=function(){function t(){}return t.prototype.init=function(){(new ee).listen(),(new ne).listen(),(new re).meddle()},t}(),oe=function(){function e(){this.runtimeData=a.getInstance(),this.safeHttpCallService=Q.getInstance(),this.newSessionExecutor=new Yt}return e.init=function(t,e){this.INSTANCE.newSessionExecutor.init(t,e)},e.setWebAppVersion=function(t){this.INSTANCE.runtimeData.setWebAppVersion(t)},e.setDebug=function(t){this.INSTANCE.runtimeData.setDebugWebApp(t)},e.sendEvent=function(e,n){for(var r in n)if(r.length>3&&r.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");this.INSTANCE.safeHttpCallService.sendEvent(new t(e,n))},e.updateProfile=function(t){for(var e in t)if(e.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");this.INSTANCE.safeHttpCallService.updateProfile(t)},e.INSTANCE=new e,e}();(new ie).init();var se=oe}();var i=CooeeSDK="undefined"==typeof CooeeSDK?{}:CooeeSDK,o=r.default;for(var s in o)i[s]=o[s];o.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})}();
|
|
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import { Constants } from '../constants';
|
|
38
38
|
import { Log } from '../utils/log';
|
|
39
39
|
import { RuntimeData } from '../utils/runtime-data';
|
|
40
|
+
import { InAppRenderer } from '../renderer/in-app-renderer';
|
|
40
41
|
/**
|
|
41
42
|
* A base or lower level HTTP service which simply hits the backend for given request.
|
|
42
43
|
*
|
|
@@ -114,8 +115,11 @@ var HttpAPIService = /** @class */ (function () {
|
|
|
114
115
|
var headers = this.getDefaultHeaders();
|
|
115
116
|
headers.append('x-sdk-token', this.apiToken);
|
|
116
117
|
this.doHTTP('POST', '/v1/event/track', event, headers)
|
|
117
|
-
.then(function () {
|
|
118
|
+
.then(function (data) {
|
|
118
119
|
Log.l('Sent', event.name);
|
|
120
|
+
if (data.triggerData) {
|
|
121
|
+
new InAppRenderer().render(data.triggerData);
|
|
122
|
+
}
|
|
119
123
|
})
|
|
120
124
|
.catch(function (error) {
|
|
121
125
|
Log.e('Error sending event', error);
|
package/dist/utils/log.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
2
|
-
for (var i = 0,
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
5
9
|
};
|
|
6
10
|
import { Constants } from '../constants';
|
|
7
11
|
/**
|
|
@@ -16,38 +20,38 @@ var Log = /** @class */ (function () {
|
|
|
16
20
|
/**
|
|
17
21
|
* Log info messages.
|
|
18
22
|
*
|
|
19
|
-
* @param {any
|
|
23
|
+
* @param {any} messages
|
|
20
24
|
*/
|
|
21
25
|
Log.l = function () {
|
|
22
26
|
var messages = [];
|
|
23
27
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
24
28
|
messages[_i] = arguments[_i];
|
|
25
29
|
}
|
|
26
|
-
console.log.apply(console, __spreadArray([Constants.LOG_PREFIX, ':'], messages));
|
|
30
|
+
console.log.apply(console, __spreadArray([Constants.LOG_PREFIX, ':'], messages, false));
|
|
27
31
|
};
|
|
28
32
|
/**
|
|
29
33
|
* Log error messages.
|
|
30
34
|
*
|
|
31
|
-
* @param {any
|
|
35
|
+
* @param {any} messages
|
|
32
36
|
*/
|
|
33
37
|
Log.e = function () {
|
|
34
38
|
var messages = [];
|
|
35
39
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
36
40
|
messages[_i] = arguments[_i];
|
|
37
41
|
}
|
|
38
|
-
console.error.apply(console, __spreadArray([Constants.LOG_PREFIX, ':'], messages));
|
|
42
|
+
console.error.apply(console, __spreadArray([Constants.LOG_PREFIX, ':'], messages, false));
|
|
39
43
|
};
|
|
40
44
|
/**
|
|
41
45
|
* Log warning messages.
|
|
42
46
|
*
|
|
43
|
-
* @param {any
|
|
47
|
+
* @param {any} messages
|
|
44
48
|
*/
|
|
45
49
|
Log.w = function () {
|
|
46
50
|
var messages = [];
|
|
47
51
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
48
52
|
messages[_i] = arguments[_i];
|
|
49
53
|
}
|
|
50
|
-
console.warn.apply(console, __spreadArray([Constants.LOG_PREFIX, ':'], messages));
|
|
54
|
+
console.warn.apply(console, __spreadArray([Constants.LOG_PREFIX, ':'], messages, false));
|
|
51
55
|
};
|
|
52
56
|
return Log;
|
|
53
57
|
}());
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letscooee/web-sdk",
|
|
3
3
|
"description": "Hyperpersonalised Mobile/Web App Re-Engagement via Machine Learning",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint 'src/**'",
|
|
7
7
|
"prepare": "npm run build",
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"build:production": "
|
|
9
|
+
"build:production": "webpack && webpack --config ./webpack-preview.config.js",
|
|
10
10
|
"serve:old-school": "webpack serve",
|
|
11
11
|
"preversion": "git add CHANGELOG.md src/constants.ts",
|
|
12
12
|
"version": "npm run build:production",
|
|
@@ -36,13 +36,15 @@
|
|
|
36
36
|
"eslint": "^7.32.0",
|
|
37
37
|
"eslint-config-google": "^0.14.0",
|
|
38
38
|
"ts-loader": "^9.2.4",
|
|
39
|
-
"typescript": "^4.
|
|
39
|
+
"typescript": "^4.4.4",
|
|
40
40
|
"webpack": "^5.47.1",
|
|
41
41
|
"webpack-cli": "^4.7.2",
|
|
42
42
|
"webpack-dev-server": "^4.1.1"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"bson-objectid": "^2.0.1",
|
|
46
|
+
"hex-rgb": "^5.0.0",
|
|
47
|
+
"hex-to-rgba": "^2.0.1",
|
|
46
48
|
"rxjs": "^7.3.0",
|
|
47
49
|
"ua-parser-js": "^0.7.28"
|
|
48
50
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const config = require('./webpack.config');
|
|
2
|
+
config.entry = './src/index-preview.ts';
|
|
3
|
+
config.output.library = {
|
|
4
|
+
name: 'CooeePreview',
|
|
5
|
+
type: 'assign',
|
|
6
|
+
export: 'default',
|
|
7
|
+
};
|
|
8
|
+
config.output.filename = 'sdk-preview.min.js';
|
|
9
|
+
|
|
10
|
+
module.exports = config;
|