@letscooee/web-sdk 9.3.21 → 9.3.22
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var sh=Object.create,xc=Object.defineProperty,ah=Object.defineProperties,ch=Object.getOwnPropertyDescriptor,lh=Object.getOwnPropertyDescriptors,uh=Object.getOwnPropertyNames,tp=Object.getOwnPropertySymbols,ph=Object.getPrototypeOf,np=Object.prototype.hasOwnProperty,fh=Object.prototype.propertyIsEnumerable,rp=(t,e,r)=>e in t?xc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e||={})np.call(e,r)&&rp(t,r,e[r]);if(tp)for(var r of tp(e))fh.call(e,r)&&rp(t,r,e[r]);return t},Z=(t,e)=>ah(t,lh(e)),Gi=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Vi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uh(e))!np.call(t,i)&&i!==r&&xc(t,i,{get:()=>e[i],enumerable:!(n=ch(e,i))||n.enumerable});return t},Qt=(t,e,r)=>(r=t!=null?sh(ph(t)):{},mh(e||!t||!t.__esModule?xc(r,"default",{value:t,enumerable:!0}):r,t)),tn=Vi((t,e)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,v){return function(){return v.apply(h,arguments)}},l=function(){var h=arguments,v=h[0],_,g;for(g=1;g<h.length;g++)for(_ in h[g])!(_ in v)&&h[g].hasOwnProperty(_)&&(v[_]=h[g][_]);return v},u=function(h,v){return{value:h,name:v}};n.TRACE=u(1,"TRACE"),n.DEBUG=u(2,"DEBUG"),n.INFO=u(3,"INFO"),n.TIME=u(4,"TIME"),n.WARN=u(5,"WARN"),n.ERROR=u(8,"ERROR"),n.OFF=u(99,"OFF");var f=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};f.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var v=this.context.filterLevel;return h.value>=v.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,v){i&&this.enabledFor(h)&&i(v,l({level:h},this.context))}};var m=new f({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(m,m.enabledFor),h.trace=o(m,m.trace),h.debug=o(m,m.debug),h.time=o(m,m.time),h.timeEnd=o(m,m.timeEnd),h.info=o(m,m.info),h.warn=o(m,m.warn),h.error=o(m,m.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){m.setLevel(h);for(var v in s)s.hasOwnProperty(v)&&s[v].setLevel(h)},n.getLevel=function(){return m.getLevel()},n.get=function(h){return s[h]||(s[h]=new f(l({name:h},m.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(g,y){y.name&&g.unshift("["+y.name+"]")};var v={},_=function(g,y){Function.prototype.apply.call(g,console,y)};return typeof console>"u"?function(){}:function(g,y){g=Array.prototype.slice.call(g);var C=console.log,O;y.level===n.TIME?(O=(y.name?"["+y.name+"] ":"")+g[0],g[1]==="start"?console.time?console.time(O):v[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):_(C,[O+": "+(new Date().getTime()-v[O])+"ms"])):(y.level===n.WARN&&console.warn?C=console.warn:y.level===n.ERROR&&console.error?C=console.error:y.level===n.INFO&&console.info?C=console.info:y.level===n.DEBUG&&console.debug?C=console.debug:y.level===n.TRACE&&console.trace&&(C=console.trace),h.formatter(g,y),_(C,g))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof e<"u"&&e.exports?e.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(t)}),Mp=Vi((t,e)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",l="function",u="undefined",f="object",m="string",h="major",v="model",_="name",g="type",y="vendor",C="version",O="architecture",H="console",R="mobile",k="tablet",V="smarttv",Mt="wearable",fe="embedded",j=500,ct="Amazon",Y="Apple",at="ASUS",Xt="BlackBerry",me="Browser",de="Chrome",xe="Edge",be="Firefox",Ut="Google",De="Huawei",ht="LG",Q="Microsoft",we="Motorola",cr="Opera",jr="Samsung",je="Sharp",en="Sony",Hn="Xiaomi",kn="Zebra",Hi="Facebook",Wi="Chromium OS",ji="Mac OS",Mn=" Browser",Be=function(z,dt){var J={};for(var se in z)dt[se]&&dt[se].length%2===0?J[se]=dt[se].concat(z[se]):J[se]=z[se];return J},$r=function(z){for(var dt={},J=0;J<z.length;J++)dt[z[J].toUpperCase()]=z[J];return dt},is=function(z,dt){return typeof z===m?a(dt).indexOf(a(z))!==-1:!1},a=function(z){return z.toLowerCase()},c=function(z){return typeof z===m?z.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(z,dt){if(typeof z===m)return z=z.replace(/^\s\s*/,s),typeof dt===u?z:z.substring(0,j)},I=function(z,dt){for(var J=0,se,He,Fe,re,X,Ve;J<dt.length&&!X;){var Ls=dt[J],Yo=dt[J+1];for(se=He=0;se<Ls.length&&!X&&Ls[se];)if(X=Ls[se++].exec(z),X)for(Fe=0;Fe<Yo.length;Fe++)Ve=X[++He],re=Yo[Fe],typeof re===f&&re.length>0?re.length===2?typeof re[1]==l?this[re[0]]=re[1].call(this,Ve):this[re[0]]=re[1]:re.length===3?typeof re[1]===l&&!(re[1].exec&&re[1].test)?this[re[0]]=Ve?re[1].call(this,Ve,re[2]):n:this[re[0]]=Ve?Ve.replace(re[1],re[2]):n:re.length===4&&(this[re[0]]=Ve?re[3].call(this,Ve.replace(re[1],re[2])):n):this[re]=Ve||n;J+=2}},N=function(z,dt){for(var J in dt)if(typeof dt[J]===f&&dt[J].length>0){for(var se=0;se<dt[J].length;se++)if(is(dt[J][se],z))return J===o?n:J}else if(is(dt[J],z))return J===o?n:J;return dt.hasOwnProperty("*")?dt["*"]:z},L={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},W={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"},te={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[_,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[_,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[_,C],[/opios[\/ ]+([\w\.]+)/i],[C,[_,cr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[_,cr+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[_,cr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[_,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[_,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[_,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[_,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[_,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[C,[_,"UC"+me]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[_,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[_,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[_,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[_,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[_,"Smart Lenovo "+me]],[/(avast|avg)\/([\w\.]+)/i],[[_,/(.+)/,"$1 Secure "+me],C],[/\bfocus\/([\w\.]+)/i],[C,[_,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[C,[_,cr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[_,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[_,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[_,cr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[_,"MIUI"+Mn]],[/fxios\/([\w\.-]+)/i],[C,[_,be]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[_,"360"]],[/\b(qq)\/([\w\.]+)/i],[[_,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[_,/(.+)/,"$1"+Mn],C],[/samsungbrowser\/([\w\.]+)/i],[C,[_,jr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[_,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[_,"Sogou Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[_,C],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[_],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[C,_],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[_,Hi],C],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[_,C],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[_,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[C,[_,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[_,de+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[_,de+" WebView"],C],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[_,"Android "+me]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[_,C],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[C,[_,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[C,_],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[_,[C,N,L]],[/(webkit|khtml)\/([\w\.]+)/i],[_,C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[_,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[_,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[_,be+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[_,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[_,[C,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[O,"amd64"]],[/(ia32(?=;))/i],[[O,a]],[/((?:i[346]|x)86)[;\)]/i],[[O,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[O,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[O,"armhf"]],[/windows (ce|mobile); ppc;/i],[[O,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[O,/ower/,s,a]],[/(sun4\w)[;\)]/i],[[O,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[O,a]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[y,jr],[g,k]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[v,[y,jr],[g,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[y,Y],[g,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[y,Y],[g,k]],[/(macintosh);/i],[v,[y,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[y,je],[g,R]],[/(?:honor)([-\w ]+)[;\)]/i],[v,[y,"Honor"],[g,R]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[y,De],[g,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[y,De],[g,R]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[g,R]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[g,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[y,"OPPO"],[g,R]],[/\b(opd2\d{3}a?) bui/i],[v,[y,"OPPO"],[g,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[y,"Vivo"],[g,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[v,[y,"Realme"],[g,R]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[y,we],[g,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[y,we],[g,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[y,ht],[g,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[y,ht],[g,R]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[y,"Lenovo"],[g,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[y,"Nokia"],[g,R]],[/(pixel c)\b/i],[v,[y,Ut],[g,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[y,Ut],[g,R]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[y,en],[g,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[y,en],[g,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[y,"OnePlus"],[g,R]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[y,ct],[g,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[y,ct],[g,R]],[/(playbook);[-\w\),; ]+(rim)/i],[v,y,[g,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[y,Xt],[g,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[y,at],[g,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[y,at],[g,R]],[/(nexus 9)/i],[v,[y,"HTC"],[g,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[v,/_/g," "],[g,R]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[v,[y,"TCL"],[g,k]],[/(itel) ((\w+))/i],[[y,a],v,[g,N,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[y,"Acer"],[g,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[y,"Meizu"],[g,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[v,[y,"Ulefone"],[g,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[v,[y,"Energizer"],[g,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[v,[y,"Cat"],[g,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[v,[y,"Smartfren"],[g,R]],[/droid.+; (a(?:015|06[35]|142p?))/i],[v,[y,"Nothing"],[g,R]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[y,v,[g,R]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[y,v,[g,k]],[/(surface duo)/i],[v,[y,Q],[g,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[y,"Fairphone"],[g,R]],[/(u304aa)/i],[v,[y,"AT&T"],[g,R]],[/\bsie-(\w*)/i],[v,[y,"Siemens"],[g,R]],[/\b(rct\w+) b/i],[v,[y,"RCA"],[g,k]],[/\b(venue[\d ]{2,7}) b/i],[v,[y,"Dell"],[g,k]],[/\b(q(?:mv|ta)\w+) b/i],[v,[y,"Verizon"],[g,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[y,"Barnes & Noble"],[g,k]],[/\b(tm\d{3}\w+) b/i],[v,[y,"NuVision"],[g,k]],[/\b(k88) b/i],[v,[y,"ZTE"],[g,k]],[/\b(nx\d{3}j) b/i],[v,[y,"ZTE"],[g,R]],[/\b(gen\d{3}) b.+49h/i],[v,[y,"Swiss"],[g,R]],[/\b(zur\d{3}) b/i],[v,[y,"Swiss"],[g,k]],[/\b((zeki)?tb.*\b) b/i],[v,[y,"Zeki"],[g,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],v,[g,k]],[/\b(ns-?\w{0,9}) b/i],[v,[y,"Insignia"],[g,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[y,"NextBook"],[g,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],v,[g,R]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],v,[g,R]],[/\b(ph-1) /i],[v,[y,"Essential"],[g,R]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[y,"Envizen"],[g,k]],[/\b(trio[-\w\. ]+) b/i],[v,[y,"MachSpeed"],[g,k]],[/\btu_(1491) b/i],[v,[y,"Rotor"],[g,k]],[/(shield[\w ]+) b/i],[v,[y,"Nvidia"],[g,k]],[/(sprint) (\w+)/i],[y,v,[g,R]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[y,Q],[g,R]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[y,kn],[g,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[y,kn],[g,R]],[/smart-tv.+(samsung)/i],[y,[g,V]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[y,jr],[g,V]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,ht],[g,V]],[/(apple) ?tv/i],[y,[v,Y+" TV"],[g,V]],[/crkey/i],[[v,de+"cast"],[y,Ut],[g,V]],[/droid.+aft(\w+)( bui|\))/i],[v,[y,ct],[g,V]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[y,je],[g,V]],[/(bravia[\w ]+)( bui|\))/i],[v,[y,en],[g,V]],[/(mitv-\w{5}) bui/i],[v,[y,Hn],[g,V]],[/Hbbtv.*(technisat) (.*);/i],[y,v,[g,V]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,p],[v,p],[g,V]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[g,V]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,v,[g,H]],[/droid.+; (shield) bui/i],[v,[y,"Nvidia"],[g,H]],[/(playstation [345portablevi]+)/i],[v,[y,en],[g,H]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[y,Q],[g,H]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[v,[y,jr],[g,Mt]],[/((pebble))app/i],[y,v,[g,Mt]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[y,Y],[g,Mt]],[/droid.+; (glass) \d/i],[v,[y,Ut],[g,Mt]],[/droid.+; (wt63?0{2,3})\)/i],[v,[y,kn],[g,Mt]],[/droid.+; (glass) \d/i],[v,[y,Ut],[g,Mt]],[/(pico) (4|neo3(?: link|pro)?)/i],[y,v,[g,Mt]],[/; (quest( \d| pro)?)/i],[v,[y,Hi],[g,Mt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[g,fe]],[/(aeobc)\b/i],[v,[y,ct],[g,fe]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[v,[g,R]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[g,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,R]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[_,xe+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[_,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[_,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[_,C],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,_]],os:[[/microsoft (windows) (vista|xp)/i],[_,C],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[_,[C,N,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[C,N,W],[_,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[_,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[_,ji],[C,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[C,_],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[_,C],[/\(bb(10);/i],[C,[_,Xt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[C,[_,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[C,[_,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[C,[_,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[C,[_,"watchOS"]],[/crkey\/([\d\.]+)/i],[C,[_,de+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[_,Wi],C],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[_,C],[/(sunos) ?([\w\.\d]*)/i],[[_,"Solaris"],C],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[_,C]]},Tt=function(z,dt){if(typeof z===f&&(dt=z,z=n),!(this instanceof Tt))return new Tt(z,dt).getResult();var J=typeof r!==u&&r.navigator?r.navigator:n,se=z||(J&&J.userAgent?J.userAgent:s),He=J&&J.userAgentData?J.userAgentData:n,Fe=dt?Be(te,dt):te,re=J&&J.userAgent==se;return this.getBrowser=function(){var X={};return X[_]=n,X[C]=n,I.call(X,se,Fe.browser),X[h]=c(X[C]),re&&J&&J.brave&&typeof J.brave.isBrave==l&&(X[_]="Brave"),X},this.getCPU=function(){var X={};return X[O]=n,I.call(X,se,Fe.cpu),X},this.getDevice=function(){var X={};return X[y]=n,X[v]=n,X[g]=n,I.call(X,se,Fe.device),re&&!X[g]&&He&&He.mobile&&(X[g]=R),re&&X[v]=="Macintosh"&&J&&typeof J.standalone!==u&&J.maxTouchPoints&&J.maxTouchPoints>2&&(X[v]="iPad",X[g]=k),X},this.getEngine=function(){var X={};return X[_]=n,X[C]=n,I.call(X,se,Fe.engine),X},this.getOS=function(){var X={};return X[_]=n,X[C]=n,I.call(X,se,Fe.os),re&&!X[_]&&He&&He.platform&&He.platform!="Unknown"&&(X[_]=He.platform.replace(/chrome os/i,Wi).replace(/macos/i,ji)),X},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 se},this.setUA=function(X){return se=typeof X===m&&X.length>j?p(X,j):X,this},this.setUA(se),this};Tt.VERSION=i,Tt.BROWSER=$r([_,C,h]),Tt.CPU=$r([O]),Tt.DEVICE=$r([v,y,g,H,R,V,k,Mt,fe]),Tt.ENGINE=Tt.OS=$r([_,C]),typeof t!==u?(typeof e!==u&&e.exports&&(t=e.exports=Tt),t.UAParser=Tt):typeof define===l&&define.amd?define(function(){return Tt}):typeof r!==u&&(r.UAParser=Tt);var Dt=typeof r!==u&&(r.jQuery||r.Zepto);if(Dt&&!Dt.ua){var ce=new Tt;Dt.ua=ce.getResult(),Dt.ua.get=function(){return ce.getUA()},Dt.ua.set=function(z){ce.setUA(z);var dt=ce.getResult();for(var J in dt)Dt.ua[J]=dt[J]}}})(typeof window=="object"?window:t)}),Hp=Vi((t,e)=>{"use strict";(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,l,u){function f(v,_){if(!l[v]){if(!o[v]){var g=typeof Gi=="function"&&Gi;if(!_&&g)return g(v,!0);if(m)return m(v,!0);var y=new Error("Cannot find module '"+v+"'");throw y.code="MODULE_NOT_FOUND",y}var C=l[v]={exports:{}};o[v][0].call(C.exports,function(O){var H=o[v][1][O];return f(H||O)},C,C.exports,s,o,l,u)}return l[v].exports}for(var m=typeof Gi=="function"&&Gi,h=0;h<u.length;h++)f(u[h]);return f}({1:[function(s,o,l){(function(u){"use strict";var f=u.MutationObserver||u.WebKitMutationObserver,m;if(f){var h=0,v=new f(O),_=u.document.createTextNode("");v.observe(_,{characterData:!0}),m=function(){_.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var g=new u.MessageChannel;g.port1.onmessage=O,m=function(){g.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?m=function(){var R=u.document.createElement("script");R.onreadystatechange=function(){O(),R.onreadystatechange=null,R.parentNode.removeChild(R),R=null},u.document.documentElement.appendChild(R)}:m=function(){setTimeout(O,0)};var y,C=[];function O(){y=!0;for(var R,k,V=C.length;V;){for(k=C,C=[],R=-1;++R<V;)k[R]();V=C.length}y=!1}o.exports=H;function H(R){C.push(R)===1&&!y&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,l){"use strict";var u=s(1);function f(){}var m={},h=["REJECTED"],v=["FULFILLED"],_=["PENDING"];o.exports=g;function g(j){if(typeof j!="function")throw new TypeError("resolver must be a function");this.state=_,this.queue=[],this.outcome=void 0,j!==f&&H(this,j)}g.prototype.catch=function(j){return this.then(null,j)},g.prototype.then=function(j,ct){if(typeof j!="function"&&this.state===v||typeof ct!="function"&&this.state===h)return this;var Y=new this.constructor(f);if(this.state!==_){var at=this.state===v?j:ct;C(Y,at,this.outcome)}else this.queue.push(new y(Y,j,ct));return Y};function y(j,ct,Y){this.promise=j,typeof ct=="function"&&(this.onFulfilled=ct,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}y.prototype.callFulfilled=function(j){m.resolve(this.promise,j)},y.prototype.otherCallFulfilled=function(j){C(this.promise,this.onFulfilled,j)},y.prototype.callRejected=function(j){m.reject(this.promise,j)},y.prototype.otherCallRejected=function(j){C(this.promise,this.onRejected,j)};function C(j,ct,Y){u(function(){var at;try{at=ct(Y)}catch(Xt){return m.reject(j,Xt)}at===j?m.reject(j,new TypeError("Cannot resolve promise with itself")):m.resolve(j,at)})}m.resolve=function(j,ct){var Y=R(O,ct);if(Y.status==="error")return m.reject(j,Y.value);var at=Y.value;if(at)H(j,at);else{j.state=v,j.outcome=ct;for(var Xt=-1,me=j.queue.length;++Xt<me;)j.queue[Xt].callFulfilled(ct)}return j},m.reject=function(j,ct){j.state=h,j.outcome=ct;for(var Y=-1,at=j.queue.length;++Y<at;)j.queue[Y].callRejected(ct);return j};function O(j){var ct=j&&j.then;if(j&&(typeof j=="object"||typeof j=="function")&&typeof ct=="function")return function(){ct.apply(j,arguments)}}function H(j,ct){var Y=!1;function at(xe){Y||(Y=!0,m.reject(j,xe))}function Xt(xe){Y||(Y=!0,m.resolve(j,xe))}function me(){ct(Xt,at)}var de=R(me);de.status==="error"&&at(de.value)}function R(j,ct){var Y={};try{Y.value=j(ct),Y.status="success"}catch(at){Y.status="error",Y.value=at}return Y}g.resolve=k;function k(j){return j instanceof this?j:m.resolve(new this(f),j)}g.reject=V;function V(j){var ct=new this(f);return m.reject(ct,j)}g.all=Mt;function Mt(j){var ct=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=j.length,at=!1;if(!Y)return this.resolve([]);for(var Xt=new Array(Y),me=0,de=-1,xe=new this(f);++de<Y;)be(j[de],de);return xe;function be(Ut,De){ct.resolve(Ut).then(ht,function(Q){at||(at=!0,m.reject(xe,Q))});function ht(Q){Xt[De]=Q,++me===Y&&!at&&(at=!0,m.resolve(xe,Xt))}}}g.race=fe;function fe(j){var ct=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=j.length,at=!1;if(!Y)return this.resolve([]);for(var Xt=-1,me=new this(f);++Xt<Y;)de(j[Xt]);return me;function de(xe){ct.resolve(xe).then(function(be){at||(at=!0,m.resolve(me,be))},function(be){at||(at=!0,m.reject(me,be))})}}},{1:1}],3:[function(s,o,l){(function(u){"use strict";typeof u.Promise!="function"&&(u.Promise=s(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(s,o,l){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function f(d,E){if(!(d instanceof E))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=m();function v(){try{if(!h||!h.open)return!1;var d=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),E=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||E)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function _(d,E){d=d||[],E=E||{};try{return new Blob(d,E)}catch(D){if(D.name!=="TypeError")throw D;for(var S=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,T=new S,x=0;x<d.length;x+=1)T.append(d[x]);return T.getBlob(E.type)}}typeof Promise>"u"&&s(3);var g=Promise;function y(d,E){E&&d.then(function(S){E(null,S)},function(S){E(S)})}function C(d,E,S){typeof E=="function"&&d.then(E),typeof S=="function"&&d.catch(S)}function O(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function H(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",k=void 0,V={},Mt=Object.prototype.toString,fe="readonly",j="readwrite";function ct(d){for(var E=d.length,S=new ArrayBuffer(E),T=new Uint8Array(S),x=0;x<E;x++)T[x]=d.charCodeAt(x);return S}function Y(d){return new g(function(E){var S=d.transaction(R,j),T=_([""]);S.objectStore(R).put(T,"key"),S.onabort=function(x){x.preventDefault(),x.stopPropagation(),E(!1)},S.oncomplete=function(){var x=navigator.userAgent.match(/Chrome\/(\d+)/),D=navigator.userAgent.match(/Edge\//);E(D||!x||parseInt(x[1],10)>=43)}}).catch(function(){return!1})}function at(d){return typeof k=="boolean"?g.resolve(k):Y(d).then(function(E){return k=E,k})}function Xt(d){var E=V[d.name],S={};S.promise=new g(function(T,x){S.resolve=T,S.reject=x}),E.deferredOperations.push(S),E.dbReady?E.dbReady=E.dbReady.then(function(){return S.promise}):E.dbReady=S.promise}function me(d){var E=V[d.name],S=E.deferredOperations.pop();if(S)return S.resolve(),S.promise}function de(d,E){var S=V[d.name],T=S.deferredOperations.pop();if(T)return T.reject(E),T.promise}function xe(d,E){return new g(function(S,T){if(V[d.name]=V[d.name]||en(),d.db)if(E)Xt(d),d.db.close();else return S(d.db);var x=[d.name];E&&x.push(d.version);var D=h.open.apply(h,x);E&&(D.onupgradeneeded=function(P){var U=D.result;try{U.createObjectStore(d.storeName),P.oldVersion<=1&&U.createObjectStore(R)}catch(F){if(F.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+P.oldVersion+" to version "+P.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw F}}),D.onerror=function(P){P.preventDefault(),T(D.error)},D.onsuccess=function(){var P=D.result;P.onversionchange=function(U){U.target.close()},S(P),me(d)}})}function be(d){return xe(d,!1)}function Ut(d){return xe(d,!0)}function De(d,E){if(!d.db)return!0;var S=!d.db.objectStoreNames.contains(d.storeName),T=d.version<d.db.version,x=d.version>d.db.version;if(T&&(d.version!==E&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),x||S){if(S){var D=d.db.version+1;D>d.version&&(d.version=D)}return!0}return!1}function ht(d){return new g(function(E,S){var T=new FileReader;T.onerror=S,T.onloadend=function(x){var D=btoa(x.target.result||"");E({__local_forage_encoded_blob:!0,data:D,type:d.type})},T.readAsBinaryString(d)})}function Q(d){var E=ct(atob(d.data));return _([E],{type:d.type})}function we(d){return d&&d.__local_forage_encoded_blob}function cr(d){var E=this,S=E._initReady().then(function(){var T=V[E._dbInfo.name];if(T&&T.dbReady)return T.dbReady});return C(S,d,d),S}function jr(d){Xt(d);for(var E=V[d.name],S=E.forages,T=0;T<S.length;T++){var x=S[T];x._dbInfo.db&&(x._dbInfo.db.close(),x._dbInfo.db=null)}return d.db=null,be(d).then(function(D){return d.db=D,De(d)?Ut(d):D}).then(function(D){d.db=E.db=D;for(var P=0;P<S.length;P++)S[P]._dbInfo.db=D}).catch(function(D){throw de(d,D),D})}function je(d,E,S,T){T===void 0&&(T=1);try{var x=d.db.transaction(d.storeName,E);S(null,x)}catch(D){if(T>0&&(!d.db||D.name==="InvalidStateError"||D.name==="NotFoundError"))return g.resolve().then(function(){if(!d.db||D.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Ut(d)}).then(function(){return jr(d).then(function(){je(d,E,S,T-1)})}).catch(S);S(D)}}function en(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hn(d){var E=this,S={db:null};if(d)for(var T in d)S[T]=d[T];var x=V[S.name];x||(x=en(),V[S.name]=x),x.forages.push(E),E._initReady||(E._initReady=E.ready,E.ready=cr);var D=[];function P(){return g.resolve()}for(var U=0;U<x.forages.length;U++){var F=x.forages[U];F!==E&&D.push(F._initReady().catch(P))}var $=x.forages.slice(0);return g.all(D).then(function(){return S.db=x.db,be(S)}).then(function(B){return S.db=B,De(S,E._defaultConfig.version)?Ut(S):B}).then(function(B){S.db=x.db=B,E._dbInfo=S;for(var G=0;G<$.length;G++){var gt=$[G];gt!==E&&(gt._dbInfo.db=S.db,gt._dbInfo.version=S.version)}})}function kn(d,E){var S=this;d=O(d);var T=new g(function(x,D){S.ready().then(function(){je(S._dbInfo,fe,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.get(d);$.onsuccess=function(){var B=$.result;B===void 0&&(B=null),we(B)&&(B=Q(B)),x(B)},$.onerror=function(){D($.error)}}catch(B){D(B)}})}).catch(D)});return y(T,E),T}function Hi(d,E){var S=this,T=new g(function(x,D){S.ready().then(function(){je(S._dbInfo,fe,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.openCursor(),B=1;$.onsuccess=function(){var G=$.result;if(G){var gt=G.value;we(gt)&&(gt=Q(gt));var he=d(gt,G.key,B++);he!==void 0?x(he):G.continue()}else x()},$.onerror=function(){D($.error)}}catch(G){D(G)}})}).catch(D)});return y(T,E),T}function Wi(d,E,S){var T=this;d=O(d);var x=new g(function(D,P){var U;T.ready().then(function(){return U=T._dbInfo,Mt.call(E)==="[object Blob]"?at(U.db).then(function(F){return F?E:ht(E)}):E}).then(function(F){je(T._dbInfo,j,function($,B){if($)return P($);try{var G=B.objectStore(T._dbInfo.storeName);F===null&&(F=void 0);var gt=G.put(F,d);B.oncomplete=function(){F===void 0&&(F=null),D(F)},B.onabort=B.onerror=function(){var he=gt.error?gt.error:gt.transaction.error;P(he)}}catch(he){P(he)}})}).catch(P)});return y(x,S),x}function ji(d,E){var S=this;d=O(d);var T=new g(function(x,D){S.ready().then(function(){je(S._dbInfo,j,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.delete(d);U.oncomplete=function(){x()},U.onerror=function(){D($.error)},U.onabort=function(){var B=$.error?$.error:$.transaction.error;D(B)}}catch(B){D(B)}})}).catch(D)});return y(T,E),T}function Mn(d){var E=this,S=new g(function(T,x){E.ready().then(function(){je(E._dbInfo,j,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.clear();P.oncomplete=function(){T()},P.onabort=P.onerror=function(){var $=F.error?F.error:F.transaction.error;x($)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function Be(d){var E=this,S=new g(function(T,x){E.ready().then(function(){je(E._dbInfo,fe,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.count();F.onsuccess=function(){T(F.result)},F.onerror=function(){x(F.error)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function $r(d,E){var S=this,T=new g(function(x,D){if(d<0){x(null);return}S.ready().then(function(){je(S._dbInfo,fe,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=!1,B=F.openKeyCursor();B.onsuccess=function(){var G=B.result;if(!G){x(null);return}d===0||$?x(G.key):($=!0,G.advance(d))},B.onerror=function(){D(B.error)}}catch(G){D(G)}})}).catch(D)});return y(T,E),T}function is(d){var E=this,S=new g(function(T,x){E.ready().then(function(){je(E._dbInfo,fe,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.openKeyCursor(),$=[];F.onsuccess=function(){var B=F.result;if(!B){T($);return}$.push(B.key),B.continue()},F.onerror=function(){x(F.error)}}catch(B){x(B)}})}).catch(x)});return y(S,d),S}function a(d,E){E=H.apply(this,arguments);var S=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||S.name,d.storeName=d.storeName||S.storeName);var T=this,x;if(!d.name)x=g.reject("Invalid arguments");else{var D=d.name===S.name&&T._dbInfo.db,P=D?g.resolve(T._dbInfo.db):be(d).then(function(U){var F=V[d.name],$=F.forages;F.db=U;for(var B=0;B<$.length;B++)$[B]._dbInfo.db=U;return U});d.storeName?x=P.then(function(U){if(U.objectStoreNames.contains(d.storeName)){var F=U.version+1;Xt(d);var $=V[d.name],B=$.forages;U.close();for(var G=0;G<B.length;G++){var gt=B[G];gt._dbInfo.db=null,gt._dbInfo.version=F}var he=new g(function(oe,Ie){var ye=h.open(d.name,F);ye.onerror=function(We){var Ku=ye.result;Ku.close(),Ie(We)},ye.onupgradeneeded=function(){var We=ye.result;We.deleteObjectStore(d.storeName)},ye.onsuccess=function(){var We=ye.result;We.close(),oe(We)}});return he.then(function(oe){$.db=oe;for(var Ie=0;Ie<B.length;Ie++){var ye=B[Ie];ye._dbInfo.db=oe,me(ye._dbInfo)}}).catch(function(oe){throw(de(d,oe)||g.resolve()).catch(function(){}),oe})}}):x=P.then(function(U){Xt(d);var F=V[d.name],$=F.forages;U.close();for(var B=0;B<$.length;B++){var G=$[B];G._dbInfo.db=null}var gt=new g(function(he,oe){var Ie=h.deleteDatabase(d.name);Ie.onerror=function(){var ye=Ie.result;ye&&ye.close(),oe(Ie.error)},Ie.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},Ie.onsuccess=function(){var ye=Ie.result;ye&&ye.close(),he(ye)}});return gt.then(function(he){F.db=he;for(var oe=0;oe<$.length;oe++){var Ie=$[oe];me(Ie._dbInfo)}}).catch(function(he){throw(de(d,he)||g.resolve()).catch(function(){}),he})})}return y(x,E),x}var c={_driver:"asyncStorage",_initStorage:Hn,_support:v(),iterate:Hi,getItem:kn,setItem:Wi,removeItem:ji,clear:Mn,length:Be,key:$r,keys:is,dropInstance:a};function p(){return typeof openDatabase=="function"}var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="~~local_forage_type~",L=/^~~local_forage_type~([^~]+)~/,W="__lfsc__:",te=W.length,Tt="arbf",Dt="blob",ce="si08",z="ui08",dt="uic8",J="si16",se="si32",He="ur16",Fe="ui32",re="fl32",X="fl64",Ve=te+Tt.length,Ls=Object.prototype.toString;function Yo(d){var E=d.length*.75,S=d.length,T,x=0,D,P,U,F;d[d.length-1]==="="&&(E--,d[d.length-2]==="="&&E--);var $=new ArrayBuffer(E),B=new Uint8Array($);for(T=0;T<S;T+=4)D=I.indexOf(d[T]),P=I.indexOf(d[T+1]),U=I.indexOf(d[T+2]),F=I.indexOf(d[T+3]),B[x++]=D<<2|P>>4,B[x++]=(P&15)<<4|U>>2,B[x++]=(U&3)<<6|F&63;return $}function Ic(d){var E=new Uint8Array(d),S="",T;for(T=0;T<E.length;T+=3)S+=I[E[T]>>2],S+=I[(E[T]&3)<<4|E[T+1]>>4],S+=I[(E[T+1]&15)<<2|E[T+2]>>6],S+=I[E[T+2]&63];return E.length%3===2?S=S.substring(0,S.length-1)+"=":E.length%3===1&&(S=S.substring(0,S.length-2)+"=="),S}function $d(d,E){var S="";if(d&&(S=Ls.call(d)),d&&(S==="[object ArrayBuffer]"||d.buffer&&Ls.call(d.buffer)==="[object ArrayBuffer]")){var T,x=W;d instanceof ArrayBuffer?(T=d,x+=Tt):(T=d.buffer,S==="[object Int8Array]"?x+=ce:S==="[object Uint8Array]"?x+=z:S==="[object Uint8ClampedArray]"?x+=dt:S==="[object Int16Array]"?x+=J:S==="[object Uint16Array]"?x+=He:S==="[object Int32Array]"?x+=se:S==="[object Uint32Array]"?x+=Fe:S==="[object Float32Array]"?x+=re:S==="[object Float64Array]"?x+=X:E(new Error("Failed to get type for BinaryArray"))),E(x+Ic(T))}else if(S==="[object Blob]"){var D=new FileReader;D.onload=function(){var P=N+d.type+"~"+Ic(this.result);E(W+Dt+P)},D.readAsArrayBuffer(d)}else try{E(JSON.stringify(d))}catch(P){console.error("Couldn't convert value into a JSON string: ",d),E(null,P)}}function Fd(d){if(d.substring(0,te)!==W)return JSON.parse(d);var E=d.substring(Ve),S=d.substring(te,Ve),T;if(S===Dt&&L.test(E)){var x=E.match(L);T=x[1],E=E.substring(x[0].length)}var D=Yo(E);switch(S){case Tt:return D;case Dt:return _([D],{type:T});case ce:return new Int8Array(D);case z:return new Uint8Array(D);case dt:return new Uint8ClampedArray(D);case J:return new Int16Array(D);case He:return new Uint16Array(D);case se:return new Int32Array(D);case Fe:return new Uint32Array(D);case re:return new Float32Array(D);case X:return new Float64Array(D);default:throw new Error("Unkown type: "+S)}}var Tc={serialize:$d,deserialize:Fd,stringToBuffer:Yo,bufferToString:Ic};function eh(d,E,S,T){d.executeSql("CREATE TABLE IF NOT EXISTS "+E.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],S,T)}function Hd(d){var E=this,S={db:null};if(d)for(var T in d)S[T]=typeof d[T]!="string"?d[T].toString():d[T];var x=new g(function(D,P){try{S.db=openDatabase(S.name,String(S.version),S.description,S.size)}catch(U){return P(U)}S.db.transaction(function(U){eh(U,S,function(){E._dbInfo=S,D()},function(F,$){P($)})},P)});return S.serializer=Tc,x}function Fn(d,E,S,T,x,D){d.executeSql(S,T,x,function(P,U){U.code===U.SYNTAX_ERR?P.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[E.storeName],function(F,$){$.rows.length?D(F,U):eh(F,E,function(){F.executeSql(S,T,x,D)},D)},D):D(P,U)},D)}function Vd(d,E){var S=this;d=O(d);var T=new g(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT * FROM "+P.storeName+" WHERE key = ? LIMIT 1",[d],function(F,$){var B=$.rows.length?$.rows.item(0).value:null;B&&(B=P.serializer.deserialize(B)),x(B)},function(F,$){D($)})})}).catch(D)});return y(T,E),T}function qd(d,E){var S=this,T=new g(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT * FROM "+P.storeName,[],function(F,$){for(var B=$.rows,G=B.length,gt=0;gt<G;gt++){var he=B.item(gt),oe=he.value;if(oe&&(oe=P.serializer.deserialize(oe)),oe=d(oe,he.key,gt+1),oe!==void 0){x(oe);return}}x()},function(F,$){D($)})})}).catch(D)});return y(T,E),T}function rh(d,E,S,T){var x=this;d=O(d);var D=new g(function(P,U){x.ready().then(function(){E===void 0&&(E=null);var F=E,$=x._dbInfo;$.serializer.serialize(E,function(B,G){G?U(G):$.db.transaction(function(gt){Fn(gt,$,"INSERT OR REPLACE INTO "+$.storeName+" (key, value) VALUES (?, ?)",[d,B],function(){P(F)},function(he,oe){U(oe)})},function(gt){if(gt.code===gt.QUOTA_ERR){if(T>0){P(rh.apply(x,[d,F,S,T-1]));return}U(gt)}})})}).catch(U)});return y(D,S),D}function Wd(d,E,S){return rh.apply(this,[d,E,S,1])}function zd(d,E){var S=this;d=O(d);var T=new g(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"DELETE FROM "+P.storeName+" WHERE key = ?",[d],function(){x()},function(F,$){D($)})})}).catch(D)});return y(T,E),T}function Gd(d){var E=this,S=new g(function(T,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"DELETE FROM "+D.storeName,[],function(){T()},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Kd(d){var E=this,S=new g(function(T,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"SELECT COUNT(key) as c FROM "+D.storeName,[],function(U,F){var $=F.rows.item(0).c;T($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Yd(d,E){var S=this,T=new g(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT key FROM "+P.storeName+" WHERE id = ? LIMIT 1",[d+1],function(F,$){var B=$.rows.length?$.rows.item(0).key:null;x(B)},function(F,$){D($)})})}).catch(D)});return y(T,E),T}function Jd(d){var E=this,S=new g(function(T,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"SELECT key FROM "+D.storeName,[],function(U,F){for(var $=[],B=0;B<F.rows.length;B++)$.push(F.rows.item(B).key);T($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Xd(d){return new g(function(E,S){d.transaction(function(T){T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(x,D){for(var P=[],U=0;U<D.rows.length;U++)P.push(D.rows.item(U).name);E({db:d,storeNames:P})},function(x,D){S(D)})},function(T){S(T)})})}function Zd(d,E){E=H.apply(this,arguments);var S=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||S.name,d.storeName=d.storeName||S.storeName);var T=this,x;return d.name?x=new g(function(D){var P;d.name===S.name?P=T._dbInfo.db:P=openDatabase(d.name,"","",0),d.storeName?D({db:P,storeNames:[d.storeName]}):D(Xd(P))}).then(function(D){return new g(function(P,U){D.db.transaction(function(F){function $(he){return new g(function(oe,Ie){F.executeSql("DROP TABLE IF EXISTS "+he,[],function(){oe()},function(ye,We){Ie(We)})})}for(var B=[],G=0,gt=D.storeNames.length;G<gt;G++)B.push($(D.storeNames[G]));g.all(B).then(function(){P()}).catch(function(he){U(he)})},function(F){U(F)})})}):x=g.reject("Invalid arguments"),y(x,E),x}var Qd={_driver:"webSQLStorage",_initStorage:Hd,_support:p(),iterate:qd,getItem:Vd,setItem:Wd,removeItem:zd,clear:Gd,length:Kd,key:Yd,keys:Jd,dropInstance:Zd};function Hg(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function nh(d,E){var S=d.name+"/";return d.storeName!==E.storeName&&(S+=d.storeName+"/"),S}function Lm(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function qm(){return!Lm()||localStorage.length>0}function zm(d){var E=this,S={};if(d)for(var T in d)S[T]=d[T];return S.keyPrefix=nh(d,E._defaultConfig),qm()?(E._dbInfo=S,S.serializer=Tc,g.resolve()):g.reject()}function Ym(d){var E=this,S=E.ready().then(function(){for(var T=E._dbInfo.keyPrefix,x=localStorage.length-1;x>=0;x--){var D=localStorage.key(x);D.indexOf(T)===0&&localStorage.removeItem(D)}});return y(S,d),S}function kv(d,E){var S=this;d=O(d);var T=S.ready().then(function(){var x=S._dbInfo,D=localStorage.getItem(x.keyPrefix+d);return D&&(D=x.serializer.deserialize(D)),D});return y(T,E),T}function Mv(d,E){var S=this,T=S.ready().then(function(){for(var x=S._dbInfo,D=x.keyPrefix,P=D.length,U=localStorage.length,F=1,$=0;$<U;$++){var B=localStorage.key($);if(B.indexOf(D)===0){var G=localStorage.getItem(B);if(G&&(G=x.serializer.deserialize(G)),G=d(G,B.substring(P),F++),G!==void 0)return G}}});return y(T,E),T}function Uv(d,E){var S=this,T=S.ready().then(function(){var x=S._dbInfo,D;try{D=localStorage.key(d)}catch{D=null}return D&&(D=D.substring(x.keyPrefix.length)),D});return y(T,E),T}function jv(d){var E=this,S=E.ready().then(function(){for(var T=E._dbInfo,x=localStorage.length,D=[],P=0;P<x;P++){var U=localStorage.key(P);U.indexOf(T.keyPrefix)===0&&D.push(U.substring(T.keyPrefix.length))}return D});return y(S,d),S}function Bv(d){var E=this,S=E.keys().then(function(T){return T.length});return y(S,d),S}function $v(d,E){var S=this;d=O(d);var T=S.ready().then(function(){var x=S._dbInfo;localStorage.removeItem(x.keyPrefix+d)});return y(T,E),T}function Fv(d,E,S){var T=this;d=O(d);var x=T.ready().then(function(){E===void 0&&(E=null);var D=E;return new g(function(P,U){var F=T._dbInfo;F.serializer.serialize(E,function($,B){if(B)U(B);else try{localStorage.setItem(F.keyPrefix+d,$),P(D)}catch(G){(G.name==="QuotaExceededError"||G.name==="NS_ERROR_DOM_QUOTA_REACHED")&&U(G),U(G)}})})});return y(x,S),x}function Hv(d,E){if(E=H.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var S=this.config();d.name=d.name||S.name,d.storeName=d.storeName||S.storeName}var T=this,x;return d.name?x=new g(function(D){d.storeName?D(nh(d,T._defaultConfig)):D(d.name+"/")}).then(function(D){for(var P=localStorage.length-1;P>=0;P--){var U=localStorage.key(P);U.indexOf(D)===0&&localStorage.removeItem(U)}}):x=g.reject("Invalid arguments"),y(x,E),x}var Vv={_driver:"localStorageWrapper",_initStorage:zm,_support:Hg(),iterate:Mv,getItem:kv,setItem:Fv,removeItem:$v,clear:Ym,length:Bv,key:Uv,keys:jv,dropInstance:Hv},Wv=function(d,E){return d===E||typeof d=="number"&&typeof E=="number"&&isNaN(d)&&isNaN(E)},zv=function(d,E){for(var S=d.length,T=0;T<S;){if(Wv(d[T],E))return!0;T++}return!1},ih=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},Ga={},oh={},to={INDEXEDDB:c,WEBSQL:Qd,LOCALSTORAGE:Vv},Gv=[to.INDEXEDDB._driver,to.WEBSQL._driver,to.LOCALSTORAGE._driver],Ec=["dropInstance"],Jc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ec),Ly={description:"",driver:Gv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function By(d,E){d[E]=function(){var S=arguments;return d.ready().then(function(){return d[E].apply(d,S)})}}function zu(){for(var d=1;d<arguments.length;d++){var E=arguments[d];if(E)for(var S in E)E.hasOwnProperty(S)&&(ih(E[S])?arguments[0][S]=E[S].slice():arguments[0][S]=E[S])}return arguments[0]}var tb=function(){function d(E){f(this,d);for(var S in to)if(to.hasOwnProperty(S)){var T=to[S],x=T._driver;this[S]=x,Ga[x]||this.defineDriver(T)}this._defaultConfig=zu({},Ly),this._config=zu({},this._defaultConfig,E),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(E){if((typeof E>"u"?"undefined":u(E))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var S in E){if(S==="storeName"&&(E[S]=E[S].replace(/\W/g,"_")),S==="version"&&typeof E[S]!="number")return new Error("Database version must be a number.");this._config[S]=E[S]}return"driver"in E&&E.driver?this.setDriver(this._config.driver):!0}else return typeof E=="string"?this._config[E]:this._config},d.prototype.defineDriver=function(E,S,T){var x=new g(function(D,P){try{var U=E._driver,F=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!E._driver){P(F);return}for(var $=Jc.concat("_initStorage"),B=0,G=$.length;B<G;B++){var gt=$[B],he=!zv(Ec,gt);if((he||E[gt])&&typeof E[gt]!="function"){P(F);return}}var oe=function(){for(var ye=function(rb){return function(){var nb=new Error("Method "+rb+" is not implemented by the current driver"),dh=g.reject(nb);return y(dh,arguments[arguments.length-1]),dh}},We=0,Ku=Ec.length;We<Ku;We++){var Yu=Ec[We];E[Yu]||(E[Yu]=ye(Yu))}};oe();var Ie=function(ye){Ga[U]&&console.info("Redefining LocalForage driver: "+U),Ga[U]=E,oh[U]=ye,D()};"_support"in E?E._support&&typeof E._support=="function"?E._support().then(Ie,P):Ie(!!E._support):Ie(!0)}catch(ye){P(ye)}});return C(x,S,T),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(E,S,T){var x=Ga[E]?g.resolve(Ga[E]):g.reject(new Error("Driver not found."));return C(x,S,T),x},d.prototype.getSerializer=function(E){var S=g.resolve(Tc);return C(S,E),S},d.prototype.ready=function(E){var S=this,T=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return C(T,E,E),T},d.prototype.setDriver=function(E,S,T){var x=this;ih(E)||(E=[E]);var D=this._getSupportedDrivers(E);function P(){x._config.driver=x.driver()}function U(B){return x._extend(B),P(),x._ready=x._initStorage(x._config),x._ready}function F(B){return function(){var G=0;function gt(){for(;G<B.length;){var he=B[G];return G++,x._dbInfo=null,x._ready=null,x.getDriver(he).then(U).catch(gt)}P();var oe=new Error("No available storage method found.");return x._driverSet=g.reject(oe),x._driverSet}return gt()}}var $=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=$.then(function(){var B=D[0];return x._dbInfo=null,x._ready=null,x.getDriver(B).then(function(G){x._driver=G._driver,P(),x._wrapLibraryMethodsWithReady(),x._initDriver=F(D)})}).catch(function(){P();var B=new Error("No available storage method found.");return x._driverSet=g.reject(B),x._driverSet}),C(this._driverSet,S,T),this._driverSet},d.prototype.supports=function(E){return!!oh[E]},d.prototype._extend=function(E){zu(this,E)},d.prototype._getSupportedDrivers=function(E){for(var S=[],T=0,x=E.length;T<x;T++){var D=E[T];this.supports(D)&&S.push(D)}return S},d.prototype._wrapLibraryMethodsWithReady=function(){for(var E=0,S=Jc.length;E<S;E++)By(this,Jc[E])},d.prototype.createInstance=function(E){return new d(E)},d}(),eb=new tb;o.exports=eb},{3:3}]},{},[4])(4)})}),Sl=Vi(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URLBuilder=void 0;var e=function(){function r(n){try{this.base=new URL(n),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return r.prototype.appendQueryParam=function(n,i){this.params.append(n,i?i.toString():"")},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(n){this.params.delete(n)},r.prototype.getBase=function(){return this.base},r.prototype.getPath=function(){return this.base.pathname},r.prototype.getHostname=function(){return this.base.hostname},r.prototype.getParams=function(){return this.params},r.prototype.getQueryParam=function(n){if(!this.params)return"";var i=this.params.get(n);return!i||i==="undefined"||i==="null"?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(n){return this.base.pathname=n,this},r.prototype.setQueryParam=function(n,i){return this.params.set(n,i?i.toString():""),this},r.prototype.setQueryString=function(n){if(n)return n[0]==="?"&&(n=n.slice(1)),this.params=new URLSearchParams(n),this},r.prototype.toString=function(){var n=this.params.toString();return n===""?this.base.search="":this.base.search="?"+n,this.base.toString()},r}();t.URLBuilder=e}),dd=Vi((t,e)=>{"use strict";(function(r,n){typeof t=="object"&&typeof e<"u"?e.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(t,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var l={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(l,o),function(u,f){var m=o.retries,h=o.retryDelay,v=o.retryOn;if(f&&f.retries!==void 0)if(n(f.retries))m=f.retries;else throw new i("retries must be a positive integer");if(f&&f.retryDelay!==void 0)if(n(f.retryDelay)||typeof f.retryDelay=="function")h=f.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(f&&f.retryOn)if(Array.isArray(f.retryOn)||typeof f.retryOn=="function")v=f.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(_,g){var y=function(O){var H=typeof Request<"u"&&u instanceof Request?u.clone():u;s(H,f).then(function(R){if(Array.isArray(v)&&v.indexOf(R.status)===-1)_(R);else if(typeof v=="function")try{return Promise.resolve(v(O,null,R)).then(function(k){k?C(O,null,R):_(R)}).catch(g)}catch(k){g(k)}else O<m?C(O,null,R):_(R)}).catch(function(R){if(typeof v=="function")try{Promise.resolve(v(O,R,null)).then(function(k){k?C(O,R,null):g(R)}).catch(function(k){g(k)})}catch(k){g(k)}else O<m?C(O,R,null):g(R)})};function C(O,H,R){var k=typeof h=="function"?h(O,H,R):h;setTimeout(function(){y(++O)},k)}y(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),ip="9.3.21",A=class Ju{static SDK_VERSION=ip;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static CTA_EVENT="letscooee:outbound:cta";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static{let e=Ju.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ju.SDK_VERSION_CODE=parseInt(e,10)}},Zt={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${A.SDK_VERSION}/dist/widget-sdk.min.css`},Rt=Qt(tn()),b=class{static log(...t){Rt.default.info(...t)}static debug(...t){Rt.default.debug(...t)}static error(...t){Rt.default.error(...t)}static warn(...t){Rt.default.warn(...t)}static info(...t){Rt.default.info(...t)}static trace(...t){Rt.default.trace(...t)}static configure(t=A.LOG_PREFIX){Rt.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${A.SDK_VERSION}):`)}});let e=this.getDebugParam();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Rt.default.setLevel(Rt.default[localStorage.cooeeLogLevel]):Rt.default.setLevel(Zt.debug?Rt.default.TRACE:Rt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let t=`
|
|
1
|
+
"use strict";(()=>{var sh=Object.create,xc=Object.defineProperty,ah=Object.defineProperties,ch=Object.getOwnPropertyDescriptor,lh=Object.getOwnPropertyDescriptors,uh=Object.getOwnPropertyNames,tp=Object.getOwnPropertySymbols,ph=Object.getPrototypeOf,np=Object.prototype.hasOwnProperty,fh=Object.prototype.propertyIsEnumerable,rp=(t,e,r)=>e in t?xc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e||={})np.call(e,r)&&rp(t,r,e[r]);if(tp)for(var r of tp(e))fh.call(e,r)&&rp(t,r,e[r]);return t},Z=(t,e)=>ah(t,lh(e)),Gi=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Vi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uh(e))!np.call(t,i)&&i!==r&&xc(t,i,{get:()=>e[i],enumerable:!(n=ch(e,i))||n.enumerable});return t},Qt=(t,e,r)=>(r=t!=null?sh(ph(t)):{},mh(e||!t||!t.__esModule?xc(r,"default",{value:t,enumerable:!0}):r,t)),tn=Vi((t,e)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,v){return function(){return v.apply(h,arguments)}},l=function(){var h=arguments,v=h[0],_,g;for(g=1;g<h.length;g++)for(_ in h[g])!(_ in v)&&h[g].hasOwnProperty(_)&&(v[_]=h[g][_]);return v},u=function(h,v){return{value:h,name:v}};n.TRACE=u(1,"TRACE"),n.DEBUG=u(2,"DEBUG"),n.INFO=u(3,"INFO"),n.TIME=u(4,"TIME"),n.WARN=u(5,"WARN"),n.ERROR=u(8,"ERROR"),n.OFF=u(99,"OFF");var f=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};f.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var v=this.context.filterLevel;return h.value>=v.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,v){i&&this.enabledFor(h)&&i(v,l({level:h},this.context))}};var m=new f({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(m,m.enabledFor),h.trace=o(m,m.trace),h.debug=o(m,m.debug),h.time=o(m,m.time),h.timeEnd=o(m,m.timeEnd),h.info=o(m,m.info),h.warn=o(m,m.warn),h.error=o(m,m.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){m.setLevel(h);for(var v in s)s.hasOwnProperty(v)&&s[v].setLevel(h)},n.getLevel=function(){return m.getLevel()},n.get=function(h){return s[h]||(s[h]=new f(l({name:h},m.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(g,y){y.name&&g.unshift("["+y.name+"]")};var v={},_=function(g,y){Function.prototype.apply.call(g,console,y)};return typeof console>"u"?function(){}:function(g,y){g=Array.prototype.slice.call(g);var C=console.log,O;y.level===n.TIME?(O=(y.name?"["+y.name+"] ":"")+g[0],g[1]==="start"?console.time?console.time(O):v[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):_(C,[O+": "+(new Date().getTime()-v[O])+"ms"])):(y.level===n.WARN&&console.warn?C=console.warn:y.level===n.ERROR&&console.error?C=console.error:y.level===n.INFO&&console.info?C=console.info:y.level===n.DEBUG&&console.debug?C=console.debug:y.level===n.TRACE&&console.trace&&(C=console.trace),h.formatter(g,y),_(C,g))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof e<"u"&&e.exports?e.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(t)}),Mp=Vi((t,e)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",l="function",u="undefined",f="object",m="string",h="major",v="model",_="name",g="type",y="vendor",C="version",O="architecture",H="console",R="mobile",k="tablet",V="smarttv",Mt="wearable",fe="embedded",j=500,ct="Amazon",Y="Apple",at="ASUS",Xt="BlackBerry",me="Browser",de="Chrome",xe="Edge",be="Firefox",Ut="Google",De="Huawei",ht="LG",Q="Microsoft",we="Motorola",cr="Opera",jr="Samsung",je="Sharp",en="Sony",Hn="Xiaomi",kn="Zebra",Hi="Facebook",Wi="Chromium OS",ji="Mac OS",Mn=" Browser",Be=function(z,dt){var J={};for(var se in z)dt[se]&&dt[se].length%2===0?J[se]=dt[se].concat(z[se]):J[se]=z[se];return J},$r=function(z){for(var dt={},J=0;J<z.length;J++)dt[z[J].toUpperCase()]=z[J];return dt},is=function(z,dt){return typeof z===m?a(dt).indexOf(a(z))!==-1:!1},a=function(z){return z.toLowerCase()},c=function(z){return typeof z===m?z.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(z,dt){if(typeof z===m)return z=z.replace(/^\s\s*/,s),typeof dt===u?z:z.substring(0,j)},I=function(z,dt){for(var J=0,se,He,Fe,re,X,Ve;J<dt.length&&!X;){var Ls=dt[J],Yo=dt[J+1];for(se=He=0;se<Ls.length&&!X&&Ls[se];)if(X=Ls[se++].exec(z),X)for(Fe=0;Fe<Yo.length;Fe++)Ve=X[++He],re=Yo[Fe],typeof re===f&&re.length>0?re.length===2?typeof re[1]==l?this[re[0]]=re[1].call(this,Ve):this[re[0]]=re[1]:re.length===3?typeof re[1]===l&&!(re[1].exec&&re[1].test)?this[re[0]]=Ve?re[1].call(this,Ve,re[2]):n:this[re[0]]=Ve?Ve.replace(re[1],re[2]):n:re.length===4&&(this[re[0]]=Ve?re[3].call(this,Ve.replace(re[1],re[2])):n):this[re]=Ve||n;J+=2}},N=function(z,dt){for(var J in dt)if(typeof dt[J]===f&&dt[J].length>0){for(var se=0;se<dt[J].length;se++)if(is(dt[J][se],z))return J===o?n:J}else if(is(dt[J],z))return J===o?n:J;return dt.hasOwnProperty("*")?dt["*"]:z},L={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},W={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"},te={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[_,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[_,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[_,C],[/opios[\/ ]+([\w\.]+)/i],[C,[_,cr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[_,cr+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[_,cr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[_,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[_,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[_,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[_,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[_,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[C,[_,"UC"+me]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[_,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[_,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[_,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[_,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[_,"Smart Lenovo "+me]],[/(avast|avg)\/([\w\.]+)/i],[[_,/(.+)/,"$1 Secure "+me],C],[/\bfocus\/([\w\.]+)/i],[C,[_,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[C,[_,cr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[_,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[_,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[_,cr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[_,"MIUI"+Mn]],[/fxios\/([\w\.-]+)/i],[C,[_,be]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[_,"360"]],[/\b(qq)\/([\w\.]+)/i],[[_,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[_,/(.+)/,"$1"+Mn],C],[/samsungbrowser\/([\w\.]+)/i],[C,[_,jr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[_,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[_,"Sogou Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[_,C],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[_],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[C,_],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[_,Hi],C],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[_,C],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[_,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[C,[_,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[_,de+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[_,de+" WebView"],C],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[_,"Android "+me]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[_,C],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[C,[_,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[C,_],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[_,[C,N,L]],[/(webkit|khtml)\/([\w\.]+)/i],[_,C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[_,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[_,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[_,be+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[_,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[_,[C,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[O,"amd64"]],[/(ia32(?=;))/i],[[O,a]],[/((?:i[346]|x)86)[;\)]/i],[[O,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[O,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[O,"armhf"]],[/windows (ce|mobile); ppc;/i],[[O,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[O,/ower/,s,a]],[/(sun4\w)[;\)]/i],[[O,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[O,a]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[y,jr],[g,k]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[v,[y,jr],[g,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[y,Y],[g,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[y,Y],[g,k]],[/(macintosh);/i],[v,[y,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[y,je],[g,R]],[/(?:honor)([-\w ]+)[;\)]/i],[v,[y,"Honor"],[g,R]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[y,De],[g,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[y,De],[g,R]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[g,R]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[g,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[y,"OPPO"],[g,R]],[/\b(opd2\d{3}a?) bui/i],[v,[y,"OPPO"],[g,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[y,"Vivo"],[g,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[v,[y,"Realme"],[g,R]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[y,we],[g,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[y,we],[g,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[y,ht],[g,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[y,ht],[g,R]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[y,"Lenovo"],[g,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[y,"Nokia"],[g,R]],[/(pixel c)\b/i],[v,[y,Ut],[g,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[y,Ut],[g,R]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[y,en],[g,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[y,en],[g,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[y,"OnePlus"],[g,R]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[y,ct],[g,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[y,ct],[g,R]],[/(playbook);[-\w\),; ]+(rim)/i],[v,y,[g,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[y,Xt],[g,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[y,at],[g,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[y,at],[g,R]],[/(nexus 9)/i],[v,[y,"HTC"],[g,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[v,/_/g," "],[g,R]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[v,[y,"TCL"],[g,k]],[/(itel) ((\w+))/i],[[y,a],v,[g,N,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[y,"Acer"],[g,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[y,"Meizu"],[g,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[v,[y,"Ulefone"],[g,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[v,[y,"Energizer"],[g,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[v,[y,"Cat"],[g,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[v,[y,"Smartfren"],[g,R]],[/droid.+; (a(?:015|06[35]|142p?))/i],[v,[y,"Nothing"],[g,R]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[y,v,[g,R]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[y,v,[g,k]],[/(surface duo)/i],[v,[y,Q],[g,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[y,"Fairphone"],[g,R]],[/(u304aa)/i],[v,[y,"AT&T"],[g,R]],[/\bsie-(\w*)/i],[v,[y,"Siemens"],[g,R]],[/\b(rct\w+) b/i],[v,[y,"RCA"],[g,k]],[/\b(venue[\d ]{2,7}) b/i],[v,[y,"Dell"],[g,k]],[/\b(q(?:mv|ta)\w+) b/i],[v,[y,"Verizon"],[g,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[y,"Barnes & Noble"],[g,k]],[/\b(tm\d{3}\w+) b/i],[v,[y,"NuVision"],[g,k]],[/\b(k88) b/i],[v,[y,"ZTE"],[g,k]],[/\b(nx\d{3}j) b/i],[v,[y,"ZTE"],[g,R]],[/\b(gen\d{3}) b.+49h/i],[v,[y,"Swiss"],[g,R]],[/\b(zur\d{3}) b/i],[v,[y,"Swiss"],[g,k]],[/\b((zeki)?tb.*\b) b/i],[v,[y,"Zeki"],[g,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],v,[g,k]],[/\b(ns-?\w{0,9}) b/i],[v,[y,"Insignia"],[g,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[y,"NextBook"],[g,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],v,[g,R]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],v,[g,R]],[/\b(ph-1) /i],[v,[y,"Essential"],[g,R]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[y,"Envizen"],[g,k]],[/\b(trio[-\w\. ]+) b/i],[v,[y,"MachSpeed"],[g,k]],[/\btu_(1491) b/i],[v,[y,"Rotor"],[g,k]],[/(shield[\w ]+) b/i],[v,[y,"Nvidia"],[g,k]],[/(sprint) (\w+)/i],[y,v,[g,R]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[y,Q],[g,R]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[y,kn],[g,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[y,kn],[g,R]],[/smart-tv.+(samsung)/i],[y,[g,V]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[y,jr],[g,V]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,ht],[g,V]],[/(apple) ?tv/i],[y,[v,Y+" TV"],[g,V]],[/crkey/i],[[v,de+"cast"],[y,Ut],[g,V]],[/droid.+aft(\w+)( bui|\))/i],[v,[y,ct],[g,V]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[y,je],[g,V]],[/(bravia[\w ]+)( bui|\))/i],[v,[y,en],[g,V]],[/(mitv-\w{5}) bui/i],[v,[y,Hn],[g,V]],[/Hbbtv.*(technisat) (.*);/i],[y,v,[g,V]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,p],[v,p],[g,V]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[g,V]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,v,[g,H]],[/droid.+; (shield) bui/i],[v,[y,"Nvidia"],[g,H]],[/(playstation [345portablevi]+)/i],[v,[y,en],[g,H]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[y,Q],[g,H]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[v,[y,jr],[g,Mt]],[/((pebble))app/i],[y,v,[g,Mt]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[y,Y],[g,Mt]],[/droid.+; (glass) \d/i],[v,[y,Ut],[g,Mt]],[/droid.+; (wt63?0{2,3})\)/i],[v,[y,kn],[g,Mt]],[/droid.+; (glass) \d/i],[v,[y,Ut],[g,Mt]],[/(pico) (4|neo3(?: link|pro)?)/i],[y,v,[g,Mt]],[/; (quest( \d| pro)?)/i],[v,[y,Hi],[g,Mt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[g,fe]],[/(aeobc)\b/i],[v,[y,ct],[g,fe]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[v,[g,R]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[g,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,R]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[_,xe+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[_,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[_,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[_,C],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,_]],os:[[/microsoft (windows) (vista|xp)/i],[_,C],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[_,[C,N,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[C,N,W],[_,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[_,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[_,ji],[C,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[C,_],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[_,C],[/\(bb(10);/i],[C,[_,Xt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[C,[_,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[C,[_,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[C,[_,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[C,[_,"watchOS"]],[/crkey\/([\d\.]+)/i],[C,[_,de+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[_,Wi],C],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[_,C],[/(sunos) ?([\w\.\d]*)/i],[[_,"Solaris"],C],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[_,C]]},Tt=function(z,dt){if(typeof z===f&&(dt=z,z=n),!(this instanceof Tt))return new Tt(z,dt).getResult();var J=typeof r!==u&&r.navigator?r.navigator:n,se=z||(J&&J.userAgent?J.userAgent:s),He=J&&J.userAgentData?J.userAgentData:n,Fe=dt?Be(te,dt):te,re=J&&J.userAgent==se;return this.getBrowser=function(){var X={};return X[_]=n,X[C]=n,I.call(X,se,Fe.browser),X[h]=c(X[C]),re&&J&&J.brave&&typeof J.brave.isBrave==l&&(X[_]="Brave"),X},this.getCPU=function(){var X={};return X[O]=n,I.call(X,se,Fe.cpu),X},this.getDevice=function(){var X={};return X[y]=n,X[v]=n,X[g]=n,I.call(X,se,Fe.device),re&&!X[g]&&He&&He.mobile&&(X[g]=R),re&&X[v]=="Macintosh"&&J&&typeof J.standalone!==u&&J.maxTouchPoints&&J.maxTouchPoints>2&&(X[v]="iPad",X[g]=k),X},this.getEngine=function(){var X={};return X[_]=n,X[C]=n,I.call(X,se,Fe.engine),X},this.getOS=function(){var X={};return X[_]=n,X[C]=n,I.call(X,se,Fe.os),re&&!X[_]&&He&&He.platform&&He.platform!="Unknown"&&(X[_]=He.platform.replace(/chrome os/i,Wi).replace(/macos/i,ji)),X},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 se},this.setUA=function(X){return se=typeof X===m&&X.length>j?p(X,j):X,this},this.setUA(se),this};Tt.VERSION=i,Tt.BROWSER=$r([_,C,h]),Tt.CPU=$r([O]),Tt.DEVICE=$r([v,y,g,H,R,V,k,Mt,fe]),Tt.ENGINE=Tt.OS=$r([_,C]),typeof t!==u?(typeof e!==u&&e.exports&&(t=e.exports=Tt),t.UAParser=Tt):typeof define===l&&define.amd?define(function(){return Tt}):typeof r!==u&&(r.UAParser=Tt);var Dt=typeof r!==u&&(r.jQuery||r.Zepto);if(Dt&&!Dt.ua){var ce=new Tt;Dt.ua=ce.getResult(),Dt.ua.get=function(){return ce.getUA()},Dt.ua.set=function(z){ce.setUA(z);var dt=ce.getResult();for(var J in dt)Dt.ua[J]=dt[J]}}})(typeof window=="object"?window:t)}),Hp=Vi((t,e)=>{"use strict";(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,l,u){function f(v,_){if(!l[v]){if(!o[v]){var g=typeof Gi=="function"&&Gi;if(!_&&g)return g(v,!0);if(m)return m(v,!0);var y=new Error("Cannot find module '"+v+"'");throw y.code="MODULE_NOT_FOUND",y}var C=l[v]={exports:{}};o[v][0].call(C.exports,function(O){var H=o[v][1][O];return f(H||O)},C,C.exports,s,o,l,u)}return l[v].exports}for(var m=typeof Gi=="function"&&Gi,h=0;h<u.length;h++)f(u[h]);return f}({1:[function(s,o,l){(function(u){"use strict";var f=u.MutationObserver||u.WebKitMutationObserver,m;if(f){var h=0,v=new f(O),_=u.document.createTextNode("");v.observe(_,{characterData:!0}),m=function(){_.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var g=new u.MessageChannel;g.port1.onmessage=O,m=function(){g.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?m=function(){var R=u.document.createElement("script");R.onreadystatechange=function(){O(),R.onreadystatechange=null,R.parentNode.removeChild(R),R=null},u.document.documentElement.appendChild(R)}:m=function(){setTimeout(O,0)};var y,C=[];function O(){y=!0;for(var R,k,V=C.length;V;){for(k=C,C=[],R=-1;++R<V;)k[R]();V=C.length}y=!1}o.exports=H;function H(R){C.push(R)===1&&!y&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,l){"use strict";var u=s(1);function f(){}var m={},h=["REJECTED"],v=["FULFILLED"],_=["PENDING"];o.exports=g;function g(j){if(typeof j!="function")throw new TypeError("resolver must be a function");this.state=_,this.queue=[],this.outcome=void 0,j!==f&&H(this,j)}g.prototype.catch=function(j){return this.then(null,j)},g.prototype.then=function(j,ct){if(typeof j!="function"&&this.state===v||typeof ct!="function"&&this.state===h)return this;var Y=new this.constructor(f);if(this.state!==_){var at=this.state===v?j:ct;C(Y,at,this.outcome)}else this.queue.push(new y(Y,j,ct));return Y};function y(j,ct,Y){this.promise=j,typeof ct=="function"&&(this.onFulfilled=ct,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}y.prototype.callFulfilled=function(j){m.resolve(this.promise,j)},y.prototype.otherCallFulfilled=function(j){C(this.promise,this.onFulfilled,j)},y.prototype.callRejected=function(j){m.reject(this.promise,j)},y.prototype.otherCallRejected=function(j){C(this.promise,this.onRejected,j)};function C(j,ct,Y){u(function(){var at;try{at=ct(Y)}catch(Xt){return m.reject(j,Xt)}at===j?m.reject(j,new TypeError("Cannot resolve promise with itself")):m.resolve(j,at)})}m.resolve=function(j,ct){var Y=R(O,ct);if(Y.status==="error")return m.reject(j,Y.value);var at=Y.value;if(at)H(j,at);else{j.state=v,j.outcome=ct;for(var Xt=-1,me=j.queue.length;++Xt<me;)j.queue[Xt].callFulfilled(ct)}return j},m.reject=function(j,ct){j.state=h,j.outcome=ct;for(var Y=-1,at=j.queue.length;++Y<at;)j.queue[Y].callRejected(ct);return j};function O(j){var ct=j&&j.then;if(j&&(typeof j=="object"||typeof j=="function")&&typeof ct=="function")return function(){ct.apply(j,arguments)}}function H(j,ct){var Y=!1;function at(xe){Y||(Y=!0,m.reject(j,xe))}function Xt(xe){Y||(Y=!0,m.resolve(j,xe))}function me(){ct(Xt,at)}var de=R(me);de.status==="error"&&at(de.value)}function R(j,ct){var Y={};try{Y.value=j(ct),Y.status="success"}catch(at){Y.status="error",Y.value=at}return Y}g.resolve=k;function k(j){return j instanceof this?j:m.resolve(new this(f),j)}g.reject=V;function V(j){var ct=new this(f);return m.reject(ct,j)}g.all=Mt;function Mt(j){var ct=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=j.length,at=!1;if(!Y)return this.resolve([]);for(var Xt=new Array(Y),me=0,de=-1,xe=new this(f);++de<Y;)be(j[de],de);return xe;function be(Ut,De){ct.resolve(Ut).then(ht,function(Q){at||(at=!0,m.reject(xe,Q))});function ht(Q){Xt[De]=Q,++me===Y&&!at&&(at=!0,m.resolve(xe,Xt))}}}g.race=fe;function fe(j){var ct=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=j.length,at=!1;if(!Y)return this.resolve([]);for(var Xt=-1,me=new this(f);++Xt<Y;)de(j[Xt]);return me;function de(xe){ct.resolve(xe).then(function(be){at||(at=!0,m.resolve(me,be))},function(be){at||(at=!0,m.reject(me,be))})}}},{1:1}],3:[function(s,o,l){(function(u){"use strict";typeof u.Promise!="function"&&(u.Promise=s(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(s,o,l){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function f(d,E){if(!(d instanceof E))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=m();function v(){try{if(!h||!h.open)return!1;var d=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),E=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||E)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function _(d,E){d=d||[],E=E||{};try{return new Blob(d,E)}catch(D){if(D.name!=="TypeError")throw D;for(var S=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,T=new S,x=0;x<d.length;x+=1)T.append(d[x]);return T.getBlob(E.type)}}typeof Promise>"u"&&s(3);var g=Promise;function y(d,E){E&&d.then(function(S){E(null,S)},function(S){E(S)})}function C(d,E,S){typeof E=="function"&&d.then(E),typeof S=="function"&&d.catch(S)}function O(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function H(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",k=void 0,V={},Mt=Object.prototype.toString,fe="readonly",j="readwrite";function ct(d){for(var E=d.length,S=new ArrayBuffer(E),T=new Uint8Array(S),x=0;x<E;x++)T[x]=d.charCodeAt(x);return S}function Y(d){return new g(function(E){var S=d.transaction(R,j),T=_([""]);S.objectStore(R).put(T,"key"),S.onabort=function(x){x.preventDefault(),x.stopPropagation(),E(!1)},S.oncomplete=function(){var x=navigator.userAgent.match(/Chrome\/(\d+)/),D=navigator.userAgent.match(/Edge\//);E(D||!x||parseInt(x[1],10)>=43)}}).catch(function(){return!1})}function at(d){return typeof k=="boolean"?g.resolve(k):Y(d).then(function(E){return k=E,k})}function Xt(d){var E=V[d.name],S={};S.promise=new g(function(T,x){S.resolve=T,S.reject=x}),E.deferredOperations.push(S),E.dbReady?E.dbReady=E.dbReady.then(function(){return S.promise}):E.dbReady=S.promise}function me(d){var E=V[d.name],S=E.deferredOperations.pop();if(S)return S.resolve(),S.promise}function de(d,E){var S=V[d.name],T=S.deferredOperations.pop();if(T)return T.reject(E),T.promise}function xe(d,E){return new g(function(S,T){if(V[d.name]=V[d.name]||en(),d.db)if(E)Xt(d),d.db.close();else return S(d.db);var x=[d.name];E&&x.push(d.version);var D=h.open.apply(h,x);E&&(D.onupgradeneeded=function(P){var U=D.result;try{U.createObjectStore(d.storeName),P.oldVersion<=1&&U.createObjectStore(R)}catch(F){if(F.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+P.oldVersion+" to version "+P.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw F}}),D.onerror=function(P){P.preventDefault(),T(D.error)},D.onsuccess=function(){var P=D.result;P.onversionchange=function(U){U.target.close()},S(P),me(d)}})}function be(d){return xe(d,!1)}function Ut(d){return xe(d,!0)}function De(d,E){if(!d.db)return!0;var S=!d.db.objectStoreNames.contains(d.storeName),T=d.version<d.db.version,x=d.version>d.db.version;if(T&&(d.version!==E&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),x||S){if(S){var D=d.db.version+1;D>d.version&&(d.version=D)}return!0}return!1}function ht(d){return new g(function(E,S){var T=new FileReader;T.onerror=S,T.onloadend=function(x){var D=btoa(x.target.result||"");E({__local_forage_encoded_blob:!0,data:D,type:d.type})},T.readAsBinaryString(d)})}function Q(d){var E=ct(atob(d.data));return _([E],{type:d.type})}function we(d){return d&&d.__local_forage_encoded_blob}function cr(d){var E=this,S=E._initReady().then(function(){var T=V[E._dbInfo.name];if(T&&T.dbReady)return T.dbReady});return C(S,d,d),S}function jr(d){Xt(d);for(var E=V[d.name],S=E.forages,T=0;T<S.length;T++){var x=S[T];x._dbInfo.db&&(x._dbInfo.db.close(),x._dbInfo.db=null)}return d.db=null,be(d).then(function(D){return d.db=D,De(d)?Ut(d):D}).then(function(D){d.db=E.db=D;for(var P=0;P<S.length;P++)S[P]._dbInfo.db=D}).catch(function(D){throw de(d,D),D})}function je(d,E,S,T){T===void 0&&(T=1);try{var x=d.db.transaction(d.storeName,E);S(null,x)}catch(D){if(T>0&&(!d.db||D.name==="InvalidStateError"||D.name==="NotFoundError"))return g.resolve().then(function(){if(!d.db||D.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Ut(d)}).then(function(){return jr(d).then(function(){je(d,E,S,T-1)})}).catch(S);S(D)}}function en(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hn(d){var E=this,S={db:null};if(d)for(var T in d)S[T]=d[T];var x=V[S.name];x||(x=en(),V[S.name]=x),x.forages.push(E),E._initReady||(E._initReady=E.ready,E.ready=cr);var D=[];function P(){return g.resolve()}for(var U=0;U<x.forages.length;U++){var F=x.forages[U];F!==E&&D.push(F._initReady().catch(P))}var $=x.forages.slice(0);return g.all(D).then(function(){return S.db=x.db,be(S)}).then(function(B){return S.db=B,De(S,E._defaultConfig.version)?Ut(S):B}).then(function(B){S.db=x.db=B,E._dbInfo=S;for(var G=0;G<$.length;G++){var gt=$[G];gt!==E&&(gt._dbInfo.db=S.db,gt._dbInfo.version=S.version)}})}function kn(d,E){var S=this;d=O(d);var T=new g(function(x,D){S.ready().then(function(){je(S._dbInfo,fe,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.get(d);$.onsuccess=function(){var B=$.result;B===void 0&&(B=null),we(B)&&(B=Q(B)),x(B)},$.onerror=function(){D($.error)}}catch(B){D(B)}})}).catch(D)});return y(T,E),T}function Hi(d,E){var S=this,T=new g(function(x,D){S.ready().then(function(){je(S._dbInfo,fe,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.openCursor(),B=1;$.onsuccess=function(){var G=$.result;if(G){var gt=G.value;we(gt)&&(gt=Q(gt));var he=d(gt,G.key,B++);he!==void 0?x(he):G.continue()}else x()},$.onerror=function(){D($.error)}}catch(G){D(G)}})}).catch(D)});return y(T,E),T}function Wi(d,E,S){var T=this;d=O(d);var x=new g(function(D,P){var U;T.ready().then(function(){return U=T._dbInfo,Mt.call(E)==="[object Blob]"?at(U.db).then(function(F){return F?E:ht(E)}):E}).then(function(F){je(T._dbInfo,j,function($,B){if($)return P($);try{var G=B.objectStore(T._dbInfo.storeName);F===null&&(F=void 0);var gt=G.put(F,d);B.oncomplete=function(){F===void 0&&(F=null),D(F)},B.onabort=B.onerror=function(){var he=gt.error?gt.error:gt.transaction.error;P(he)}}catch(he){P(he)}})}).catch(P)});return y(x,S),x}function ji(d,E){var S=this;d=O(d);var T=new g(function(x,D){S.ready().then(function(){je(S._dbInfo,j,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.delete(d);U.oncomplete=function(){x()},U.onerror=function(){D($.error)},U.onabort=function(){var B=$.error?$.error:$.transaction.error;D(B)}}catch(B){D(B)}})}).catch(D)});return y(T,E),T}function Mn(d){var E=this,S=new g(function(T,x){E.ready().then(function(){je(E._dbInfo,j,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.clear();P.oncomplete=function(){T()},P.onabort=P.onerror=function(){var $=F.error?F.error:F.transaction.error;x($)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function Be(d){var E=this,S=new g(function(T,x){E.ready().then(function(){je(E._dbInfo,fe,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.count();F.onsuccess=function(){T(F.result)},F.onerror=function(){x(F.error)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function $r(d,E){var S=this,T=new g(function(x,D){if(d<0){x(null);return}S.ready().then(function(){je(S._dbInfo,fe,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=!1,B=F.openKeyCursor();B.onsuccess=function(){var G=B.result;if(!G){x(null);return}d===0||$?x(G.key):($=!0,G.advance(d))},B.onerror=function(){D(B.error)}}catch(G){D(G)}})}).catch(D)});return y(T,E),T}function is(d){var E=this,S=new g(function(T,x){E.ready().then(function(){je(E._dbInfo,fe,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.openKeyCursor(),$=[];F.onsuccess=function(){var B=F.result;if(!B){T($);return}$.push(B.key),B.continue()},F.onerror=function(){x(F.error)}}catch(B){x(B)}})}).catch(x)});return y(S,d),S}function a(d,E){E=H.apply(this,arguments);var S=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||S.name,d.storeName=d.storeName||S.storeName);var T=this,x;if(!d.name)x=g.reject("Invalid arguments");else{var D=d.name===S.name&&T._dbInfo.db,P=D?g.resolve(T._dbInfo.db):be(d).then(function(U){var F=V[d.name],$=F.forages;F.db=U;for(var B=0;B<$.length;B++)$[B]._dbInfo.db=U;return U});d.storeName?x=P.then(function(U){if(U.objectStoreNames.contains(d.storeName)){var F=U.version+1;Xt(d);var $=V[d.name],B=$.forages;U.close();for(var G=0;G<B.length;G++){var gt=B[G];gt._dbInfo.db=null,gt._dbInfo.version=F}var he=new g(function(oe,Ie){var ye=h.open(d.name,F);ye.onerror=function(We){var Ku=ye.result;Ku.close(),Ie(We)},ye.onupgradeneeded=function(){var We=ye.result;We.deleteObjectStore(d.storeName)},ye.onsuccess=function(){var We=ye.result;We.close(),oe(We)}});return he.then(function(oe){$.db=oe;for(var Ie=0;Ie<B.length;Ie++){var ye=B[Ie];ye._dbInfo.db=oe,me(ye._dbInfo)}}).catch(function(oe){throw(de(d,oe)||g.resolve()).catch(function(){}),oe})}}):x=P.then(function(U){Xt(d);var F=V[d.name],$=F.forages;U.close();for(var B=0;B<$.length;B++){var G=$[B];G._dbInfo.db=null}var gt=new g(function(he,oe){var Ie=h.deleteDatabase(d.name);Ie.onerror=function(){var ye=Ie.result;ye&&ye.close(),oe(Ie.error)},Ie.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},Ie.onsuccess=function(){var ye=Ie.result;ye&&ye.close(),he(ye)}});return gt.then(function(he){F.db=he;for(var oe=0;oe<$.length;oe++){var Ie=$[oe];me(Ie._dbInfo)}}).catch(function(he){throw(de(d,he)||g.resolve()).catch(function(){}),he})})}return y(x,E),x}var c={_driver:"asyncStorage",_initStorage:Hn,_support:v(),iterate:Hi,getItem:kn,setItem:Wi,removeItem:ji,clear:Mn,length:Be,key:$r,keys:is,dropInstance:a};function p(){return typeof openDatabase=="function"}var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="~~local_forage_type~",L=/^~~local_forage_type~([^~]+)~/,W="__lfsc__:",te=W.length,Tt="arbf",Dt="blob",ce="si08",z="ui08",dt="uic8",J="si16",se="si32",He="ur16",Fe="ui32",re="fl32",X="fl64",Ve=te+Tt.length,Ls=Object.prototype.toString;function Yo(d){var E=d.length*.75,S=d.length,T,x=0,D,P,U,F;d[d.length-1]==="="&&(E--,d[d.length-2]==="="&&E--);var $=new ArrayBuffer(E),B=new Uint8Array($);for(T=0;T<S;T+=4)D=I.indexOf(d[T]),P=I.indexOf(d[T+1]),U=I.indexOf(d[T+2]),F=I.indexOf(d[T+3]),B[x++]=D<<2|P>>4,B[x++]=(P&15)<<4|U>>2,B[x++]=(U&3)<<6|F&63;return $}function Ic(d){var E=new Uint8Array(d),S="",T;for(T=0;T<E.length;T+=3)S+=I[E[T]>>2],S+=I[(E[T]&3)<<4|E[T+1]>>4],S+=I[(E[T+1]&15)<<2|E[T+2]>>6],S+=I[E[T+2]&63];return E.length%3===2?S=S.substring(0,S.length-1)+"=":E.length%3===1&&(S=S.substring(0,S.length-2)+"=="),S}function $d(d,E){var S="";if(d&&(S=Ls.call(d)),d&&(S==="[object ArrayBuffer]"||d.buffer&&Ls.call(d.buffer)==="[object ArrayBuffer]")){var T,x=W;d instanceof ArrayBuffer?(T=d,x+=Tt):(T=d.buffer,S==="[object Int8Array]"?x+=ce:S==="[object Uint8Array]"?x+=z:S==="[object Uint8ClampedArray]"?x+=dt:S==="[object Int16Array]"?x+=J:S==="[object Uint16Array]"?x+=He:S==="[object Int32Array]"?x+=se:S==="[object Uint32Array]"?x+=Fe:S==="[object Float32Array]"?x+=re:S==="[object Float64Array]"?x+=X:E(new Error("Failed to get type for BinaryArray"))),E(x+Ic(T))}else if(S==="[object Blob]"){var D=new FileReader;D.onload=function(){var P=N+d.type+"~"+Ic(this.result);E(W+Dt+P)},D.readAsArrayBuffer(d)}else try{E(JSON.stringify(d))}catch(P){console.error("Couldn't convert value into a JSON string: ",d),E(null,P)}}function Fd(d){if(d.substring(0,te)!==W)return JSON.parse(d);var E=d.substring(Ve),S=d.substring(te,Ve),T;if(S===Dt&&L.test(E)){var x=E.match(L);T=x[1],E=E.substring(x[0].length)}var D=Yo(E);switch(S){case Tt:return D;case Dt:return _([D],{type:T});case ce:return new Int8Array(D);case z:return new Uint8Array(D);case dt:return new Uint8ClampedArray(D);case J:return new Int16Array(D);case He:return new Uint16Array(D);case se:return new Int32Array(D);case Fe:return new Uint32Array(D);case re:return new Float32Array(D);case X:return new Float64Array(D);default:throw new Error("Unkown type: "+S)}}var Tc={serialize:$d,deserialize:Fd,stringToBuffer:Yo,bufferToString:Ic};function eh(d,E,S,T){d.executeSql("CREATE TABLE IF NOT EXISTS "+E.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],S,T)}function Hd(d){var E=this,S={db:null};if(d)for(var T in d)S[T]=typeof d[T]!="string"?d[T].toString():d[T];var x=new g(function(D,P){try{S.db=openDatabase(S.name,String(S.version),S.description,S.size)}catch(U){return P(U)}S.db.transaction(function(U){eh(U,S,function(){E._dbInfo=S,D()},function(F,$){P($)})},P)});return S.serializer=Tc,x}function Fn(d,E,S,T,x,D){d.executeSql(S,T,x,function(P,U){U.code===U.SYNTAX_ERR?P.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[E.storeName],function(F,$){$.rows.length?D(F,U):eh(F,E,function(){F.executeSql(S,T,x,D)},D)},D):D(P,U)},D)}function Vd(d,E){var S=this;d=O(d);var T=new g(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT * FROM "+P.storeName+" WHERE key = ? LIMIT 1",[d],function(F,$){var B=$.rows.length?$.rows.item(0).value:null;B&&(B=P.serializer.deserialize(B)),x(B)},function(F,$){D($)})})}).catch(D)});return y(T,E),T}function qd(d,E){var S=this,T=new g(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT * FROM "+P.storeName,[],function(F,$){for(var B=$.rows,G=B.length,gt=0;gt<G;gt++){var he=B.item(gt),oe=he.value;if(oe&&(oe=P.serializer.deserialize(oe)),oe=d(oe,he.key,gt+1),oe!==void 0){x(oe);return}}x()},function(F,$){D($)})})}).catch(D)});return y(T,E),T}function rh(d,E,S,T){var x=this;d=O(d);var D=new g(function(P,U){x.ready().then(function(){E===void 0&&(E=null);var F=E,$=x._dbInfo;$.serializer.serialize(E,function(B,G){G?U(G):$.db.transaction(function(gt){Fn(gt,$,"INSERT OR REPLACE INTO "+$.storeName+" (key, value) VALUES (?, ?)",[d,B],function(){P(F)},function(he,oe){U(oe)})},function(gt){if(gt.code===gt.QUOTA_ERR){if(T>0){P(rh.apply(x,[d,F,S,T-1]));return}U(gt)}})})}).catch(U)});return y(D,S),D}function Wd(d,E,S){return rh.apply(this,[d,E,S,1])}function zd(d,E){var S=this;d=O(d);var T=new g(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"DELETE FROM "+P.storeName+" WHERE key = ?",[d],function(){x()},function(F,$){D($)})})}).catch(D)});return y(T,E),T}function Gd(d){var E=this,S=new g(function(T,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"DELETE FROM "+D.storeName,[],function(){T()},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Kd(d){var E=this,S=new g(function(T,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"SELECT COUNT(key) as c FROM "+D.storeName,[],function(U,F){var $=F.rows.item(0).c;T($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Yd(d,E){var S=this,T=new g(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT key FROM "+P.storeName+" WHERE id = ? LIMIT 1",[d+1],function(F,$){var B=$.rows.length?$.rows.item(0).key:null;x(B)},function(F,$){D($)})})}).catch(D)});return y(T,E),T}function Jd(d){var E=this,S=new g(function(T,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"SELECT key FROM "+D.storeName,[],function(U,F){for(var $=[],B=0;B<F.rows.length;B++)$.push(F.rows.item(B).key);T($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Xd(d){return new g(function(E,S){d.transaction(function(T){T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(x,D){for(var P=[],U=0;U<D.rows.length;U++)P.push(D.rows.item(U).name);E({db:d,storeNames:P})},function(x,D){S(D)})},function(T){S(T)})})}function Zd(d,E){E=H.apply(this,arguments);var S=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||S.name,d.storeName=d.storeName||S.storeName);var T=this,x;return d.name?x=new g(function(D){var P;d.name===S.name?P=T._dbInfo.db:P=openDatabase(d.name,"","",0),d.storeName?D({db:P,storeNames:[d.storeName]}):D(Xd(P))}).then(function(D){return new g(function(P,U){D.db.transaction(function(F){function $(he){return new g(function(oe,Ie){F.executeSql("DROP TABLE IF EXISTS "+he,[],function(){oe()},function(ye,We){Ie(We)})})}for(var B=[],G=0,gt=D.storeNames.length;G<gt;G++)B.push($(D.storeNames[G]));g.all(B).then(function(){P()}).catch(function(he){U(he)})},function(F){U(F)})})}):x=g.reject("Invalid arguments"),y(x,E),x}var Qd={_driver:"webSQLStorage",_initStorage:Hd,_support:p(),iterate:qd,getItem:Vd,setItem:Wd,removeItem:zd,clear:Gd,length:Kd,key:Yd,keys:Jd,dropInstance:Zd};function Hg(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function nh(d,E){var S=d.name+"/";return d.storeName!==E.storeName&&(S+=d.storeName+"/"),S}function Lm(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function qm(){return!Lm()||localStorage.length>0}function zm(d){var E=this,S={};if(d)for(var T in d)S[T]=d[T];return S.keyPrefix=nh(d,E._defaultConfig),qm()?(E._dbInfo=S,S.serializer=Tc,g.resolve()):g.reject()}function Ym(d){var E=this,S=E.ready().then(function(){for(var T=E._dbInfo.keyPrefix,x=localStorage.length-1;x>=0;x--){var D=localStorage.key(x);D.indexOf(T)===0&&localStorage.removeItem(D)}});return y(S,d),S}function kv(d,E){var S=this;d=O(d);var T=S.ready().then(function(){var x=S._dbInfo,D=localStorage.getItem(x.keyPrefix+d);return D&&(D=x.serializer.deserialize(D)),D});return y(T,E),T}function Mv(d,E){var S=this,T=S.ready().then(function(){for(var x=S._dbInfo,D=x.keyPrefix,P=D.length,U=localStorage.length,F=1,$=0;$<U;$++){var B=localStorage.key($);if(B.indexOf(D)===0){var G=localStorage.getItem(B);if(G&&(G=x.serializer.deserialize(G)),G=d(G,B.substring(P),F++),G!==void 0)return G}}});return y(T,E),T}function Uv(d,E){var S=this,T=S.ready().then(function(){var x=S._dbInfo,D;try{D=localStorage.key(d)}catch{D=null}return D&&(D=D.substring(x.keyPrefix.length)),D});return y(T,E),T}function jv(d){var E=this,S=E.ready().then(function(){for(var T=E._dbInfo,x=localStorage.length,D=[],P=0;P<x;P++){var U=localStorage.key(P);U.indexOf(T.keyPrefix)===0&&D.push(U.substring(T.keyPrefix.length))}return D});return y(S,d),S}function Bv(d){var E=this,S=E.keys().then(function(T){return T.length});return y(S,d),S}function $v(d,E){var S=this;d=O(d);var T=S.ready().then(function(){var x=S._dbInfo;localStorage.removeItem(x.keyPrefix+d)});return y(T,E),T}function Fv(d,E,S){var T=this;d=O(d);var x=T.ready().then(function(){E===void 0&&(E=null);var D=E;return new g(function(P,U){var F=T._dbInfo;F.serializer.serialize(E,function($,B){if(B)U(B);else try{localStorage.setItem(F.keyPrefix+d,$),P(D)}catch(G){(G.name==="QuotaExceededError"||G.name==="NS_ERROR_DOM_QUOTA_REACHED")&&U(G),U(G)}})})});return y(x,S),x}function Hv(d,E){if(E=H.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var S=this.config();d.name=d.name||S.name,d.storeName=d.storeName||S.storeName}var T=this,x;return d.name?x=new g(function(D){d.storeName?D(nh(d,T._defaultConfig)):D(d.name+"/")}).then(function(D){for(var P=localStorage.length-1;P>=0;P--){var U=localStorage.key(P);U.indexOf(D)===0&&localStorage.removeItem(U)}}):x=g.reject("Invalid arguments"),y(x,E),x}var Vv={_driver:"localStorageWrapper",_initStorage:zm,_support:Hg(),iterate:Mv,getItem:kv,setItem:Fv,removeItem:$v,clear:Ym,length:Bv,key:Uv,keys:jv,dropInstance:Hv},Wv=function(d,E){return d===E||typeof d=="number"&&typeof E=="number"&&isNaN(d)&&isNaN(E)},zv=function(d,E){for(var S=d.length,T=0;T<S;){if(Wv(d[T],E))return!0;T++}return!1},ih=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},Ga={},oh={},to={INDEXEDDB:c,WEBSQL:Qd,LOCALSTORAGE:Vv},Gv=[to.INDEXEDDB._driver,to.WEBSQL._driver,to.LOCALSTORAGE._driver],Ec=["dropInstance"],Jc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ec),Ly={description:"",driver:Gv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function By(d,E){d[E]=function(){var S=arguments;return d.ready().then(function(){return d[E].apply(d,S)})}}function zu(){for(var d=1;d<arguments.length;d++){var E=arguments[d];if(E)for(var S in E)E.hasOwnProperty(S)&&(ih(E[S])?arguments[0][S]=E[S].slice():arguments[0][S]=E[S])}return arguments[0]}var tb=function(){function d(E){f(this,d);for(var S in to)if(to.hasOwnProperty(S)){var T=to[S],x=T._driver;this[S]=x,Ga[x]||this.defineDriver(T)}this._defaultConfig=zu({},Ly),this._config=zu({},this._defaultConfig,E),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(E){if((typeof E>"u"?"undefined":u(E))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var S in E){if(S==="storeName"&&(E[S]=E[S].replace(/\W/g,"_")),S==="version"&&typeof E[S]!="number")return new Error("Database version must be a number.");this._config[S]=E[S]}return"driver"in E&&E.driver?this.setDriver(this._config.driver):!0}else return typeof E=="string"?this._config[E]:this._config},d.prototype.defineDriver=function(E,S,T){var x=new g(function(D,P){try{var U=E._driver,F=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!E._driver){P(F);return}for(var $=Jc.concat("_initStorage"),B=0,G=$.length;B<G;B++){var gt=$[B],he=!zv(Ec,gt);if((he||E[gt])&&typeof E[gt]!="function"){P(F);return}}var oe=function(){for(var ye=function(rb){return function(){var nb=new Error("Method "+rb+" is not implemented by the current driver"),dh=g.reject(nb);return y(dh,arguments[arguments.length-1]),dh}},We=0,Ku=Ec.length;We<Ku;We++){var Yu=Ec[We];E[Yu]||(E[Yu]=ye(Yu))}};oe();var Ie=function(ye){Ga[U]&&console.info("Redefining LocalForage driver: "+U),Ga[U]=E,oh[U]=ye,D()};"_support"in E?E._support&&typeof E._support=="function"?E._support().then(Ie,P):Ie(!!E._support):Ie(!0)}catch(ye){P(ye)}});return C(x,S,T),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(E,S,T){var x=Ga[E]?g.resolve(Ga[E]):g.reject(new Error("Driver not found."));return C(x,S,T),x},d.prototype.getSerializer=function(E){var S=g.resolve(Tc);return C(S,E),S},d.prototype.ready=function(E){var S=this,T=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return C(T,E,E),T},d.prototype.setDriver=function(E,S,T){var x=this;ih(E)||(E=[E]);var D=this._getSupportedDrivers(E);function P(){x._config.driver=x.driver()}function U(B){return x._extend(B),P(),x._ready=x._initStorage(x._config),x._ready}function F(B){return function(){var G=0;function gt(){for(;G<B.length;){var he=B[G];return G++,x._dbInfo=null,x._ready=null,x.getDriver(he).then(U).catch(gt)}P();var oe=new Error("No available storage method found.");return x._driverSet=g.reject(oe),x._driverSet}return gt()}}var $=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=$.then(function(){var B=D[0];return x._dbInfo=null,x._ready=null,x.getDriver(B).then(function(G){x._driver=G._driver,P(),x._wrapLibraryMethodsWithReady(),x._initDriver=F(D)})}).catch(function(){P();var B=new Error("No available storage method found.");return x._driverSet=g.reject(B),x._driverSet}),C(this._driverSet,S,T),this._driverSet},d.prototype.supports=function(E){return!!oh[E]},d.prototype._extend=function(E){zu(this,E)},d.prototype._getSupportedDrivers=function(E){for(var S=[],T=0,x=E.length;T<x;T++){var D=E[T];this.supports(D)&&S.push(D)}return S},d.prototype._wrapLibraryMethodsWithReady=function(){for(var E=0,S=Jc.length;E<S;E++)By(this,Jc[E])},d.prototype.createInstance=function(E){return new d(E)},d}(),eb=new tb;o.exports=eb},{3:3}]},{},[4])(4)})}),Sl=Vi(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URLBuilder=void 0;var e=function(){function r(n){try{this.base=new URL(n),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return r.prototype.appendQueryParam=function(n,i){this.params.append(n,i?i.toString():"")},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(n){this.params.delete(n)},r.prototype.getBase=function(){return this.base},r.prototype.getPath=function(){return this.base.pathname},r.prototype.getHostname=function(){return this.base.hostname},r.prototype.getParams=function(){return this.params},r.prototype.getQueryParam=function(n){if(!this.params)return"";var i=this.params.get(n);return!i||i==="undefined"||i==="null"?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(n){return this.base.pathname=n,this},r.prototype.setQueryParam=function(n,i){return this.params.set(n,i?i.toString():""),this},r.prototype.setQueryString=function(n){if(n)return n[0]==="?"&&(n=n.slice(1)),this.params=new URLSearchParams(n),this},r.prototype.toString=function(){var n=this.params.toString();return n===""?this.base.search="":this.base.search="?"+n,this.base.toString()},r}();t.URLBuilder=e}),dd=Vi((t,e)=>{"use strict";(function(r,n){typeof t=="object"&&typeof e<"u"?e.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(t,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var l={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(l,o),function(u,f){var m=o.retries,h=o.retryDelay,v=o.retryOn;if(f&&f.retries!==void 0)if(n(f.retries))m=f.retries;else throw new i("retries must be a positive integer");if(f&&f.retryDelay!==void 0)if(n(f.retryDelay)||typeof f.retryDelay=="function")h=f.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(f&&f.retryOn)if(Array.isArray(f.retryOn)||typeof f.retryOn=="function")v=f.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(_,g){var y=function(O){var H=typeof Request<"u"&&u instanceof Request?u.clone():u;s(H,f).then(function(R){if(Array.isArray(v)&&v.indexOf(R.status)===-1)_(R);else if(typeof v=="function")try{return Promise.resolve(v(O,null,R)).then(function(k){k?C(O,null,R):_(R)}).catch(g)}catch(k){g(k)}else O<m?C(O,null,R):_(R)}).catch(function(R){if(typeof v=="function")try{Promise.resolve(v(O,R,null)).then(function(k){k?C(O,R,null):g(R)}).catch(function(k){g(k)})}catch(k){g(k)}else O<m?C(O,R,null):g(R)})};function C(O,H,R){var k=typeof h=="function"?h(O,H,R):h;setTimeout(function(){y(++O)},k)}y(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),ip="9.3.22",A=class Ju{static SDK_VERSION=ip;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static CTA_EVENT="letscooee:outbound:cta";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static{let e=Ju.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ju.SDK_VERSION_CODE=parseInt(e,10)}},Zt={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${A.SDK_VERSION}/dist/widget-sdk.min.css`},Rt=Qt(tn()),b=class{static log(...t){Rt.default.info(...t)}static debug(...t){Rt.default.debug(...t)}static error(...t){Rt.default.error(...t)}static warn(...t){Rt.default.warn(...t)}static info(...t){Rt.default.info(...t)}static trace(...t){Rt.default.trace(...t)}static configure(t=A.LOG_PREFIX){Rt.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${A.SDK_VERSION}):`)}});let e=this.getDebugParam();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Rt.default.setLevel(Rt.default[localStorage.cooeeLogLevel]):Rt.default.setLevel(Zt.debug?Rt.default.TRACE:Rt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let t=`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
font-size: 14px;
|
|
4
4
|
background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
|
|
@@ -35,7 +35,7 @@ Event: ${ir(t)}`),!0):Iv(t,e.denyUrls)?(Ce&&q.warn(`Event dropped due to being m
|
|
|
35
35
|
Event: ${ir(t)}.
|
|
36
36
|
Url: ${Aa(t)}`),!0):Tv(t,e.allowUrls)?!1:(Ce&&q.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
37
37
|
Event: ${ir(t)}.
|
|
38
|
-
Url: ${Aa(t)}`),!0)}function wv(t,e){return t.type||!e||!e.length?!1:xv(t).some(r=>wi(r,e))}function bv(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?wi(r,e):!1}function Iv(t,e){if(!e||!e.length)return!1;let r=Aa(t);return r?wi(r,e):!1}function Tv(t,e){if(!e||!e.length)return!0;let r=Aa(t);return r?wi(r,e):!0}function xv(t){let e=[];t.message&&e.push(t.message);let r;try{r=t.exception.values[t.exception.values.length-1]}catch{}return r&&r.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`)),e}function Cv(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Dv(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Aa(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Dv(e):null}catch{return Ce&&q.error(`Cannot extract url for event ${ir(t)}`),null}}function Rv(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}var Nv="Dedupe",Av=()=>{let t;return{name:Nv,processEvent(e){if(e.type)return e;try{if(Ov(e,t))return Ce&&q.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Pa=Av;function Ov(t,e){return e?!!(Pv(t,e)||Lv(t,e)):!1}function Pv(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Vm(t,e)||!Gm(t,e))}function Lv(t,e){let r=Wm(e),n=Wm(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Vm(t,e)||!Gm(t,e))}function Gm(t,e){let r=ua(t),n=ua(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let s=n[i],o=r[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function Vm(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Wm(t){return t.exception&&t.exception.values&&t.exception.values[0]}var Ge=ee,Cu=0;function Du(){return Cu>0}function Yv(){Cu++,setTimeout(()=>{Cu--})}function Rn(t,e={},r){if(typeof t!="function")return t;try{let i=t.__sentry_wrapped__;if(i)return i;if(In(t))return t}catch{return t}let n=function(){let i=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let s=i.map(o=>Rn(o,e));return t.apply(this,s)}catch(s){throw Yv(),Ta(o=>{o.addEventProcessor(l=>(e.mechanism&&(xi(l,void 0,void 0),Br(l,e.mechanism)),l.extra=Z(w({},l.extra),{arguments:i}),l)),Da(s)}),s}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}aa(n,t),St(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}var Mr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function La(t,e){let r=Au(t,e),n={type:e&&e.name,value:Qv(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function qv(t,e,r,n){let i=Me(),s=i&&i.getOptions().normalizeDepth,o=t_(e),l={__serialized__:ga(e,s)};if(o)return{exception:{values:[La(t,o)]},extra:l};let u={exception:{values:[{type:bn(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:Zv(e,{isUnhandledRejection:n})}]},extra:l};if(r){let f=Au(t,r);f.length&&(u.exception.values[0].stacktrace={frames:f})}return u}function Ru(t,e){return{exception:{values:[La(t,e)]}}}function Au(t,e){let r=e.stacktrace||e.stack||"",n=Jv(e),i=Xv(e);try{return t(r,n,i)}catch{}return[]}var Kv=/Minified React error #\d+;/i;function Jv(t){return t&&Kv.test(t.message)?1:0}function Xv(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Qv(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Km(t,e,r,n){let i=r&&r.syntheticException||void 0,s=Ba(t,e,i,n);return Br(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),qt(s)}function Jm(t,e,r="info",n,i){let s=n&&n.syntheticException||void 0,o=Nu(t,e,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),qt(o)}function Ba(t,e,r,n,i){let s;if(na(e)&&e.error)return Ru(t,e.error);if(ia(e)||Al(e)){let o=e;if("stack"in e)s=Ru(t,e);else{let l=o.name||(ia(o)?"DOMError":"DOMException"),u=o.message?`${l}: ${o.message}`:l;s=Nu(t,u,r,n),xi(s,u)}return"code"in o&&(s.tags=Z(w({},s.tags),{"DOMException.code":`${o.code}`})),s}return Sn(e)?Ru(t,e):nr(e)||bn(e)?(s=qv(t,e,r,i),Br(s,{synthetic:!0}),s):(s=Nu(t,e,r,n),xi(s,`${e}`,void 0),Br(s,{synthetic:!0}),s)}function Nu(t,e,r,n){let i={};if(n&&r){let s=Au(t,r);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(Si(e)){let{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function Zv(t,{isUnhandledRejection:e}){let r=jl(t),n=e?"promise rejection":"exception";return na(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:bn(t)?`Event \`${e_(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function e_(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function t_(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}function Xm(t,{metadata:e,tunnel:r,dsn:n}){let i=w(w({event_id:t.event_id,sent_at:new Date().toISOString()},e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}}),!!r&&!!n&&{dsn:br(n)}),s=r_(t);return xr(i,[s])}function r_(t){return[{type:"user_report"},t]}var Ao=class extends No{constructor(t){let e=w({parentSpanIsAlwaysRootSpan:!0},t),r=Ge.SENTRY_SDK_SOURCE||Ql();xu(e,"browser",["browser"],r),super(e),e.sendClientReports&&Ge.document&&Ge.document.addEventListener("visibilitychange",()=>{Ge.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,e){return Km(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",r){return Jm(this._options.stackParser,t,e,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){Mr&&q.warn("SDK not enabled, will not capture user feedback.");return}let e=Xm(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(e)}_prepareEvent(t,e,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,e,r)}_flushOutcomes(){let t=this._clearOutcomes();if(t.length===0){Mr&&q.log("No outcomes to send");return}if(!this._dsn){Mr&&q.log("No dsn provided, will not send outcomes");return}Mr&&q.log("Sending outcomes:",t);let e=cu(t,this._options.tunnel&&br(this._dsn));this.sendEnvelope(e)}},Qm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ye=ee,n_=1e3,Zm,Ou,Pu;function Lu(t){let e="dom";wt(e,t),bt(e,i_)}function i_(){if(!Ye.document)return;let t=Qe.bind(null,"dom"),e=ed(t,!0);Ye.document.addEventListener("click",e,!1),Ye.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let n=Ye[r]&&Ye[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Le(n,"addEventListener",function(i){return function(s,o,l){if(s==="click"||s=="keypress")try{let u=this,f=u.__sentry_instrumentation_handlers__=u.__sentry_instrumentation_handlers__||{},m=f[s]=f[s]||{refCount:0};if(!m.handler){let h=ed(t);m.handler=h,i.call(this,s,h,l)}m.refCount++}catch{}return i.call(this,s,o,l)}}),Le(n,"removeEventListener",function(i){return function(s,o,l){if(s==="click"||s=="keypress")try{let u=this,f=u.__sentry_instrumentation_handlers__||{},m=f[s];m&&(m.refCount--,m.refCount<=0&&(i.call(this,s,m.handler,l),m.handler=void 0,delete f[s]),Object.keys(f).length===0&&delete u.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,l)}}))})}function o_(t){if(t.type!==Ou)return!1;try{if(!t.target||t.target._sentryId!==Pu)return!1}catch{}return!0}function s_(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function ed(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=a_(r);if(s_(r.type,n))return;St(r,"_sentryCaptured",!0),n&&!n._sentryId&&St(n,"_sentryId",nt());let i=r.type==="keypress"?"input":r.type;o_(r)||(t({event:r,name:i,global:e}),Ou=r.type,Pu=n?n._sentryId:void 0),clearTimeout(Zm),Zm=Ye.setTimeout(()=>{Pu=void 0,Ou=void 0},n_)}}function a_(t){try{return t.target}catch{return null}}var Ua;function Bu(t){let e="history";wt(e,t),bt(e,c_)}function c_(){if(!pu())return;let t=Ye.onpopstate;Ye.onpopstate=function(...r){let n=Ye.location.href,i=Ua;if(Ua=n,Qe("history",{from:i,to:n}),t)try{return t.apply(this,r)}catch{}};function e(r){return function(...n){let i=n.length>2?n[2]:void 0;if(i){let s=Ua,o=String(i);Ua=o,Qe("history",{from:s,to:o})}return r.apply(this,n)}}Le(Ye.history,"pushState",e),Le(Ye.history,"replaceState",e)}var Ma={};function Uu(t){let e=Ma[t];if(e)return e;let r=Ye[t];if(wo(r))return Ma[t]=r.bind(Ye);let n=Ye.document;if(n&&typeof n.createElement=="function")try{let i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);let s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch(i){Qm&&q.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return r&&(Ma[t]=r.bind(Ye))}function ka(t){Ma[t]=void 0}var Nn="__sentry_xhr_v3__";function Mu(t){let e="xhr";wt(e,t),bt(e,l_)}function l_(){if(!Ye.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;Le(t,"open",function(e){return function(...r){let n=Bt()*1e3,i=Et(r[0])?r[0].toUpperCase():void 0,s=u_(r[1]);if(!i||!s)return e.apply(this,r);this[Nn]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let l=this[Nn];if(l&&this.readyState===4){try{l.status_code=this.status}catch{}let u={endTimestamp:Bt()*1e3,startTimestamp:n,xhr:this};Qe("xhr",u)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Le(this,"onreadystatechange",function(l){return function(...u){return o(),l.apply(this,u)}}):this.addEventListener("readystatechange",o),Le(this,"setRequestHeader",function(l){return function(...u){let[f,m]=u,h=this[Nn];return h&&Et(f)&&Et(m)&&(h.request_headers[f.toLowerCase()]=m),l.apply(this,u)}}),e.apply(this,r)}}),Le(t,"send",function(e){return function(...r){let n=this[Nn];if(!n)return e.apply(this,r);r[0]!==void 0&&(n.body=r[0]);let i={startTimestamp:Bt()*1e3,xhr:this};return Qe("xhr",i),e.apply(this,r)}})}function u_(t){if(Et(t))return t;try{return t.toString()}catch{}}function ku(t,e=Uu("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let l=w({body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return ka("fetch"),Jr("No fetch implementation available");try{return e(t.url,l).then(u=>(r-=o,n--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return ka("fetch"),r-=o,n--,Jr(u)}}return Ra(t,i)}var p_=30,f_=50;function Fu(t,e,r,n){let i={filename:t,function:e==="<anonymous>"?Ir:e,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var m_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,d_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h_=/\((\S*)(?::(\d+))(?::(\d+))\)/,g_=t=>{let e=m_.exec(t);if(e){let[,n,i,s]=e;return Fu(n,Ir,+i,+s)}let r=d_.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=h_.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=id(r[1]||Ir,r[2]);return Fu(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},td=[p_,g_],y_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,v_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,__=t=>{let e=y_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=v_.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],n=e[1]||Ir;return[n,r]=id(n,r),Fu(r,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},rd=[f_,__],nd=[td,rd],Hu=Gl(...nd),id=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:Ir,r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Fa=1024,S_="Breadcrumbs",w_=(t={})=>{let e=w({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:S_,setup(r){e.console&&Vl(T_(r)),e.dom&&Lu(I_(r,e.dom)),e.xhr&&Mu(x_(r)),e.fetch&&Kl(C_(r)),e.history&&Bu(D_(r)),e.sentry&&r.on("beforeSendEvent",b_(r))}}},od=w_;function b_(t){return function(e){Me()===t&&Cr({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:ir(e)},{event:e})}}function I_(t,e){return function(r){if(Me()!==t)return;let n,i,s=typeof e=="object"?e.serializeAttribute:void 0,o=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;o&&o>Fa&&(Mr&&q.warn(`\`dom.maxStringLength\` cannot exceed ${Fa}, but a value of ${o} was configured. Sentry will use ${Fa} instead.`),o=Fa),typeof s=="string"&&(s=[s]);try{let u=r.event,f=R_(u)?u.target:u;n=Eo(f,{keyAttrs:s,maxStringLength:o}),i=Fl(f)}catch{n="<unknown>"}if(n.length===0)return;let l={category:`ui.${r.name}`,message:n};i&&(l.data={"ui.component_name":i}),Cr(l,{event:r.event,name:r.name,global:r.global})}}function T_(t){return function(e){if(Me()!==t)return;let r={category:"console",data:{arguments:e.args,logger:"console"},level:tu(e.level),message:oa(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)r.message=`Assertion failed: ${oa(e.args.slice(1)," ")||"console.assert"}`,r.data.arguments=e.args.slice(1);else return;Cr(r,{input:e.args,level:e.level})}}function x_(t){return function(e){if(Me()!==t)return;let{startTimestamp:r,endTimestamp:n}=e,i=e.xhr[Nn];if(!r||!n||!i)return;let{method:s,url:o,status_code:l,body:u}=i,f={method:s,url:o,status_code:l},m={xhr:e.xhr,input:u,startTimestamp:r,endTimestamp:n};Cr({category:"xhr",data:f,type:"http"},m)}}function C_(t){return function(e){if(Me()!==t)return;let{startTimestamp:r,endTimestamp:n}=e;if(n&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){let i=e.fetchData,s={data:e.error,input:e.args,startTimestamp:r,endTimestamp:n};Cr({category:"fetch",data:i,level:"error",type:"http"},s)}else{let i=e.response,s=Z(w({},e.fetchData),{status_code:i&&i.status}),o={input:e.args,response:i,startTimestamp:r,endTimestamp:n};Cr({category:"fetch",data:s,type:"http"},o)}}}function D_(t){return function(e){if(Me()!==t)return;let r=e.from,n=e.to,i=Io(Ge.location.href),s=r?Io(r):void 0,o=Io(n);(!s||!s.path)&&(s=i),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),Cr({category:"navigation",data:{from:r,to:n}})}}function R_(t){return!!t&&!!t.target}var N_=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],A_="BrowserApiErrors",O_=(t={})=>{let e=w({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t);return{name:A_,setupOnce(){e.setTimeout&&Le(Ge,"setTimeout",sd),e.setInterval&&Le(Ge,"setInterval",sd),e.requestAnimationFrame&&Le(Ge,"requestAnimationFrame",P_),e.XMLHttpRequest&&"XMLHttpRequest"in Ge&&Le(XMLHttpRequest.prototype,"send",L_);let r=e.eventTarget;r&&(Array.isArray(r)?r:N_).forEach(B_)}}},ad=O_;function sd(t){return function(...e){let r=e[0];return e[0]=Rn(r,{mechanism:{data:{function:Yt(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function P_(t){return function(e){return t.apply(this,[Rn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Yt(t)},handled:!1,type:"instrument"}})])}}function L_(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Le(r,n,function(i){let s={mechanism:{data:{function:n,handler:Yt(i)},handled:!1,type:"instrument"}},o=In(i);return o&&(s.mechanism.data.handler=Yt(o)),Rn(i,s)})}),t.apply(this,e)}}function B_(t){let e=Ge,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Le(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Rn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Yt(s),target:t},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,Rn(s,{mechanism:{data:{function:"addEventListener",handler:Yt(s),target:t},handled:!1,type:"instrument"}}),o])}}),Le(r,"removeEventListener",function(n){return function(i,s,o){let l=s;try{let u=l&&l.__sentry_wrapped__;u&&n.call(this,i,u,o)}catch{}return n.call(this,i,l,o)}}))}var U_="GlobalHandlers",M_=(t={})=>{let e=w({onerror:!0,onunhandledrejection:!0},t);return{name:U_,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&(k_(r),cd("onerror")),e.onunhandledrejection&&(F_(r),cd("onunhandledrejection"))}}},ld=M_;function k_(t){Jl(e=>{let{stackParser:r,attachStacktrace:n}=ud();if(Me()!==t||Du())return;let{msg:i,url:s,line:o,column:l,error:u}=e,f=j_(Ba(r,u||i,void 0,n,!1),s,o,l);f.level="error",Ro(f,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function F_(t){Xl(e=>{let{stackParser:r,attachStacktrace:n}=ud();if(Me()!==t||Du())return;let i=H_(e),s=wn(i)?$_(i):Ba(r,i,void 0,n,!0);s.level="error",Ro(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function H_(t){if(wn(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function $_(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function j_(t,e,r,n){let i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},l=o.stacktrace=o.stacktrace||{},u=l.frames=l.frames||[],f=isNaN(parseInt(n,10))?void 0:n,m=isNaN(parseInt(r,10))?void 0:r,h=Et(e)&&e.length>0?e:kl();return u.length===0&&u.push({colno:f,filename:h,function:Ir,in_app:!0,lineno:m}),t}function cd(t){Mr&&q.log(`Global Handler attached: ${t}`)}function ud(){let t=Me();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var pd=()=>({name:"HttpContext",preprocessEvent(t){if(!Ge.navigator&&!Ge.location&&!Ge.document)return;let e=t.request&&t.request.url||Ge.location&&Ge.location.href,{referrer:r}=Ge.document||{},{userAgent:n}=Ge.navigator||{},i=w(w(w({},t.request&&t.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=Z(w(w({},t.request),e&&{url:e}),{headers:i});t.request=s}}),W_="cause",G_=5,V_="LinkedErrors",z_=(t={})=>{let e=t.limit||G_,r=t.key||W_;return{name:V_,preprocessEvent(n,i,s){let o=s.getOptions();Ul(La,o.stackParser,o.maxValueLength,r,e,n,i)}}},fd=z_;function $u(t){return[Oa(),Na(),ad(),od(),ld(),fd(),Pa(),pd()]}var ju=class extends Error{cause;constructor(t,e){super(t),this.cause=e}},ke=class Td{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Td),this.INSTANCE}captureException(e,r,n){b.error(e),this.getNewScope(r,n).captureException(e)}captureMessage(e,r,n,i){this.getNewScope(n,i).captureMessage(e,r??"error")}captureError(e,r,n,i){b.error(e,r);let s=this.getNewScope(n,i),o=new ju(e,r);s.captureException(o)}setGlobalContext(e,r){this.contexts[e]=w({context:r},this.contexts[e])}setUser(e){this.user=e}setTags(e){this.tags=e}getNewScope(e,r){let n=new ft;if(n.setClient(this.client),n.setUser(this.user),e?.triggerContext){let i=e.triggerContext;n.setExtras(i.triggerData.sentryContext()),delete e.triggerContext}return e&&n.setExtras(e),this.tags&&n.setTags(this.tags),r&&n.setTags(r),Object.keys(this.contexts).forEach(i=>{n.setContext(i,this.contexts[i])}),n.setTag("language",navigator.language),n.setTag("timezone",ne.getTimezone()),n}init(){let e=$u({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new Ao({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:ku,stackParser:Hu,integrations:e,environment:Zt.mode,release:`web-sdk@${A.SDK_VERSION}`,debug:Zt.debug}),this.client.init()}},Wu={d:(t,e)=>{for(var r in e)Wu.o(e,r)&&!Wu.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Gu={};Wu.d(Gu,{A:()=>K_,k:()=>Vu});var Y_=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(f){try{u(n.next(f))}catch(m){s(m)}}function l(f){try{u(n.throw(f))}catch(m){s(m)}}function u(f){var m;f.done?i(f.value):(m=f.value,m instanceof r?m:new r(function(h){h(m)})).then(o,l)}u((n=n.apply(t,e||[])).next())})},q_=function(t,e){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(u){return function(f){return function(m){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,m[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&m[0]?n.return:m[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,m[1])).done)return i;switch(n=0,i&&(m=[2&m[0],i.value]),m[0]){case 0:case 1:i=m;break;case 4:return o.label++,{value:m[1],done:!1};case 5:o.label++,n=m[1],m=[0];continue;case 7:m=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||m[0]!==6&&m[0]!==2)){o=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){o.label=m[1];break}if(m[0]===6&&o.label<i[1]){o.label=i[1],i=m;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(m);break}i[2]&&o.ops.pop(),o.trys.pop();continue}m=e.call(t,o)}catch(h){m=[6,h],n=0}finally{r=i=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}([u,f])}}};function Vu(){return Y_(this,void 0,Promise,function(){return q_(this,function(_a){switch(_a.label){case 0:return[4,new Promise(function(resolve,reject){var browserName="Unknown";function __callback(t){resolve({isPrivate:t,browserName})}function identifyChromium(){var t=navigator.userAgent;return t.match(/Chrome/)?navigator.brave!==void 0?"Brave":t.match(/Edg/)?"Edge":t.match(/OPR/)?"Opera":"Chrome":"Chromium"}function assertEvalToString(t){return t===eval.toString().length}function feid(){var toFixedEngineID=0;try{eval("(-1).toFixed(-1);")}catch(t){toFixedEngineID=t.message.length}return toFixedEngineID}function isSafari(){return feid()===44}function isChrome(){return feid()===51}function isFirefox(){return feid()===25}function isMSIE(){return navigator.msSaveBlob!==void 0&&assertEvalToString(39)}function newSafariTest(){var t=String(Math.random());try{window.indexedDB.open(t,1).onupgradeneeded=function(e){var r,n,i=(r=e.target)===null||r===void 0?void 0:r.result;try{i.createObjectStore("test",{autoIncrement:!0}).put(new Blob),__callback(!1)}catch(o){var s=o;return o instanceof Error&&(s=(n=o.message)!==null&&n!==void 0?n:o),typeof s!="string"?void __callback(!1):void __callback(s.includes("BlobURLs are not yet supported"))}finally{i.close(),window.indexedDB.deleteDatabase(t)}}}catch{__callback(!1)}}function oldSafariTest(){var t=window.openDatabase,e=window.localStorage;try{t(null,null,null,null)}catch{return void __callback(!0)}try{e.setItem("test","1"),e.removeItem("test")}catch{return void __callback(!0)}__callback(!1)}function safariPrivateTest(){navigator.maxTouchPoints!==void 0?newSafariTest():oldSafariTest()}function getQuotaLimit(){var t=window;return t.performance!==void 0&&t.performance.memory!==void 0&&t.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function storageQuotaChromePrivateTest(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(t,e){__callback(Math.round(e/1048576)<2*Math.round(getQuotaLimit()/1048576))},function(t){reject(new Error("detectIncognito somehow failed to query storage quota: "+t.message))})}function oldChromePrivateTest(){(0,window.webkitRequestFileSystem)(0,1,function(){__callback(!1)},function(){__callback(!0)})}function chromePrivateTest(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?storageQuotaChromePrivateTest():oldChromePrivateTest()}function firefoxPrivateTest(){__callback(navigator.serviceWorker===void 0)}function msiePrivateTest(){__callback(window.indexedDB===void 0)}function main(){isSafari()?(browserName="Safari",safariPrivateTest()):isChrome()?(browserName=identifyChromium(),chromePrivateTest()):isFirefox()?(browserName="Firefox",firefoxPrivateTest()):isMSIE()?(browserName="Internet Explorer",msiePrivateTest()):reject(new Error("detectIncognito cannot determine the browser"))}main()})];case 1:return[2,_a.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Vu);var K_=Vu,md=Gu.A,VL=Gu.k,yd=Qt(tn()),Ha=class{parser;result={};constructor(){this.parser=At.get().getUAParser()}async get(){let t=this.result;return this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),await this.getBatteryInfo(),await this.getLocation(),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},t.navigatorUA=navigator.userAgent,t.isHeadless=navigator.webdriver,t}getDeviceMemory(){let t=navigator;if(!t.deviceMemory)return;let e=t.deviceMemory;this.result.mem={tot:e*1024}}getNetworkType(){let t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;e?.effectiveType&&(this.result.net={type:e.effectiveType})}getOrientation(){let t=screen.orientation?.type;t&&(this.result.orientation=t)}getDPI(){let t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);let e=window.devicePixelRatio||1,r=t.offsetWidth*e;return document.body.removeChild(t),r}async getLocation(){if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:"geolocation"})).state!="granted"))return new Promise(t=>{navigator.geolocation.getCurrentPosition(e=>{this.result.coords=[e.coords.latitude,e.coords.longitude],t()},()=>t())})}async getBatteryInfo(){if("getBattery"in navigator)try{let t=await navigator.getBattery();this.result.bat={l:t.level*100,c:t.charging}}catch{}}},Di=class{static trackDeviceID(t){this.isInstalled()}static trackIntent(t){if(!this.isInstalled())return;let e=cn[t]?.toLowerCase();e&&(b.debug(`Sending ${e} intent to MS Clarity`),window.clarity("set","Cooee Intent",e))}static isInstalled(){return window.clarity&&typeof window.clarity=="function"}},Ri=class{constructor(t,e){this._startTime=t,this._triggerData=e}intervals=[];selectedEmbeddedItems;renderer;closeCallback;inputFields=[];get startTime(){return this._startTime}get triggerData(){return this._triggerData}get inputs(){return this.inputFields}get rootClassName(){let t=this.triggerData.shortID??this.triggerData.id.slice(-6);return t==="test"&&(t="test-"+this.startTime.getTime().toString()),A.IN_APP_WRAPPER_NAME+"-"+t}get selectedItems(){return this.triggerData.items.filter(t=>t.selected.value)}get shouldGiveFBTDiscount(){let t=this.selectedItems.length;return this.triggerData.bundleConfig?.applyDiscountOnMinimum?this.triggerData.bundleConfig.applyDiscountOnMinimum<=t:t===this.triggerData.items.length}onClose(t){this.closeCallback=t}closeInApp(t,e){e??={};let r=(new Date().getTime()-this.startTime.getTime())/1e3,n=w({eventName:t,duration:r},e);this.stopIntervals(),this.closeCallback&&this.closeCallback(n)}addInputField(t,e){this.inputFields.push({id:t,type:e,isValid:!1})}updateValidation(t,e){this.inputFields.forEach(r=>{if(r.id===t){r.isValid=e;return}})}hasManipulatedProductQuantity(){let t=this.triggerData.manipulation.productQuantity;return t.enabled&&t.min!=null&&t.max!=null}getManipulatedQuantity(t){let{min:e=1,max:r=100}=this.triggerData.manipulation.productQuantity;if(e>r)return b.error("Invalid range: min should be less than or equal to max."),t;if(t>=e&&t<=r)return t;let n=t%100;return n<e?e:n>r?r:n}stopIntervals(){this.intervals.forEach(t=>clearInterval(t))}},$a=class{loadedFonts=[];async loadAllFonts(t){t.elems?.forEach(e=>{e instanceof hr&&this.loadFamily(e.typography?.fam)})}async loadFamily(t){if(!t?.fonts||this.loadedFonts.indexOf(t.name)>-1)return;let e=[];t.fonts.forEach(r=>{if(r.url){let n=new FontFace(A.COOEE+t.name,r.getURL(),r.getFontDescriptor());e.push(n.load())}}),this.loadedFonts.push(t.name),(await Promise.all(e)).forEach(r=>{document.fonts.add(r)})}},ja=class{static updateIdentity(t){if(!this.isInstalled())return;let e={};t.email&&(e.email=t.email),t.mobile&&(e.phone_number=t.mobile),b.debug("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",e])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}},Wa=class{apiService;action;triggerContext;constructor(t,e){this.action=t,this.apiService=pe.getInstance(),this.triggerContext=e}async execute(){let t=this.containsCTA()?A.EVENT_TRIGGER_CLICKED:A.EVENT_TRIGGER_CLOSED;switch(this.action.at!==106&&this.closeTriggerAndSendEvent(t),this.action.at){case 2:break;case 4:this.gotoURLAction();break;case 5:this.shareAction();break;case 106:this.collectFormData();break;case void 0:case 105:break;default:b.error("Received an invalid ClickActionType: ",this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,"_blank")?.focus()}gotoURLAction(){if(this.action.gu?.u){let t=this.action.gu.u;ne.isValidURL(t)||(t=`//${t}`),window.open(t,"_self")}}prompt(){let t=this.action.pmpt;t&&(t===2&&this.promptLocationPermission(),t===3&&this.promptPushNotificationPermission(),t===1&&this.promptCameraPermission())}closeTriggerAndSendEvent(t,e){this.triggerContext.closeInApp(t,e),this.dispatchEvent()}shareAction(){if(this.action.share){if(!navigator.share){b.warn("Navigator.share is not compatible with this browser");return}navigator.share({text:this.action.share.text,title:"Share"}).then(t=>console.log(t)).catch(t=>console.error(t))}}containsCTA(){return this.action.at&&this.action.at!==1?!0:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(t){return t?Object.keys(t).length===0:!0}promptLocationPermission(){!navigator.geolocation||!navigator.permissions||navigator.geolocation.getCurrentPosition(t=>{this.apiService.updateDeviceProps({coords:[t.coords.latitude,t.coords.longitude]}),this.sendPermissionData()})}promptPushNotificationPermission(){if(!("Notification"in window)){b.warn("This browser does not support desktop notification");return}if(Notification.permission!=="default"){this.apiService.updateDeviceProps({pnPerm:Notification.permission});return}Notification.requestPermission().then(()=>{this.sendPermissionData()})}promptCameraPermission(){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally(()=>{this.sendPermissionData()})}checkPermission(t){return navigator.permissions.query({name:t}).then(e=>e.state.toString())}async checkAllPermission(){let t=await this.checkPermission("camera"),e=await this.checkPermission("geolocation"),r=Notification.permission;return{camera:t,location:e,notification:r}}sendPermissionData(){this.checkAllPermission().then(t=>{this.apiService.updateDeviceProps({perm:t})})}collectFormData(){let t={};for(let e of this.triggerContext.inputs){if(!e.isValid)return;let r=document.getElementById(e.id).value;e.type===51?t.email=r:e.type===52&&(t.mobile=r)}this.closeTriggerAndSendEvent(A.EVENT_FORM_SUBMITTED,{form:t}),ne.showSnackbar("Coupon applied on cart"),ja.updateIdentity(t)}dispatchEvent(){let t=this.triggerContext.triggerData,e={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??t.embeddedItems??t.items,collections:t.collections,triggerData:t};document.dispatchEvent(new CustomEvent(A.CTA_EVENT,{detail:e}));let r={action:this.containsCTA()?A.CAMPAIGN_CLICKED_ACTIVITY:A.CAMPAIGN_CLOSED_ACTIVITY};document.dispatchEvent(new CustomEvent(A.POPUP_ACTIVITY_EVENT,{detail:r}))}},Ni=class{constructor(t){this.scalingFactor=t}getLayoutStyles(t){if(!t)return{display:"block"};let e={display:t.disp};return t.of&&(e.objectFit=t.of),t.pos==="absolute"&&(e.width="auto !important",e.position="absolute",e.right=t.right+"px",e.left=t.left+"px",e.top=t.top+"px",e.bottom=t.bottom+"px"),e}getSizeStyles(t){let e={};return t?.w&&(e.width=t.w),t?.h&&(e.height=t.h),t?.maxW&&(e.maxWidth=t.maxW),t?.maxH&&(e.maxHeight=t.maxH),t?.minW&&(e.minWidth=t.minW),t?.minH&&(e.minHeight=t.minH),e}getBorderStyles(t){if(!t)return{};let e={};return t.radius&&t.radius>0&&(e.borderRadius=this.getSizePx(t.radius)),t.width&&t.width>0&&(e.borderWidth=this.getSizePx(t.width),e.borderStyle=t.style?.toLowerCase(),t.color?this.getColourStyles(t.color,"border-color",e):e.borderColor="black"),e}getFlexStyles(t){return t?{gap:t.gap+"px",flexWrap:t.wrap,flexDirection:t.dir,justifyContent:t.jc,alignItems:t.ai,width:"100%"}:{}}getSpaceStyles(t){let e={};return t?(e.paddingTop=this.getSizePx(t.pt),e.paddingBottom=this.getSizePx(t.pb),e.paddingLeft=this.getSizePx(t.pl),e.paddingRight=this.getSizePx(t.pr),e.marginTop=this.getSizePx(t.mt),e.marginBottom=this.getSizePx(t.mb),e.marginLeft=t.cent?"auto":this.getSizePx(t.ml),e.marginRight=t.cent?"auto":this.getSizePx(t.mr),e):(e.margin="0 !important",e.padding="unset",e)}getBackgroundStyles(t){if(!t)return{};let e={};if(t.glossy){let r="backdrop-filter",n="-webkit-"+r,i=`blur(${t.glossy.radius}px)`;if(!CSS.supports(n,i)&&!CSS.supports(r,i))return{background:t.glossy.fallback.rgba};if(e[n]=i,e[r]=i,t.glossy.color)return this.getColourStyles(t.glossy.color,"background",e)}else if(t.solid){if(t.solid.grad)return this.getGradientStyles(t.solid.grad,"background",e);if(t.solid.hex)return{backgroundColor:t.solid.rgba}}else if(t.img){if(!t.img.src)return{};let r=(t.img.a??0)/100;e.background=`linear-gradient(rgba(0, 0, 0, ${r}), rgba(0, 0, 0, ${r})),url("${t.img.src}") no-repeat center`,e.backgroundSize="cover",t.img.a&&(e["-webkit-backdrop-filter"]=`opacity(${t.img.a})`,e.backdropFilter=`opacity(${t.img.a})`)}return e}getGradientStyles(t,e,r){if(r??={},t.type==="LINEAR"){let n=`linear-gradient(${t.ang}deg, ${t.c1}, ${t.c2}`;t.c3&&(n+=`, ${t.c3}`),n+=")",r[e]=n}return r}getColourStyles(t,e="color",r){return r??={},t?t.grad?this.getGradientStyles(t.grad,e,r):(t.hex&&(r[e]=t.rgba),r):r}getSizePx(t){return this.getScaledSize(t)+"px"}getScaledSize(t){return(t??0)*this.scalingFactor}},Kt=class{renderer=At.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(t,e,r){this.parentHTMLEl=t,this.inappElement=e,this.triggerContext=r,this.stylesConverter=new Ni(this.renderer.getScalingFactor())}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let t=Z(w(w(w(w({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:"border-box",outline:"none"});this.renderer.setStyles(this.inappHTMLEl,t)}getDisplayStyles(){return{display:"block"}}processWidthAndHeight(){this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.stylesConverter.getSizePx(this.inappElement.h))}processPositionBlock(){let t={position:"absolute",left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};this.renderer.setStyles(this.inappHTMLEl,t)}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let t=this.inappElement.alpha;if(!isNaN(t)){let e=(t/100).toFixed(2);this.renderer.setStyle(this.inappHTMLEl,"opacity",e)}}processShadow(){let t=this.inappElement.shd;t?this.renderer.setStyle(this.inappHTMLEl,"box-shadow",t.getStyle(this.scalingFactor)):this.renderer.setStyle(this.inappHTMLEl,"box-shadow","unset")}processTransformBlock(){let t=new sn(this.inappElement.trf);t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform",`rotate(${t.rotate}deg)`)}registerAction(){let t=this.inappElement.clc;!t||Object.keys(t).length===0||(this.inappHTMLEl.addEventListener("click",e=>{e.stopPropagation(),new Wa(t,this.triggerContext).execute()}),this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}},Dr=class extends Kt{constructor(t,e,r){super(t,e,r)}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment()}processFontBlock(){let t={},e=this.inappElement.typography;return e&&(t.fontSize=this.stylesConverter.getSizePx(e.fs),t.fontFamily=A.COOEE+e.fam?.name,t.lineHeight=`${e.lh}`,t.letterSpacing=e.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,"color",t),this.renderer.setStyles(this.inappHTMLEl,t),t}processPart(t,e){let 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",e.c??"inherit"),this.renderer.setStyle(t,"font-family","inherit")}processAlignment(){let t=this.inappElement.typography.ta,e=t?Qn[t]?.toLowerCase():this.inappElement.typography.alignment;e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)}},Oo=class extends Dr{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.inappElement.parts?.forEach(t=>{let e=this.renderer.createElement("span");e.innerHTML=t.txt?.toString()?.replace(/\n/g,"<br />"),this.processPart(e,t),this.renderer.appendChild(this.inappHTMLEl,e)}),this.processCommonBlocks()}},Po=class extends Kt{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}},An=class extends Kt{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("img"),this.insertElement()}render(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","none"),this.renderer.setStyle(this.inappHTMLEl,"max-height","none"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()}},Lo=class Cd extends Kt{constructor(e,r,n){super(e,r,n),this.parent=e,this.inappHTMLEl=this.renderer.createElement("div")}static MAX_Z_INDEX="2147483647";render(){return this.parent||this.renderer.removeInApp(this.triggerContext),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(A.IN_APP_WRAPPER_NAME),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),this.renderer.setStyle(this.inappHTMLEl,"z-index",Cd.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let e=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(this.renderer.setStyle(this.inappHTMLEl,"width","100%"),this.renderer.setStyle(this.inappHTMLEl,"height","100%")):(this.renderer.setStyle(this.inappHTMLEl,"width","100vw"),this.renderer.setStyle(this.inappHTMLEl,"height","100vh")),this.renderer.setStyle(this.inappHTMLEl,"top","0"),this.renderer.setStyle(this.inappHTMLEl,"left","0");else{let r=this.inappElement.spc,n=this.stylesConverter.getScaledSize(e.w)+r.getHorizontal(),i=this.stylesConverter.getScaledSize(e.h)+r.getVertical();this.renderer.setStyle(this.inappHTMLEl,"width",n+"px"),this.renderer.setStyle(this.inappHTMLEl,"height",i+"px")}}getSpaceStyles(){return{padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return w(w({display:"flex"},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){if(this.renderer.isParentNotBody()){if(this.triggerContext.triggerData.ian?.isEmbedded()){this.renderer.setStyle(this.inappHTMLEl,"position","block");return}this.renderer.setStyle(this.inappHTMLEl,"position","absolute")}else this.renderer.setStyle(this.inappHTMLEl,"position","fixed")}getBorderStyles(){return{}}processTransparency(){}processTransformBlock(){}processShadow(){}},Va=class extends Kt{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this.renderer.setStyle(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(A.IN_APP_CONTAINER_NAME),this}},Ai=class extends Dr{borderColor="";constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("input"),this.insertElement()}render(){let t=this.setInputType();this.renderer.setAttribute(this.inappHTMLEl,"placeholder",this.inappElement.placeholderText),this.renderer.setStyle(this.inappHTMLEl,"background","#ffffff00"),this.renderer.setStyle(this.inappHTMLEl,"outline","none"),this.inappHTMLEl.addEventListener("click",e=>{e.stopPropagation()}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,t),this.triggerContext.addInputField(t,this.inappElement.t)}},za=class Dd extends Ai{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.renderer.setAttribute(this.inappHTMLEl,"type","email"),this.renderer.setAttribute(this.inappHTMLEl,"id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(Dd.EMAIL_REGEX)?(this.renderer.setStyle(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(this.renderer.setStyle(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}},Ya=class Ad extends Ai{static MOBILE_REGEX=/^\d+$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.renderer.setAttribute(this.inappHTMLEl,"type","tel"),this.renderer.setAttribute(this.inappHTMLEl,"id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(Ad.MOBILE_REGEX)?(this.renderer.setStyle(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(this.renderer.setStyle(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}},qa=class Bn extends Dr{static DAYS="Days";static HOURS="Hours";static MINUTES="Minutes";static SECONDS="Seconds";elements;spans=[];constructor(e,r,n){super(e,r,n),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let e=Z(w(w(w({flex:"1 1 0"},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(e)}getBackgroundStyles(){return{}}processFontBlock(){let e=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),this.addStylesToTimer(e),e}getSpaceStyles(){return{}}getBorderStyles(){return{}}getDisplayStyles(){return{display:"flex",flexWrap:"nowrap",justifyContent:"center"}}addStylesToTimer(e){this.elements.forEach(r=>this.renderer.setStyles(r,e))}addTimerChildren(){let e=this.inappElement.show;this.elements=[],e.day&&this.elements.push(this.getChild(Bn.DAYS)),e.hour&&this.elements.push(this.getChild(Bn.HOURS)),e.minute&&this.elements.push(this.getChild(Bn.MINUTES)),e.second&&this.elements.push(this.getChild(Bn.SECONDS)),this.elements.forEach(r=>this.inappHTMLEl.appendChild(r))}getChild(e){let r=this.renderer.createElement("div"),n=this.renderer.createElement("span"),i=this.renderer.createElement("span");return i.innerText=e,n.innerText="00",n.id=`lc-${e}`,this.renderer.setStyle(i,"font-size","0.5em"),this.renderer.setStyle(i,"text-align","center"),this.renderer.setStyle(i,"font-family","inherit"),this.renderer.setStyle(n,"text-align","center"),this.renderer.setStyle(n,"font-family","inherit"),this.inappElement.lblPos==="start"?(r.appendChild(i),r.appendChild(n)):(r.appendChild(n),r.appendChild(i)),this.renderer.setStyle(r,"display","flex"),this.renderer.setStyle(r,"flex-direction",this.inappElement.horizontal?"":"column"),this.renderer.setStyle(r,"justify-content","center"),this.renderer.setStyle(r,"align-items","center"),this.renderer.setStyle(r,"gap","5px"),this.spans.push(n),r}processAndStartTimer(){let e=this.inappElement.timer.start(this.inappElement.timerType,r=>{this.spans.forEach(n=>{n.id===`lc-${Bn.DAYS}`?n.innerText=String(r.days).padStart(2,"0"):n.id===`lc-${Bn.HOURS}`?n.innerText=String(r.hours).padStart(2,"0"):n.id===`lc-${Bn.MINUTES}`?n.innerText=String(r.minutes).padStart(2,"0"):n.id===`lc-${Bn.SECONDS}`&&(n.innerText=String(r.seconds).padStart(2,"0"))})});this.triggerContext.intervals.push(e)}},Ka=class extends Dr{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("select"),this.insertElement()}render(){this.renderer.setStyle(this.inappHTMLEl,"background","#ffffff00"),this.renderer.setStyle(this.inappHTMLEl,"outline","none"),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions()}addListener(t){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),t.addEventListener("click",e=>{e.stopPropagation()}),t.addEventListener("change",()=>{let e=new dr(JSON.parse(t.value));this.updateItems(e)})}updateItems(t){let e=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[e.toEmbed(t)];let r=this.parentHTMLEl.querySelector("#coo-13");if(!r)return;let n=t.imgs[0]??e.imgs?.at(0);n?.url&&r.setAttribute("src",n.url)}addOptions(){let t=this.triggerContext.triggerData.items,e=this.inappHTMLEl;if(!t?.length){e.add(this.createOption(this.inappElement.placeholderText));return}let r=this.triggerContext.selectedEmbeddedItems?.at(0);t[0].vars.forEach(n=>{e.add(this.createOption(n.name??"Default",n,n.mID===r?.vID))})}createOption(t,e,r){let n=this.renderer.createElement("option");return n.text=t,n.value=JSON.stringify(e),r&&(n.selected=!0),e||(n.disabled=!0),n}},Ja=class extends An{constructor(t,e,r){super(t,e,r)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}},Xa=Qt(tn()),Rr=class Nd{static INSTANCE=new Nd;topics={};constructor(){}static get(){return this.INSTANCE}broadcast(e,r){this.topics[e]||(this.topics[e]=new _t),this.topics[e].next(r)}subscriber(e){return this.topics[e]||(this.topics[e]=new _t),this.topics[e].asObservable()}},Ze=class Wr{static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=Oe.get().website??{};currentState=!1;drawerSubject=new fo({open:!1,firstOpen:!1});mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count"].join(",");cartSelector=[Wr.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize()}get element(){return this.cartDrawerElement}static get(){return Wr._instance||(Wr._instance=new Wr),Wr._instance}static forceUpdate(){Wr._instance=new Wr}isOpen(){let e=this.inShadow?this.isPresent():this.isVisible();return Xa.default.log(`Cart drawer is currently ${e?"open":"close"}`),e}open(){if(this.isOpen()){b.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent(A.CTA_OPEN_CART_EVENT));let e=document.querySelector(this.iconSelector);if(!e){b.debug("No clickable cart icon found with selector",this.iconSelector);return}e.click()}onToggle(){return this.drawerSubject}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===Wr.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(e,r=!0){if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:e}});else if(this.isShopifyDefaultDrawer())this.element?.renderContents&&e&&(this.element.classList.remove("is-empty"),this.element.renderContents?.(e));else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!e?.items?.[0])return;let n=e.items[0].id,i=e.items[0].quantity,s=e.items[0].price;window.cartGiftUpdate(n,s,i,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer)window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else b.info("No method found to update the cart without refreshing");r&&Rr.get().broadcast(A.CART_UPDATE_BROADCAST)}async initialize(){let e=this.configWebsite.cartDrawerSelector;if(!e){await this.findCartDrawer();return}let r=e.split(A.SHADOW_SPLITTER);r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!Ae.isShopify())return;let e=this.selector||this.cartSelector;if(this.cartDrawerElement=await ne.retrySelector(e),!this.cartDrawerElement){Xa.default.warn("Max attempts exhausted to find cart drawer");return}Xa.default.log("Found",this.cartDrawerElement,`from selector: ${e}`),this.createMutationObserver()}async findCartDrawerWithShadow(){if(!Ae.isShopify()||!this.shadowParentElementSelector)return;let e=(await ne.retrySelector(this.shadowParentElementSelector))?.shadowRoot;e?.mode==="open"&&(this.cartDrawerShadowElement=e,this.createMutationObserver())}isVisible(){if(!this.cartDrawerElement)return!1;let e=this.cartDrawerElement.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)+.5,n=(window.innerWidth||document.documentElement.clientWidth)+.5,i=e.top<=r&&e.bottom>=0,s=e.left<=n&&e.right>=0,o=i&&s,l=this.cartDrawerElement.tagName.toLowerCase()===Wr.DEFAULT_SELECTOR&&this.cartDrawerElement.open,u=getComputedStyle(this.cartDrawerElement),f=u.display!=="none"&&u.visibility!=="hidden"&&parseFloat(u.opacity)>0,m=!this.cartDrawerElement.hidden,h=this.cartDrawerElement.offsetWidth>0||this.cartDrawerElement.offsetHeight>0||this.cartDrawerElement.getClientRects().length>0,v=u.transform.match(/matrix\(([^)]+)\)/),_=0,g=0;if(v){let V=v[1].split(", ").map(parseFloat);_=V[4],g=V[5]}let y=_+e.left>n||_+e.right<0||g+e.top>r||g+e.bottom<0,C=Math.max(0,Math.min(e.right,n)-Math.max(e.left,0)),O=Math.max(0,Math.min(e.bottom,r)-Math.max(e.top,0)),H=C*O,R=e.width*e.height,k=R>0&&H/R>=.1;return(o||l||!y)&&f&&m&&h&&k}createMutationObserver(){if(!this.cartDrawerElement&&!this.cartDrawerShadowElement)return;let e=this.cartDrawerElement||this.cartDrawerShadowElement,r=new _t;this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(e,{attributes:!0,subtree:!0,childList:this.inShadow}),r.pipe(rr(500)).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,this.drawerSubject.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){return!this.selector||!this.cartDrawerShadowElement?!1:!!this.cartDrawerShadowElement.querySelector(this.selector)}},Oi=class bc{static ACTIVE_TRIGGER_DATA;renderer=At.get();safeHTTP;parent;rootContainer;containerHTMLElement;ian;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.safeHTTP=pe.getInstance(),this.resizeListener=()=>this.screenResized(),this.setParentContainer(e)}setParentContainer(e){this.parent=e??document.body,this.renderer.setParentContainer(this.parent)}render(e){this.renderEngagement(new Lt(e))}async renderEngagement(e){if(!e.previewType&&bc.ACTIVE_TRIGGER_DATA){let r={triggerShown:new mi(bc.ACTIVE_TRIGGER_DATA??{})};this.skipTrigger(e,r);return}if(bc.ACTIVE_TRIGGER_DATA=e,this.triggerContext=new Ri(new Date,e),this.triggerContext.onClose(r=>{this.closeInApp(r)}),this.ian=e.ian,(this.renderer.isMobile()||e.previewType==="mobile")&&this.ian.overrideForMobileView(),this.ian.isEmbedded()){let r=document.querySelector(this.ian.getEmbeddedSelector());this.setParentContainer(r)}await this.preloadImages(e),e.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed()},e.getDelaySeconds()):this.withCartDrawerClosed()}withCartDrawerClosed(){if(!Ze.get().isOpen()||!this.renderer.isMobile()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=Ze.get().onToggle().subscribe(({open:e})=>{!e&&this.startRenderingOnce()})}startRenderingOnce(){if(le.get().isGoKwikPopupOpen){this.skipTrigger(this.triggerContext.triggerData,{reason:"GoKwik popup is open"});return}try{this.startRendering()}catch(e){ke.getInstance().captureException(e,{triggerData:JSON.stringify(this.triggerContext.triggerData)});return}this.sendTriggerDisplayed(),this.renderer.isMobile()||window.addEventListener("resize",this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe()}startRendering(){this.renderer.calculateScalingFactor(this.ian),this.rootContainer=new Lo(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(e){throw b.error(e),e}}sendTriggerDisplayed(){let e={};this.triggerContext.triggerData.items?.length&&(e.promotedMIDs=this.triggerContext.triggerData.items?.map(i=>i.mID));let r=new ve(A.EVENT_TRIGGER_DISPLAYED,e,this.triggerContext.triggerData);this.safeHTTP.sendEvent(r);let n={action:A.CAMPAIGN_DISPLAYED_ACTIVITY};document.dispatchEvent(new CustomEvent(A.POPUP_ACTIVITY_EVENT,{detail:n}))}sendTriggerClosed(e){let r=e.eventName;delete e.eventName;let n=new ve(r,e,this.triggerContext.triggerData);n.name===A.EVENT_TRIGGER_CLICKED&&(n.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(i=>i.toEmbed())),this.safeHTTP.sendEvent(n)}addEnterAnimation(e){this.containerHTMLElement.animate(e.getEnterAnimation(),{duration:500})}renderElement(e,r,n){r instanceof ri?new za(e,r,n).render():r instanceof ni?new Ya(e,r,n).render():r instanceof zr?new Oo(e,r,n).render():r instanceof ii?new Ja(e,r,n).render():r instanceof Or?new An(e,r,n).render():r instanceof an?new Po(e,r,n).render():r instanceof ei?new qa(e,r,n).render():r instanceof ti?new Ka(e,r,n).render():b.error("Unsupported element type- "+r.type)}renderContainer(e){let r=this.ian?.cont;r&&(this.containerHTMLElement=new Va(this.rootContainer,r,e).render().getHTMLElement(),new $a().loadAllFonts(this.ian),this.ian.elems?.forEach(async n=>{await this.renderElement(this.containerHTMLElement,n,e)}),this.addEnterAnimation(this.ian.anim))}closeInApp(e){let r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(e),bc.ACTIVE_TRIGGER_DATA=void 0;let n=this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"});n.onfinish=()=>{this.removeInApp(),window.removeEventListener("resize",this.resizeListener)}}screenResized(){this.removeInApp(),this.startRendering()}removeInApp(){At.get().removeInApp(this.triggerContext)}skipTrigger(e,r){let n=new ve(A.EVENT_CAMPAIGN_REJECTED,r,e);this.safeHTTP.sendEvent(n)}async preloadImages(e){let r=e.ian;if(!r)return;let n=[];r.elems.forEach(i=>{let s=i.bg?.img?.src;if(s&&n.push(this.getPromise(s)),i.t===1){let o=i.src;if(!o)return;n.push(this.getPromise(o))}}),r.bg?.img?.src&&n.push(this.getPromise(r.bg.img.src)),r.cont.bg?.img?.src&&n.push(this.getPromise(r.cont.bg.img.src)),await Promise.all(n)}getPromise(e){return new Promise(r=>{let n=new Image;n.onload=r,n.src=e,n.style.display="none"})}},Qa=class{triggerData;safeHttpService=pe.getInstance();render(t){t.contentSource===qi.KLAVIYO&&(this.triggerData=t,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",t.klaviyoFormID]))}handleKlaviyoEvents(t){if(t.type!=="klaviyoForms")return;let e=t.detail;if(e.formId!==this.triggerData.klaviyoFormID){b.warn("Received invalid trigger callback");return}switch(e.type){case"open":this.safeHttpService.sendEvent(new ve(A.EVENT_TRIGGER_DISPLAYED,{form:{id:e.formId}},this.triggerData));break;case"stepSubmit":{let r=this.getFormDetails(e);this.safeHttpService.sendEvent(new ve(A.EVENT_FORM_SUBMITTED,{form:r},this.triggerData)),this.safeHttpService.updateProfile(r);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),this.safeHttpService.sendEvent(new ve(A.EVENT_TRIGGER_CLOSED,{form:{id:e.formId}},this.triggerData));break}}getFormDetails(t){let e={id:t.formId},r=t.metaData;if(Ft.hasKeys(r)){let n=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(r).forEach(o=>{n.includes(o)||(e[o]=r[o])}),e.email=r.$email??r.email,e.mobile=r.$phone_number??r.phone_number;let i=r.$first_name??r.first_name,s=r.$last_name??r.last_name;(i?.length||s?.length)&&(e.name=i+" "+s)}return e}},Za=class{static trackIntent(t){if(!this.isInstalled()){b.log("Facebook pixel not installed");return}if(!Oe.get().pixelPush){b.log("Facebook pixel push not enabled");return}let e=cn[t.intent]?.toLowerCase(),r=t.segmentName;!e&&!r||(b.debug(`Sending ${e} intent and ${r} segment to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:e,segment_value:t.segmentName}))}static isInstalled(){return window.fbq&&typeof window.fbq=="function"}},hd=Qt(dd()),On=class{static _flags={};static getFlags(){return this._flags}static setFlags(t){this._flags=t??{}}static isECommerceApp(){return Ae.isShopify()}},J_=(0,hd.default)(fetch),X_={retryDelay:A.API_CALL_RETRY_DELAY,retryOn:(t,e,r)=>t>=A.API_CALL_MAX_ATTEMPTS?!1:!!(e!==null||r?.status&&r?.status>=500)},mt=class Od{static INSTANCE;apiToken="";firstSeen="";constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Od),this.INSTANCE}async validateSession(e){return this.post("/v1/event/validate-session",e)}updateUserData(e){this.put("/v1/user/update",e).then(async r=>{b.log("Updated user profile"),await Pn.getInstance().storeAndPopulateAuthData(r)}).catch(r=>{b.error("Error saving user profile",r)})}trackOrder(e){this.post("/v1/event/track-order",e).then(()=>{b.log("Sent Order")}).catch(r=>{b.error("Error sending track order",r)})}generateDiscount(e){return this.post("/v1/event/generate-discount",e)}updateDeviceProps(e){this.put("/v1/device/update",e).then(()=>{b.log("Updated device property")}).catch(async r=>{b.error("Error saving device property",r)})}setAPIToken(e){this.apiToken=e??""}setFirstSeen(e){this.firstSeen=e?.toUTCString()??""}get(e){return this.requestBackend("GET",e)}post(e,r){return this.requestBackend("POST",e,r)}put(e,r){return this.requestBackend("PUT",e,r)}async requestBackend(e,r,n){if(!On.isECommerceApp()&&!On.getFlags().allowEvents)return b.log(`Rejecting ${e} ${r} as this is not e-commerce app`),Promise.reject();r.startsWith("http")||(r=Zt.apiURL+r);let i=this.getDefaultHeaders(),s="keepalive"in new Request("");if(n&&!s&&JSON.stringify(n).includes("CE App Background"))try{return this.performXMLHttpRequest(r,i,n)}catch(l){return ke.getInstance().captureException(l,{body:JSON.stringify(n)}),{}}let o={method:e,headers:i,keepalive:!0};return n&&(o.body=JSON.stringify(n)),this.request(r,o)}async request(e,r){let n=w(w({},X_),r),i=await J_(e,n);if(!i.ok)throw i;return i.json()}performXMLHttpRequest(e,r,n){return new Promise((i,s)=>{let o=new XMLHttpRequest;o.open("POST",e,!0),r.forEach((l,u)=>{o.setRequestHeader(u,l)}),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE)if(o.status>=200&&o.status<300)try{o.getResponseHeader("Content-Type")?.includes("application/json")?i(JSON.parse(o.responseText)):s(new Error("Content-Type of response header is not json"))}catch(l){s(l)}else s(new Error(`Received status - ${o.status}(${o.statusText})`))},o.onerror=()=>{s(new Error("Network error occurred during the request."))},o.send(JSON.stringify(n))})}getDefaultHeaders(){let e=new Headers;return e.set("content-type","application/json"),e.set("cooee-sdk",A.SDK),e.set("cooee-sdk-code",A.SDK_VERSION_CODE.toString()),e.set("cooee-sdk-version",A.SDK_VERSION),e.set("cooee-first-seen",this.firstSeen),this.apiToken&&e.append("cooee-sdk-token",this.apiToken),Zt.debug&&e.set("cooee-sdk-debug",String(1)),e}},Pi=class{static sentryService=ke.getInstance();static httpApiService=mt.getInstance();static async refreshItems(t){if(t.isCartEmbed()&&!t.isSubscriptionUpsell()){let i=(await ge.getCurrent().getNormalisedCart()).items.map(s=>s.mID);t.items=t.items.filter(s=>!i.includes(s.mID))}if(t.isCartRecovery()){let i=ge.getCurrent().items,s=[];for(let o of t.items)for(let l of o.vars){let u=i.find(h=>h.variant_id.toString()===l.mID);if(!u)continue;let f=new xt(o);f.name=u.title;let m=new dr(l);m.name=u.variant_title,m.price.d=u.discounted_price/100,f.variants=[m],s.push(f)}return s}if(Oe.get().currencyCount<=1)return t.items;let e=t.items.length,r=t.items.map(i=>this.updatedItem(i,t.engagementID)),n=(await Promise.all(r)).filter(i=>i!=null);if(e&&!n.length){let i="Failed to fetch any product from Ajax API",s=new ve(A.EVENT_CAMPAIGN_FAILED,{reason:i,currency:t.currency},t);throw pe.getInstance().sendEvent(s),new Error(i)}return n}static async updatedItem(t,e){let r=t,n,i=Ae.getRootPrefix()+`products/${r.slug}.js`;try{n=await this.httpApiService.request(i)}catch(s){return b.error(`Failed to fetch ${i}`,s),s instanceof Response?this.sentryService.captureMessage(`Shopify product fetch failed ${s.status}`,"error",{item:r,path:i},{"engagement.id":e}):this.sentryService.captureException(s,{item:r,path:i},{"engagement.id":e}),null}return n?(r.name=n.title,r.vars.map(s=>{let o=n.variants.find(l=>l.id===+s.mID);s.name=o.title,s.price.d=o.price?o.price/100:o.price,s.price.cmp=o.compare_at_price?o.compare_at_price/100:o.compare_at_price}),r):(b.error("Item not found after AJAX call for:",r),null)}},ec=class kd{static INSTANCE;httpService=ue.get(mt);sentryService=ue.get(ke);sessionManager=ue.get(it);runtime=le.get();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new kd),this.INSTANCE}sendSilently(e){this.send(e).catch(r=>b.error(`Failed to send ${e.name}`,r))}async send(e){if(b.debug(`Sending event ${e.name}`),Jt.prepend(`Sending event <strong>${e.name}</strong> with id ${e.id}`),this.shouldReject(e)){b.warn(`Rejecting event ${e.name}`);return}await Promise.all([this.addSessionContext(e),this.addShopifyContext(e)]),this.addShopifyAttributes(),e.name!==A.EVENT_APP_BACKGROUND&&this.runtime.setActive(),e.currentItem=this.runtime.getCurrentItem(),this.httpService.post("/v1/event/track",e).then(async r=>{b.log("\u2705 Event tracked:",e.name),Jt.prepend(`\u2705 Event <strong>${r.eventName}</strong> tracked`),this.processEventResponse(e,r)}).catch(r=>{b.error(`Error sending event ${e.name} to server`,r)})}shouldReject(e){return e.trigger?.triggerID==="test"||e.trigger?.triggerID==="preview"?(b.warn("Not sending event as this is a test trigger"),!0):!1}async addSessionContext(e){let r=await this.sessionManager.checkSessionAndGetContext();e.sessionID=r[0],e.sessionNumber=r[1],e.landingPage=r[2],e.page=_r.parseFromCurrent()}async addShopifyContext(e){if(Ae.isShopify())try{e.cart=await ge.getCurrent().getNormalisedCart()}catch(r){b.error("Error fetching Shopify cart before sending the event",r)}}processEventResponse(e,r){this.renderWidgetIfAny(e,r).catch(n=>{b.error("Failed to display a campaign",n,e,r),this.sentryService.captureException(n,{event:e,response:r})}),this.utiliseIntentIfCalculated(r)}async renderWidgetIfAny(e,r){if(!r.triggerData){b.log(`Nothing to engage after ${e.name}`);return}b.log(`\u{1F4E3} Engagement(id=${r.triggerData.shortID}) will be shown`,r.triggerData);let n=new Lt(r.triggerData);n.occurred=e.occurred;let i;try{i=await Pi.refreshItems(n)}catch(s){b.error("Failed to refresh the products",s);return}if(n.items=i,n.contentSource===qi.KLAVIYO){new Qa().render(n);return}new Oi().renderEngagement(n).catch(s=>{b.error("Failed to render popup",s),this.sentryService.captureException(s,{event:e,triggerData:n})})}utiliseIntentIfCalculated(e){e.intent&&(Di.trackIntent(e.intent),Za.trackIntent(e),Jt.prepend(`Intent is <strong>${cn[e.intent]}</strong>`))}addShopifyAttributes(){Ae.isShopify()&&ge.getCurrent().addCooeeAttributes().catch(e=>{b.error("Fail to add attributes in cart",e)})}},pe=class Pd{static INSTANCE;httpApiService=mt.getInstance();eventAPIService=ec.getInstance();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Pd),this.INSTANCE}sendEvent(e){b.debug(`Waiting for auth to send event ${e.name}`),it.replaySubject.subscribe(async()=>{this.eventAPIService.sendSilently(e)})}updateProfile(e){it.replaySubject.subscribe(()=>{this.httpApiService.updateUserData(e??{})})}trackOrder(e){it.replaySubject.subscribe(()=>{this.httpApiService.trackOrder(e)})}updateDeviceProps(e){it.replaySubject.subscribe(()=>{this.httpApiService.updateDeviceProps({props:e})})}generateDiscount(e){return this.httpApiService.generateDiscount(e)}},Jt=class{static isOn=!1;static element;static watch(){let t=b.getDebugParam();(t==="1"||t==="on")&&pe.getInstance().updateDeviceProps({debugTill:this.getDebugMillis()}),t==="on"?sessionStorage.cooeeDebug="1":t==="off"&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&(this.isOn=!0,this.renderDebugBar())}static prepend(t){if(!this.isOn)return;let e=document.createElement("div");e.innerHTML="• "+new Date().toLocaleString()+" - "+t,this.element.prepend(e)}static renderDebugBar(){this.element=document.createElement("div"),this.element.id="cooee-debugger",this.element.setAttribute("draggable","true"),document.body.appendChild(this.element)}static dragElement(){let t=0,e=0,r=0,n=0,i=l=>{l=l||window.event,l.preventDefault(),r=l.clientX,n=l.clientY,document.onmouseup=o,document.onmousemove=s},s=l=>{l=l||window.event,l.preventDefault(),t=r-l.clientX,e=n-l.clientY,r=l.clientX,n=l.clientY,this.element.style.top=this.element.offsetTop-e+"px",this.element.style.left=this.element.offsetLeft-t+"px"},o=()=>{document.onmouseup=null,document.onmousemove=null};this.element.onmousedown=i}static getDebugMillis(){return new Date().getTime()+6*60*60*1e3}},Bo=class extends Vr{static storeName="app";static{this.storage=Kn(this.storeName)}},tc=class{static processConfiguration(){let t=Oe.get();!t.gaMeasurementID||!t.gaEnabled||this.sendClientID()}static async sendClientID(){let t=await this.getClientID();t&&pe.getInstance().updateDeviceProps({gaClientID:t})}static async getClientID(){let t=await Ne.get(ie.GA_CLIENT_ID),e=await this.getClientIDViaGTag();if(t!==e)return await Ne.set(ie.GA_CLIENT_ID,e),e}static async getClientIDViaGTag(){let t=Oe.get().gaMeasurementID;if(!(!t||!window.gtag))return new Promise(e=>{window.gtag("get",t,"client_id",r=>{e(r)})})}},rc=class Rd{static INSTANCE;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Rd),this.INSTANCE}init(){Bo.get(ie.APP_CONFIG,{}).then(e=>this.updateGlobalConfig(e))}async processAppConfigurations(e){b.log("Received app configuration",e),e.currencyCount=e.currencies?.length;let r=this.updateGlobalConfig(e);Bo.set(ie.APP_CONFIG,r).catch(n=>b.error(n)),tc.processConfiguration(),r.website&&(ut.injectRawScript(r.website.commonJS),ut.injectRawCSS(r.website.commonCSS)),Ze.get().onToggle().subscribe(async({open:n})=>{b.info("Cart drawer is now",n?"open":"closed"),n&&(ue.get(ar).loadOrRenderWidgetsAfterCartChange(),await this.trackViewCartEvent())})}updateGlobalConfig(e){let r=Se.globalRef.config.update(e);return Ze.forceUpdate(),b.debug("App configurations",r),r}async trackViewCartEvent(){let e=await ge.getCurrent().getNormalisedCart(),r={value:e.amount,currency:e.currency},n={items:e.items,amount:r,drawer:!0};pe.getInstance().sendEvent(new ve(A.EVENT_VIEW_CART,n))}},gd=Qt(Sl()),nc=class Zu{static META_REQUIRED_FIELDS=["ad_id","campaign_id","fbclid"];static GOOGLE_REQUIRED_FIELDS=["gad_source","gclid"];source;adID;campaignID;adName;campaignName;constructor(e){this.adID=e.adID,this.campaignID=e.campaignID,this.source=e.source}static getAdParams(){let e;try{e=new gd.URLBuilder(location.href)}catch{return{}}let r={};if(this.META_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return r={source:"META",adID:e.getQueryParam("ad_id")?.trim(),campaignID:e.getQueryParam("campaign_id")?.trim()},new Zu(r);if(this.GOOGLE_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return r={source:"GOOGLE"},new Zu(r)}},Pn=class Ld{static INSTANCE=new Ld;httpAPIService=mt.getInstance();coreService=rc.getInstance();sentryService=ke.getInstance();sdkToken="";userID="";deviceID="";appID="";shopifyShop="";constructor(){}static getInstance(){return this.INSTANCE}init(e){this.appID=e.appID,this.shopifyShop=e.shopifyShop}async storeAndPopulateAuthData(e){e&&(e.userID&&(this.userID=e.userID,await Ne.set(ie.ID,e.userID)),e.deviceID&&(this.deviceID=e.deviceID,await Ne.set(ie.DEVICE_ID,e.deviceID)),e.sdkToken&&(this.sdkToken=e.sdkToken,await Ne.set(ie.SDK_TOKEN,e.sdkToken)),this.updateAPIClient())}async validateSession(e){await this.populateFirstSeen(),await this.populateUserDataFromStorage(),b.log("Validating session with server");let r=await this.getSessionValidateData(e);try{let n=await this.httpAPIService.validateSession(r);b.log("Validating session Response",n),await this.coreService.processAppConfigurations(n.appSettings),await this.storeAndPopulateAuthData(n)}catch(n){throw b.error(n),n}}async populateUserDataFromStorage(){if(this.sdkToken=await Ne.get(ie.SDK_TOKEN),!this.sdkToken){b.warn("No SDK token found in local storage");return}this.userID=await Ne.get(ie.ID),this.deviceID=await Ne.get(ie.DEVICE_ID),this.updateAPIClient()}updateAPIClient(){b.debug("SDK Token:",this.sdkToken),b.log("Device ID:",this.deviceID),b.log("User ID:",this.userID),Di.trackDeviceID(this.deviceID),Jt.prepend(`Device ID: <strong>${this.deviceID}</strong>`),this.httpAPIService.setAPIToken(this.sdkToken),this.sentryService.setGlobalContext("Visitor Info",{device_id:this.deviceID,user_id:this.userID}),this.sentryService.setUser({id:this.deviceID})}async getSessionValidateData(e){let r=await new Ha().get();r.host=location.origin;try{(await md())?.isPrivate&&(r.private=!0)}catch(i){yd.default.error("Unable to detect private/incognito window",i)}let n=await Ne.get(ie.DEVICE_ID);return n||(n=new Je().toHexString(),await Ne.set(ie.DEVICE_ID,n)),Z(w({deviceID:n,deviceProps:r,appID:this.appID,shopifyShop:this.shopifyShop},e),{sdk:A.SDK,page:_r.parseFromCurrent(),ad:nc.getAdParams(),occurred:this.getSessionStartTime(le.get().jsLoadTime),currentItem:le.get().getCurrentItem(),cart:await ge.getCurrent().getNormalisedCart(),properties:{}})}async populateFirstSeen(){let e=await Ne.get(ie.FIRST_SEEN),r=e?new Date(e):new Date;e||await Ne.set(ie.FIRST_SEEN,r.toISOString()),this.httpAPIService.setFirstSeen(r),this.sentryService.setGlobalContext("Visitor Info",{first_seen:r.toISOString()})}getSessionStartTime(e){return(new Date().getTime()-e.getTime())/1e3>A.IDLE_TIME_IN_SECONDS?new Date:e}},it=class wc{static replaySubject=new ho(1);static INSTANCE;sentryService=ue.get(ke);lock=new Jn;constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new wc),this.INSTANCE}init(e){if(b.debug("Initialising SDK",e),zf(navigator.userAgent)){b.info("This seems to be a bot. Disabling SDK");return}Pn.getInstance().init(e),wc.INSTANCE.checkForNewSession(!0).then(async()=>{wc.replaySubject.next(!0),wc.replaySubject.complete()}).catch(r=>b.error("Unable to perform device init",r))}getCurrentSessionID(){return et.set(ie.SESSION_LAST_USED_TIME,new Date().getTime()),et.get(ie.ID,"")}async checkSessionAndGetContext(){return await this.checkForNewSession(),this.getContext()}async getContext(){let e=await Promise.all([this.getCurrentSessionID(),this.getCurrentSessionNumber(),this.getLandingPage()]);return this.sentryService.setGlobalContext("Visitor Session",{id:e[0],number:e[1],landing_page:e[2]}),e}async checkForNewSession(e){await this.lock.acquire();let r=!1;if(await this.isNewSessionRequired()?(await this.startNewSession(),e=!0,r=!0):await this.notSynced()&&(r=!0),e){let n=await this.getContext();await Pn.getInstance().validateSession({sessionID:n[0],sessionNumber:n[1],landingPage:n[2],newSession:r}),await et.set(ie.SESSION_SYNCED,!0)}this.lock.release()}async startNewSession(){b.debug("Starting new session"),await et.clear(),b.debug("Cleared SessionStorage before starting new session");let e=new Date,r=new Je().toHexString();b.debug("New session ID to be used",r);let n=await Ne.get(ie.SESSION_NUMBER,0)+1;Jt.prepend(`New Session ID: <strong>${r}</strong> & number: ${n}`),await Promise.all([Ne.set(ie.SESSION_NUMBER,n),et.set(ie.ID,r),et.set(ie.SESSION_LAST_USED_TIME,e.getTime()),et.set(ie.SESSION_LANDING_PAGE,_r.parseFromCurrent())])}getLandingPage(){return et.get(ie.SESSION_LANDING_PAGE,{})}getCurrentSessionNumber(){return Ne.get(ie.SESSION_NUMBER,1)}async isNewSessionRequired(){if(!await et.get(ie.ID))return!0;let e=await et.get(ie.SESSION_LAST_USED_TIME,0);return e?(new Date().getTime()-e)/1e3>A.IDLE_TIME_IN_SECONDS:!0}async notSynced(){return!await et.get(ie.SESSION_SYNCED,!1)}},_d=Qt(tn()),vd=Qt(tn()),Q_=`
|
|
38
|
+
Url: ${Aa(t)}`),!0)}function wv(t,e){return t.type||!e||!e.length?!1:xv(t).some(r=>wi(r,e))}function bv(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?wi(r,e):!1}function Iv(t,e){if(!e||!e.length)return!1;let r=Aa(t);return r?wi(r,e):!1}function Tv(t,e){if(!e||!e.length)return!0;let r=Aa(t);return r?wi(r,e):!0}function xv(t){let e=[];t.message&&e.push(t.message);let r;try{r=t.exception.values[t.exception.values.length-1]}catch{}return r&&r.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`)),e}function Cv(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Dv(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Aa(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Dv(e):null}catch{return Ce&&q.error(`Cannot extract url for event ${ir(t)}`),null}}function Rv(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}var Nv="Dedupe",Av=()=>{let t;return{name:Nv,processEvent(e){if(e.type)return e;try{if(Ov(e,t))return Ce&&q.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Pa=Av;function Ov(t,e){return e?!!(Pv(t,e)||Lv(t,e)):!1}function Pv(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Vm(t,e)||!Gm(t,e))}function Lv(t,e){let r=Wm(e),n=Wm(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Vm(t,e)||!Gm(t,e))}function Gm(t,e){let r=ua(t),n=ua(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let s=n[i],o=r[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function Vm(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Wm(t){return t.exception&&t.exception.values&&t.exception.values[0]}var Ge=ee,Cu=0;function Du(){return Cu>0}function Yv(){Cu++,setTimeout(()=>{Cu--})}function Rn(t,e={},r){if(typeof t!="function")return t;try{let i=t.__sentry_wrapped__;if(i)return i;if(In(t))return t}catch{return t}let n=function(){let i=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let s=i.map(o=>Rn(o,e));return t.apply(this,s)}catch(s){throw Yv(),Ta(o=>{o.addEventProcessor(l=>(e.mechanism&&(xi(l,void 0,void 0),Br(l,e.mechanism)),l.extra=Z(w({},l.extra),{arguments:i}),l)),Da(s)}),s}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}aa(n,t),St(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}var Mr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function La(t,e){let r=Au(t,e),n={type:e&&e.name,value:Qv(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function qv(t,e,r,n){let i=Me(),s=i&&i.getOptions().normalizeDepth,o=t_(e),l={__serialized__:ga(e,s)};if(o)return{exception:{values:[La(t,o)]},extra:l};let u={exception:{values:[{type:bn(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:Zv(e,{isUnhandledRejection:n})}]},extra:l};if(r){let f=Au(t,r);f.length&&(u.exception.values[0].stacktrace={frames:f})}return u}function Ru(t,e){return{exception:{values:[La(t,e)]}}}function Au(t,e){let r=e.stacktrace||e.stack||"",n=Jv(e),i=Xv(e);try{return t(r,n,i)}catch{}return[]}var Kv=/Minified React error #\d+;/i;function Jv(t){return t&&Kv.test(t.message)?1:0}function Xv(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Qv(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Km(t,e,r,n){let i=r&&r.syntheticException||void 0,s=Ba(t,e,i,n);return Br(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),qt(s)}function Jm(t,e,r="info",n,i){let s=n&&n.syntheticException||void 0,o=Nu(t,e,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),qt(o)}function Ba(t,e,r,n,i){let s;if(na(e)&&e.error)return Ru(t,e.error);if(ia(e)||Al(e)){let o=e;if("stack"in e)s=Ru(t,e);else{let l=o.name||(ia(o)?"DOMError":"DOMException"),u=o.message?`${l}: ${o.message}`:l;s=Nu(t,u,r,n),xi(s,u)}return"code"in o&&(s.tags=Z(w({},s.tags),{"DOMException.code":`${o.code}`})),s}return Sn(e)?Ru(t,e):nr(e)||bn(e)?(s=qv(t,e,r,i),Br(s,{synthetic:!0}),s):(s=Nu(t,e,r,n),xi(s,`${e}`,void 0),Br(s,{synthetic:!0}),s)}function Nu(t,e,r,n){let i={};if(n&&r){let s=Au(t,r);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(Si(e)){let{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function Zv(t,{isUnhandledRejection:e}){let r=jl(t),n=e?"promise rejection":"exception";return na(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:bn(t)?`Event \`${e_(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function e_(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function t_(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}function Xm(t,{metadata:e,tunnel:r,dsn:n}){let i=w(w({event_id:t.event_id,sent_at:new Date().toISOString()},e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}}),!!r&&!!n&&{dsn:br(n)}),s=r_(t);return xr(i,[s])}function r_(t){return[{type:"user_report"},t]}var Ao=class extends No{constructor(t){let e=w({parentSpanIsAlwaysRootSpan:!0},t),r=Ge.SENTRY_SDK_SOURCE||Ql();xu(e,"browser",["browser"],r),super(e),e.sendClientReports&&Ge.document&&Ge.document.addEventListener("visibilitychange",()=>{Ge.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,e){return Km(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",r){return Jm(this._options.stackParser,t,e,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){Mr&&q.warn("SDK not enabled, will not capture user feedback.");return}let e=Xm(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(e)}_prepareEvent(t,e,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,e,r)}_flushOutcomes(){let t=this._clearOutcomes();if(t.length===0){Mr&&q.log("No outcomes to send");return}if(!this._dsn){Mr&&q.log("No dsn provided, will not send outcomes");return}Mr&&q.log("Sending outcomes:",t);let e=cu(t,this._options.tunnel&&br(this._dsn));this.sendEnvelope(e)}},Qm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ye=ee,n_=1e3,Zm,Ou,Pu;function Lu(t){let e="dom";wt(e,t),bt(e,i_)}function i_(){if(!Ye.document)return;let t=Qe.bind(null,"dom"),e=ed(t,!0);Ye.document.addEventListener("click",e,!1),Ye.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let n=Ye[r]&&Ye[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Le(n,"addEventListener",function(i){return function(s,o,l){if(s==="click"||s=="keypress")try{let u=this,f=u.__sentry_instrumentation_handlers__=u.__sentry_instrumentation_handlers__||{},m=f[s]=f[s]||{refCount:0};if(!m.handler){let h=ed(t);m.handler=h,i.call(this,s,h,l)}m.refCount++}catch{}return i.call(this,s,o,l)}}),Le(n,"removeEventListener",function(i){return function(s,o,l){if(s==="click"||s=="keypress")try{let u=this,f=u.__sentry_instrumentation_handlers__||{},m=f[s];m&&(m.refCount--,m.refCount<=0&&(i.call(this,s,m.handler,l),m.handler=void 0,delete f[s]),Object.keys(f).length===0&&delete u.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,l)}}))})}function o_(t){if(t.type!==Ou)return!1;try{if(!t.target||t.target._sentryId!==Pu)return!1}catch{}return!0}function s_(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function ed(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=a_(r);if(s_(r.type,n))return;St(r,"_sentryCaptured",!0),n&&!n._sentryId&&St(n,"_sentryId",nt());let i=r.type==="keypress"?"input":r.type;o_(r)||(t({event:r,name:i,global:e}),Ou=r.type,Pu=n?n._sentryId:void 0),clearTimeout(Zm),Zm=Ye.setTimeout(()=>{Pu=void 0,Ou=void 0},n_)}}function a_(t){try{return t.target}catch{return null}}var Ua;function Bu(t){let e="history";wt(e,t),bt(e,c_)}function c_(){if(!pu())return;let t=Ye.onpopstate;Ye.onpopstate=function(...r){let n=Ye.location.href,i=Ua;if(Ua=n,Qe("history",{from:i,to:n}),t)try{return t.apply(this,r)}catch{}};function e(r){return function(...n){let i=n.length>2?n[2]:void 0;if(i){let s=Ua,o=String(i);Ua=o,Qe("history",{from:s,to:o})}return r.apply(this,n)}}Le(Ye.history,"pushState",e),Le(Ye.history,"replaceState",e)}var Ma={};function Uu(t){let e=Ma[t];if(e)return e;let r=Ye[t];if(wo(r))return Ma[t]=r.bind(Ye);let n=Ye.document;if(n&&typeof n.createElement=="function")try{let i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);let s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch(i){Qm&&q.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return r&&(Ma[t]=r.bind(Ye))}function ka(t){Ma[t]=void 0}var Nn="__sentry_xhr_v3__";function Mu(t){let e="xhr";wt(e,t),bt(e,l_)}function l_(){if(!Ye.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;Le(t,"open",function(e){return function(...r){let n=Bt()*1e3,i=Et(r[0])?r[0].toUpperCase():void 0,s=u_(r[1]);if(!i||!s)return e.apply(this,r);this[Nn]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let l=this[Nn];if(l&&this.readyState===4){try{l.status_code=this.status}catch{}let u={endTimestamp:Bt()*1e3,startTimestamp:n,xhr:this};Qe("xhr",u)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Le(this,"onreadystatechange",function(l){return function(...u){return o(),l.apply(this,u)}}):this.addEventListener("readystatechange",o),Le(this,"setRequestHeader",function(l){return function(...u){let[f,m]=u,h=this[Nn];return h&&Et(f)&&Et(m)&&(h.request_headers[f.toLowerCase()]=m),l.apply(this,u)}}),e.apply(this,r)}}),Le(t,"send",function(e){return function(...r){let n=this[Nn];if(!n)return e.apply(this,r);r[0]!==void 0&&(n.body=r[0]);let i={startTimestamp:Bt()*1e3,xhr:this};return Qe("xhr",i),e.apply(this,r)}})}function u_(t){if(Et(t))return t;try{return t.toString()}catch{}}function ku(t,e=Uu("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let l=w({body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return ka("fetch"),Jr("No fetch implementation available");try{return e(t.url,l).then(u=>(r-=o,n--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return ka("fetch"),r-=o,n--,Jr(u)}}return Ra(t,i)}var p_=30,f_=50;function Fu(t,e,r,n){let i={filename:t,function:e==="<anonymous>"?Ir:e,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var m_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,d_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h_=/\((\S*)(?::(\d+))(?::(\d+))\)/,g_=t=>{let e=m_.exec(t);if(e){let[,n,i,s]=e;return Fu(n,Ir,+i,+s)}let r=d_.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=h_.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=id(r[1]||Ir,r[2]);return Fu(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},td=[p_,g_],y_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,v_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,__=t=>{let e=y_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=v_.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],n=e[1]||Ir;return[n,r]=id(n,r),Fu(r,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},rd=[f_,__],nd=[td,rd],Hu=Gl(...nd),id=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:Ir,r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Fa=1024,S_="Breadcrumbs",w_=(t={})=>{let e=w({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:S_,setup(r){e.console&&Vl(T_(r)),e.dom&&Lu(I_(r,e.dom)),e.xhr&&Mu(x_(r)),e.fetch&&Kl(C_(r)),e.history&&Bu(D_(r)),e.sentry&&r.on("beforeSendEvent",b_(r))}}},od=w_;function b_(t){return function(e){Me()===t&&Cr({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:ir(e)},{event:e})}}function I_(t,e){return function(r){if(Me()!==t)return;let n,i,s=typeof e=="object"?e.serializeAttribute:void 0,o=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;o&&o>Fa&&(Mr&&q.warn(`\`dom.maxStringLength\` cannot exceed ${Fa}, but a value of ${o} was configured. Sentry will use ${Fa} instead.`),o=Fa),typeof s=="string"&&(s=[s]);try{let u=r.event,f=R_(u)?u.target:u;n=Eo(f,{keyAttrs:s,maxStringLength:o}),i=Fl(f)}catch{n="<unknown>"}if(n.length===0)return;let l={category:`ui.${r.name}`,message:n};i&&(l.data={"ui.component_name":i}),Cr(l,{event:r.event,name:r.name,global:r.global})}}function T_(t){return function(e){if(Me()!==t)return;let r={category:"console",data:{arguments:e.args,logger:"console"},level:tu(e.level),message:oa(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)r.message=`Assertion failed: ${oa(e.args.slice(1)," ")||"console.assert"}`,r.data.arguments=e.args.slice(1);else return;Cr(r,{input:e.args,level:e.level})}}function x_(t){return function(e){if(Me()!==t)return;let{startTimestamp:r,endTimestamp:n}=e,i=e.xhr[Nn];if(!r||!n||!i)return;let{method:s,url:o,status_code:l,body:u}=i,f={method:s,url:o,status_code:l},m={xhr:e.xhr,input:u,startTimestamp:r,endTimestamp:n};Cr({category:"xhr",data:f,type:"http"},m)}}function C_(t){return function(e){if(Me()!==t)return;let{startTimestamp:r,endTimestamp:n}=e;if(n&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){let i=e.fetchData,s={data:e.error,input:e.args,startTimestamp:r,endTimestamp:n};Cr({category:"fetch",data:i,level:"error",type:"http"},s)}else{let i=e.response,s=Z(w({},e.fetchData),{status_code:i&&i.status}),o={input:e.args,response:i,startTimestamp:r,endTimestamp:n};Cr({category:"fetch",data:s,type:"http"},o)}}}function D_(t){return function(e){if(Me()!==t)return;let r=e.from,n=e.to,i=Io(Ge.location.href),s=r?Io(r):void 0,o=Io(n);(!s||!s.path)&&(s=i),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),Cr({category:"navigation",data:{from:r,to:n}})}}function R_(t){return!!t&&!!t.target}var N_=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],A_="BrowserApiErrors",O_=(t={})=>{let e=w({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t);return{name:A_,setupOnce(){e.setTimeout&&Le(Ge,"setTimeout",sd),e.setInterval&&Le(Ge,"setInterval",sd),e.requestAnimationFrame&&Le(Ge,"requestAnimationFrame",P_),e.XMLHttpRequest&&"XMLHttpRequest"in Ge&&Le(XMLHttpRequest.prototype,"send",L_);let r=e.eventTarget;r&&(Array.isArray(r)?r:N_).forEach(B_)}}},ad=O_;function sd(t){return function(...e){let r=e[0];return e[0]=Rn(r,{mechanism:{data:{function:Yt(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function P_(t){return function(e){return t.apply(this,[Rn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Yt(t)},handled:!1,type:"instrument"}})])}}function L_(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Le(r,n,function(i){let s={mechanism:{data:{function:n,handler:Yt(i)},handled:!1,type:"instrument"}},o=In(i);return o&&(s.mechanism.data.handler=Yt(o)),Rn(i,s)})}),t.apply(this,e)}}function B_(t){let e=Ge,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Le(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Rn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Yt(s),target:t},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,Rn(s,{mechanism:{data:{function:"addEventListener",handler:Yt(s),target:t},handled:!1,type:"instrument"}}),o])}}),Le(r,"removeEventListener",function(n){return function(i,s,o){let l=s;try{let u=l&&l.__sentry_wrapped__;u&&n.call(this,i,u,o)}catch{}return n.call(this,i,l,o)}}))}var U_="GlobalHandlers",M_=(t={})=>{let e=w({onerror:!0,onunhandledrejection:!0},t);return{name:U_,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&(k_(r),cd("onerror")),e.onunhandledrejection&&(F_(r),cd("onunhandledrejection"))}}},ld=M_;function k_(t){Jl(e=>{let{stackParser:r,attachStacktrace:n}=ud();if(Me()!==t||Du())return;let{msg:i,url:s,line:o,column:l,error:u}=e,f=j_(Ba(r,u||i,void 0,n,!1),s,o,l);f.level="error",Ro(f,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function F_(t){Xl(e=>{let{stackParser:r,attachStacktrace:n}=ud();if(Me()!==t||Du())return;let i=H_(e),s=wn(i)?$_(i):Ba(r,i,void 0,n,!0);s.level="error",Ro(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function H_(t){if(wn(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function $_(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function j_(t,e,r,n){let i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},l=o.stacktrace=o.stacktrace||{},u=l.frames=l.frames||[],f=isNaN(parseInt(n,10))?void 0:n,m=isNaN(parseInt(r,10))?void 0:r,h=Et(e)&&e.length>0?e:kl();return u.length===0&&u.push({colno:f,filename:h,function:Ir,in_app:!0,lineno:m}),t}function cd(t){Mr&&q.log(`Global Handler attached: ${t}`)}function ud(){let t=Me();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var pd=()=>({name:"HttpContext",preprocessEvent(t){if(!Ge.navigator&&!Ge.location&&!Ge.document)return;let e=t.request&&t.request.url||Ge.location&&Ge.location.href,{referrer:r}=Ge.document||{},{userAgent:n}=Ge.navigator||{},i=w(w(w({},t.request&&t.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=Z(w(w({},t.request),e&&{url:e}),{headers:i});t.request=s}}),W_="cause",G_=5,V_="LinkedErrors",z_=(t={})=>{let e=t.limit||G_,r=t.key||W_;return{name:V_,preprocessEvent(n,i,s){let o=s.getOptions();Ul(La,o.stackParser,o.maxValueLength,r,e,n,i)}}},fd=z_;function $u(t){return[Oa(),Na(),ad(),od(),ld(),fd(),Pa(),pd()]}var ju=class extends Error{cause;constructor(t,e){super(t),this.cause=e}},ke=class Td{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Td),this.INSTANCE}captureException(e,r,n){b.error(e),this.getNewScope(r,n).captureException(e)}captureMessage(e,r,n,i){this.getNewScope(n,i).captureMessage(e,r??"error")}captureError(e,r,n,i){b.error(e,r);let s=this.getNewScope(n,i),o=new ju(e,r);s.captureException(o)}setGlobalContext(e,r){this.contexts[e]=w({context:r},this.contexts[e])}setUser(e){this.user=e}setTags(e){this.tags=e}getNewScope(e,r){let n=new ft;if(n.setClient(this.client),n.setUser(this.user),e?.triggerContext){let i=e.triggerContext;n.setExtras(i.triggerData.sentryContext()),delete e.triggerContext}return e&&n.setExtras(e),this.tags&&n.setTags(this.tags),r&&n.setTags(r),Object.keys(this.contexts).forEach(i=>{n.setContext(i,this.contexts[i])}),n.setTag("language",navigator.language),n.setTag("timezone",ne.getTimezone()),n}init(){let e=$u({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new Ao({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:ku,stackParser:Hu,integrations:e,environment:Zt.mode,release:`web-sdk@${A.SDK_VERSION}`,debug:Zt.debug}),this.client.init()}},Wu={d:(t,e)=>{for(var r in e)Wu.o(e,r)&&!Wu.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Gu={};Wu.d(Gu,{A:()=>K_,k:()=>Vu});var Y_=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(f){try{u(n.next(f))}catch(m){s(m)}}function l(f){try{u(n.throw(f))}catch(m){s(m)}}function u(f){var m;f.done?i(f.value):(m=f.value,m instanceof r?m:new r(function(h){h(m)})).then(o,l)}u((n=n.apply(t,e||[])).next())})},q_=function(t,e){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(u){return function(f){return function(m){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,m[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&m[0]?n.return:m[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,m[1])).done)return i;switch(n=0,i&&(m=[2&m[0],i.value]),m[0]){case 0:case 1:i=m;break;case 4:return o.label++,{value:m[1],done:!1};case 5:o.label++,n=m[1],m=[0];continue;case 7:m=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||m[0]!==6&&m[0]!==2)){o=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){o.label=m[1];break}if(m[0]===6&&o.label<i[1]){o.label=i[1],i=m;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(m);break}i[2]&&o.ops.pop(),o.trys.pop();continue}m=e.call(t,o)}catch(h){m=[6,h],n=0}finally{r=i=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}([u,f])}}};function Vu(){return Y_(this,void 0,Promise,function(){return q_(this,function(_a){switch(_a.label){case 0:return[4,new Promise(function(resolve,reject){var browserName="Unknown";function __callback(t){resolve({isPrivate:t,browserName})}function identifyChromium(){var t=navigator.userAgent;return t.match(/Chrome/)?navigator.brave!==void 0?"Brave":t.match(/Edg/)?"Edge":t.match(/OPR/)?"Opera":"Chrome":"Chromium"}function assertEvalToString(t){return t===eval.toString().length}function feid(){var toFixedEngineID=0;try{eval("(-1).toFixed(-1);")}catch(t){toFixedEngineID=t.message.length}return toFixedEngineID}function isSafari(){return feid()===44}function isChrome(){return feid()===51}function isFirefox(){return feid()===25}function isMSIE(){return navigator.msSaveBlob!==void 0&&assertEvalToString(39)}function newSafariTest(){var t=String(Math.random());try{window.indexedDB.open(t,1).onupgradeneeded=function(e){var r,n,i=(r=e.target)===null||r===void 0?void 0:r.result;try{i.createObjectStore("test",{autoIncrement:!0}).put(new Blob),__callback(!1)}catch(o){var s=o;return o instanceof Error&&(s=(n=o.message)!==null&&n!==void 0?n:o),typeof s!="string"?void __callback(!1):void __callback(s.includes("BlobURLs are not yet supported"))}finally{i.close(),window.indexedDB.deleteDatabase(t)}}}catch{__callback(!1)}}function oldSafariTest(){var t=window.openDatabase,e=window.localStorage;try{t(null,null,null,null)}catch{return void __callback(!0)}try{e.setItem("test","1"),e.removeItem("test")}catch{return void __callback(!0)}__callback(!1)}function safariPrivateTest(){navigator.maxTouchPoints!==void 0?newSafariTest():oldSafariTest()}function getQuotaLimit(){var t=window;return t.performance!==void 0&&t.performance.memory!==void 0&&t.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function storageQuotaChromePrivateTest(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(t,e){__callback(Math.round(e/1048576)<2*Math.round(getQuotaLimit()/1048576))},function(t){reject(new Error("detectIncognito somehow failed to query storage quota: "+t.message))})}function oldChromePrivateTest(){(0,window.webkitRequestFileSystem)(0,1,function(){__callback(!1)},function(){__callback(!0)})}function chromePrivateTest(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?storageQuotaChromePrivateTest():oldChromePrivateTest()}function firefoxPrivateTest(){__callback(navigator.serviceWorker===void 0)}function msiePrivateTest(){__callback(window.indexedDB===void 0)}function main(){isSafari()?(browserName="Safari",safariPrivateTest()):isChrome()?(browserName=identifyChromium(),chromePrivateTest()):isFirefox()?(browserName="Firefox",firefoxPrivateTest()):isMSIE()?(browserName="Internet Explorer",msiePrivateTest()):reject(new Error("detectIncognito cannot determine the browser"))}main()})];case 1:return[2,_a.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Vu);var K_=Vu,md=Gu.A,VL=Gu.k,yd=Qt(tn()),Ha=class{parser;result={};constructor(){this.parser=At.get().getUAParser()}async get(){let t=this.result;return this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),await this.getBatteryInfo(),await this.getLocation(),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},t.navigatorUA=navigator.userAgent,t.isHeadless=navigator.webdriver,t}getDeviceMemory(){let t=navigator;if(!t.deviceMemory)return;let e=t.deviceMemory;this.result.mem={tot:e*1024}}getNetworkType(){let t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;e?.effectiveType&&(this.result.net={type:e.effectiveType})}getOrientation(){let t=screen.orientation?.type;t&&(this.result.orientation=t)}getDPI(){let t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);let e=window.devicePixelRatio||1,r=t.offsetWidth*e;return document.body.removeChild(t),r}async getLocation(){if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:"geolocation"})).state!="granted"))return new Promise(t=>{navigator.geolocation.getCurrentPosition(e=>{this.result.coords=[e.coords.latitude,e.coords.longitude],t()},()=>t())})}async getBatteryInfo(){if("getBattery"in navigator)try{let t=await navigator.getBattery();this.result.bat={l:t.level*100,c:t.charging}}catch{}}},Di=class{static trackDeviceID(t){this.isInstalled()}static trackIntent(t){if(!this.isInstalled())return;let e=cn[t]?.toLowerCase();e&&(b.debug(`Sending ${e} intent to MS Clarity`),window.clarity("set","Cooee Intent",e))}static isInstalled(){return window.clarity&&typeof window.clarity=="function"}},Ri=class{constructor(t,e){this._startTime=t,this._triggerData=e}intervals=[];selectedEmbeddedItems;renderer;closeCallback;inputFields=[];get startTime(){return this._startTime}get triggerData(){return this._triggerData}get inputs(){return this.inputFields}get rootClassName(){let t=this.triggerData.shortID??this.triggerData.id.slice(-6);return t==="test"&&(t="test-"+this.startTime.getTime().toString()),A.IN_APP_WRAPPER_NAME+"-"+t}get selectedItems(){return this.triggerData.items.filter(t=>t.selected.value)}get shouldGiveFBTDiscount(){let t=this.selectedItems.length;return this.triggerData.bundleConfig?.applyDiscountOnMinimum?this.triggerData.bundleConfig.applyDiscountOnMinimum<=t:t===this.triggerData.items.length}onClose(t){this.closeCallback=t}closeInApp(t,e){e??={};let r=(new Date().getTime()-this.startTime.getTime())/1e3,n=w({eventName:t,duration:r},e);this.stopIntervals(),this.closeCallback&&this.closeCallback(n)}addInputField(t,e){this.inputFields.push({id:t,type:e,isValid:!1})}updateValidation(t,e){this.inputFields.forEach(r=>{if(r.id===t){r.isValid=e;return}})}hasManipulatedProductQuantity(){let t=this.triggerData.manipulation.productQuantity;return t.enabled&&t.min!=null&&t.max!=null}getManipulatedQuantity(t){let{min:e=1,max:r=100}=this.triggerData.manipulation.productQuantity;if(e>r)return b.error("Invalid range: min should be less than or equal to max."),t;if(t>=e&&t<=r)return t;let n=t%100;return n<e?e:n>r?r:n}stopIntervals(){this.intervals.forEach(t=>clearInterval(t))}},$a=class{loadedFonts=[];async loadAllFonts(t){t.elems?.forEach(e=>{e instanceof hr&&this.loadFamily(e.typography?.fam)})}async loadFamily(t){if(!t?.fonts||this.loadedFonts.indexOf(t.name)>-1)return;let e=[];t.fonts.forEach(r=>{if(r.url){let n=new FontFace(A.COOEE+t.name,r.getURL(),r.getFontDescriptor());e.push(n.load())}}),this.loadedFonts.push(t.name),(await Promise.all(e)).forEach(r=>{document.fonts.add(r)})}},ja=class{static updateIdentity(t){if(!this.isInstalled())return;let e={};t.email&&(e.email=t.email),t.mobile&&(e.phone_number=t.mobile),b.debug("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",e])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}},Wa=class{apiService;action;triggerContext;constructor(t,e){this.action=t,this.apiService=pe.getInstance(),this.triggerContext=e}async execute(){let t=this.containsCTA()?A.EVENT_TRIGGER_CLICKED:A.EVENT_TRIGGER_CLOSED;switch(this.action.at!==106&&this.closeTriggerAndSendEvent(t),this.action.at){case 2:break;case 4:this.gotoURLAction();break;case 5:this.shareAction();break;case 106:this.collectFormData();break;case void 0:case 105:break;default:b.error("Received an invalid ClickActionType: ",this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,"_blank")?.focus()}gotoURLAction(){if(this.action.gu?.u){let t=this.action.gu.u;ne.isValidURL(t)||(t=`//${t}`),window.open(t,"_self")}}prompt(){let t=this.action.pmpt;t&&(t===2&&this.promptLocationPermission(),t===3&&this.promptPushNotificationPermission(),t===1&&this.promptCameraPermission())}closeTriggerAndSendEvent(t,e){this.triggerContext.closeInApp(t,e),this.dispatchEvent()}shareAction(){if(this.action.share){if(!navigator.share){b.warn("Navigator.share is not compatible with this browser");return}navigator.share({text:this.action.share.text,title:"Share"}).then(t=>console.log(t)).catch(t=>console.error(t))}}containsCTA(){return this.action.at&&this.action.at!==1?!0:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(t){return t?Object.keys(t).length===0:!0}promptLocationPermission(){!navigator.geolocation||!navigator.permissions||navigator.geolocation.getCurrentPosition(t=>{this.apiService.updateDeviceProps({coords:[t.coords.latitude,t.coords.longitude]}),this.sendPermissionData()})}promptPushNotificationPermission(){if(!("Notification"in window)){b.warn("This browser does not support desktop notification");return}if(Notification.permission!=="default"){this.apiService.updateDeviceProps({pnPerm:Notification.permission});return}Notification.requestPermission().then(()=>{this.sendPermissionData()})}promptCameraPermission(){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally(()=>{this.sendPermissionData()})}checkPermission(t){return navigator.permissions.query({name:t}).then(e=>e.state.toString())}async checkAllPermission(){let t=await this.checkPermission("camera"),e=await this.checkPermission("geolocation"),r=Notification.permission;return{camera:t,location:e,notification:r}}sendPermissionData(){this.checkAllPermission().then(t=>{this.apiService.updateDeviceProps({perm:t})})}collectFormData(){let t={};for(let e of this.triggerContext.inputs){if(!e.isValid)return;let r=document.getElementById(e.id).value;e.type===51?t.email=r:e.type===52&&(t.mobile=r)}this.closeTriggerAndSendEvent(A.EVENT_FORM_SUBMITTED,{form:t}),ne.showSnackbar("Coupon applied on cart"),ja.updateIdentity(t)}dispatchEvent(){let t=this.triggerContext.triggerData,e={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??t.embeddedItems??t.items,collections:t.collections,triggerData:t};document.dispatchEvent(new CustomEvent(A.CTA_EVENT,{detail:e}));let r={action:this.containsCTA()?A.CAMPAIGN_CLICKED_ACTIVITY:A.CAMPAIGN_CLOSED_ACTIVITY};document.dispatchEvent(new CustomEvent(A.POPUP_ACTIVITY_EVENT,{detail:r}))}},Ni=class{constructor(t){this.scalingFactor=t}getLayoutStyles(t){if(!t)return{display:"block"};let e={display:t.disp};return t.of&&(e.objectFit=t.of),t.pos==="absolute"&&(e.width="auto !important",e.position="absolute",e.right=t.right+"px",e.left=t.left+"px",e.top=t.top+"px",e.bottom=t.bottom+"px"),e}getSizeStyles(t){let e={};return t?.w&&(e.width=t.w),t?.h&&(e.height=t.h),t?.maxW&&(e.maxWidth=t.maxW),t?.maxH&&(e.maxHeight=t.maxH),t?.minW&&(e.minWidth=t.minW),t?.minH&&(e.minHeight=t.minH),e}getBorderStyles(t){if(!t)return{};let e={};return t.radius&&t.radius>0&&(e.borderRadius=this.getSizePx(t.radius)),t.width&&t.width>0&&(e.borderWidth=this.getSizePx(t.width),e.borderStyle=t.style?.toLowerCase(),t.color?this.getColourStyles(t.color,"border-color",e):e.borderColor="black"),e}getFlexStyles(t){return t?{gap:t.gap+"px",flexWrap:t.wrap,flexDirection:t.dir,justifyContent:t.jc,alignItems:t.ai,width:"100%"}:{}}getSpaceStyles(t){let e={};return t?(e.paddingTop=this.getSizePx(t.pt),e.paddingBottom=this.getSizePx(t.pb),e.paddingLeft=this.getSizePx(t.pl),e.paddingRight=this.getSizePx(t.pr),e.marginTop=this.getSizePx(t.mt),e.marginBottom=this.getSizePx(t.mb),e.marginLeft=t.cent?"auto":this.getSizePx(t.ml),e.marginRight=t.cent?"auto":this.getSizePx(t.mr),e):(e.margin="0 !important",e.padding="unset",e)}getBackgroundStyles(t){if(!t)return{};let e={};if(t.glossy){let r="backdrop-filter",n="-webkit-"+r,i=`blur(${t.glossy.radius}px)`;if(!CSS.supports(n,i)&&!CSS.supports(r,i))return{background:t.glossy.fallback.rgba};if(e[n]=i,e[r]=i,t.glossy.color)return this.getColourStyles(t.glossy.color,"background",e)}else if(t.solid){if(t.solid.grad)return this.getGradientStyles(t.solid.grad,"background",e);if(t.solid.hex)return{backgroundColor:t.solid.rgba}}else if(t.img){if(!t.img.src)return{};let r=(t.img.a??0)/100;e.background=`linear-gradient(rgba(0, 0, 0, ${r}), rgba(0, 0, 0, ${r})),url("${t.img.src}") no-repeat center`,e.backgroundSize="cover",t.img.a&&(e["-webkit-backdrop-filter"]=`opacity(${t.img.a})`,e.backdropFilter=`opacity(${t.img.a})`)}return e}getGradientStyles(t,e,r){if(r??={},t.type==="LINEAR"){let n=`linear-gradient(${t.ang}deg, ${t.c1}, ${t.c2}`;t.c3&&(n+=`, ${t.c3}`),n+=")",r[e]=n}return r}getColourStyles(t,e="color",r){return r??={},t?t.grad?this.getGradientStyles(t.grad,e,r):(t.hex&&(r[e]=t.rgba),r):r}getSizePx(t){return this.getScaledSize(t)+"px"}getScaledSize(t){return(t??0)*this.scalingFactor}},Kt=class{renderer=At.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(t,e,r){this.parentHTMLEl=t,this.inappElement=e,this.triggerContext=r,this.stylesConverter=new Ni(this.renderer.getScalingFactor())}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let t=Z(w(w(w(w({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:"border-box",outline:"none"});this.renderer.setStyles(this.inappHTMLEl,t)}getDisplayStyles(){return{display:"block"}}processWidthAndHeight(){this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.stylesConverter.getSizePx(this.inappElement.h))}processPositionBlock(){let t={position:"absolute",left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};this.renderer.setStyles(this.inappHTMLEl,t)}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let t=this.inappElement.alpha;if(!isNaN(t)){let e=(t/100).toFixed(2);this.renderer.setStyle(this.inappHTMLEl,"opacity",e)}}processShadow(){let t=this.inappElement.shd;t?this.renderer.setStyle(this.inappHTMLEl,"box-shadow",t.getStyle(this.scalingFactor)):this.renderer.setStyle(this.inappHTMLEl,"box-shadow","unset")}processTransformBlock(){let t=new sn(this.inappElement.trf);t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform",`rotate(${t.rotate}deg)`)}registerAction(){let t=this.inappElement.clc;!t||Object.keys(t).length===0||(this.inappHTMLEl.addEventListener("click",e=>{e.stopPropagation(),new Wa(t,this.triggerContext).execute()}),this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}},Dr=class extends Kt{constructor(t,e,r){super(t,e,r)}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment()}processFontBlock(){let t={},e=this.inappElement.typography;return e&&(t.fontSize=this.stylesConverter.getSizePx(e.fs),t.fontFamily=A.COOEE+e.fam?.name,t.lineHeight=`${e.lh}`,t.letterSpacing=e.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,"color",t),this.renderer.setStyles(this.inappHTMLEl,t),t}processPart(t,e){let 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",e.c??"inherit"),this.renderer.setStyle(t,"font-family","inherit")}processAlignment(){let t=this.inappElement.typography.ta,e=t?Qn[t]?.toLowerCase():this.inappElement.typography.alignment;e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)}},Oo=class extends Dr{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.inappElement.parts?.forEach(t=>{let e=this.renderer.createElement("span");e.innerHTML=t.txt?.toString()?.replace(/\n/g,"<br />"),this.processPart(e,t),this.renderer.appendChild(this.inappHTMLEl,e)}),this.processCommonBlocks()}},Po=class extends Kt{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}},An=class extends Kt{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("img"),this.insertElement()}render(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","none"),this.renderer.setStyle(this.inappHTMLEl,"max-height","none"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()}},Lo=class Cd extends Kt{constructor(e,r,n){super(e,r,n),this.parent=e,this.inappHTMLEl=this.renderer.createElement("div")}static MAX_Z_INDEX="2147483647";render(){return this.parent||this.renderer.removeInApp(this.triggerContext),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(A.IN_APP_WRAPPER_NAME),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),this.renderer.setStyle(this.inappHTMLEl,"z-index",Cd.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let e=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(this.renderer.setStyle(this.inappHTMLEl,"width","100%"),this.renderer.setStyle(this.inappHTMLEl,"height","100%")):(this.renderer.setStyle(this.inappHTMLEl,"width","100vw"),this.renderer.setStyle(this.inappHTMLEl,"height","100vh")),this.renderer.setStyle(this.inappHTMLEl,"top","0"),this.renderer.setStyle(this.inappHTMLEl,"left","0");else{let r=this.inappElement.spc,n=this.stylesConverter.getScaledSize(e.w)+r.getHorizontal(),i=this.stylesConverter.getScaledSize(e.h)+r.getVertical();this.renderer.setStyle(this.inappHTMLEl,"width",n+"px"),this.renderer.setStyle(this.inappHTMLEl,"height",i+"px")}}getSpaceStyles(){return{padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return w(w({display:"flex"},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){if(this.renderer.isParentNotBody()){if(this.triggerContext.triggerData.ian?.isEmbedded()){this.renderer.setStyle(this.inappHTMLEl,"position","block");return}this.renderer.setStyle(this.inappHTMLEl,"position","absolute")}else this.renderer.setStyle(this.inappHTMLEl,"position","fixed")}getBorderStyles(){return{}}processTransparency(){}processTransformBlock(){}processShadow(){}},Va=class extends Kt{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this.renderer.setStyle(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(A.IN_APP_CONTAINER_NAME),this}},Ai=class extends Dr{borderColor="";constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("input"),this.insertElement()}render(){let t=this.setInputType();this.renderer.setAttribute(this.inappHTMLEl,"placeholder",this.inappElement.placeholderText),this.renderer.setStyle(this.inappHTMLEl,"background","#ffffff00"),this.renderer.setStyle(this.inappHTMLEl,"outline","none"),this.inappHTMLEl.addEventListener("click",e=>{e.stopPropagation()}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,t),this.triggerContext.addInputField(t,this.inappElement.t)}},za=class Dd extends Ai{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.renderer.setAttribute(this.inappHTMLEl,"type","email"),this.renderer.setAttribute(this.inappHTMLEl,"id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(Dd.EMAIL_REGEX)?(this.renderer.setStyle(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(this.renderer.setStyle(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}},Ya=class Ad extends Ai{static MOBILE_REGEX=/^\d+$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.renderer.setAttribute(this.inappHTMLEl,"type","tel"),this.renderer.setAttribute(this.inappHTMLEl,"id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(Ad.MOBILE_REGEX)?(this.renderer.setStyle(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(this.renderer.setStyle(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}},qa=class Bn extends Dr{static DAYS="Days";static HOURS="Hours";static MINUTES="Minutes";static SECONDS="Seconds";elements;spans=[];constructor(e,r,n){super(e,r,n),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let e=Z(w(w(w({flex:"1 1 0"},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(e)}getBackgroundStyles(){return{}}processFontBlock(){let e=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),this.addStylesToTimer(e),e}getSpaceStyles(){return{}}getBorderStyles(){return{}}getDisplayStyles(){return{display:"flex",flexWrap:"nowrap",justifyContent:"center"}}addStylesToTimer(e){this.elements.forEach(r=>this.renderer.setStyles(r,e))}addTimerChildren(){let e=this.inappElement.show;this.elements=[],e.day&&this.elements.push(this.getChild(Bn.DAYS)),e.hour&&this.elements.push(this.getChild(Bn.HOURS)),e.minute&&this.elements.push(this.getChild(Bn.MINUTES)),e.second&&this.elements.push(this.getChild(Bn.SECONDS)),this.elements.forEach(r=>this.inappHTMLEl.appendChild(r))}getChild(e){let r=this.renderer.createElement("div"),n=this.renderer.createElement("span"),i=this.renderer.createElement("span");return i.innerText=e,n.innerText="00",n.id=`lc-${e}`,this.renderer.setStyle(i,"font-size","0.5em"),this.renderer.setStyle(i,"text-align","center"),this.renderer.setStyle(i,"font-family","inherit"),this.renderer.setStyle(n,"text-align","center"),this.renderer.setStyle(n,"font-family","inherit"),this.inappElement.lblPos==="start"?(r.appendChild(i),r.appendChild(n)):(r.appendChild(n),r.appendChild(i)),this.renderer.setStyle(r,"display","flex"),this.renderer.setStyle(r,"flex-direction",this.inappElement.horizontal?"":"column"),this.renderer.setStyle(r,"justify-content","center"),this.renderer.setStyle(r,"align-items","center"),this.renderer.setStyle(r,"gap","5px"),this.spans.push(n),r}processAndStartTimer(){let e=this.inappElement.timer.start(this.inappElement.timerType,r=>{this.spans.forEach(n=>{n.id===`lc-${Bn.DAYS}`?n.innerText=String(r.days).padStart(2,"0"):n.id===`lc-${Bn.HOURS}`?n.innerText=String(r.hours).padStart(2,"0"):n.id===`lc-${Bn.MINUTES}`?n.innerText=String(r.minutes).padStart(2,"0"):n.id===`lc-${Bn.SECONDS}`&&(n.innerText=String(r.seconds).padStart(2,"0"))})});this.triggerContext.intervals.push(e)}},Ka=class extends Dr{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("select"),this.insertElement()}render(){this.renderer.setStyle(this.inappHTMLEl,"background","#ffffff00"),this.renderer.setStyle(this.inappHTMLEl,"outline","none"),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions()}addListener(t){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),t.addEventListener("click",e=>{e.stopPropagation()}),t.addEventListener("change",()=>{let e=new dr(JSON.parse(t.value));this.updateItems(e)})}updateItems(t){let e=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[e.toEmbed(t)];let r=this.parentHTMLEl.querySelector("#coo-13");if(!r)return;let n=t.imgs[0]??e.imgs?.at(0);n?.url&&r.setAttribute("src",n.url)}addOptions(){let t=this.triggerContext.triggerData.items,e=this.inappHTMLEl;if(!t?.length){e.add(this.createOption(this.inappElement.placeholderText));return}let r=this.triggerContext.selectedEmbeddedItems?.at(0);t[0].vars.forEach(n=>{e.add(this.createOption(n.name??"Default",n,n.mID===r?.vID))})}createOption(t,e,r){let n=this.renderer.createElement("option");return n.text=t,n.value=JSON.stringify(e),r&&(n.selected=!0),e||(n.disabled=!0),n}},Ja=class extends An{constructor(t,e,r){super(t,e,r)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}},Xa=Qt(tn()),Rr=class Nd{static INSTANCE=new Nd;topics={};constructor(){}static get(){return this.INSTANCE}broadcast(e,r){this.topics[e]||(this.topics[e]=new _t),this.topics[e].next(r)}subscriber(e){return this.topics[e]||(this.topics[e]=new _t),this.topics[e].asObservable()}},Ze=class Wr{static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=Oe.get().website??{};currentState=!1;drawerSubject=new fo({open:!1,firstOpen:!1});mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[Wr.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize()}get element(){return this.cartDrawerElement}static get(){return Wr._instance||(Wr._instance=new Wr),Wr._instance}static forceUpdate(){Wr._instance=new Wr}isOpen(){let e=this.inShadow?this.isPresent():this.isVisible();return Xa.default.log(`Cart drawer is currently ${e?"open":"close"}`),e}open(){if(this.isOpen()){b.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent(A.CTA_OPEN_CART_EVENT));let e=document.querySelector(this.iconSelector);if(!e){b.debug("No clickable cart icon found with selector",this.iconSelector);return}e.click()}onToggle(){return this.drawerSubject}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===Wr.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(e,r=!0){if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:e}});else if(this.isShopifyDefaultDrawer())this.element?.renderContents&&e&&(this.element.classList.remove("is-empty"),this.element.renderContents?.(e));else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!e?.items?.[0])return;let n=e.items[0].id,i=e.items[0].quantity,s=e.items[0].price;window.cartGiftUpdate(n,s,i,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer)window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else b.info("No method found to update the cart without refreshing");r&&Rr.get().broadcast(A.CART_UPDATE_BROADCAST)}async initialize(){let e=this.configWebsite.cartDrawerSelector;if(!e){await this.findCartDrawer();return}let r=e.split(A.SHADOW_SPLITTER);r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!Ae.isShopify())return;let e=this.selector||this.cartSelector;if(this.cartDrawerElement=await ne.retrySelector(e),!this.cartDrawerElement){Xa.default.warn("Max attempts exhausted to find cart drawer");return}Xa.default.log("Found",this.cartDrawerElement,`from selector: ${e}`),this.createMutationObserver()}async findCartDrawerWithShadow(){if(!Ae.isShopify()||!this.shadowParentElementSelector)return;let e=(await ne.retrySelector(this.shadowParentElementSelector))?.shadowRoot;e?.mode==="open"&&(this.cartDrawerShadowElement=e,this.createMutationObserver())}isVisible(){if(!this.cartDrawerElement)return!1;let e=this.cartDrawerElement.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)+.5,n=(window.innerWidth||document.documentElement.clientWidth)+.5,i=e.top<=r&&e.bottom>=0,s=e.left<=n&&e.right>=0,o=i&&s,l=this.cartDrawerElement.tagName.toLowerCase()===Wr.DEFAULT_SELECTOR&&this.cartDrawerElement.open,u=getComputedStyle(this.cartDrawerElement),f=u.display!=="none"&&u.visibility!=="hidden"&&parseFloat(u.opacity)>0,m=!this.cartDrawerElement.hidden,h=this.cartDrawerElement.offsetWidth>0||this.cartDrawerElement.offsetHeight>0||this.cartDrawerElement.getClientRects().length>0,v=u.transform.match(/matrix\(([^)]+)\)/),_=0,g=0;if(v){let V=v[1].split(", ").map(parseFloat);_=V[4],g=V[5]}let y=_+e.left>n||_+e.right<0||g+e.top>r||g+e.bottom<0,C=Math.max(0,Math.min(e.right,n)-Math.max(e.left,0)),O=Math.max(0,Math.min(e.bottom,r)-Math.max(e.top,0)),H=C*O,R=e.width*e.height,k=R>0&&H/R>=.1;return(o||l||!y)&&f&&m&&h&&k}createMutationObserver(){if(!this.cartDrawerElement&&!this.cartDrawerShadowElement)return;let e=this.cartDrawerElement||this.cartDrawerShadowElement,r=new _t;this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(e,{attributes:!0,subtree:!0,childList:this.inShadow}),r.pipe(rr(500)).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,this.drawerSubject.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){return!this.selector||!this.cartDrawerShadowElement?!1:!!this.cartDrawerShadowElement.querySelector(this.selector)}},Oi=class bc{static ACTIVE_TRIGGER_DATA;renderer=At.get();safeHTTP;parent;rootContainer;containerHTMLElement;ian;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.safeHTTP=pe.getInstance(),this.resizeListener=()=>this.screenResized(),this.setParentContainer(e)}setParentContainer(e){this.parent=e??document.body,this.renderer.setParentContainer(this.parent)}render(e){this.renderEngagement(new Lt(e))}async renderEngagement(e){if(!e.previewType&&bc.ACTIVE_TRIGGER_DATA){let r={triggerShown:new mi(bc.ACTIVE_TRIGGER_DATA??{})};this.skipTrigger(e,r);return}if(bc.ACTIVE_TRIGGER_DATA=e,this.triggerContext=new Ri(new Date,e),this.triggerContext.onClose(r=>{this.closeInApp(r)}),this.ian=e.ian,(this.renderer.isMobile()||e.previewType==="mobile")&&this.ian.overrideForMobileView(),this.ian.isEmbedded()){let r=document.querySelector(this.ian.getEmbeddedSelector());this.setParentContainer(r)}await this.preloadImages(e),e.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed()},e.getDelaySeconds()):this.withCartDrawerClosed()}withCartDrawerClosed(){if(!Ze.get().isOpen()||!this.renderer.isMobile()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=Ze.get().onToggle().subscribe(({open:e})=>{!e&&this.startRenderingOnce()})}startRenderingOnce(){if(le.get().isGoKwikPopupOpen){this.skipTrigger(this.triggerContext.triggerData,{reason:"GoKwik popup is open"});return}try{this.startRendering()}catch(e){ke.getInstance().captureException(e,{triggerData:JSON.stringify(this.triggerContext.triggerData)});return}this.sendTriggerDisplayed(),this.renderer.isMobile()||window.addEventListener("resize",this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe()}startRendering(){this.renderer.calculateScalingFactor(this.ian),this.rootContainer=new Lo(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(e){throw b.error(e),e}}sendTriggerDisplayed(){let e={};this.triggerContext.triggerData.items?.length&&(e.promotedMIDs=this.triggerContext.triggerData.items?.map(i=>i.mID));let r=new ve(A.EVENT_TRIGGER_DISPLAYED,e,this.triggerContext.triggerData);this.safeHTTP.sendEvent(r);let n={action:A.CAMPAIGN_DISPLAYED_ACTIVITY};document.dispatchEvent(new CustomEvent(A.POPUP_ACTIVITY_EVENT,{detail:n}))}sendTriggerClosed(e){let r=e.eventName;delete e.eventName;let n=new ve(r,e,this.triggerContext.triggerData);n.name===A.EVENT_TRIGGER_CLICKED&&(n.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(i=>i.toEmbed())),this.safeHTTP.sendEvent(n)}addEnterAnimation(e){this.containerHTMLElement.animate(e.getEnterAnimation(),{duration:500})}renderElement(e,r,n){r instanceof ri?new za(e,r,n).render():r instanceof ni?new Ya(e,r,n).render():r instanceof zr?new Oo(e,r,n).render():r instanceof ii?new Ja(e,r,n).render():r instanceof Or?new An(e,r,n).render():r instanceof an?new Po(e,r,n).render():r instanceof ei?new qa(e,r,n).render():r instanceof ti?new Ka(e,r,n).render():b.error("Unsupported element type- "+r.type)}renderContainer(e){let r=this.ian?.cont;r&&(this.containerHTMLElement=new Va(this.rootContainer,r,e).render().getHTMLElement(),new $a().loadAllFonts(this.ian),this.ian.elems?.forEach(async n=>{await this.renderElement(this.containerHTMLElement,n,e)}),this.addEnterAnimation(this.ian.anim))}closeInApp(e){let r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(e),bc.ACTIVE_TRIGGER_DATA=void 0;let n=this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"});n.onfinish=()=>{this.removeInApp(),window.removeEventListener("resize",this.resizeListener)}}screenResized(){this.removeInApp(),this.startRendering()}removeInApp(){At.get().removeInApp(this.triggerContext)}skipTrigger(e,r){let n=new ve(A.EVENT_CAMPAIGN_REJECTED,r,e);this.safeHTTP.sendEvent(n)}async preloadImages(e){let r=e.ian;if(!r)return;let n=[];r.elems.forEach(i=>{let s=i.bg?.img?.src;if(s&&n.push(this.getPromise(s)),i.t===1){let o=i.src;if(!o)return;n.push(this.getPromise(o))}}),r.bg?.img?.src&&n.push(this.getPromise(r.bg.img.src)),r.cont.bg?.img?.src&&n.push(this.getPromise(r.cont.bg.img.src)),await Promise.all(n)}getPromise(e){return new Promise(r=>{let n=new Image;n.onload=r,n.src=e,n.style.display="none"})}},Qa=class{triggerData;safeHttpService=pe.getInstance();render(t){t.contentSource===qi.KLAVIYO&&(this.triggerData=t,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",t.klaviyoFormID]))}handleKlaviyoEvents(t){if(t.type!=="klaviyoForms")return;let e=t.detail;if(e.formId!==this.triggerData.klaviyoFormID){b.warn("Received invalid trigger callback");return}switch(e.type){case"open":this.safeHttpService.sendEvent(new ve(A.EVENT_TRIGGER_DISPLAYED,{form:{id:e.formId}},this.triggerData));break;case"stepSubmit":{let r=this.getFormDetails(e);this.safeHttpService.sendEvent(new ve(A.EVENT_FORM_SUBMITTED,{form:r},this.triggerData)),this.safeHttpService.updateProfile(r);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),this.safeHttpService.sendEvent(new ve(A.EVENT_TRIGGER_CLOSED,{form:{id:e.formId}},this.triggerData));break}}getFormDetails(t){let e={id:t.formId},r=t.metaData;if(Ft.hasKeys(r)){let n=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(r).forEach(o=>{n.includes(o)||(e[o]=r[o])}),e.email=r.$email??r.email,e.mobile=r.$phone_number??r.phone_number;let i=r.$first_name??r.first_name,s=r.$last_name??r.last_name;(i?.length||s?.length)&&(e.name=i+" "+s)}return e}},Za=class{static trackIntent(t){if(!this.isInstalled()){b.log("Facebook pixel not installed");return}if(!Oe.get().pixelPush){b.log("Facebook pixel push not enabled");return}let e=cn[t.intent]?.toLowerCase(),r=t.segmentName;!e&&!r||(b.debug(`Sending ${e} intent and ${r} segment to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:e,segment_value:t.segmentName}))}static isInstalled(){return window.fbq&&typeof window.fbq=="function"}},hd=Qt(dd()),On=class{static _flags={};static getFlags(){return this._flags}static setFlags(t){this._flags=t??{}}static isECommerceApp(){return Ae.isShopify()}},J_=(0,hd.default)(fetch),X_={retryDelay:A.API_CALL_RETRY_DELAY,retryOn:(t,e,r)=>t>=A.API_CALL_MAX_ATTEMPTS?!1:!!(e!==null||r?.status&&r?.status>=500)},mt=class Od{static INSTANCE;apiToken="";firstSeen="";constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Od),this.INSTANCE}async validateSession(e){return this.post("/v1/event/validate-session",e)}updateUserData(e){this.put("/v1/user/update",e).then(async r=>{b.log("Updated user profile"),await Pn.getInstance().storeAndPopulateAuthData(r)}).catch(r=>{b.error("Error saving user profile",r)})}trackOrder(e){this.post("/v1/event/track-order",e).then(()=>{b.log("Sent Order")}).catch(r=>{b.error("Error sending track order",r)})}generateDiscount(e){return this.post("/v1/event/generate-discount",e)}updateDeviceProps(e){this.put("/v1/device/update",e).then(()=>{b.log("Updated device property")}).catch(async r=>{b.error("Error saving device property",r)})}setAPIToken(e){this.apiToken=e??""}setFirstSeen(e){this.firstSeen=e?.toUTCString()??""}get(e){return this.requestBackend("GET",e)}post(e,r){return this.requestBackend("POST",e,r)}put(e,r){return this.requestBackend("PUT",e,r)}async requestBackend(e,r,n){if(!On.isECommerceApp()&&!On.getFlags().allowEvents)return b.log(`Rejecting ${e} ${r} as this is not e-commerce app`),Promise.reject();r.startsWith("http")||(r=Zt.apiURL+r);let i=this.getDefaultHeaders(),s="keepalive"in new Request("");if(n&&!s&&JSON.stringify(n).includes("CE App Background"))try{return this.performXMLHttpRequest(r,i,n)}catch(l){return ke.getInstance().captureException(l,{body:JSON.stringify(n)}),{}}let o={method:e,headers:i,keepalive:!0};return n&&(o.body=JSON.stringify(n)),this.request(r,o)}async request(e,r){let n=w(w({},X_),r),i=await J_(e,n);if(!i.ok)throw i;return i.json()}performXMLHttpRequest(e,r,n){return new Promise((i,s)=>{let o=new XMLHttpRequest;o.open("POST",e,!0),r.forEach((l,u)=>{o.setRequestHeader(u,l)}),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE)if(o.status>=200&&o.status<300)try{o.getResponseHeader("Content-Type")?.includes("application/json")?i(JSON.parse(o.responseText)):s(new Error("Content-Type of response header is not json"))}catch(l){s(l)}else s(new Error(`Received status - ${o.status}(${o.statusText})`))},o.onerror=()=>{s(new Error("Network error occurred during the request."))},o.send(JSON.stringify(n))})}getDefaultHeaders(){let e=new Headers;return e.set("content-type","application/json"),e.set("cooee-sdk",A.SDK),e.set("cooee-sdk-code",A.SDK_VERSION_CODE.toString()),e.set("cooee-sdk-version",A.SDK_VERSION),e.set("cooee-first-seen",this.firstSeen),this.apiToken&&e.append("cooee-sdk-token",this.apiToken),Zt.debug&&e.set("cooee-sdk-debug",String(1)),e}},Pi=class{static sentryService=ke.getInstance();static httpApiService=mt.getInstance();static async refreshItems(t){if(t.isCartEmbed()&&!t.isSubscriptionUpsell()){let i=(await ge.getCurrent().getNormalisedCart()).items.map(s=>s.mID);t.items=t.items.filter(s=>!i.includes(s.mID))}if(t.isCartRecovery()){let i=ge.getCurrent().items,s=[];for(let o of t.items)for(let l of o.vars){let u=i.find(h=>h.variant_id.toString()===l.mID);if(!u)continue;let f=new xt(o);f.name=u.title;let m=new dr(l);m.name=u.variant_title,m.price.d=u.discounted_price/100,f.variants=[m],s.push(f)}return s}if(Oe.get().currencyCount<=1)return t.items;let e=t.items.length,r=t.items.map(i=>this.updatedItem(i,t.engagementID)),n=(await Promise.all(r)).filter(i=>i!=null);if(e&&!n.length){let i="Failed to fetch any product from Ajax API",s=new ve(A.EVENT_CAMPAIGN_FAILED,{reason:i,currency:t.currency},t);throw pe.getInstance().sendEvent(s),new Error(i)}return n}static async updatedItem(t,e){let r=t,n,i=Ae.getRootPrefix()+`products/${r.slug}.js`;try{n=await this.httpApiService.request(i)}catch(s){return b.error(`Failed to fetch ${i}`,s),s instanceof Response?this.sentryService.captureMessage(`Shopify product fetch failed ${s.status}`,"error",{item:r,path:i},{"engagement.id":e}):this.sentryService.captureException(s,{item:r,path:i},{"engagement.id":e}),null}return n?(r.name=n.title,r.vars.map(s=>{let o=n.variants.find(l=>l.id===+s.mID);s.name=o.title,s.price.d=o.price?o.price/100:o.price,s.price.cmp=o.compare_at_price?o.compare_at_price/100:o.compare_at_price}),r):(b.error("Item not found after AJAX call for:",r),null)}},ec=class kd{static INSTANCE;httpService=ue.get(mt);sentryService=ue.get(ke);sessionManager=ue.get(it);runtime=le.get();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new kd),this.INSTANCE}sendSilently(e){this.send(e).catch(r=>b.error(`Failed to send ${e.name}`,r))}async send(e){if(b.debug(`Sending event ${e.name}`),Jt.prepend(`Sending event <strong>${e.name}</strong> with id ${e.id}`),this.shouldReject(e)){b.warn(`Rejecting event ${e.name}`);return}await Promise.all([this.addSessionContext(e),this.addShopifyContext(e)]),this.addShopifyAttributes(),e.name!==A.EVENT_APP_BACKGROUND&&this.runtime.setActive(),e.currentItem=this.runtime.getCurrentItem(),this.httpService.post("/v1/event/track",e).then(async r=>{b.log("\u2705 Event tracked:",e.name),Jt.prepend(`\u2705 Event <strong>${r.eventName}</strong> tracked`),this.processEventResponse(e,r)}).catch(r=>{b.error(`Error sending event ${e.name} to server`,r)})}shouldReject(e){return e.trigger?.triggerID==="test"||e.trigger?.triggerID==="preview"?(b.warn("Not sending event as this is a test trigger"),!0):!1}async addSessionContext(e){let r=await this.sessionManager.checkSessionAndGetContext();e.sessionID=r[0],e.sessionNumber=r[1],e.landingPage=r[2],e.page=_r.parseFromCurrent()}async addShopifyContext(e){if(Ae.isShopify())try{e.cart=await ge.getCurrent().getNormalisedCart()}catch(r){b.error("Error fetching Shopify cart before sending the event",r)}}processEventResponse(e,r){this.renderWidgetIfAny(e,r).catch(n=>{b.error("Failed to display a campaign",n,e,r),this.sentryService.captureException(n,{event:e,response:r})}),this.utiliseIntentIfCalculated(r)}async renderWidgetIfAny(e,r){if(!r.triggerData){b.log(`Nothing to engage after ${e.name}`);return}b.log(`\u{1F4E3} Engagement(id=${r.triggerData.shortID}) will be shown`,r.triggerData);let n=new Lt(r.triggerData);n.occurred=e.occurred;let i;try{i=await Pi.refreshItems(n)}catch(s){b.error("Failed to refresh the products",s);return}if(n.items=i,n.contentSource===qi.KLAVIYO){new Qa().render(n);return}new Oi().renderEngagement(n).catch(s=>{b.error("Failed to render popup",s),this.sentryService.captureException(s,{event:e,triggerData:n})})}utiliseIntentIfCalculated(e){e.intent&&(Di.trackIntent(e.intent),Za.trackIntent(e),Jt.prepend(`Intent is <strong>${cn[e.intent]}</strong>`))}addShopifyAttributes(){Ae.isShopify()&&ge.getCurrent().addCooeeAttributes().catch(e=>{b.error("Fail to add attributes in cart",e)})}},pe=class Pd{static INSTANCE;httpApiService=mt.getInstance();eventAPIService=ec.getInstance();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Pd),this.INSTANCE}sendEvent(e){b.debug(`Waiting for auth to send event ${e.name}`),it.replaySubject.subscribe(async()=>{this.eventAPIService.sendSilently(e)})}updateProfile(e){it.replaySubject.subscribe(()=>{this.httpApiService.updateUserData(e??{})})}trackOrder(e){it.replaySubject.subscribe(()=>{this.httpApiService.trackOrder(e)})}updateDeviceProps(e){it.replaySubject.subscribe(()=>{this.httpApiService.updateDeviceProps({props:e})})}generateDiscount(e){return this.httpApiService.generateDiscount(e)}},Jt=class{static isOn=!1;static element;static watch(){let t=b.getDebugParam();(t==="1"||t==="on")&&pe.getInstance().updateDeviceProps({debugTill:this.getDebugMillis()}),t==="on"?sessionStorage.cooeeDebug="1":t==="off"&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&(this.isOn=!0,this.renderDebugBar())}static prepend(t){if(!this.isOn)return;let e=document.createElement("div");e.innerHTML="• "+new Date().toLocaleString()+" - "+t,this.element.prepend(e)}static renderDebugBar(){this.element=document.createElement("div"),this.element.id="cooee-debugger",this.element.setAttribute("draggable","true"),document.body.appendChild(this.element)}static dragElement(){let t=0,e=0,r=0,n=0,i=l=>{l=l||window.event,l.preventDefault(),r=l.clientX,n=l.clientY,document.onmouseup=o,document.onmousemove=s},s=l=>{l=l||window.event,l.preventDefault(),t=r-l.clientX,e=n-l.clientY,r=l.clientX,n=l.clientY,this.element.style.top=this.element.offsetTop-e+"px",this.element.style.left=this.element.offsetLeft-t+"px"},o=()=>{document.onmouseup=null,document.onmousemove=null};this.element.onmousedown=i}static getDebugMillis(){return new Date().getTime()+6*60*60*1e3}},Bo=class extends Vr{static storeName="app";static{this.storage=Kn(this.storeName)}},tc=class{static processConfiguration(){let t=Oe.get();!t.gaMeasurementID||!t.gaEnabled||this.sendClientID()}static async sendClientID(){let t=await this.getClientID();t&&pe.getInstance().updateDeviceProps({gaClientID:t})}static async getClientID(){let t=await Ne.get(ie.GA_CLIENT_ID),e=await this.getClientIDViaGTag();if(t!==e)return await Ne.set(ie.GA_CLIENT_ID,e),e}static async getClientIDViaGTag(){let t=Oe.get().gaMeasurementID;if(!(!t||!window.gtag))return new Promise(e=>{window.gtag("get",t,"client_id",r=>{e(r)})})}},rc=class Rd{static INSTANCE;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Rd),this.INSTANCE}init(){Bo.get(ie.APP_CONFIG,{}).then(e=>this.updateGlobalConfig(e))}async processAppConfigurations(e){b.log("Received app configuration",e),e.currencyCount=e.currencies?.length;let r=this.updateGlobalConfig(e);Bo.set(ie.APP_CONFIG,r).catch(n=>b.error(n)),tc.processConfiguration(),r.website&&(ut.injectRawScript(r.website.commonJS),ut.injectRawCSS(r.website.commonCSS)),Ze.get().onToggle().subscribe(async({open:n})=>{b.info("Cart drawer is now",n?"open":"closed"),n&&(ue.get(ar).loadOrRenderWidgetsAfterCartChange(),await this.trackViewCartEvent())})}updateGlobalConfig(e){let r=Se.globalRef.config.update(e);return Ze.forceUpdate(),b.debug("App configurations",r),r}async trackViewCartEvent(){let e=await ge.getCurrent().getNormalisedCart(),r={value:e.amount,currency:e.currency},n={items:e.items,amount:r,drawer:!0};pe.getInstance().sendEvent(new ve(A.EVENT_VIEW_CART,n))}},gd=Qt(Sl()),nc=class Zu{static META_REQUIRED_FIELDS=["ad_id","campaign_id","fbclid"];static GOOGLE_REQUIRED_FIELDS=["gad_source","gclid"];source;adID;campaignID;adName;campaignName;constructor(e){this.adID=e.adID,this.campaignID=e.campaignID,this.source=e.source}static getAdParams(){let e;try{e=new gd.URLBuilder(location.href)}catch{return{}}let r={};if(this.META_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return r={source:"META",adID:e.getQueryParam("ad_id")?.trim(),campaignID:e.getQueryParam("campaign_id")?.trim()},new Zu(r);if(this.GOOGLE_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return r={source:"GOOGLE"},new Zu(r)}},Pn=class Ld{static INSTANCE=new Ld;httpAPIService=mt.getInstance();coreService=rc.getInstance();sentryService=ke.getInstance();sdkToken="";userID="";deviceID="";appID="";shopifyShop="";constructor(){}static getInstance(){return this.INSTANCE}init(e){this.appID=e.appID,this.shopifyShop=e.shopifyShop}async storeAndPopulateAuthData(e){e&&(e.userID&&(this.userID=e.userID,await Ne.set(ie.ID,e.userID)),e.deviceID&&(this.deviceID=e.deviceID,await Ne.set(ie.DEVICE_ID,e.deviceID)),e.sdkToken&&(this.sdkToken=e.sdkToken,await Ne.set(ie.SDK_TOKEN,e.sdkToken)),this.updateAPIClient())}async validateSession(e){await this.populateFirstSeen(),await this.populateUserDataFromStorage(),b.log("Validating session with server");let r=await this.getSessionValidateData(e);try{let n=await this.httpAPIService.validateSession(r);b.log("Validating session Response",n),await this.coreService.processAppConfigurations(n.appSettings),await this.storeAndPopulateAuthData(n)}catch(n){throw b.error(n),n}}async populateUserDataFromStorage(){if(this.sdkToken=await Ne.get(ie.SDK_TOKEN),!this.sdkToken){b.warn("No SDK token found in local storage");return}this.userID=await Ne.get(ie.ID),this.deviceID=await Ne.get(ie.DEVICE_ID),this.updateAPIClient()}updateAPIClient(){b.debug("SDK Token:",this.sdkToken),b.log("Device ID:",this.deviceID),b.log("User ID:",this.userID),Di.trackDeviceID(this.deviceID),Jt.prepend(`Device ID: <strong>${this.deviceID}</strong>`),this.httpAPIService.setAPIToken(this.sdkToken),this.sentryService.setGlobalContext("Visitor Info",{device_id:this.deviceID,user_id:this.userID}),this.sentryService.setUser({id:this.deviceID})}async getSessionValidateData(e){let r=await new Ha().get();r.host=location.origin;try{(await md())?.isPrivate&&(r.private=!0)}catch(i){yd.default.error("Unable to detect private/incognito window",i)}let n=await Ne.get(ie.DEVICE_ID);return n||(n=new Je().toHexString(),await Ne.set(ie.DEVICE_ID,n)),Z(w({deviceID:n,deviceProps:r,appID:this.appID,shopifyShop:this.shopifyShop},e),{sdk:A.SDK,page:_r.parseFromCurrent(),ad:nc.getAdParams(),occurred:this.getSessionStartTime(le.get().jsLoadTime),currentItem:le.get().getCurrentItem(),cart:await ge.getCurrent().getNormalisedCart(),properties:{}})}async populateFirstSeen(){let e=await Ne.get(ie.FIRST_SEEN),r=e?new Date(e):new Date;e||await Ne.set(ie.FIRST_SEEN,r.toISOString()),this.httpAPIService.setFirstSeen(r),this.sentryService.setGlobalContext("Visitor Info",{first_seen:r.toISOString()})}getSessionStartTime(e){return(new Date().getTime()-e.getTime())/1e3>A.IDLE_TIME_IN_SECONDS?new Date:e}},it=class wc{static replaySubject=new ho(1);static INSTANCE;sentryService=ue.get(ke);lock=new Jn;constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new wc),this.INSTANCE}init(e){if(b.debug("Initialising SDK",e),zf(navigator.userAgent)){b.info("This seems to be a bot. Disabling SDK");return}Pn.getInstance().init(e),wc.INSTANCE.checkForNewSession(!0).then(async()=>{wc.replaySubject.next(!0),wc.replaySubject.complete()}).catch(r=>b.error("Unable to perform device init",r))}getCurrentSessionID(){return et.set(ie.SESSION_LAST_USED_TIME,new Date().getTime()),et.get(ie.ID,"")}async checkSessionAndGetContext(){return await this.checkForNewSession(),this.getContext()}async getContext(){let e=await Promise.all([this.getCurrentSessionID(),this.getCurrentSessionNumber(),this.getLandingPage()]);return this.sentryService.setGlobalContext("Visitor Session",{id:e[0],number:e[1],landing_page:e[2]}),e}async checkForNewSession(e){await this.lock.acquire();let r=!1;if(await this.isNewSessionRequired()?(await this.startNewSession(),e=!0,r=!0):await this.notSynced()&&(r=!0),e){let n=await this.getContext();await Pn.getInstance().validateSession({sessionID:n[0],sessionNumber:n[1],landingPage:n[2],newSession:r}),await et.set(ie.SESSION_SYNCED,!0)}this.lock.release()}async startNewSession(){b.debug("Starting new session"),await et.clear(),b.debug("Cleared SessionStorage before starting new session");let e=new Date,r=new Je().toHexString();b.debug("New session ID to be used",r);let n=await Ne.get(ie.SESSION_NUMBER,0)+1;Jt.prepend(`New Session ID: <strong>${r}</strong> & number: ${n}`),await Promise.all([Ne.set(ie.SESSION_NUMBER,n),et.set(ie.ID,r),et.set(ie.SESSION_LAST_USED_TIME,e.getTime()),et.set(ie.SESSION_LANDING_PAGE,_r.parseFromCurrent())])}getLandingPage(){return et.get(ie.SESSION_LANDING_PAGE,{})}getCurrentSessionNumber(){return Ne.get(ie.SESSION_NUMBER,1)}async isNewSessionRequired(){if(!await et.get(ie.ID))return!0;let e=await et.get(ie.SESSION_LAST_USED_TIME,0);return e?(new Date().getTime()-e)/1e3>A.IDLE_TIME_IN_SECONDS:!0}async notSynced(){return!await et.get(ie.SESSION_SYNCED,!1)}},_d=Qt(tn()),vd=Qt(tn()),Q_=`
|
|
39
39
|
mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
40
40
|
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
|
|
41
41
|
cart {
|