@letscooee/web-sdk 9.3.8 → 9.3.10

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 ih=Object.create,wc=Object.defineProperty,oh=Object.defineProperties,sh=Object.getOwnPropertyDescriptor,ah=Object.getOwnPropertyDescriptors,ch=Object.getOwnPropertyNames,Qu=Object.getOwnPropertySymbols,lh=Object.getPrototypeOf,ep=Object.prototype.hasOwnProperty,uh=Object.prototype.propertyIsEnumerable,Zu=(t,e,r)=>e in t?wc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b=(t,e)=>{for(var r in e||={})ep.call(e,r)&&Zu(t,r,e[r]);if(Qu)for(var r of Qu(e))uh.call(e,r)&&Zu(t,r,e[r]);return t},Z=(t,e)=>oh(t,ah(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),ph=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ch(e))!ep.call(t,i)&&i!==r&&wc(t,i,{get:()=>e[i],enumerable:!(n=sh(e,i))||n.enumerable});return t},Jt=(t,e,r)=>(r=t!=null?ih(lh(t)):{},ph(e||!t||!t.__esModule?wc(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)}},c=function(){var h=arguments,v=h[0],_,m;for(m=1;m<h.length;m++)for(_ in h[m])!(_ in v)&&h[m].hasOwnProperty(_)&&(v[_]=h[m][_]);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,c({level:h},this.context))}};var g=new f({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(g,g.enabledFor),h.trace=o(g,g.trace),h.debug=o(g,g.debug),h.time=o(g,g.time),h.timeEnd=o(g,g.timeEnd),h.info=o(g,g.info),h.warn=o(g,g.warn),h.error=o(g,g.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){g.setLevel(h);for(var v in s)s.hasOwnProperty(v)&&s[v].setLevel(h)},n.getLevel=function(){return g.getLevel()},n.get=function(h){return s[h]||(s[h]=new f(c({name:h},g.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(m,y){y.name&&m.unshift("["+y.name+"]")};var v={},_=function(m,y){Function.prototype.apply.call(m,console,y)};return typeof console>"u"?function(){}:function(m,y){m=Array.prototype.slice.call(m);var T=console.log,O;y.level===n.TIME?(O=(y.name?"["+y.name+"] ":"")+m[0],m[1]==="start"?console.time?console.time(O):v[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):_(T,[O+": "+(new Date().getTime()-v[O])+"ms"])):(y.level===n.WARN&&console.warn?T=console.warn:y.level===n.ERROR&&console.error?T=console.error:y.level===n.INFO&&console.info?T=console.info:y.level===n.DEBUG&&console.debug?T=console.debug:y.level===n.TRACE&&console.trace&&(T=console.trace),h.formatter(m,y),_(T,m))}},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)}),Bp=Vi((t,e)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",f="object",g="string",h="major",v="model",_="name",m="type",y="vendor",T="version",O="architecture",H="console",R="mobile",k="tablet",V="smarttv",Ut="wearable",de="embedded",j=500,ot="Amazon",J="Apple",st="ASUS",Xt="BlackBerry",me="Browser",pe="Chrome",Ce="Edge",be="Firefox",Bt="Google",Te="Huawei",pt="LG",Q="Microsoft",we="Motorola",cr="Opera",jr="Samsung",ke="Sharp",en="Sony",Hn="Xiaomi",kn="Zebra",Hi="Facebook",Wi="Chromium OS",ji="Mac OS",Mn=" Browser",Pe=function(z,ft){var Y={};for(var ie in z)ft[ie]&&ft[ie].length%2===0?Y[ie]=ft[ie].concat(z[ie]):Y[ie]=z[ie];return Y},Wr=function(z){for(var ft={},Y=0;Y<z.length;Y++)ft[z[Y].toUpperCase()]=z[Y];return ft},rs=function(z,ft){return typeof z===g?a(ft).indexOf(a(z))!==-1:!1},a=function(z){return z.toLowerCase()},l=function(z){return typeof z===g?z.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(z,ft){if(typeof z===g)return z=z.replace(/^\s\s*/,s),typeof ft===u?z:z.substring(0,j)},I=function(z,ft){for(var Y=0,ie,$e,Me,re,X,He;Y<ft.length&&!X;){var As=ft[Y],Yo=ft[Y+1];for(ie=$e=0;ie<As.length&&!X&&As[ie];)if(X=As[ie++].exec(z),X)for(Me=0;Me<Yo.length;Me++)He=X[++$e],re=Yo[Me],typeof re===f&&re.length>0?re.length===2?typeof re[1]==c?this[re[0]]=re[1].call(this,He):this[re[0]]=re[1]:re.length===3?typeof re[1]===c&&!(re[1].exec&&re[1].test)?this[re[0]]=He?re[1].call(this,He,re[2]):n:this[re[0]]=He?He.replace(re[1],re[2]):n:re.length===4&&(this[re[0]]=He?re[3].call(this,He.replace(re[1],re[2])):n):this[re]=He||n;Y+=2}},N=function(z,ft){for(var Y in ft)if(typeof ft[Y]===f&&ft[Y].length>0){for(var ie=0;ie<ft[Y].length;ie++)if(rs(ft[Y][ie],z))return Y===o?n:Y}else if(rs(ft[Y],z))return Y===o?n:Y;return ft.hasOwnProperty("*")?ft["*"]: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],[T,[_,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[T,[_,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[_,T],[/opios[\/ ]+([\w\.]+)/i],[T,[_,cr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[T,[_,cr+" GX"]],[/\bopr\/([\w\.]+)/i],[T,[_,cr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[T,[_,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[T,[_,"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],[_,T],[/quark(?:pc)?\/([-\w\.]+)/i],[T,[_,"Quark"]],[/\bddg\/([\w\.]+)/i],[T,[_,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[T,[_,"UC"+me]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[T,[_,"WeChat"]],[/konqueror\/([\w\.]+)/i],[T,[_,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[T,[_,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[T,[_,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[T,[_,"Smart Lenovo "+me]],[/(avast|avg)\/([\w\.]+)/i],[[_,/(.+)/,"$1 Secure "+me],T],[/\bfocus\/([\w\.]+)/i],[T,[_,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[T,[_,cr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[T,[_,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[T,[_,"Dolphin"]],[/coast\/([\w\.]+)/i],[T,[_,cr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[T,[_,"MIUI"+Mn]],[/fxios\/([\w\.-]+)/i],[T,[_,be]],[/\bqihoobrowser\/?([\w\.]*)/i],[T,[_,"360"]],[/\b(qq)\/([\w\.]+)/i],[[_,/(.+)/,"$1Browser"],T],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[_,/(.+)/,"$1"+Mn],T],[/samsungbrowser\/([\w\.]+)/i],[T,[_,jr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[T,[_,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[_,"Sogou Mobile"],T],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[_,T],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[_],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[T,_],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[_,Hi],T],[/(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],[_,T],[/\bgsa\/([\w\.]+) .*safari\//i],[T,[_,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[T,[_,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[T,[_,pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[_,pe+" WebView"],T],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[T,[_,"Android "+me]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[_,T],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[T,[_,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[T,_],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[_,[T,N,L]],[/(webkit|khtml)\/([\w\.]+)/i],[_,T],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[_,"Netscape"],T],[/(wolvic|librewolf)\/([\w\.]+)/i],[_,T],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[T,[_,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],[_,[T,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[_,[T,/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],[m,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],[m,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[y,J],[m,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[y,J],[m,k]],[/(macintosh);/i],[v,[y,J]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[y,ke],[m,R]],[/(?:honor)([-\w ]+)[;\)]/i],[v,[y,"Honor"],[m,R]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[y,Te],[m,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[y,Te],[m,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],[m,R]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[m,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"],[m,R]],[/\b(opd2\d{3}a?) bui/i],[v,[y,"OPPO"],[m,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[y,"Vivo"],[m,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[v,[y,"Realme"],[m,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],[m,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[y,we],[m,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[y,pt],[m,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[y,pt],[m,R]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[y,"Lenovo"],[m,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[y,"Nokia"],[m,R]],[/(pixel c)\b/i],[v,[y,Bt],[m,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[y,Bt],[m,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],[m,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[y,en],[m,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[y,"OnePlus"],[m,R]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[y,ot],[m,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[y,ot],[m,R]],[/(playbook);[-\w\),; ]+(rim)/i],[v,y,[m,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[y,Xt],[m,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[y,st],[m,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[y,st],[m,R]],[/(nexus 9)/i],[v,[y,"HTC"],[m,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[v,/_/g," "],[m,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"],[m,k]],[/(itel) ((\w+))/i],[[y,a],v,[m,N,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[y,"Acer"],[m,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[y,"Meizu"],[m,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[v,[y,"Ulefone"],[m,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[v,[y,"Energizer"],[m,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[v,[y,"Cat"],[m,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[v,[y,"Smartfren"],[m,R]],[/droid.+; (a(?:015|06[35]|142p?))/i],[v,[y,"Nothing"],[m,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,[m,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,[m,k]],[/(surface duo)/i],[v,[y,Q],[m,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[y,"Fairphone"],[m,R]],[/(u304aa)/i],[v,[y,"AT&T"],[m,R]],[/\bsie-(\w*)/i],[v,[y,"Siemens"],[m,R]],[/\b(rct\w+) b/i],[v,[y,"RCA"],[m,k]],[/\b(venue[\d ]{2,7}) b/i],[v,[y,"Dell"],[m,k]],[/\b(q(?:mv|ta)\w+) b/i],[v,[y,"Verizon"],[m,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[y,"Barnes & Noble"],[m,k]],[/\b(tm\d{3}\w+) b/i],[v,[y,"NuVision"],[m,k]],[/\b(k88) b/i],[v,[y,"ZTE"],[m,k]],[/\b(nx\d{3}j) b/i],[v,[y,"ZTE"],[m,R]],[/\b(gen\d{3}) b.+49h/i],[v,[y,"Swiss"],[m,R]],[/\b(zur\d{3}) b/i],[v,[y,"Swiss"],[m,k]],[/\b((zeki)?tb.*\b) b/i],[v,[y,"Zeki"],[m,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],v,[m,k]],[/\b(ns-?\w{0,9}) b/i],[v,[y,"Insignia"],[m,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[y,"NextBook"],[m,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],v,[m,R]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],v,[m,R]],[/\b(ph-1) /i],[v,[y,"Essential"],[m,R]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[y,"Envizen"],[m,k]],[/\b(trio[-\w\. ]+) b/i],[v,[y,"MachSpeed"],[m,k]],[/\btu_(1491) b/i],[v,[y,"Rotor"],[m,k]],[/(shield[\w ]+) b/i],[v,[y,"Nvidia"],[m,k]],[/(sprint) (\w+)/i],[y,v,[m,R]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[y,Q],[m,R]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[y,kn],[m,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[y,kn],[m,R]],[/smart-tv.+(samsung)/i],[y,[m,V]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[y,jr],[m,V]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,pt],[m,V]],[/(apple) ?tv/i],[y,[v,J+" TV"],[m,V]],[/crkey/i],[[v,pe+"cast"],[y,Bt],[m,V]],[/droid.+aft(\w+)( bui|\))/i],[v,[y,ot],[m,V]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[y,ke],[m,V]],[/(bravia[\w ]+)( bui|\))/i],[v,[y,en],[m,V]],[/(mitv-\w{5}) bui/i],[v,[y,Hn],[m,V]],[/Hbbtv.*(technisat) (.*);/i],[y,v,[m,V]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,p],[v,p],[m,V]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,V]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,v,[m,H]],[/droid.+; (shield) bui/i],[v,[y,"Nvidia"],[m,H]],[/(playstation [345portablevi]+)/i],[v,[y,en],[m,H]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[y,Q],[m,H]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[v,[y,jr],[m,Ut]],[/((pebble))app/i],[y,v,[m,Ut]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[y,J],[m,Ut]],[/droid.+; (glass) \d/i],[v,[y,Bt],[m,Ut]],[/droid.+; (wt63?0{2,3})\)/i],[v,[y,kn],[m,Ut]],[/droid.+; (glass) \d/i],[v,[y,Bt],[m,Ut]],[/(pico) (4|neo3(?: link|pro)?)/i],[y,v,[m,Ut]],[/; (quest( \d| pro)?)/i],[v,[y,Hi],[m,Ut]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[m,de]],[/(aeobc)\b/i],[v,[y,ot],[m,de]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[v,[m,R]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[m,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,R]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[T,[_,Ce+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[_,T],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[T,[_,"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],[_,T],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[T,_]],os:[[/microsoft (windows) (vista|xp)/i],[_,T],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[_,[T,N,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[T,N,W],[_,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[T,/_/g,"."],[_,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[_,ji],[T,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[T,_],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[_,T],[/\(bb(10);/i],[T,[_,Xt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[T,[_,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[T,[_,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[T,[_,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[T,[_,"watchOS"]],[/crkey\/([\d\.]+)/i],[T,[_,pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[_,Wi],T],[/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],[_,T],[/(sunos) ?([\w\.\d]*)/i],[[_,"Solaris"],T],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[_,T]]},bt=function(z,ft){if(typeof z===f&&(ft=z,z=n),!(this instanceof bt))return new bt(z,ft).getResult();var Y=typeof r!==u&&r.navigator?r.navigator:n,ie=z||(Y&&Y.userAgent?Y.userAgent:s),$e=Y&&Y.userAgentData?Y.userAgentData:n,Me=ft?Pe(te,ft):te,re=Y&&Y.userAgent==ie;return this.getBrowser=function(){var X={};return X[_]=n,X[T]=n,I.call(X,ie,Me.browser),X[h]=l(X[T]),re&&Y&&Y.brave&&typeof Y.brave.isBrave==c&&(X[_]="Brave"),X},this.getCPU=function(){var X={};return X[O]=n,I.call(X,ie,Me.cpu),X},this.getDevice=function(){var X={};return X[y]=n,X[v]=n,X[m]=n,I.call(X,ie,Me.device),re&&!X[m]&&$e&&$e.mobile&&(X[m]=R),re&&X[v]=="Macintosh"&&Y&&typeof Y.standalone!==u&&Y.maxTouchPoints&&Y.maxTouchPoints>2&&(X[v]="iPad",X[m]=k),X},this.getEngine=function(){var X={};return X[_]=n,X[T]=n,I.call(X,ie,Me.engine),X},this.getOS=function(){var X={};return X[_]=n,X[T]=n,I.call(X,ie,Me.os),re&&!X[_]&&$e&&$e.platform&&$e.platform!="Unknown"&&(X[_]=$e.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 ie},this.setUA=function(X){return ie=typeof X===g&&X.length>j?p(X,j):X,this},this.setUA(ie),this};bt.VERSION=i,bt.BROWSER=Wr([_,T,h]),bt.CPU=Wr([O]),bt.DEVICE=Wr([v,y,m,H,R,V,k,Ut,de]),bt.ENGINE=bt.OS=Wr([_,T]),typeof t!==u?(typeof e!==u&&e.exports&&(t=e.exports=bt),t.UAParser=bt):typeof define===c&&define.amd?define(function(){return bt}):typeof r!==u&&(r.UAParser=bt);var Ct=typeof r!==u&&(r.jQuery||r.Zepto);if(Ct&&!Ct.ua){var le=new bt;Ct.ua=le.getResult(),Ct.ua.get=function(){return le.getUA()},Ct.ua.set=function(z){le.setUA(z);var ft=le.getResult();for(var Y in ft)Ct.ua[Y]=ft[Y]}}})(typeof window=="object"?window:t)}),kp=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,c,u){function f(v,_){if(!c[v]){if(!o[v]){var m=typeof Gi=="function"&&Gi;if(!_&&m)return m(v,!0);if(g)return g(v,!0);var y=new Error("Cannot find module '"+v+"'");throw y.code="MODULE_NOT_FOUND",y}var T=c[v]={exports:{}};o[v][0].call(T.exports,function(O){var H=o[v][1][O];return f(H||O)},T,T.exports,s,o,c,u)}return c[v].exports}for(var g=typeof Gi=="function"&&Gi,h=0;h<u.length;h++)f(u[h]);return f}({1:[function(s,o,c){(function(u){"use strict";var f=u.MutationObserver||u.WebKitMutationObserver,g;if(f){var h=0,v=new f(O),_=u.document.createTextNode("");v.observe(_,{characterData:!0}),g=function(){_.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var m=new u.MessageChannel;m.port1.onmessage=O,g=function(){m.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?g=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)}:g=function(){setTimeout(O,0)};var y,T=[];function O(){y=!0;for(var R,k,V=T.length;V;){for(k=T,T=[],R=-1;++R<V;)k[R]();V=T.length}y=!1}o.exports=H;function H(R){T.push(R)===1&&!y&&g()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var u=s(1);function f(){}var g={},h=["REJECTED"],v=["FULFILLED"],_=["PENDING"];o.exports=m;function m(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)}m.prototype.catch=function(j){return this.then(null,j)},m.prototype.then=function(j,ot){if(typeof j!="function"&&this.state===v||typeof ot!="function"&&this.state===h)return this;var J=new this.constructor(f);if(this.state!==_){var st=this.state===v?j:ot;T(J,st,this.outcome)}else this.queue.push(new y(J,j,ot));return J};function y(j,ot,J){this.promise=j,typeof ot=="function"&&(this.onFulfilled=ot,this.callFulfilled=this.otherCallFulfilled),typeof J=="function"&&(this.onRejected=J,this.callRejected=this.otherCallRejected)}y.prototype.callFulfilled=function(j){g.resolve(this.promise,j)},y.prototype.otherCallFulfilled=function(j){T(this.promise,this.onFulfilled,j)},y.prototype.callRejected=function(j){g.reject(this.promise,j)},y.prototype.otherCallRejected=function(j){T(this.promise,this.onRejected,j)};function T(j,ot,J){u(function(){var st;try{st=ot(J)}catch(Xt){return g.reject(j,Xt)}st===j?g.reject(j,new TypeError("Cannot resolve promise with itself")):g.resolve(j,st)})}g.resolve=function(j,ot){var J=R(O,ot);if(J.status==="error")return g.reject(j,J.value);var st=J.value;if(st)H(j,st);else{j.state=v,j.outcome=ot;for(var Xt=-1,me=j.queue.length;++Xt<me;)j.queue[Xt].callFulfilled(ot)}return j},g.reject=function(j,ot){j.state=h,j.outcome=ot;for(var J=-1,st=j.queue.length;++J<st;)j.queue[J].callRejected(ot);return j};function O(j){var ot=j&&j.then;if(j&&(typeof j=="object"||typeof j=="function")&&typeof ot=="function")return function(){ot.apply(j,arguments)}}function H(j,ot){var J=!1;function st(Ce){J||(J=!0,g.reject(j,Ce))}function Xt(Ce){J||(J=!0,g.resolve(j,Ce))}function me(){ot(Xt,st)}var pe=R(me);pe.status==="error"&&st(pe.value)}function R(j,ot){var J={};try{J.value=j(ot),J.status="success"}catch(st){J.status="error",J.value=st}return J}m.resolve=k;function k(j){return j instanceof this?j:g.resolve(new this(f),j)}m.reject=V;function V(j){var ot=new this(f);return g.reject(ot,j)}m.all=Ut;function Ut(j){var ot=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var J=j.length,st=!1;if(!J)return this.resolve([]);for(var Xt=new Array(J),me=0,pe=-1,Ce=new this(f);++pe<J;)be(j[pe],pe);return Ce;function be(Bt,Te){ot.resolve(Bt).then(pt,function(Q){st||(st=!0,g.reject(Ce,Q))});function pt(Q){Xt[Te]=Q,++me===J&&!st&&(st=!0,g.resolve(Ce,Xt))}}}m.race=de;function de(j){var ot=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var J=j.length,st=!1;if(!J)return this.resolve([]);for(var Xt=-1,me=new this(f);++Xt<J;)pe(j[Xt]);return me;function pe(Ce){ot.resolve(Ce).then(function(be){st||(st=!0,g.resolve(me,be))},function(be){st||(st=!0,g.reject(me,be))})}}},{1:1}],3:[function(s,o,c){(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,c){"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 g(){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=g();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,C=new S,x=0;x<d.length;x+=1)C.append(d[x]);return C.getBlob(E.type)}}typeof Promise>"u"&&s(3);var m=Promise;function y(d,E){E&&d.then(function(S){E(null,S)},function(S){E(S)})}function T(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={},Ut=Object.prototype.toString,de="readonly",j="readwrite";function ot(d){for(var E=d.length,S=new ArrayBuffer(E),C=new Uint8Array(S),x=0;x<E;x++)C[x]=d.charCodeAt(x);return S}function J(d){return new m(function(E){var S=d.transaction(R,j),C=_([""]);S.objectStore(R).put(C,"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 st(d){return typeof k=="boolean"?m.resolve(k):J(d).then(function(E){return k=E,k})}function Xt(d){var E=V[d.name],S={};S.promise=new m(function(C,x){S.resolve=C,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 pe(d,E){var S=V[d.name],C=S.deferredOperations.pop();if(C)return C.reject(E),C.promise}function Ce(d,E){return new m(function(S,C){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(),C(D.error)},D.onsuccess=function(){var P=D.result;P.onversionchange=function(U){U.target.close()},S(P),me(d)}})}function be(d){return Ce(d,!1)}function Bt(d){return Ce(d,!0)}function Te(d,E){if(!d.db)return!0;var S=!d.db.objectStoreNames.contains(d.storeName),C=d.version<d.db.version,x=d.version>d.db.version;if(C&&(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 pt(d){return new m(function(E,S){var C=new FileReader;C.onerror=S,C.onloadend=function(x){var D=btoa(x.target.result||"");E({__local_forage_encoded_blob:!0,data:D,type:d.type})},C.readAsBinaryString(d)})}function Q(d){var E=ot(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 C=V[E._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return T(S,d,d),S}function jr(d){Xt(d);for(var E=V[d.name],S=E.forages,C=0;C<S.length;C++){var x=S[C];x._dbInfo.db&&(x._dbInfo.db.close(),x._dbInfo.db=null)}return d.db=null,be(d).then(function(D){return d.db=D,Te(d)?Bt(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 pe(d,D),D})}function ke(d,E,S,C){C===void 0&&(C=1);try{var x=d.db.transaction(d.storeName,E);S(null,x)}catch(D){if(C>0&&(!d.db||D.name==="InvalidStateError"||D.name==="NotFoundError"))return m.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),Bt(d)}).then(function(){return jr(d).then(function(){ke(d,E,S,C-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 C in d)S[C]=d[C];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 m.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 m.all(D).then(function(){return S.db=x.db,be(S)}).then(function(B){return S.db=B,Te(S,E._defaultConfig.version)?Bt(S):B}).then(function(B){S.db=x.db=B,E._dbInfo=S;for(var G=0;G<$.length;G++){var mt=$[G];mt!==E&&(mt._dbInfo.db=S.db,mt._dbInfo.version=S.version)}})}function kn(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,de,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(C,E),C}function Hi(d,E){var S=this,C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,de,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 mt=G.value;we(mt)&&(mt=Q(mt));var he=d(mt,G.key,B++);he!==void 0?x(he):G.continue()}else x()},$.onerror=function(){D($.error)}}catch(G){D(G)}})}).catch(D)});return y(C,E),C}function Wi(d,E,S){var C=this;d=O(d);var x=new m(function(D,P){var U;C.ready().then(function(){return U=C._dbInfo,Ut.call(E)==="[object Blob]"?st(U.db).then(function(F){return F?E:pt(E)}):E}).then(function(F){ke(C._dbInfo,j,function($,B){if($)return P($);try{var G=B.objectStore(C._dbInfo.storeName);F===null&&(F=void 0);var mt=G.put(F,d);B.oncomplete=function(){F===void 0&&(F=null),D(F)},B.onabort=B.onerror=function(){var he=mt.error?mt.error:mt.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 C=new m(function(x,D){S.ready().then(function(){ke(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(C,E),C}function Mn(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(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(){C()},P.onabort=P.onerror=function(){var $=F.error?F.error:F.transaction.error;x($)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function Pe(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,de,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.count();F.onsuccess=function(){C(F.result)},F.onerror=function(){x(F.error)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function Wr(d,E){var S=this,C=new m(function(x,D){if(d<0){x(null);return}S.ready().then(function(){ke(S._dbInfo,de,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(C,E),C}function rs(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,de,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){C($);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 C=this,x;if(!d.name)x=m.reject("Invalid arguments");else{var D=d.name===S.name&&C._dbInfo.db,P=D?m.resolve(C._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 mt=B[G];mt._dbInfo.db=null,mt._dbInfo.version=F}var he=new m(function(oe,Ie){var ye=h.open(d.name,F);ye.onerror=function(Ve){var Wu=ye.result;Wu.close(),Ie(Ve)},ye.onupgradeneeded=function(){var Ve=ye.result;Ve.deleteObjectStore(d.storeName)},ye.onsuccess=function(){var Ve=ye.result;Ve.close(),oe(Ve)}});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(pe(d,oe)||m.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 mt=new m(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 mt.then(function(he){F.db=he;for(var oe=0;oe<$.length;oe++){var Ie=$[oe];me(Ie._dbInfo)}}).catch(function(he){throw(pe(d,he)||m.resolve()).catch(function(){}),he})})}return y(x,E),x}var l={_driver:"asyncStorage",_initStorage:Hn,_support:v(),iterate:Hi,getItem:kn,setItem:Wi,removeItem:ji,clear:Mn,length:Pe,key:Wr,keys:rs,dropInstance:a};function p(){return typeof openDatabase=="function"}var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="~~local_forage_type~",L=/^~~local_forage_type~([^~]+)~/,W="__lfsc__:",te=W.length,bt="arbf",Ct="blob",le="si08",z="ui08",ft="uic8",Y="si16",ie="si32",$e="ur16",Me="ui32",re="fl32",X="fl64",He=te+bt.length,As=Object.prototype.toString;function Yo(d){var E=d.length*.75,S=d.length,C,x=0,D,P,U,F;d[d.length-1]==="="&&(E--,d[d.length-2]==="="&&E--);var $=new ArrayBuffer(E),B=new Uint8Array($);for(C=0;C<S;C+=4)D=I.indexOf(d[C]),P=I.indexOf(d[C+1]),U=I.indexOf(d[C+2]),F=I.indexOf(d[C+3]),B[x++]=D<<2|P>>4,B[x++]=(P&15)<<4|U>>2,B[x++]=(U&3)<<6|F&63;return $}function Ec(d){var E=new Uint8Array(d),S="",C;for(C=0;C<E.length;C+=3)S+=I[E[C]>>2],S+=I[(E[C]&3)<<4|E[C+1]>>4],S+=I[(E[C+1]&15)<<2|E[C+2]>>6],S+=I[E[C+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=As.call(d)),d&&(S==="[object ArrayBuffer]"||d.buffer&&As.call(d.buffer)==="[object ArrayBuffer]")){var C,x=W;d instanceof ArrayBuffer?(C=d,x+=bt):(C=d.buffer,S==="[object Int8Array]"?x+=le:S==="[object Uint8Array]"?x+=z:S==="[object Uint8ClampedArray]"?x+=ft:S==="[object Int16Array]"?x+=Y:S==="[object Uint16Array]"?x+=$e:S==="[object Int32Array]"?x+=ie:S==="[object Uint32Array]"?x+=Me:S==="[object Float32Array]"?x+=re:S==="[object Float64Array]"?x+=X:E(new Error("Failed to get type for BinaryArray"))),E(x+Ec(C))}else if(S==="[object Blob]"){var D=new FileReader;D.onload=function(){var P=N+d.type+"~"+Ec(this.result);E(W+Ct+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(He),S=d.substring(te,He),C;if(S===Ct&&L.test(E)){var x=E.match(L);C=x[1],E=E.substring(x[0].length)}var D=Yo(E);switch(S){case bt:return D;case Ct:return _([D],{type:C});case le:return new Int8Array(D);case z:return new Uint8Array(D);case ft:return new Uint8ClampedArray(D);case Y:return new Int16Array(D);case $e:return new Uint16Array(D);case ie:return new Int32Array(D);case Me:return new Uint32Array(D);case re:return new Float32Array(D);case X:return new Float64Array(D);default:throw new Error("Unkown type: "+S)}}var Sc={serialize:$d,deserialize:Fd,stringToBuffer:Yo,bufferToString:Ec};function th(d,E,S,C){d.executeSql("CREATE TABLE IF NOT EXISTS "+E.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],S,C)}function Hd(d){var E=this,S={db:null};if(d)for(var C in d)S[C]=typeof d[C]!="string"?d[C].toString():d[C];var x=new m(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){th(U,S,function(){E._dbInfo=S,D()},function(F,$){P($)})},P)});return S.serializer=Sc,x}function Fn(d,E,S,C,x,D){d.executeSql(S,C,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):th(F,E,function(){F.executeSql(S,C,x,D)},D)},D):D(P,U)},D)}function Vd(d,E){var S=this;d=O(d);var C=new m(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(C,E),C}function qd(d,E){var S=this,C=new m(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,mt=0;mt<G;mt++){var he=B.item(mt),oe=he.value;if(oe&&(oe=P.serializer.deserialize(oe)),oe=d(oe,he.key,mt+1),oe!==void 0){x(oe);return}}x()},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function eh(d,E,S,C){var x=this;d=O(d);var D=new m(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(mt){Fn(mt,$,"INSERT OR REPLACE INTO "+$.storeName+" (key, value) VALUES (?, ?)",[d,B],function(){P(F)},function(he,oe){U(oe)})},function(mt){if(mt.code===mt.QUOTA_ERR){if(C>0){P(eh.apply(x,[d,F,S,C-1]));return}U(mt)}})})}).catch(U)});return y(D,S),D}function Wd(d,E,S){return eh.apply(this,[d,E,S,1])}function zd(d,E){var S=this;d=O(d);var C=new m(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(C,E),C}function Kd(d){var E=this,S=new m(function(C,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"DELETE FROM "+D.storeName,[],function(){C()},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Gd(d){var E=this,S=new m(function(C,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;C($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Jd(d,E){var S=this,C=new m(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(C,E),C}function Yd(d){var E=this,S=new m(function(C,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);C($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Zd(d){return new m(function(E,S){d.transaction(function(C){C.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(C){S(C)})})}function Xd(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 C=this,x;return d.name?x=new m(function(D){var P;d.name===S.name?P=C._dbInfo.db:P=openDatabase(d.name,"","",0),d.storeName?D({db:P,storeNames:[d.storeName]}):D(Zd(P))}).then(function(D){return new m(function(P,U){D.db.transaction(function(F){function $(he){return new m(function(oe,Ie){F.executeSql("DROP TABLE IF EXISTS "+he,[],function(){oe()},function(ye,Ve){Ie(Ve)})})}for(var B=[],G=0,mt=D.storeNames.length;G<mt;G++)B.push($(D.storeNames[G]));m.all(B).then(function(){P()}).catch(function(he){U(he)})},function(F){U(F)})})}):x=m.reject("Invalid arguments"),y(x,E),x}var Qd={_driver:"webSQLStorage",_initStorage:Hd,_support:p(),iterate:qd,getItem:Vd,setItem:Wd,removeItem:zd,clear:Kd,length:Gd,key:Jd,keys:Yd,dropInstance:Xd};function kg(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function rh(d,E){var S=d.name+"/";return d.storeName!==E.storeName&&(S+=d.storeName+"/"),S}function Om(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function Vm(){return!Om()||localStorage.length>0}function zm(d){var E=this,S={};if(d)for(var C in d)S[C]=d[C];return S.keyPrefix=rh(d,E._defaultConfig),Vm()?(E._dbInfo=S,S.serializer=Sc,m.resolve()):m.reject()}function Gm(d){var E=this,S=E.ready().then(function(){for(var C=E._dbInfo.keyPrefix,x=localStorage.length-1;x>=0;x--){var D=localStorage.key(x);D.indexOf(C)===0&&localStorage.removeItem(D)}});return y(S,d),S}function kv(d,E){var S=this;d=O(d);var C=S.ready().then(function(){var x=S._dbInfo,D=localStorage.getItem(x.keyPrefix+d);return D&&(D=x.serializer.deserialize(D)),D});return y(C,E),C}function Pv(d,E){var S=this,C=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(C,E),C}function Lv(d,E){var S=this,C=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(C,E),C}function Mv(d){var E=this,S=E.ready().then(function(){for(var C=E._dbInfo,x=localStorage.length,D=[],P=0;P<x;P++){var U=localStorage.key(P);U.indexOf(C.keyPrefix)===0&&D.push(U.substring(C.keyPrefix.length))}return D});return y(S,d),S}function Uv(d){var E=this,S=E.keys().then(function(C){return C.length});return y(S,d),S}function jv(d,E){var S=this;d=O(d);var C=S.ready().then(function(){var x=S._dbInfo;localStorage.removeItem(x.keyPrefix+d)});return y(C,E),C}function Bv(d,E,S){var C=this;d=O(d);var x=C.ready().then(function(){E===void 0&&(E=null);var D=E;return new m(function(P,U){var F=C._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 $v(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 C=this,x;return d.name?x=new m(function(D){d.storeName?D(rh(d,C._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=m.reject("Invalid arguments"),y(x,E),x}var Fv={_driver:"localStorageWrapper",_initStorage:zm,_support:kg(),iterate:Pv,getItem:kv,setItem:Bv,removeItem:jv,clear:Gm,length:Uv,key:Lv,keys:Mv,dropInstance:$v},Hv=function(d,E){return d===E||typeof d=="number"&&typeof E=="number"&&isNaN(d)&&isNaN(E)},Wv=function(d,E){for(var S=d.length,C=0;C<S;){if(Hv(d[C],E))return!0;C++}return!1},nh=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},$a={},fh={},to={INDEXEDDB:l,WEBSQL:Qd,LOCALSTORAGE:Fv},Gv=[to.INDEXEDDB._driver,to.WEBSQL._driver,to.LOCALSTORAGE._driver],bc=["dropInstance"],Yc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(bc),Oy={description:"",driver:Gv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Py(d,E){d[E]=function(){var S=arguments;return d.ready().then(function(){return d[E].apply(d,S)})}}function qu(){for(var d=1;d<arguments.length;d++){var E=arguments[d];if(E)for(var S in E)E.hasOwnProperty(S)&&(nh(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 C=to[S],x=C._driver;this[S]=x,$a[x]||this.defineDriver(C)}this._defaultConfig=qu({},Oy),this._config=qu({},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,C){var x=new m(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 $=Yc.concat("_initStorage"),B=0,G=$.length;B<G;B++){var mt=$[B],he=!Wv(bc,mt);if((he||E[mt])&&typeof E[mt]!="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"),Yh=m.reject(nb);return y(Yh,arguments[arguments.length-1]),Yh}},Ve=0,Wu=bc.length;Ve<Wu;Ve++){var zu=bc[Ve];E[zu]||(E[zu]=ye(zu))}};oe();var Ie=function(ye){$a[U]&&console.info("Redefining LocalForage driver: "+U),$a[U]=E,fh[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 T(x,S,C),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(E,S,C){var x=$a[E]?m.resolve($a[E]):m.reject(new Error("Driver not found."));return T(x,S,C),x},d.prototype.getSerializer=function(E){var S=m.resolve(Sc);return T(S,E),S},d.prototype.ready=function(E){var S=this,C=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return T(C,E,E),C},d.prototype.setDriver=function(E,S,C){var x=this;nh(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 mt(){for(;G<B.length;){var he=B[G];return G++,x._dbInfo=null,x._ready=null,x.getDriver(he).then(U).catch(mt)}P();var oe=new Error("No available storage method found.");return x._driverSet=m.reject(oe),x._driverSet}return mt()}}var $=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.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=m.reject(B),x._driverSet}),T(this._driverSet,S,C),this._driverSet},d.prototype.supports=function(E){return!!fh[E]},d.prototype._extend=function(E){qu(this,E)},d.prototype._getSupportedDrivers=function(E){for(var S=[],C=0,x=E.length;C<x;C++){var D=E[C];this.supports(D)&&S.push(D)}return S},d.prototype._wrapLibraryMethodsWithReady=function(){for(var E=0,S=Yc.length;E<S;E++)Py(this,Yc[E])},d.prototype.createInstance=function(E){return new d(E)},d}(),eb=new tb;o.exports=eb},{3:3}]},{},[4])(4)})}),vl=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}),fd=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 c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(u,f){var g=o.retries,h=o.retryDelay,v=o.retryOn;if(f&&f.retries!==void 0)if(n(f.retries))g=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(_,m){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?T(O,null,R):_(R)}).catch(m)}catch(k){m(k)}else O<g?T(O,null,R):_(R)}).catch(function(R){if(typeof v=="function")try{Promise.resolve(v(O,R,null)).then(function(k){k?T(O,R,null):m(R)}).catch(function(k){m(k)})}catch(k){m(k)}else O<g?T(O,R,null):m(R)})};function T(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})}),tp="9.3.8",A=class Ku{static SDK_VERSION=tp;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{let e=Ku.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ku.SDK_VERSION_CODE=parseInt(e,10)}},Qt={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`},Dt=Jt(tn()),w=class{static log(...t){Dt.default.info(...t)}static debug(...t){Dt.default.debug(...t)}static error(...t){Dt.default.error(...t)}static warn(...t){Dt.default.warn(...t)}static info(...t){Dt.default.info(...t)}static trace(...t){Dt.default.trace(...t)}static configure(t=A.LOG_PREFIX){Dt.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?Dt.default.setLevel(Dt.default[localStorage.cooeeLogLevel]):Dt.default.setLevel(Qt.debug?Dt.default.TRACE:Dt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let t=`
1
+ "use strict";(()=>{var ih=Object.create,wc=Object.defineProperty,oh=Object.defineProperties,sh=Object.getOwnPropertyDescriptor,ah=Object.getOwnPropertyDescriptors,ch=Object.getOwnPropertyNames,Qu=Object.getOwnPropertySymbols,lh=Object.getPrototypeOf,ep=Object.prototype.hasOwnProperty,uh=Object.prototype.propertyIsEnumerable,Zu=(t,e,r)=>e in t?wc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b=(t,e)=>{for(var r in e||={})ep.call(e,r)&&Zu(t,r,e[r]);if(Qu)for(var r of Qu(e))uh.call(e,r)&&Zu(t,r,e[r]);return t},Z=(t,e)=>oh(t,ah(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),ph=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ch(e))!ep.call(t,i)&&i!==r&&wc(t,i,{get:()=>e[i],enumerable:!(n=sh(e,i))||n.enumerable});return t},Jt=(t,e,r)=>(r=t!=null?ih(lh(t)):{},ph(e||!t||!t.__esModule?wc(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)}},c=function(){var h=arguments,v=h[0],_,m;for(m=1;m<h.length;m++)for(_ in h[m])!(_ in v)&&h[m].hasOwnProperty(_)&&(v[_]=h[m][_]);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,c({level:h},this.context))}};var g=new f({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(g,g.enabledFor),h.trace=o(g,g.trace),h.debug=o(g,g.debug),h.time=o(g,g.time),h.timeEnd=o(g,g.timeEnd),h.info=o(g,g.info),h.warn=o(g,g.warn),h.error=o(g,g.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){g.setLevel(h);for(var v in s)s.hasOwnProperty(v)&&s[v].setLevel(h)},n.getLevel=function(){return g.getLevel()},n.get=function(h){return s[h]||(s[h]=new f(c({name:h},g.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(m,y){y.name&&m.unshift("["+y.name+"]")};var v={},_=function(m,y){Function.prototype.apply.call(m,console,y)};return typeof console>"u"?function(){}:function(m,y){m=Array.prototype.slice.call(m);var T=console.log,O;y.level===n.TIME?(O=(y.name?"["+y.name+"] ":"")+m[0],m[1]==="start"?console.time?console.time(O):v[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):_(T,[O+": "+(new Date().getTime()-v[O])+"ms"])):(y.level===n.WARN&&console.warn?T=console.warn:y.level===n.ERROR&&console.error?T=console.error:y.level===n.INFO&&console.info?T=console.info:y.level===n.DEBUG&&console.debug?T=console.debug:y.level===n.TRACE&&console.trace&&(T=console.trace),h.formatter(m,y),_(T,m))}},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)}),Bp=Vi((t,e)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",f="object",g="string",h="major",v="model",_="name",m="type",y="vendor",T="version",O="architecture",H="console",R="mobile",k="tablet",V="smarttv",Ut="wearable",de="embedded",j=500,ot="Amazon",J="Apple",st="ASUS",Xt="BlackBerry",me="Browser",pe="Chrome",Ce="Edge",be="Firefox",Bt="Google",Te="Huawei",pt="LG",Q="Microsoft",we="Motorola",cr="Opera",jr="Samsung",ke="Sharp",en="Sony",Hn="Xiaomi",kn="Zebra",Hi="Facebook",Wi="Chromium OS",ji="Mac OS",Mn=" Browser",Pe=function(z,ft){var Y={};for(var ie in z)ft[ie]&&ft[ie].length%2===0?Y[ie]=ft[ie].concat(z[ie]):Y[ie]=z[ie];return Y},Wr=function(z){for(var ft={},Y=0;Y<z.length;Y++)ft[z[Y].toUpperCase()]=z[Y];return ft},rs=function(z,ft){return typeof z===g?a(ft).indexOf(a(z))!==-1:!1},a=function(z){return z.toLowerCase()},l=function(z){return typeof z===g?z.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(z,ft){if(typeof z===g)return z=z.replace(/^\s\s*/,s),typeof ft===u?z:z.substring(0,j)},I=function(z,ft){for(var Y=0,ie,$e,Me,re,X,He;Y<ft.length&&!X;){var As=ft[Y],Yo=ft[Y+1];for(ie=$e=0;ie<As.length&&!X&&As[ie];)if(X=As[ie++].exec(z),X)for(Me=0;Me<Yo.length;Me++)He=X[++$e],re=Yo[Me],typeof re===f&&re.length>0?re.length===2?typeof re[1]==c?this[re[0]]=re[1].call(this,He):this[re[0]]=re[1]:re.length===3?typeof re[1]===c&&!(re[1].exec&&re[1].test)?this[re[0]]=He?re[1].call(this,He,re[2]):n:this[re[0]]=He?He.replace(re[1],re[2]):n:re.length===4&&(this[re[0]]=He?re[3].call(this,He.replace(re[1],re[2])):n):this[re]=He||n;Y+=2}},N=function(z,ft){for(var Y in ft)if(typeof ft[Y]===f&&ft[Y].length>0){for(var ie=0;ie<ft[Y].length;ie++)if(rs(ft[Y][ie],z))return Y===o?n:Y}else if(rs(ft[Y],z))return Y===o?n:Y;return ft.hasOwnProperty("*")?ft["*"]: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],[T,[_,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[T,[_,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[_,T],[/opios[\/ ]+([\w\.]+)/i],[T,[_,cr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[T,[_,cr+" GX"]],[/\bopr\/([\w\.]+)/i],[T,[_,cr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[T,[_,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[T,[_,"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],[_,T],[/quark(?:pc)?\/([-\w\.]+)/i],[T,[_,"Quark"]],[/\bddg\/([\w\.]+)/i],[T,[_,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[T,[_,"UC"+me]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[T,[_,"WeChat"]],[/konqueror\/([\w\.]+)/i],[T,[_,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[T,[_,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[T,[_,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[T,[_,"Smart Lenovo "+me]],[/(avast|avg)\/([\w\.]+)/i],[[_,/(.+)/,"$1 Secure "+me],T],[/\bfocus\/([\w\.]+)/i],[T,[_,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[T,[_,cr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[T,[_,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[T,[_,"Dolphin"]],[/coast\/([\w\.]+)/i],[T,[_,cr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[T,[_,"MIUI"+Mn]],[/fxios\/([\w\.-]+)/i],[T,[_,be]],[/\bqihoobrowser\/?([\w\.]*)/i],[T,[_,"360"]],[/\b(qq)\/([\w\.]+)/i],[[_,/(.+)/,"$1Browser"],T],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[_,/(.+)/,"$1"+Mn],T],[/samsungbrowser\/([\w\.]+)/i],[T,[_,jr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[T,[_,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[_,"Sogou Mobile"],T],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[_,T],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[_],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[T,_],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[_,Hi],T],[/(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],[_,T],[/\bgsa\/([\w\.]+) .*safari\//i],[T,[_,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[T,[_,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[T,[_,pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[_,pe+" WebView"],T],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[T,[_,"Android "+me]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[_,T],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[T,[_,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[T,_],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[_,[T,N,L]],[/(webkit|khtml)\/([\w\.]+)/i],[_,T],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[_,"Netscape"],T],[/(wolvic|librewolf)\/([\w\.]+)/i],[_,T],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[T,[_,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],[_,[T,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[_,[T,/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],[m,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],[m,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[y,J],[m,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[y,J],[m,k]],[/(macintosh);/i],[v,[y,J]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[y,ke],[m,R]],[/(?:honor)([-\w ]+)[;\)]/i],[v,[y,"Honor"],[m,R]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[y,Te],[m,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[y,Te],[m,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],[m,R]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[m,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"],[m,R]],[/\b(opd2\d{3}a?) bui/i],[v,[y,"OPPO"],[m,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[y,"Vivo"],[m,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[v,[y,"Realme"],[m,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],[m,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[y,we],[m,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[y,pt],[m,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[y,pt],[m,R]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[y,"Lenovo"],[m,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[y,"Nokia"],[m,R]],[/(pixel c)\b/i],[v,[y,Bt],[m,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[y,Bt],[m,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],[m,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[y,en],[m,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[y,"OnePlus"],[m,R]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[y,ot],[m,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[y,ot],[m,R]],[/(playbook);[-\w\),; ]+(rim)/i],[v,y,[m,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[y,Xt],[m,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[y,st],[m,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[y,st],[m,R]],[/(nexus 9)/i],[v,[y,"HTC"],[m,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[v,/_/g," "],[m,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"],[m,k]],[/(itel) ((\w+))/i],[[y,a],v,[m,N,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[y,"Acer"],[m,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[y,"Meizu"],[m,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[v,[y,"Ulefone"],[m,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[v,[y,"Energizer"],[m,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[v,[y,"Cat"],[m,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[v,[y,"Smartfren"],[m,R]],[/droid.+; (a(?:015|06[35]|142p?))/i],[v,[y,"Nothing"],[m,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,[m,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,[m,k]],[/(surface duo)/i],[v,[y,Q],[m,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[y,"Fairphone"],[m,R]],[/(u304aa)/i],[v,[y,"AT&T"],[m,R]],[/\bsie-(\w*)/i],[v,[y,"Siemens"],[m,R]],[/\b(rct\w+) b/i],[v,[y,"RCA"],[m,k]],[/\b(venue[\d ]{2,7}) b/i],[v,[y,"Dell"],[m,k]],[/\b(q(?:mv|ta)\w+) b/i],[v,[y,"Verizon"],[m,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[y,"Barnes & Noble"],[m,k]],[/\b(tm\d{3}\w+) b/i],[v,[y,"NuVision"],[m,k]],[/\b(k88) b/i],[v,[y,"ZTE"],[m,k]],[/\b(nx\d{3}j) b/i],[v,[y,"ZTE"],[m,R]],[/\b(gen\d{3}) b.+49h/i],[v,[y,"Swiss"],[m,R]],[/\b(zur\d{3}) b/i],[v,[y,"Swiss"],[m,k]],[/\b((zeki)?tb.*\b) b/i],[v,[y,"Zeki"],[m,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],v,[m,k]],[/\b(ns-?\w{0,9}) b/i],[v,[y,"Insignia"],[m,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[y,"NextBook"],[m,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],v,[m,R]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],v,[m,R]],[/\b(ph-1) /i],[v,[y,"Essential"],[m,R]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[y,"Envizen"],[m,k]],[/\b(trio[-\w\. ]+) b/i],[v,[y,"MachSpeed"],[m,k]],[/\btu_(1491) b/i],[v,[y,"Rotor"],[m,k]],[/(shield[\w ]+) b/i],[v,[y,"Nvidia"],[m,k]],[/(sprint) (\w+)/i],[y,v,[m,R]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[y,Q],[m,R]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[y,kn],[m,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[y,kn],[m,R]],[/smart-tv.+(samsung)/i],[y,[m,V]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[y,jr],[m,V]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,pt],[m,V]],[/(apple) ?tv/i],[y,[v,J+" TV"],[m,V]],[/crkey/i],[[v,pe+"cast"],[y,Bt],[m,V]],[/droid.+aft(\w+)( bui|\))/i],[v,[y,ot],[m,V]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[y,ke],[m,V]],[/(bravia[\w ]+)( bui|\))/i],[v,[y,en],[m,V]],[/(mitv-\w{5}) bui/i],[v,[y,Hn],[m,V]],[/Hbbtv.*(technisat) (.*);/i],[y,v,[m,V]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,p],[v,p],[m,V]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,V]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,v,[m,H]],[/droid.+; (shield) bui/i],[v,[y,"Nvidia"],[m,H]],[/(playstation [345portablevi]+)/i],[v,[y,en],[m,H]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[y,Q],[m,H]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[v,[y,jr],[m,Ut]],[/((pebble))app/i],[y,v,[m,Ut]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[y,J],[m,Ut]],[/droid.+; (glass) \d/i],[v,[y,Bt],[m,Ut]],[/droid.+; (wt63?0{2,3})\)/i],[v,[y,kn],[m,Ut]],[/droid.+; (glass) \d/i],[v,[y,Bt],[m,Ut]],[/(pico) (4|neo3(?: link|pro)?)/i],[y,v,[m,Ut]],[/; (quest( \d| pro)?)/i],[v,[y,Hi],[m,Ut]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[m,de]],[/(aeobc)\b/i],[v,[y,ot],[m,de]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[v,[m,R]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[m,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,R]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[T,[_,Ce+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[_,T],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[T,[_,"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],[_,T],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[T,_]],os:[[/microsoft (windows) (vista|xp)/i],[_,T],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[_,[T,N,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[T,N,W],[_,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[T,/_/g,"."],[_,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[_,ji],[T,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[T,_],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[_,T],[/\(bb(10);/i],[T,[_,Xt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[T,[_,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[T,[_,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[T,[_,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[T,[_,"watchOS"]],[/crkey\/([\d\.]+)/i],[T,[_,pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[_,Wi],T],[/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],[_,T],[/(sunos) ?([\w\.\d]*)/i],[[_,"Solaris"],T],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[_,T]]},bt=function(z,ft){if(typeof z===f&&(ft=z,z=n),!(this instanceof bt))return new bt(z,ft).getResult();var Y=typeof r!==u&&r.navigator?r.navigator:n,ie=z||(Y&&Y.userAgent?Y.userAgent:s),$e=Y&&Y.userAgentData?Y.userAgentData:n,Me=ft?Pe(te,ft):te,re=Y&&Y.userAgent==ie;return this.getBrowser=function(){var X={};return X[_]=n,X[T]=n,I.call(X,ie,Me.browser),X[h]=l(X[T]),re&&Y&&Y.brave&&typeof Y.brave.isBrave==c&&(X[_]="Brave"),X},this.getCPU=function(){var X={};return X[O]=n,I.call(X,ie,Me.cpu),X},this.getDevice=function(){var X={};return X[y]=n,X[v]=n,X[m]=n,I.call(X,ie,Me.device),re&&!X[m]&&$e&&$e.mobile&&(X[m]=R),re&&X[v]=="Macintosh"&&Y&&typeof Y.standalone!==u&&Y.maxTouchPoints&&Y.maxTouchPoints>2&&(X[v]="iPad",X[m]=k),X},this.getEngine=function(){var X={};return X[_]=n,X[T]=n,I.call(X,ie,Me.engine),X},this.getOS=function(){var X={};return X[_]=n,X[T]=n,I.call(X,ie,Me.os),re&&!X[_]&&$e&&$e.platform&&$e.platform!="Unknown"&&(X[_]=$e.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 ie},this.setUA=function(X){return ie=typeof X===g&&X.length>j?p(X,j):X,this},this.setUA(ie),this};bt.VERSION=i,bt.BROWSER=Wr([_,T,h]),bt.CPU=Wr([O]),bt.DEVICE=Wr([v,y,m,H,R,V,k,Ut,de]),bt.ENGINE=bt.OS=Wr([_,T]),typeof t!==u?(typeof e!==u&&e.exports&&(t=e.exports=bt),t.UAParser=bt):typeof define===c&&define.amd?define(function(){return bt}):typeof r!==u&&(r.UAParser=bt);var Ct=typeof r!==u&&(r.jQuery||r.Zepto);if(Ct&&!Ct.ua){var le=new bt;Ct.ua=le.getResult(),Ct.ua.get=function(){return le.getUA()},Ct.ua.set=function(z){le.setUA(z);var ft=le.getResult();for(var Y in ft)Ct.ua[Y]=ft[Y]}}})(typeof window=="object"?window:t)}),kp=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,c,u){function f(v,_){if(!c[v]){if(!o[v]){var m=typeof Gi=="function"&&Gi;if(!_&&m)return m(v,!0);if(g)return g(v,!0);var y=new Error("Cannot find module '"+v+"'");throw y.code="MODULE_NOT_FOUND",y}var T=c[v]={exports:{}};o[v][0].call(T.exports,function(O){var H=o[v][1][O];return f(H||O)},T,T.exports,s,o,c,u)}return c[v].exports}for(var g=typeof Gi=="function"&&Gi,h=0;h<u.length;h++)f(u[h]);return f}({1:[function(s,o,c){(function(u){"use strict";var f=u.MutationObserver||u.WebKitMutationObserver,g;if(f){var h=0,v=new f(O),_=u.document.createTextNode("");v.observe(_,{characterData:!0}),g=function(){_.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var m=new u.MessageChannel;m.port1.onmessage=O,g=function(){m.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?g=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)}:g=function(){setTimeout(O,0)};var y,T=[];function O(){y=!0;for(var R,k,V=T.length;V;){for(k=T,T=[],R=-1;++R<V;)k[R]();V=T.length}y=!1}o.exports=H;function H(R){T.push(R)===1&&!y&&g()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var u=s(1);function f(){}var g={},h=["REJECTED"],v=["FULFILLED"],_=["PENDING"];o.exports=m;function m(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)}m.prototype.catch=function(j){return this.then(null,j)},m.prototype.then=function(j,ot){if(typeof j!="function"&&this.state===v||typeof ot!="function"&&this.state===h)return this;var J=new this.constructor(f);if(this.state!==_){var st=this.state===v?j:ot;T(J,st,this.outcome)}else this.queue.push(new y(J,j,ot));return J};function y(j,ot,J){this.promise=j,typeof ot=="function"&&(this.onFulfilled=ot,this.callFulfilled=this.otherCallFulfilled),typeof J=="function"&&(this.onRejected=J,this.callRejected=this.otherCallRejected)}y.prototype.callFulfilled=function(j){g.resolve(this.promise,j)},y.prototype.otherCallFulfilled=function(j){T(this.promise,this.onFulfilled,j)},y.prototype.callRejected=function(j){g.reject(this.promise,j)},y.prototype.otherCallRejected=function(j){T(this.promise,this.onRejected,j)};function T(j,ot,J){u(function(){var st;try{st=ot(J)}catch(Xt){return g.reject(j,Xt)}st===j?g.reject(j,new TypeError("Cannot resolve promise with itself")):g.resolve(j,st)})}g.resolve=function(j,ot){var J=R(O,ot);if(J.status==="error")return g.reject(j,J.value);var st=J.value;if(st)H(j,st);else{j.state=v,j.outcome=ot;for(var Xt=-1,me=j.queue.length;++Xt<me;)j.queue[Xt].callFulfilled(ot)}return j},g.reject=function(j,ot){j.state=h,j.outcome=ot;for(var J=-1,st=j.queue.length;++J<st;)j.queue[J].callRejected(ot);return j};function O(j){var ot=j&&j.then;if(j&&(typeof j=="object"||typeof j=="function")&&typeof ot=="function")return function(){ot.apply(j,arguments)}}function H(j,ot){var J=!1;function st(Ce){J||(J=!0,g.reject(j,Ce))}function Xt(Ce){J||(J=!0,g.resolve(j,Ce))}function me(){ot(Xt,st)}var pe=R(me);pe.status==="error"&&st(pe.value)}function R(j,ot){var J={};try{J.value=j(ot),J.status="success"}catch(st){J.status="error",J.value=st}return J}m.resolve=k;function k(j){return j instanceof this?j:g.resolve(new this(f),j)}m.reject=V;function V(j){var ot=new this(f);return g.reject(ot,j)}m.all=Ut;function Ut(j){var ot=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var J=j.length,st=!1;if(!J)return this.resolve([]);for(var Xt=new Array(J),me=0,pe=-1,Ce=new this(f);++pe<J;)be(j[pe],pe);return Ce;function be(Bt,Te){ot.resolve(Bt).then(pt,function(Q){st||(st=!0,g.reject(Ce,Q))});function pt(Q){Xt[Te]=Q,++me===J&&!st&&(st=!0,g.resolve(Ce,Xt))}}}m.race=de;function de(j){var ot=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var J=j.length,st=!1;if(!J)return this.resolve([]);for(var Xt=-1,me=new this(f);++Xt<J;)pe(j[Xt]);return me;function pe(Ce){ot.resolve(Ce).then(function(be){st||(st=!0,g.resolve(me,be))},function(be){st||(st=!0,g.reject(me,be))})}}},{1:1}],3:[function(s,o,c){(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,c){"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 g(){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=g();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,C=new S,x=0;x<d.length;x+=1)C.append(d[x]);return C.getBlob(E.type)}}typeof Promise>"u"&&s(3);var m=Promise;function y(d,E){E&&d.then(function(S){E(null,S)},function(S){E(S)})}function T(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={},Ut=Object.prototype.toString,de="readonly",j="readwrite";function ot(d){for(var E=d.length,S=new ArrayBuffer(E),C=new Uint8Array(S),x=0;x<E;x++)C[x]=d.charCodeAt(x);return S}function J(d){return new m(function(E){var S=d.transaction(R,j),C=_([""]);S.objectStore(R).put(C,"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 st(d){return typeof k=="boolean"?m.resolve(k):J(d).then(function(E){return k=E,k})}function Xt(d){var E=V[d.name],S={};S.promise=new m(function(C,x){S.resolve=C,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 pe(d,E){var S=V[d.name],C=S.deferredOperations.pop();if(C)return C.reject(E),C.promise}function Ce(d,E){return new m(function(S,C){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(),C(D.error)},D.onsuccess=function(){var P=D.result;P.onversionchange=function(U){U.target.close()},S(P),me(d)}})}function be(d){return Ce(d,!1)}function Bt(d){return Ce(d,!0)}function Te(d,E){if(!d.db)return!0;var S=!d.db.objectStoreNames.contains(d.storeName),C=d.version<d.db.version,x=d.version>d.db.version;if(C&&(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 pt(d){return new m(function(E,S){var C=new FileReader;C.onerror=S,C.onloadend=function(x){var D=btoa(x.target.result||"");E({__local_forage_encoded_blob:!0,data:D,type:d.type})},C.readAsBinaryString(d)})}function Q(d){var E=ot(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 C=V[E._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return T(S,d,d),S}function jr(d){Xt(d);for(var E=V[d.name],S=E.forages,C=0;C<S.length;C++){var x=S[C];x._dbInfo.db&&(x._dbInfo.db.close(),x._dbInfo.db=null)}return d.db=null,be(d).then(function(D){return d.db=D,Te(d)?Bt(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 pe(d,D),D})}function ke(d,E,S,C){C===void 0&&(C=1);try{var x=d.db.transaction(d.storeName,E);S(null,x)}catch(D){if(C>0&&(!d.db||D.name==="InvalidStateError"||D.name==="NotFoundError"))return m.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),Bt(d)}).then(function(){return jr(d).then(function(){ke(d,E,S,C-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 C in d)S[C]=d[C];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 m.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 m.all(D).then(function(){return S.db=x.db,be(S)}).then(function(B){return S.db=B,Te(S,E._defaultConfig.version)?Bt(S):B}).then(function(B){S.db=x.db=B,E._dbInfo=S;for(var G=0;G<$.length;G++){var mt=$[G];mt!==E&&(mt._dbInfo.db=S.db,mt._dbInfo.version=S.version)}})}function kn(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,de,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(C,E),C}function Hi(d,E){var S=this,C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,de,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 mt=G.value;we(mt)&&(mt=Q(mt));var he=d(mt,G.key,B++);he!==void 0?x(he):G.continue()}else x()},$.onerror=function(){D($.error)}}catch(G){D(G)}})}).catch(D)});return y(C,E),C}function Wi(d,E,S){var C=this;d=O(d);var x=new m(function(D,P){var U;C.ready().then(function(){return U=C._dbInfo,Ut.call(E)==="[object Blob]"?st(U.db).then(function(F){return F?E:pt(E)}):E}).then(function(F){ke(C._dbInfo,j,function($,B){if($)return P($);try{var G=B.objectStore(C._dbInfo.storeName);F===null&&(F=void 0);var mt=G.put(F,d);B.oncomplete=function(){F===void 0&&(F=null),D(F)},B.onabort=B.onerror=function(){var he=mt.error?mt.error:mt.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 C=new m(function(x,D){S.ready().then(function(){ke(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(C,E),C}function Mn(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(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(){C()},P.onabort=P.onerror=function(){var $=F.error?F.error:F.transaction.error;x($)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function Pe(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,de,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.count();F.onsuccess=function(){C(F.result)},F.onerror=function(){x(F.error)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function Wr(d,E){var S=this,C=new m(function(x,D){if(d<0){x(null);return}S.ready().then(function(){ke(S._dbInfo,de,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(C,E),C}function rs(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,de,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){C($);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 C=this,x;if(!d.name)x=m.reject("Invalid arguments");else{var D=d.name===S.name&&C._dbInfo.db,P=D?m.resolve(C._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 mt=B[G];mt._dbInfo.db=null,mt._dbInfo.version=F}var he=new m(function(oe,Ie){var ye=h.open(d.name,F);ye.onerror=function(Ve){var Wu=ye.result;Wu.close(),Ie(Ve)},ye.onupgradeneeded=function(){var Ve=ye.result;Ve.deleteObjectStore(d.storeName)},ye.onsuccess=function(){var Ve=ye.result;Ve.close(),oe(Ve)}});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(pe(d,oe)||m.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 mt=new m(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 mt.then(function(he){F.db=he;for(var oe=0;oe<$.length;oe++){var Ie=$[oe];me(Ie._dbInfo)}}).catch(function(he){throw(pe(d,he)||m.resolve()).catch(function(){}),he})})}return y(x,E),x}var l={_driver:"asyncStorage",_initStorage:Hn,_support:v(),iterate:Hi,getItem:kn,setItem:Wi,removeItem:ji,clear:Mn,length:Pe,key:Wr,keys:rs,dropInstance:a};function p(){return typeof openDatabase=="function"}var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="~~local_forage_type~",L=/^~~local_forage_type~([^~]+)~/,W="__lfsc__:",te=W.length,bt="arbf",Ct="blob",le="si08",z="ui08",ft="uic8",Y="si16",ie="si32",$e="ur16",Me="ui32",re="fl32",X="fl64",He=te+bt.length,As=Object.prototype.toString;function Yo(d){var E=d.length*.75,S=d.length,C,x=0,D,P,U,F;d[d.length-1]==="="&&(E--,d[d.length-2]==="="&&E--);var $=new ArrayBuffer(E),B=new Uint8Array($);for(C=0;C<S;C+=4)D=I.indexOf(d[C]),P=I.indexOf(d[C+1]),U=I.indexOf(d[C+2]),F=I.indexOf(d[C+3]),B[x++]=D<<2|P>>4,B[x++]=(P&15)<<4|U>>2,B[x++]=(U&3)<<6|F&63;return $}function Ec(d){var E=new Uint8Array(d),S="",C;for(C=0;C<E.length;C+=3)S+=I[E[C]>>2],S+=I[(E[C]&3)<<4|E[C+1]>>4],S+=I[(E[C+1]&15)<<2|E[C+2]>>6],S+=I[E[C+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=As.call(d)),d&&(S==="[object ArrayBuffer]"||d.buffer&&As.call(d.buffer)==="[object ArrayBuffer]")){var C,x=W;d instanceof ArrayBuffer?(C=d,x+=bt):(C=d.buffer,S==="[object Int8Array]"?x+=le:S==="[object Uint8Array]"?x+=z:S==="[object Uint8ClampedArray]"?x+=ft:S==="[object Int16Array]"?x+=Y:S==="[object Uint16Array]"?x+=$e:S==="[object Int32Array]"?x+=ie:S==="[object Uint32Array]"?x+=Me:S==="[object Float32Array]"?x+=re:S==="[object Float64Array]"?x+=X:E(new Error("Failed to get type for BinaryArray"))),E(x+Ec(C))}else if(S==="[object Blob]"){var D=new FileReader;D.onload=function(){var P=N+d.type+"~"+Ec(this.result);E(W+Ct+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(He),S=d.substring(te,He),C;if(S===Ct&&L.test(E)){var x=E.match(L);C=x[1],E=E.substring(x[0].length)}var D=Yo(E);switch(S){case bt:return D;case Ct:return _([D],{type:C});case le:return new Int8Array(D);case z:return new Uint8Array(D);case ft:return new Uint8ClampedArray(D);case Y:return new Int16Array(D);case $e:return new Uint16Array(D);case ie:return new Int32Array(D);case Me:return new Uint32Array(D);case re:return new Float32Array(D);case X:return new Float64Array(D);default:throw new Error("Unkown type: "+S)}}var Sc={serialize:$d,deserialize:Fd,stringToBuffer:Yo,bufferToString:Ec};function th(d,E,S,C){d.executeSql("CREATE TABLE IF NOT EXISTS "+E.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],S,C)}function Hd(d){var E=this,S={db:null};if(d)for(var C in d)S[C]=typeof d[C]!="string"?d[C].toString():d[C];var x=new m(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){th(U,S,function(){E._dbInfo=S,D()},function(F,$){P($)})},P)});return S.serializer=Sc,x}function Fn(d,E,S,C,x,D){d.executeSql(S,C,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):th(F,E,function(){F.executeSql(S,C,x,D)},D)},D):D(P,U)},D)}function Vd(d,E){var S=this;d=O(d);var C=new m(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(C,E),C}function qd(d,E){var S=this,C=new m(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,mt=0;mt<G;mt++){var he=B.item(mt),oe=he.value;if(oe&&(oe=P.serializer.deserialize(oe)),oe=d(oe,he.key,mt+1),oe!==void 0){x(oe);return}}x()},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function eh(d,E,S,C){var x=this;d=O(d);var D=new m(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(mt){Fn(mt,$,"INSERT OR REPLACE INTO "+$.storeName+" (key, value) VALUES (?, ?)",[d,B],function(){P(F)},function(he,oe){U(oe)})},function(mt){if(mt.code===mt.QUOTA_ERR){if(C>0){P(eh.apply(x,[d,F,S,C-1]));return}U(mt)}})})}).catch(U)});return y(D,S),D}function Wd(d,E,S){return eh.apply(this,[d,E,S,1])}function zd(d,E){var S=this;d=O(d);var C=new m(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(C,E),C}function Kd(d){var E=this,S=new m(function(C,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"DELETE FROM "+D.storeName,[],function(){C()},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Gd(d){var E=this,S=new m(function(C,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;C($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Jd(d,E){var S=this,C=new m(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(C,E),C}function Yd(d){var E=this,S=new m(function(C,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);C($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Zd(d){return new m(function(E,S){d.transaction(function(C){C.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(C){S(C)})})}function Xd(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 C=this,x;return d.name?x=new m(function(D){var P;d.name===S.name?P=C._dbInfo.db:P=openDatabase(d.name,"","",0),d.storeName?D({db:P,storeNames:[d.storeName]}):D(Zd(P))}).then(function(D){return new m(function(P,U){D.db.transaction(function(F){function $(he){return new m(function(oe,Ie){F.executeSql("DROP TABLE IF EXISTS "+he,[],function(){oe()},function(ye,Ve){Ie(Ve)})})}for(var B=[],G=0,mt=D.storeNames.length;G<mt;G++)B.push($(D.storeNames[G]));m.all(B).then(function(){P()}).catch(function(he){U(he)})},function(F){U(F)})})}):x=m.reject("Invalid arguments"),y(x,E),x}var Qd={_driver:"webSQLStorage",_initStorage:Hd,_support:p(),iterate:qd,getItem:Vd,setItem:Wd,removeItem:zd,clear:Kd,length:Gd,key:Jd,keys:Yd,dropInstance:Xd};function kg(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function rh(d,E){var S=d.name+"/";return d.storeName!==E.storeName&&(S+=d.storeName+"/"),S}function Om(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function Vm(){return!Om()||localStorage.length>0}function zm(d){var E=this,S={};if(d)for(var C in d)S[C]=d[C];return S.keyPrefix=rh(d,E._defaultConfig),Vm()?(E._dbInfo=S,S.serializer=Sc,m.resolve()):m.reject()}function Gm(d){var E=this,S=E.ready().then(function(){for(var C=E._dbInfo.keyPrefix,x=localStorage.length-1;x>=0;x--){var D=localStorage.key(x);D.indexOf(C)===0&&localStorage.removeItem(D)}});return y(S,d),S}function kv(d,E){var S=this;d=O(d);var C=S.ready().then(function(){var x=S._dbInfo,D=localStorage.getItem(x.keyPrefix+d);return D&&(D=x.serializer.deserialize(D)),D});return y(C,E),C}function Pv(d,E){var S=this,C=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(C,E),C}function Lv(d,E){var S=this,C=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(C,E),C}function Mv(d){var E=this,S=E.ready().then(function(){for(var C=E._dbInfo,x=localStorage.length,D=[],P=0;P<x;P++){var U=localStorage.key(P);U.indexOf(C.keyPrefix)===0&&D.push(U.substring(C.keyPrefix.length))}return D});return y(S,d),S}function Uv(d){var E=this,S=E.keys().then(function(C){return C.length});return y(S,d),S}function jv(d,E){var S=this;d=O(d);var C=S.ready().then(function(){var x=S._dbInfo;localStorage.removeItem(x.keyPrefix+d)});return y(C,E),C}function Bv(d,E,S){var C=this;d=O(d);var x=C.ready().then(function(){E===void 0&&(E=null);var D=E;return new m(function(P,U){var F=C._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 $v(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 C=this,x;return d.name?x=new m(function(D){d.storeName?D(rh(d,C._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=m.reject("Invalid arguments"),y(x,E),x}var Fv={_driver:"localStorageWrapper",_initStorage:zm,_support:kg(),iterate:Pv,getItem:kv,setItem:Bv,removeItem:jv,clear:Gm,length:Uv,key:Lv,keys:Mv,dropInstance:$v},Hv=function(d,E){return d===E||typeof d=="number"&&typeof E=="number"&&isNaN(d)&&isNaN(E)},Wv=function(d,E){for(var S=d.length,C=0;C<S;){if(Hv(d[C],E))return!0;C++}return!1},nh=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},$a={},fh={},to={INDEXEDDB:l,WEBSQL:Qd,LOCALSTORAGE:Fv},Gv=[to.INDEXEDDB._driver,to.WEBSQL._driver,to.LOCALSTORAGE._driver],bc=["dropInstance"],Yc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(bc),Oy={description:"",driver:Gv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Py(d,E){d[E]=function(){var S=arguments;return d.ready().then(function(){return d[E].apply(d,S)})}}function qu(){for(var d=1;d<arguments.length;d++){var E=arguments[d];if(E)for(var S in E)E.hasOwnProperty(S)&&(nh(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 C=to[S],x=C._driver;this[S]=x,$a[x]||this.defineDriver(C)}this._defaultConfig=qu({},Oy),this._config=qu({},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,C){var x=new m(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 $=Yc.concat("_initStorage"),B=0,G=$.length;B<G;B++){var mt=$[B],he=!Wv(bc,mt);if((he||E[mt])&&typeof E[mt]!="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"),Yh=m.reject(nb);return y(Yh,arguments[arguments.length-1]),Yh}},Ve=0,Wu=bc.length;Ve<Wu;Ve++){var zu=bc[Ve];E[zu]||(E[zu]=ye(zu))}};oe();var Ie=function(ye){$a[U]&&console.info("Redefining LocalForage driver: "+U),$a[U]=E,fh[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 T(x,S,C),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(E,S,C){var x=$a[E]?m.resolve($a[E]):m.reject(new Error("Driver not found."));return T(x,S,C),x},d.prototype.getSerializer=function(E){var S=m.resolve(Sc);return T(S,E),S},d.prototype.ready=function(E){var S=this,C=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return T(C,E,E),C},d.prototype.setDriver=function(E,S,C){var x=this;nh(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 mt(){for(;G<B.length;){var he=B[G];return G++,x._dbInfo=null,x._ready=null,x.getDriver(he).then(U).catch(mt)}P();var oe=new Error("No available storage method found.");return x._driverSet=m.reject(oe),x._driverSet}return mt()}}var $=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.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=m.reject(B),x._driverSet}),T(this._driverSet,S,C),this._driverSet},d.prototype.supports=function(E){return!!fh[E]},d.prototype._extend=function(E){qu(this,E)},d.prototype._getSupportedDrivers=function(E){for(var S=[],C=0,x=E.length;C<x;C++){var D=E[C];this.supports(D)&&S.push(D)}return S},d.prototype._wrapLibraryMethodsWithReady=function(){for(var E=0,S=Yc.length;E<S;E++)Py(this,Yc[E])},d.prototype.createInstance=function(E){return new d(E)},d}(),eb=new tb;o.exports=eb},{3:3}]},{},[4])(4)})}),vl=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}),fd=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 c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(u,f){var g=o.retries,h=o.retryDelay,v=o.retryOn;if(f&&f.retries!==void 0)if(n(f.retries))g=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(_,m){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?T(O,null,R):_(R)}).catch(m)}catch(k){m(k)}else O<g?T(O,null,R):_(R)}).catch(function(R){if(typeof v=="function")try{Promise.resolve(v(O,R,null)).then(function(k){k?T(O,R,null):m(R)}).catch(function(k){m(k)})}catch(k){m(k)}else O<g?T(O,R,null):m(R)})};function T(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})}),tp="9.3.10",A=class Ku{static SDK_VERSION=tp;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{let e=Ku.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ku.SDK_VERSION_CODE=parseInt(e,10)}},Qt={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`},Dt=Jt(tn()),w=class{static log(...t){Dt.default.info(...t)}static debug(...t){Dt.default.debug(...t)}static error(...t){Dt.default.error(...t)}static warn(...t){Dt.default.warn(...t)}static info(...t){Dt.default.info(...t)}static trace(...t){Dt.default.trace(...t)}static configure(t=A.LOG_PREFIX){Dt.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?Dt.default.setLevel(Dt.default[localStorage.cooeeLogLevel]):Dt.default.setLevel(Qt.debug?Dt.default.TRACE:Dt.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,11 +35,7 @@ Event: ${ir(t)}`),!0):bv(t,e.denyUrls)?(xe&&q.warn(`Event dropped due to being m
35
35
  Event: ${ir(t)}.
36
36
  Url: ${Da(t)}`),!0):wv(t,e.allowUrls)?!1:(xe&&q.warn(`Event dropped due to not being matched by \`allowUrls\` option.
37
37
  Event: ${ir(t)}.
38
- Url: ${Da(t)}`),!0)}function Ev(t,e){return t.type||!e||!e.length?!1:Iv(t).some(r=>bi(r,e))}function Sv(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?bi(r,e):!1}function bv(t,e){if(!e||!e.length)return!1;let r=Da(t);return r?bi(r,e):!1}function wv(t,e){if(!e||!e.length)return!0;let r=Da(t);return r?bi(r,e):!0}function Iv(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 Tv(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function xv(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 Da(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?xv(e):null}catch{return xe&&q.error(`Cannot extract url for event ${ir(t)}`),null}}function Cv(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 Dv="Dedupe",Rv=()=>{let t;return{name:Dv,processEvent(e){if(e.type)return e;try{if(Nv(e,t))return xe&&q.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Na=Rv;function Nv(t,e){return e?!!(Av(t,e)||Ov(t,e)):!1}function Av(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Wm(t,e)||!jm(t,e))}function Ov(t,e){let r=$m(e),n=$m(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Wm(t,e)||!jm(t,e))}function jm(t,e){let r=aa(t),n=aa(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 Wm(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 $m(t){return t.exception&&t.exception.values&&t.exception.values[0]}var Ge=ee,Iu=0;function Tu(){return Iu>0}function Vv(){Iu++,setTimeout(()=>{Iu--})}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 Vv(),ba(o=>{o.addEventProcessor(c=>(e.mechanism&&(xi(c,void 0,void 0),Br(c,e.mechanism)),c.extra=Z(b({},c.extra),{arguments:i}),c)),Ta(s)}),s}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}ia(n,t),vt(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 Aa(t,e){let r=Du(t,e),n={type:e&&e.name,value:Xv(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function zv(t,e,r,n){let i=Be(),s=i&&i.getOptions().normalizeDepth,o=Zv(e),c={__serialized__:ma(e,s)};if(o)return{exception:{values:[Aa(t,o)]},extra:c};let u={exception:{values:[{type:wn(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:Jv(e,{isUnhandledRejection:n})}]},extra:c};if(r){let f=Du(t,r);f.length&&(u.exception.values[0].stacktrace={frames:f})}return u}function xu(t,e){return{exception:{values:[Aa(t,e)]}}}function Du(t,e){let r=e.stacktrace||e.stack||"",n=qv(e),i=Kv(e);try{return t(r,n,i)}catch{}return[]}var Yv=/Minified React error #\d+;/i;function qv(t){return t&&Yv.test(t.message)?1:0}function Kv(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Xv(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Ym(t,e,r,n){let i=r&&r.syntheticException||void 0,s=Oa(t,e,i,n);return Br(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),Yt(s)}function qm(t,e,r="info",n,i){let s=n&&n.syntheticException||void 0,o=Cu(t,e,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Yt(o)}function Oa(t,e,r,n,i){let s;if(ea(e)&&e.error)return xu(t,e.error);if(ta(e)||Dl(e)){let o=e;if("stack"in e)s=xu(t,e);else{let c=o.name||(ta(o)?"DOMError":"DOMException"),u=o.message?`${c}: ${o.message}`:c;s=Cu(t,u,r,n),xi(s,u)}return"code"in o&&(s.tags=Z(b({},s.tags),{"DOMException.code":`${o.code}`})),s}return Sn(e)?xu(t,e):nr(e)||wn(e)?(s=zv(t,e,r,i),Br(s,{synthetic:!0}),s):(s=Cu(t,e,r,n),xi(s,`${e}`,void 0),Br(s,{synthetic:!0}),s)}function Cu(t,e,r,n){let i={};if(n&&r){let s=Du(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 Jv(t,{isUnhandledRejection:e}){let r=Fl(t),n=e?"promise rejection":"exception";return ea(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:wn(t)?`Event \`${Qv(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Qv(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Zv(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}function Km(t,{metadata:e,tunnel:r,dsn:n}){let i=b(b({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:wr(n)}),s=e_(t);return xr(i,[s])}function e_(t){return[{type:"user_report"},t]}var Ao=class extends No{constructor(t){let e=b({parentSpanIsAlwaysRootSpan:!0},t),r=Ge.SENTRY_SDK_SOURCE||Kl();wu(e,"browser",["browser"],r),super(e),e.sendClientReports&&Ge.document&&Ge.document.addEventListener("visibilitychange",()=>{Ge.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,e){return Ym(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",r){return qm(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=Km(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=ou(t,this._options.tunnel&&wr(this._dsn));this.sendEnvelope(e)}},Xm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ye=ee,t_=1e3,Jm,Ru,Nu;function Au(t){let e="dom";_t(e,t),Et(e,r_)}function r_(){if(!Ye.document)return;let t=Ze.bind(null,"dom"),e=Qm(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")||(Oe(n,"addEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,f=u.__sentry_instrumentation_handlers__=u.__sentry_instrumentation_handlers__||{},g=f[s]=f[s]||{refCount:0};if(!g.handler){let h=Qm(t);g.handler=h,i.call(this,s,h,c)}g.refCount++}catch{}return i.call(this,s,o,c)}}),Oe(n,"removeEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,f=u.__sentry_instrumentation_handlers__||{},g=f[s];g&&(g.refCount--,g.refCount<=0&&(i.call(this,s,g.handler,c),g.handler=void 0,delete f[s]),Object.keys(f).length===0&&delete u.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,c)}}))})}function n_(t){if(t.type!==Ru)return!1;try{if(!t.target||t.target._sentryId!==Nu)return!1}catch{}return!0}function i_(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function Qm(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=o_(r);if(i_(r.type,n))return;vt(r,"_sentryCaptured",!0),n&&!n._sentryId&&vt(n,"_sentryId",rt());let i=r.type==="keypress"?"input":r.type;n_(r)||(t({event:r,name:i,global:e}),Ru=r.type,Nu=n?n._sentryId:void 0),clearTimeout(Jm),Jm=Ye.setTimeout(()=>{Nu=void 0,Ru=void 0},t_)}}function o_(t){try{return t.target}catch{return null}}var Pa;function Ou(t){let e="history";_t(e,t),Et(e,s_)}function s_(){if(!cu())return;let t=Ye.onpopstate;Ye.onpopstate=function(...r){let n=Ye.location.href,i=Pa;if(Pa=n,Ze("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=Pa,o=String(i);Pa=o,Ze("history",{from:s,to:o})}return r.apply(this,n)}}Oe(Ye.history,"pushState",e),Oe(Ye.history,"replaceState",e)}var La={};function Pu(t){let e=La[t];if(e)return e;let r=Ye[t];if(bo(r))return La[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){Xm&&q.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return r&&(La[t]=r.bind(Ye))}function Ba(t){La[t]=void 0}var Nn="__sentry_xhr_v3__";function Lu(t){let e="xhr";_t(e,t),Et(e,a_)}function a_(){if(!Ye.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;Oe(t,"open",function(e){return function(...r){let n=Lt()*1e3,i=yt(r[0])?r[0].toUpperCase():void 0,s=c_(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 c=this[Nn];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}let u={endTimestamp:Lt()*1e3,startTimestamp:n,xhr:this};Ze("xhr",u)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Oe(this,"onreadystatechange",function(c){return function(...u){return o(),c.apply(this,u)}}):this.addEventListener("readystatechange",o),Oe(this,"setRequestHeader",function(c){return function(...u){let[f,g]=u,h=this[Nn];return h&&yt(f)&&yt(g)&&(h.request_headers[f.toLowerCase()]=g),c.apply(this,u)}}),e.apply(this,r)}}),Oe(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:Lt()*1e3,xhr:this};return Ze("xhr",i),e.apply(this,r)}})}function c_(t){if(yt(t))return t;try{return t.toString()}catch{}}function Bu(t,e=Pu("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let c=b({body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return Ba("fetch"),Jr("No fetch implementation available");try{return e(t.url,c).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 Ba("fetch"),r-=o,n--,Jr(u)}}return xa(t,i)}var l_=30,u_=50;function Uu(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 p_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,f_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,m_=/\((\S*)(?::(\d+))(?::(\d+))\)/,d_=t=>{let e=p_.exec(t);if(e){let[,n,i,s]=e;return Uu(n,Ir,+i,+s)}let r=f_.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=m_.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=rd(r[1]||Ir,r[2]);return Uu(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Zm=[l_,d_],h_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,g_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,y_=t=>{let e=h_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=g_.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]=rd(n,r),Uu(r,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},ed=[u_,y_],td=[Zm,ed],Mu=$l(...td),rd=(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]},Ua=1024,__="Breadcrumbs",E_=(t={})=>{let e=b({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:__,setup(r){e.console&&jl(w_(r)),e.dom&&Au(b_(r,e.dom)),e.xhr&&Lu(I_(r)),e.fetch&&zl(T_(r)),e.history&&Ou(x_(r)),e.sentry&&r.on("beforeSendEvent",S_(r))}}},nd=E_;function S_(t){return function(e){Be()===t&&Cr({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:ir(e)},{event:e})}}function b_(t,e){return function(r){if(Be()!==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>Ua&&(Mr&&q.warn(`\`dom.maxStringLength\` cannot exceed ${Ua}, but a value of ${o} was configured. Sentry will use ${Ua} instead.`),o=Ua),typeof s=="string"&&(s=[s]);try{let u=r.event,f=C_(u)?u.target:u;n=Eo(f,{keyAttrs:s,maxStringLength:o}),i=Ul(f)}catch{n="<unknown>"}if(n.length===0)return;let c={category:`ui.${r.name}`,message:n};i&&(c.data={"ui.component_name":i}),Cr(c,{event:r.event,name:r.name,global:r.global})}}function w_(t){return function(e){if(Be()!==t)return;let r={category:"console",data:{arguments:e.args,logger:"console"},level:Ql(e.level),message:ra(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)r.message=`Assertion failed: ${ra(e.args.slice(1)," ")||"console.assert"}`,r.data.arguments=e.args.slice(1);else return;Cr(r,{input:e.args,level:e.level})}}function I_(t){return function(e){if(Be()!==t)return;let{startTimestamp:r,endTimestamp:n}=e,i=e.xhr[Nn];if(!r||!n||!i)return;let{method:s,url:o,status_code:c,body:u}=i,f={method:s,url:o,status_code:c},g={xhr:e.xhr,input:u,startTimestamp:r,endTimestamp:n};Cr({category:"xhr",data:f,type:"http"},g)}}function T_(t){return function(e){if(Be()!==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(b({},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 x_(t){return function(e){if(Be()!==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 C_(t){return!!t&&!!t.target}var D_=["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"],R_="BrowserApiErrors",N_=(t={})=>{let e=b({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t);return{name:R_,setupOnce(){e.setTimeout&&Oe(Ge,"setTimeout",id),e.setInterval&&Oe(Ge,"setInterval",id),e.requestAnimationFrame&&Oe(Ge,"requestAnimationFrame",A_),e.XMLHttpRequest&&"XMLHttpRequest"in Ge&&Oe(XMLHttpRequest.prototype,"send",O_);let r=e.eventTarget;r&&(Array.isArray(r)?r:D_).forEach(P_)}}},od=N_;function id(t){return function(...e){let r=e[0];return e[0]=Rn(r,{mechanism:{data:{function:zt(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function A_(t){return function(e){return t.apply(this,[Rn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:zt(t)},handled:!1,type:"instrument"}})])}}function O_(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Oe(r,n,function(i){let s={mechanism:{data:{function:n,handler:zt(i)},handled:!1,type:"instrument"}},o=In(i);return o&&(s.mechanism.data.handler=zt(o)),Rn(i,s)})}),t.apply(this,e)}}function P_(t){let e=Ge,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Oe(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Rn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:zt(s),target:t},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,Rn(s,{mechanism:{data:{function:"addEventListener",handler:zt(s),target:t},handled:!1,type:"instrument"}}),o])}}),Oe(r,"removeEventListener",function(n){return function(i,s,o){let c=s;try{let u=c&&c.__sentry_wrapped__;u&&n.call(this,i,u,o)}catch{}return n.call(this,i,c,o)}}))}var L_="GlobalHandlers",B_=(t={})=>{let e=b({onerror:!0,onunhandledrejection:!0},t);return{name:L_,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&(U_(r),sd("onerror")),e.onunhandledrejection&&(M_(r),sd("onunhandledrejection"))}}},ad=B_;function U_(t){Yl(e=>{let{stackParser:r,attachStacktrace:n}=cd();if(Be()!==t||Tu())return;let{msg:i,url:s,line:o,column:c,error:u}=e,f=H_(Oa(r,u||i,void 0,n,!1),s,o,c);f.level="error",Ro(f,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function M_(t){ql(e=>{let{stackParser:r,attachStacktrace:n}=cd();if(Be()!==t||Tu())return;let i=k_(e),s=bn(i)?F_(i):Oa(r,i,void 0,n,!0);s.level="error",Ro(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function k_(t){if(bn(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 F_(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function H_(t,e,r,n){let i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},c=o.stacktrace=o.stacktrace||{},u=c.frames=c.frames||[],f=isNaN(parseInt(n,10))?void 0:n,g=isNaN(parseInt(r,10))?void 0:r,h=yt(e)&&e.length>0?e:Bl();return u.length===0&&u.push({colno:f,filename:h,function:Ir,in_app:!0,lineno:g}),t}function sd(t){Mr&&q.log(`Global Handler attached: ${t}`)}function cd(){let t=Be();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var ld=()=>({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=b(b(b({},t.request&&t.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=Z(b(b({},t.request),e&&{url:e}),{headers:i});t.request=s}}),$_="cause",j_=5,W_="LinkedErrors",G_=(t={})=>{let e=t.limit||j_,r=t.key||$_;return{name:W_,preprocessEvent(n,i,s){let o=s.getOptions();Pl(Aa,o.stackParser,o.maxValueLength,r,e,n,i)}}},ud=G_;function ku(t){return[Ra(),Ca(),od(),nd(),ad(),ud(),Na(),ld()]}var Fu=class extends Error{cause;constructor(t,e){super(t),this.cause=e}},Ue=class Cd{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Cd),this.INSTANCE}captureException(e,r,n){w.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){w.error(e,r);let s=this.getNewScope(n,i),o=new Fu(e,r);s.captureException(o)}setGlobalContext(e,r){this.contexts[e]=b({context:r},this.contexts[e])}setUser(e){this.user=e}setTags(e){this.tags=e}getNewScope(e,r){let n=new ut;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",se.getTimezone()),n}init(){let e=ku({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new Ao({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:Bu,stackParser:Mu,integrations:e,environment:Qt.mode,release:`web-sdk@${A.SDK_VERSION}`,debug:Qt.debug}),this.client.init()}},Hu={d:(t,e)=>{for(var r in e)Hu.o(e,r)&&!Hu.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},$u={};Hu.d($u,{A:()=>Y_,k:()=>ju});var V_=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(f){try{u(n.next(f))}catch(g){s(g)}}function c(f){try{u(n.throw(f))}catch(g){s(g)}}function u(f){var g;f.done?i(f.value):(g=f.value,g instanceof r?g:new r(function(h){h(g)})).then(o,c)}u((n=n.apply(t,e||[])).next())})},z_=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:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return function(g){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,g[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&g[0]?n.return:g[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,g[1])).done)return i;switch(n=0,i&&(g=[2&g[0],i.value]),g[0]){case 0:case 1:i=g;break;case 4:return o.label++,{value:g[1],done:!1};case 5:o.label++,n=g[1],g=[0];continue;case 7:g=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||g[0]!==6&&g[0]!==2)){o=0;continue}if(g[0]===3&&(!i||g[1]>i[0]&&g[1]<i[3])){o.label=g[1];break}if(g[0]===6&&o.label<i[1]){o.label=i[1],i=g;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(g);break}i[2]&&o.ops.pop(),o.trys.pop();continue}g=e.call(t,o)}catch(h){g=[6,h],n=0}finally{r=i=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([u,f])}}};function ju(){return V_(this,void 0,Promise,function(){return z_(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=ju);var Y_=ju,pd=$u.A,PL=$u.k,hd=Jt(tn()),Ma=class{parser;result={};constructor(){this.parser=Nt.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&&(w.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=b({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 w.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))}},ka=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)})}},Fa=class{static updateIdentity(t){if(!this.isInstalled())return;let e={};t.email&&(e.email=t.email),t.mobile&&(e.phone_number=t.mobile),w.debug("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",e])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}},Ha=class{apiService;action;triggerContext;constructor(t,e){this.action=t,this.apiService=ue.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:w.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;se.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){w.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)){w.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}),se.showSnackbar("Coupon applied on cart"),Fa.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}},qt=class{renderer=Nt.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(b(b(b(b({},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 Ha(t,this.triggerContext).execute()}),this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}},Dr=class extends qt{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 qt{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}},An=class extends qt{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 Td extends qt{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",Td.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 b(b({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(){}},ja=class extends qt{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)}},Wa=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()})}},Ga=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()})}},Va=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(b(b(b({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)}},za=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}},Ya=class extends An{constructor(t,e,r){super(t,e,r)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}},qa=Jt(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 gt),this.topics[e].next(r)}subscriber(e){return this.topics[e]||(this.topics[e]=new gt),this.topics[e].asObservable()}},et=class Gr{static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=je.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=[Gr.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 Gr._instance||(Gr._instance=new Gr),Gr._instance}static forceUpdate(){Gr._instance=new Gr}isOpen(){let e=this.inShadow?this.isPresent():this.isVisible();return qa.default.log(`Cart drawer is currently ${e?"open":"close"}`),e}open(){if(console.log(`
39
-
40
- cooee_debug CartDrawer:open:97`,this.cartDrawerElement,`
41
-
42
- `),this.isOpen()){w.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent(A.CTA_OPEN_CART_EVENT));let e=document.querySelector(this.iconSelector);if(!e){w.debug("No clickable cart icon found with selector",this.iconSelector);return}e.click()}onToggle(){return this.drawerSubject}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===Gr.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,void 0,"ADD_TO_CART")}else window.icartCartActivityEvent?window.icartCartActivityEvent():window.theme?.CartDrawer?new window.theme.CartDrawer().init():window.Hs_CartDrawer?.updateSlideCart?window.Hs_CartDrawer.updateSlideCart():window.theme?.fetch_side_cart?window.theme.fetch_side_cart():window.theme?.Cart?.updateCart?window.theme.Cart.updateCart():window.cartUpdate?window.cartUpdate():this.element?._onCartRefresh?this.element._onCartRefresh():this.element?.tagName?.toLowerCase()==="cart-drawer-component"?document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart")):this.element?.id==="sidebar-cart"?document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}})):w.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 se.retrySelector(e),!this.cartDrawerElement){qa.default.warn("Max attempts exhausted to find cart drawer");return}qa.default.log("Found",this.cartDrawerElement,`from selector: ${e}`),this.createMutationObserver()}async findCartDrawerWithShadow(){if(!Ae.isShopify()||!this.shadowParentElementSelector)return;let e=(await se.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,c=this.cartDrawerElement.tagName.toLowerCase()===Gr.DEFAULT_SELECTOR&&this.cartDrawerElement.open,u=getComputedStyle(this.cartDrawerElement),f=u.display!=="none"&&u.visibility!=="hidden"&&parseFloat(u.opacity)>0,g=!this.cartDrawerElement.hidden,h=this.cartDrawerElement.offsetWidth>0||this.cartDrawerElement.offsetHeight>0||this.cartDrawerElement.getClientRects().length>0,v=u.transform.match(/matrix\(([^)]+)\)/),_=0,m=0;if(v){let V=v[1].split(", ").map(parseFloat);_=V[4],m=V[5]}let y=_+e.left>n||_+e.right<0||m+e.top>r||m+e.bottom<0,T=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=T*O,R=e.width*e.height,k=R>0&&H/R>=.1;return(o||c||!y)&&f&&g&&h&&k}createMutationObserver(){if(!this.cartDrawerElement&&!this.cartDrawerShadowElement)return;let e=this.cartDrawerElement||this.cartDrawerShadowElement,r=new gt;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 vc{static ACTIVE_TRIGGER_DATA;renderer=Nt.get();safeHTTP;parent;rootContainer;containerHTMLElement;ian;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.safeHTTP=ue.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 Pt(e))}async renderEngagement(e){if(!e.previewType&&vc.ACTIVE_TRIGGER_DATA){let r={triggerShown:new mi(vc.ACTIVE_TRIGGER_DATA??{})};this.skipTrigger(e,r);return}if(vc.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(!et.get().isOpen()||!this.renderer.isMobile()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=et.get().onToggle().subscribe(({open:e})=>{!e&&this.startRenderingOnce()})}startRenderingOnce(){if(fe.get().isGoKwikPopupOpen){this.skipTrigger(this.triggerContext.triggerData,{reason:"GoKwik popup is open"});return}try{this.startRendering()}catch(e){Ue.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 w.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 Wa(e,r,n).render():r instanceof ni?new Ga(e,r,n).render():r instanceof Yr?new Oo(e,r,n).render():r instanceof ii?new Ya(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 Va(e,r,n).render():r instanceof ti?new za(e,r,n).render():w.error("Unsupported element type- "+r.type)}renderContainer(e){let r=this.ian?.cont;r&&(this.containerHTMLElement=new ja(this.rootContainer,r,e).render().getHTMLElement(),new ka().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),vc.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(){Nt.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"})}},Ka=class{triggerData;safeHttpService=ue.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){w.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(kt.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}},Xa=class{static trackIntent(t){if(!this.isInstalled()){w.log("Facebook pixel not installed");return}if(!je.get().pixelPush){w.log("Facebook pixel push not enabled");return}let e=cn[t.intent]?.toLowerCase(),r=t.segmentName;!e&&!r||(w.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"}},md=Jt(fd()),On=class{static _flags={};static getFlags(){return this._flags}static setFlags(t){this._flags=t??{}}static isECommerceApp(){return Ae.isShopify()}},q_=(0,md.default)(fetch),K_={retryDelay:A.API_CALL_RETRY_DELAY,retryOn:(t,e,r)=>t>=A.API_CALL_MAX_ATTEMPTS?!1:!!(e!==null||r?.status&&r?.status>=500)},Tt=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=>{w.log("Updated user profile"),await Pn.getInstance().storeAndPopulateAuthData(r)}).catch(r=>{w.error("Error saving user profile",r)})}trackOrder(e){this.post("/v1/event/track-order",e).then(()=>{w.log("Sent Order")}).catch(r=>{w.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(()=>{w.log("Updated device property")}).catch(async r=>{w.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 w.log(`Rejecting ${e} ${r} as this is not e-commerce app`),Promise.reject();r.startsWith("http")||(r=Qt.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(c){return Ue.getInstance().captureException(c,{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=b(b({},K_),r),i=await q_(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((c,u)=>{o.setRequestHeader(u,c)}),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(c){s(c)}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),Qt.debug&&e.set("cooee-sdk-debug",String(1)),e}},Pi=class{static sentryService=Ue.getInstance();static httpApiService=Tt.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 c of o.vars){let u=i.find(h=>h.variant_id.toString()===c.mID);if(!u)continue;let f=new It(o);f.name=u.title;let g=new dr(c);g.name=u.variant_title,g.price.d=u.discounted_price/100,f.variants=[g],s.push(f)}return s}if(je.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 ue.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 w.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(c=>c.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):(w.error("Item not found after AJAX call for:",r),null)}},Ja=class kd{static INSTANCE;httpService=ae.get(Tt);sentryService=ae.get(Ue);sessionManager=ae.get(qe);runtime=fe.get();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new kd),this.INSTANCE}sendSilently(e){this.send(e).catch(r=>w.error(`Failed to send ${e.name}`,r))}async send(e){if(w.debug(`Sending event ${e.name}`),Kt.prepend(`Sending event <strong>${e.name}</strong> with id ${e.id}`),this.shouldReject(e)){w.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=>{w.log("\u2705 Event tracked:",e.name),Kt.prepend(`\u2705 Event <strong>${r.eventName}</strong> tracked`),this.processEventResponse(e,r)}).catch(r=>{w.error(`Error sending event ${e.name} to server`,r)})}shouldReject(e){return e.trigger?.triggerID==="test"||e.trigger?.triggerID==="preview"?(w.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){w.error("Error fetching Shopify cart before sending the event",r)}}processEventResponse(e,r){this.renderWidgetIfAny(e,r).catch(n=>{w.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){w.log(`Nothing to engage after ${e.name}`);return}w.log(`\u{1F4E3} Engagement(id=${r.triggerData.shortID}) will be shown`,r.triggerData);let n=new Pt(r.triggerData);n.occurred=e.occurred;let i;try{i=await Pi.refreshItems(n)}catch(s){w.error("Failed to refresh the products",s);return}if(n.items=i,n.contentSource===qi.KLAVIYO){new Ka().render(n);return}new Oi().renderEngagement(n).catch(s=>{w.error("Failed to render popup",s),this.sentryService.captureException(s,{event:e,triggerData:n})})}utiliseIntentIfCalculated(e){e.intent&&(Di.trackIntent(e.intent),Xa.trackIntent(e),Kt.prepend(`Intent is <strong>${cn[e.intent]}</strong>`))}addShopifyAttributes(){Ae.isShopify()&&ge.getCurrent().addCooeeAttributes().catch(e=>{w.error("Fail to add attributes in cart",e)})}},ue=class Pd{static INSTANCE;httpApiService=Tt.getInstance();eventAPIService=Ja.getInstance();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Pd),this.INSTANCE}sendEvent(e){w.debug(`Waiting for auth to send event ${e.name}`),qe.replaySubject.subscribe(async()=>{this.eventAPIService.sendSilently(e)})}updateProfile(e){qe.replaySubject.subscribe(()=>{this.httpApiService.updateUserData(e??{})})}trackOrder(e){qe.replaySubject.subscribe(()=>{this.httpApiService.trackOrder(e)})}updateDeviceProps(e){qe.replaySubject.subscribe(()=>{this.httpApiService.updateDeviceProps({props:e})})}generateDiscount(e){return this.httpApiService.generateDiscount(e)}},Kt=class{static isOn=!1;static element;static watch(){let t=w.getDebugParam();(t==="1"||t==="on")&&ue.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="&#x2022; "+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=c=>{c=c||window.event,c.preventDefault(),r=c.clientX,n=c.clientY,document.onmouseup=o,document.onmousemove=s},s=c=>{c=c||window.event,c.preventDefault(),t=r-c.clientX,e=n-c.clientY,r=c.clientX,n=c.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 zr{static storeName="app";static{this.storage=Kn(this.storeName)}},Qa=class{static processConfiguration(){let t=je.get();!t.gaMeasurementID||!t.gaEnabled||this.sendClientID()}static async sendClientID(){let t=await this.getClientID();t&&ue.getInstance().updateDeviceProps({gaClientID:t})}static async getClientID(){let t=await Ne.get(ne.GA_CLIENT_ID),e=await this.getClientIDViaGTag();if(t!==e)return await Ne.set(ne.GA_CLIENT_ID,e),e}static async getClientIDViaGTag(){let t=je.get().gaMeasurementID;if(!(!t||!window.gtag))return new Promise(e=>{window.gtag("get",t,"client_id",r=>{e(r)})})}},Za=class Rd{static INSTANCE;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Rd),this.INSTANCE}init(){Bo.get(ne.APP_CONFIG,{}).then(e=>this.updateGlobalConfig(e))}async processAppConfigurations(e){w.log("Received app configuration",e),e.currencyCount=e.currencies?.length;let r=this.updateGlobalConfig(e);Bo.set(ne.APP_CONFIG,r).catch(n=>w.error(n)),Qa.processConfiguration(),r.website&&(ht.injectRawScript(r.website.commonJS),ht.injectRawCSS(r.website.commonCSS)),et.get().onToggle().subscribe(async({open:n})=>{w.info("Cart drawer is now",n?"open":"closed"),n&&(ae.get(ar).loadOrRenderWidgetsAfterCartChange(),await this.trackViewCartEvent())})}updateGlobalConfig(e){let r=Se.globalRef.config.update(e);return et.forceUpdate(),w.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};ue.getInstance().sendEvent(new ve(A.EVENT_VIEW_CART,n))}},dd=Jt(vl()),ec=class Ju{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 dd.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 Ju(r);if(this.GOOGLE_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return r={source:"GOOGLE"},new Ju(r)}},Pn=class Ld{static INSTANCE=new Ld;httpAPIService=Tt.getInstance();coreService=Za.getInstance();sentryService=Ue.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(ne.ID,e.userID)),e.deviceID&&(this.deviceID=e.deviceID,await Ne.set(ne.DEVICE_ID,e.deviceID)),e.sdkToken&&(this.sdkToken=e.sdkToken,await Ne.set(ne.SDK_TOKEN,e.sdkToken)),this.updateAPIClient())}async validateSession(e){await this.populateFirstSeen(),await this.populateUserDataFromStorage(),w.log("Validating session with server");let r=await this.getSessionValidateData(e);try{let n=await this.httpAPIService.validateSession(r);w.log("Validating session Response",n),await this.coreService.processAppConfigurations(n.appSettings),await this.storeAndPopulateAuthData(n)}catch(n){throw w.error(n),n}}async populateUserDataFromStorage(){if(this.sdkToken=await Ne.get(ne.SDK_TOKEN),!this.sdkToken){w.warn("No SDK token found in local storage");return}this.userID=await Ne.get(ne.ID),this.deviceID=await Ne.get(ne.DEVICE_ID),this.updateAPIClient()}updateAPIClient(){w.debug("SDK Token:",this.sdkToken),w.log("Device ID:",this.deviceID),w.log("User ID:",this.userID),Di.trackDeviceID(this.deviceID),Kt.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 Ma().get();r.host=location.origin;try{(await pd())?.isPrivate&&(r.private=!0)}catch(i){hd.default.error("Unable to detect private/incognito window",i)}let n=await Ne.get(ne.DEVICE_ID);return n||(n=new Je().toHexString(),await Ne.set(ne.DEVICE_ID,n)),Z(b({deviceID:n,deviceProps:r,appID:this.appID,shopifyShop:this.shopifyShop},e),{sdk:A.SDK,page:_r.parseFromCurrent(),ad:ec.getAdParams(),occurred:this.getSessionStartTime(fe.get().jsLoadTime),currentItem:fe.get().getCurrentItem(),cart:await ge.getCurrent().getNormalisedCart(),properties:{}})}async populateFirstSeen(){let e=await Ne.get(ne.FIRST_SEEN),r=e?new Date(e):new Date;e||await Ne.set(ne.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}},qe=class yc{static replaySubject=new ho(1);static INSTANCE;sentryService=ae.get(Ue);lock=new Xn;constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new yc),this.INSTANCE}init(e){if(w.debug("Initialising SDK",e),Gf(navigator.userAgent)){w.info("This seems to be a bot. Disabling SDK");return}Pn.getInstance().init(e),yc.INSTANCE.checkForNewSession(!0).then(async()=>{yc.replaySubject.next(!0),yc.replaySubject.complete()}).catch(r=>w.error("Unable to perform device init",r))}getCurrentSessionID(){return at.set(ne.SESSION_LAST_USED_TIME,new Date().getTime()),at.get(ne.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 at.set(ne.SESSION_SYNCED,!0)}this.lock.release()}async startNewSession(){w.debug("Starting new session"),await at.clear(),w.debug("Cleared SessionStorage before starting new session");let e=new Date,r=new Je().toHexString();w.debug("New session ID to be used",r);let n=await Ne.get(ne.SESSION_NUMBER,0)+1;Kt.prepend(`New Session ID: <strong>${r}</strong> & number: ${n}`),await Promise.all([Ne.set(ne.SESSION_NUMBER,n),at.set(ne.ID,r),at.set(ne.SESSION_LAST_USED_TIME,e.getTime()),at.set(ne.SESSION_LANDING_PAGE,_r.parseFromCurrent())])}getLandingPage(){return at.get(ne.SESSION_LANDING_PAGE,{})}getCurrentSessionNumber(){return Ne.get(ne.SESSION_NUMBER,1)}async isNewSessionRequired(){if(!await at.get(ne.ID))return!0;let e=await at.get(ne.SESSION_LAST_USED_TIME,0);return e?(new Date().getTime()-e)/1e3>A.IDLE_TIME_IN_SECONDS:!0}async notSynced(){return!await at.get(ne.SESSION_SYNCED,!1)}},yd=Jt(tn()),gd=Jt(tn()),X_=`
38
+ Url: ${Da(t)}`),!0)}function Ev(t,e){return t.type||!e||!e.length?!1:Iv(t).some(r=>bi(r,e))}function Sv(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?bi(r,e):!1}function bv(t,e){if(!e||!e.length)return!1;let r=Da(t);return r?bi(r,e):!1}function wv(t,e){if(!e||!e.length)return!0;let r=Da(t);return r?bi(r,e):!0}function Iv(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 Tv(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function xv(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 Da(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?xv(e):null}catch{return xe&&q.error(`Cannot extract url for event ${ir(t)}`),null}}function Cv(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 Dv="Dedupe",Rv=()=>{let t;return{name:Dv,processEvent(e){if(e.type)return e;try{if(Nv(e,t))return xe&&q.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Na=Rv;function Nv(t,e){return e?!!(Av(t,e)||Ov(t,e)):!1}function Av(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Wm(t,e)||!jm(t,e))}function Ov(t,e){let r=$m(e),n=$m(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Wm(t,e)||!jm(t,e))}function jm(t,e){let r=aa(t),n=aa(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 Wm(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 $m(t){return t.exception&&t.exception.values&&t.exception.values[0]}var Ge=ee,Iu=0;function Tu(){return Iu>0}function Vv(){Iu++,setTimeout(()=>{Iu--})}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 Vv(),ba(o=>{o.addEventProcessor(c=>(e.mechanism&&(xi(c,void 0,void 0),Br(c,e.mechanism)),c.extra=Z(b({},c.extra),{arguments:i}),c)),Ta(s)}),s}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}ia(n,t),vt(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 Aa(t,e){let r=Du(t,e),n={type:e&&e.name,value:Xv(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function zv(t,e,r,n){let i=Be(),s=i&&i.getOptions().normalizeDepth,o=Zv(e),c={__serialized__:ma(e,s)};if(o)return{exception:{values:[Aa(t,o)]},extra:c};let u={exception:{values:[{type:wn(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:Jv(e,{isUnhandledRejection:n})}]},extra:c};if(r){let f=Du(t,r);f.length&&(u.exception.values[0].stacktrace={frames:f})}return u}function xu(t,e){return{exception:{values:[Aa(t,e)]}}}function Du(t,e){let r=e.stacktrace||e.stack||"",n=qv(e),i=Kv(e);try{return t(r,n,i)}catch{}return[]}var Yv=/Minified React error #\d+;/i;function qv(t){return t&&Yv.test(t.message)?1:0}function Kv(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Xv(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Ym(t,e,r,n){let i=r&&r.syntheticException||void 0,s=Oa(t,e,i,n);return Br(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),Yt(s)}function qm(t,e,r="info",n,i){let s=n&&n.syntheticException||void 0,o=Cu(t,e,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Yt(o)}function Oa(t,e,r,n,i){let s;if(ea(e)&&e.error)return xu(t,e.error);if(ta(e)||Dl(e)){let o=e;if("stack"in e)s=xu(t,e);else{let c=o.name||(ta(o)?"DOMError":"DOMException"),u=o.message?`${c}: ${o.message}`:c;s=Cu(t,u,r,n),xi(s,u)}return"code"in o&&(s.tags=Z(b({},s.tags),{"DOMException.code":`${o.code}`})),s}return Sn(e)?xu(t,e):nr(e)||wn(e)?(s=zv(t,e,r,i),Br(s,{synthetic:!0}),s):(s=Cu(t,e,r,n),xi(s,`${e}`,void 0),Br(s,{synthetic:!0}),s)}function Cu(t,e,r,n){let i={};if(n&&r){let s=Du(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 Jv(t,{isUnhandledRejection:e}){let r=Fl(t),n=e?"promise rejection":"exception";return ea(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:wn(t)?`Event \`${Qv(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Qv(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Zv(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}function Km(t,{metadata:e,tunnel:r,dsn:n}){let i=b(b({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:wr(n)}),s=e_(t);return xr(i,[s])}function e_(t){return[{type:"user_report"},t]}var Ao=class extends No{constructor(t){let e=b({parentSpanIsAlwaysRootSpan:!0},t),r=Ge.SENTRY_SDK_SOURCE||Kl();wu(e,"browser",["browser"],r),super(e),e.sendClientReports&&Ge.document&&Ge.document.addEventListener("visibilitychange",()=>{Ge.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,e){return Ym(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",r){return qm(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=Km(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=ou(t,this._options.tunnel&&wr(this._dsn));this.sendEnvelope(e)}},Xm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ye=ee,t_=1e3,Jm,Ru,Nu;function Au(t){let e="dom";_t(e,t),Et(e,r_)}function r_(){if(!Ye.document)return;let t=Ze.bind(null,"dom"),e=Qm(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")||(Oe(n,"addEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,f=u.__sentry_instrumentation_handlers__=u.__sentry_instrumentation_handlers__||{},g=f[s]=f[s]||{refCount:0};if(!g.handler){let h=Qm(t);g.handler=h,i.call(this,s,h,c)}g.refCount++}catch{}return i.call(this,s,o,c)}}),Oe(n,"removeEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let u=this,f=u.__sentry_instrumentation_handlers__||{},g=f[s];g&&(g.refCount--,g.refCount<=0&&(i.call(this,s,g.handler,c),g.handler=void 0,delete f[s]),Object.keys(f).length===0&&delete u.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,c)}}))})}function n_(t){if(t.type!==Ru)return!1;try{if(!t.target||t.target._sentryId!==Nu)return!1}catch{}return!0}function i_(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function Qm(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=o_(r);if(i_(r.type,n))return;vt(r,"_sentryCaptured",!0),n&&!n._sentryId&&vt(n,"_sentryId",rt());let i=r.type==="keypress"?"input":r.type;n_(r)||(t({event:r,name:i,global:e}),Ru=r.type,Nu=n?n._sentryId:void 0),clearTimeout(Jm),Jm=Ye.setTimeout(()=>{Nu=void 0,Ru=void 0},t_)}}function o_(t){try{return t.target}catch{return null}}var Pa;function Ou(t){let e="history";_t(e,t),Et(e,s_)}function s_(){if(!cu())return;let t=Ye.onpopstate;Ye.onpopstate=function(...r){let n=Ye.location.href,i=Pa;if(Pa=n,Ze("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=Pa,o=String(i);Pa=o,Ze("history",{from:s,to:o})}return r.apply(this,n)}}Oe(Ye.history,"pushState",e),Oe(Ye.history,"replaceState",e)}var La={};function Pu(t){let e=La[t];if(e)return e;let r=Ye[t];if(bo(r))return La[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){Xm&&q.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return r&&(La[t]=r.bind(Ye))}function Ba(t){La[t]=void 0}var Nn="__sentry_xhr_v3__";function Lu(t){let e="xhr";_t(e,t),Et(e,a_)}function a_(){if(!Ye.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;Oe(t,"open",function(e){return function(...r){let n=Lt()*1e3,i=yt(r[0])?r[0].toUpperCase():void 0,s=c_(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 c=this[Nn];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}let u={endTimestamp:Lt()*1e3,startTimestamp:n,xhr:this};Ze("xhr",u)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Oe(this,"onreadystatechange",function(c){return function(...u){return o(),c.apply(this,u)}}):this.addEventListener("readystatechange",o),Oe(this,"setRequestHeader",function(c){return function(...u){let[f,g]=u,h=this[Nn];return h&&yt(f)&&yt(g)&&(h.request_headers[f.toLowerCase()]=g),c.apply(this,u)}}),e.apply(this,r)}}),Oe(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:Lt()*1e3,xhr:this};return Ze("xhr",i),e.apply(this,r)}})}function c_(t){if(yt(t))return t;try{return t.toString()}catch{}}function Bu(t,e=Pu("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let c=b({body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return Ba("fetch"),Jr("No fetch implementation available");try{return e(t.url,c).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 Ba("fetch"),r-=o,n--,Jr(u)}}return xa(t,i)}var l_=30,u_=50;function Uu(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 p_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,f_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,m_=/\((\S*)(?::(\d+))(?::(\d+))\)/,d_=t=>{let e=p_.exec(t);if(e){let[,n,i,s]=e;return Uu(n,Ir,+i,+s)}let r=f_.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=m_.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=rd(r[1]||Ir,r[2]);return Uu(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Zm=[l_,d_],h_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,g_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,y_=t=>{let e=h_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=g_.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]=rd(n,r),Uu(r,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},ed=[u_,y_],td=[Zm,ed],Mu=$l(...td),rd=(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]},Ua=1024,__="Breadcrumbs",E_=(t={})=>{let e=b({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:__,setup(r){e.console&&jl(w_(r)),e.dom&&Au(b_(r,e.dom)),e.xhr&&Lu(I_(r)),e.fetch&&zl(T_(r)),e.history&&Ou(x_(r)),e.sentry&&r.on("beforeSendEvent",S_(r))}}},nd=E_;function S_(t){return function(e){Be()===t&&Cr({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:ir(e)},{event:e})}}function b_(t,e){return function(r){if(Be()!==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>Ua&&(Mr&&q.warn(`\`dom.maxStringLength\` cannot exceed ${Ua}, but a value of ${o} was configured. Sentry will use ${Ua} instead.`),o=Ua),typeof s=="string"&&(s=[s]);try{let u=r.event,f=C_(u)?u.target:u;n=Eo(f,{keyAttrs:s,maxStringLength:o}),i=Ul(f)}catch{n="<unknown>"}if(n.length===0)return;let c={category:`ui.${r.name}`,message:n};i&&(c.data={"ui.component_name":i}),Cr(c,{event:r.event,name:r.name,global:r.global})}}function w_(t){return function(e){if(Be()!==t)return;let r={category:"console",data:{arguments:e.args,logger:"console"},level:Ql(e.level),message:ra(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)r.message=`Assertion failed: ${ra(e.args.slice(1)," ")||"console.assert"}`,r.data.arguments=e.args.slice(1);else return;Cr(r,{input:e.args,level:e.level})}}function I_(t){return function(e){if(Be()!==t)return;let{startTimestamp:r,endTimestamp:n}=e,i=e.xhr[Nn];if(!r||!n||!i)return;let{method:s,url:o,status_code:c,body:u}=i,f={method:s,url:o,status_code:c},g={xhr:e.xhr,input:u,startTimestamp:r,endTimestamp:n};Cr({category:"xhr",data:f,type:"http"},g)}}function T_(t){return function(e){if(Be()!==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(b({},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 x_(t){return function(e){if(Be()!==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 C_(t){return!!t&&!!t.target}var D_=["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"],R_="BrowserApiErrors",N_=(t={})=>{let e=b({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t);return{name:R_,setupOnce(){e.setTimeout&&Oe(Ge,"setTimeout",id),e.setInterval&&Oe(Ge,"setInterval",id),e.requestAnimationFrame&&Oe(Ge,"requestAnimationFrame",A_),e.XMLHttpRequest&&"XMLHttpRequest"in Ge&&Oe(XMLHttpRequest.prototype,"send",O_);let r=e.eventTarget;r&&(Array.isArray(r)?r:D_).forEach(P_)}}},od=N_;function id(t){return function(...e){let r=e[0];return e[0]=Rn(r,{mechanism:{data:{function:zt(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function A_(t){return function(e){return t.apply(this,[Rn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:zt(t)},handled:!1,type:"instrument"}})])}}function O_(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Oe(r,n,function(i){let s={mechanism:{data:{function:n,handler:zt(i)},handled:!1,type:"instrument"}},o=In(i);return o&&(s.mechanism.data.handler=zt(o)),Rn(i,s)})}),t.apply(this,e)}}function P_(t){let e=Ge,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Oe(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Rn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:zt(s),target:t},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,Rn(s,{mechanism:{data:{function:"addEventListener",handler:zt(s),target:t},handled:!1,type:"instrument"}}),o])}}),Oe(r,"removeEventListener",function(n){return function(i,s,o){let c=s;try{let u=c&&c.__sentry_wrapped__;u&&n.call(this,i,u,o)}catch{}return n.call(this,i,c,o)}}))}var L_="GlobalHandlers",B_=(t={})=>{let e=b({onerror:!0,onunhandledrejection:!0},t);return{name:L_,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&(U_(r),sd("onerror")),e.onunhandledrejection&&(M_(r),sd("onunhandledrejection"))}}},ad=B_;function U_(t){Yl(e=>{let{stackParser:r,attachStacktrace:n}=cd();if(Be()!==t||Tu())return;let{msg:i,url:s,line:o,column:c,error:u}=e,f=H_(Oa(r,u||i,void 0,n,!1),s,o,c);f.level="error",Ro(f,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function M_(t){ql(e=>{let{stackParser:r,attachStacktrace:n}=cd();if(Be()!==t||Tu())return;let i=k_(e),s=bn(i)?F_(i):Oa(r,i,void 0,n,!0);s.level="error",Ro(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function k_(t){if(bn(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 F_(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function H_(t,e,r,n){let i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},c=o.stacktrace=o.stacktrace||{},u=c.frames=c.frames||[],f=isNaN(parseInt(n,10))?void 0:n,g=isNaN(parseInt(r,10))?void 0:r,h=yt(e)&&e.length>0?e:Bl();return u.length===0&&u.push({colno:f,filename:h,function:Ir,in_app:!0,lineno:g}),t}function sd(t){Mr&&q.log(`Global Handler attached: ${t}`)}function cd(){let t=Be();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var ld=()=>({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=b(b(b({},t.request&&t.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=Z(b(b({},t.request),e&&{url:e}),{headers:i});t.request=s}}),$_="cause",j_=5,W_="LinkedErrors",G_=(t={})=>{let e=t.limit||j_,r=t.key||$_;return{name:W_,preprocessEvent(n,i,s){let o=s.getOptions();Pl(Aa,o.stackParser,o.maxValueLength,r,e,n,i)}}},ud=G_;function ku(t){return[Ra(),Ca(),od(),nd(),ad(),ud(),Na(),ld()]}var Fu=class extends Error{cause;constructor(t,e){super(t),this.cause=e}},Ue=class Cd{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Cd),this.INSTANCE}captureException(e,r,n){w.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){w.error(e,r);let s=this.getNewScope(n,i),o=new Fu(e,r);s.captureException(o)}setGlobalContext(e,r){this.contexts[e]=b({context:r},this.contexts[e])}setUser(e){this.user=e}setTags(e){this.tags=e}getNewScope(e,r){let n=new ut;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",se.getTimezone()),n}init(){let e=ku({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new Ao({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:Bu,stackParser:Mu,integrations:e,environment:Qt.mode,release:`web-sdk@${A.SDK_VERSION}`,debug:Qt.debug}),this.client.init()}},Hu={d:(t,e)=>{for(var r in e)Hu.o(e,r)&&!Hu.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},$u={};Hu.d($u,{A:()=>Y_,k:()=>ju});var V_=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(f){try{u(n.next(f))}catch(g){s(g)}}function c(f){try{u(n.throw(f))}catch(g){s(g)}}function u(f){var g;f.done?i(f.value):(g=f.value,g instanceof r?g:new r(function(h){h(g)})).then(o,c)}u((n=n.apply(t,e||[])).next())})},z_=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:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return function(g){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,g[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&g[0]?n.return:g[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,g[1])).done)return i;switch(n=0,i&&(g=[2&g[0],i.value]),g[0]){case 0:case 1:i=g;break;case 4:return o.label++,{value:g[1],done:!1};case 5:o.label++,n=g[1],g=[0];continue;case 7:g=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||g[0]!==6&&g[0]!==2)){o=0;continue}if(g[0]===3&&(!i||g[1]>i[0]&&g[1]<i[3])){o.label=g[1];break}if(g[0]===6&&o.label<i[1]){o.label=i[1],i=g;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(g);break}i[2]&&o.ops.pop(),o.trys.pop();continue}g=e.call(t,o)}catch(h){g=[6,h],n=0}finally{r=i=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([u,f])}}};function ju(){return V_(this,void 0,Promise,function(){return z_(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=ju);var Y_=ju,pd=$u.A,PL=$u.k,hd=Jt(tn()),Ma=class{parser;result={};constructor(){this.parser=Nt.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&&(w.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=b({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 w.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))}},ka=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)})}},Fa=class{static updateIdentity(t){if(!this.isInstalled())return;let e={};t.email&&(e.email=t.email),t.mobile&&(e.phone_number=t.mobile),w.debug("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",e])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}},Ha=class{apiService;action;triggerContext;constructor(t,e){this.action=t,this.apiService=ue.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:w.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;se.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){w.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)){w.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}),se.showSnackbar("Coupon applied on cart"),Fa.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}},qt=class{renderer=Nt.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(b(b(b(b({},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 Ha(t,this.triggerContext).execute()}),this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}},Dr=class extends qt{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 qt{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=this.renderer.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}},An=class extends qt{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 Td extends qt{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",Td.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 b(b({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(){}},ja=class extends qt{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)}},Wa=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()})}},Ga=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()})}},Va=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(b(b(b({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)}},za=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}},Ya=class extends An{constructor(t,e,r){super(t,e,r)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}},qa=Jt(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 gt),this.topics[e].next(r)}subscriber(e){return this.topics[e]||(this.topics[e]=new gt),this.topics[e].asObservable()}},et=class Gr{static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=je.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=[Gr.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 Gr._instance||(Gr._instance=new Gr),Gr._instance}static forceUpdate(){Gr._instance=new Gr}isOpen(){let e=this.inShadow?this.isPresent():this.isVisible();return qa.default.log(`Cart drawer is currently ${e?"open":"close"}`),e}open(){if(this.isOpen()){w.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent(A.CTA_OPEN_CART_EVENT));let e=document.querySelector(this.iconSelector);if(!e){w.debug("No clickable cart icon found with selector",this.iconSelector);return}e.click()}onToggle(){return this.drawerSubject}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===Gr.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 window.icartCartActivityEvent?window.icartCartActivityEvent():window.theme?.CartDrawer?new window.theme.CartDrawer().init():window.Hs_CartDrawer?.updateSlideCart?window.Hs_CartDrawer.updateSlideCart():window.theme?.fetch_side_cart?window.theme.fetch_side_cart():window.theme?.Cart?.updateCart?window.theme.Cart.updateCart():window.cartUpdate?window.cartUpdate():this.element?._onCartRefresh?this.element._onCartRefresh():this.element?.tagName?.toLowerCase()==="cart-drawer-component"?document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart")):this.element?.id==="sidebar-cart"?document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}})):w.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 se.retrySelector(e),!this.cartDrawerElement){qa.default.warn("Max attempts exhausted to find cart drawer");return}qa.default.log("Found",this.cartDrawerElement,`from selector: ${e}`),this.createMutationObserver()}async findCartDrawerWithShadow(){if(!Ae.isShopify()||!this.shadowParentElementSelector)return;let e=(await se.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,c=this.cartDrawerElement.tagName.toLowerCase()===Gr.DEFAULT_SELECTOR&&this.cartDrawerElement.open,u=getComputedStyle(this.cartDrawerElement),f=u.display!=="none"&&u.visibility!=="hidden"&&parseFloat(u.opacity)>0,g=!this.cartDrawerElement.hidden,h=this.cartDrawerElement.offsetWidth>0||this.cartDrawerElement.offsetHeight>0||this.cartDrawerElement.getClientRects().length>0,v=u.transform.match(/matrix\(([^)]+)\)/),_=0,m=0;if(v){let V=v[1].split(", ").map(parseFloat);_=V[4],m=V[5]}let y=_+e.left>n||_+e.right<0||m+e.top>r||m+e.bottom<0,T=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=T*O,R=e.width*e.height,k=R>0&&H/R>=.1;return(o||c||!y)&&f&&g&&h&&k}createMutationObserver(){if(!this.cartDrawerElement&&!this.cartDrawerShadowElement)return;let e=this.cartDrawerElement||this.cartDrawerShadowElement,r=new gt;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 vc{static ACTIVE_TRIGGER_DATA;renderer=Nt.get();safeHTTP;parent;rootContainer;containerHTMLElement;ian;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.safeHTTP=ue.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 Pt(e))}async renderEngagement(e){if(!e.previewType&&vc.ACTIVE_TRIGGER_DATA){let r={triggerShown:new mi(vc.ACTIVE_TRIGGER_DATA??{})};this.skipTrigger(e,r);return}if(vc.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(!et.get().isOpen()||!this.renderer.isMobile()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=et.get().onToggle().subscribe(({open:e})=>{!e&&this.startRenderingOnce()})}startRenderingOnce(){if(fe.get().isGoKwikPopupOpen){this.skipTrigger(this.triggerContext.triggerData,{reason:"GoKwik popup is open"});return}try{this.startRendering()}catch(e){Ue.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 w.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 Wa(e,r,n).render():r instanceof ni?new Ga(e,r,n).render():r instanceof Yr?new Oo(e,r,n).render():r instanceof ii?new Ya(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 Va(e,r,n).render():r instanceof ti?new za(e,r,n).render():w.error("Unsupported element type- "+r.type)}renderContainer(e){let r=this.ian?.cont;r&&(this.containerHTMLElement=new ja(this.rootContainer,r,e).render().getHTMLElement(),new ka().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),vc.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(){Nt.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"})}},Ka=class{triggerData;safeHttpService=ue.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){w.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(kt.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}},Xa=class{static trackIntent(t){if(!this.isInstalled()){w.log("Facebook pixel not installed");return}if(!je.get().pixelPush){w.log("Facebook pixel push not enabled");return}let e=cn[t.intent]?.toLowerCase(),r=t.segmentName;!e&&!r||(w.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"}},md=Jt(fd()),On=class{static _flags={};static getFlags(){return this._flags}static setFlags(t){this._flags=t??{}}static isECommerceApp(){return Ae.isShopify()}},q_=(0,md.default)(fetch),K_={retryDelay:A.API_CALL_RETRY_DELAY,retryOn:(t,e,r)=>t>=A.API_CALL_MAX_ATTEMPTS?!1:!!(e!==null||r?.status&&r?.status>=500)},Tt=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=>{w.log("Updated user profile"),await Pn.getInstance().storeAndPopulateAuthData(r)}).catch(r=>{w.error("Error saving user profile",r)})}trackOrder(e){this.post("/v1/event/track-order",e).then(()=>{w.log("Sent Order")}).catch(r=>{w.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(()=>{w.log("Updated device property")}).catch(async r=>{w.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 w.log(`Rejecting ${e} ${r} as this is not e-commerce app`),Promise.reject();r.startsWith("http")||(r=Qt.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(c){return Ue.getInstance().captureException(c,{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=b(b({},K_),r),i=await q_(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((c,u)=>{o.setRequestHeader(u,c)}),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(c){s(c)}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),Qt.debug&&e.set("cooee-sdk-debug",String(1)),e}},Pi=class{static sentryService=Ue.getInstance();static httpApiService=Tt.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 c of o.vars){let u=i.find(h=>h.variant_id.toString()===c.mID);if(!u)continue;let f=new It(o);f.name=u.title;let g=new dr(c);g.name=u.variant_title,g.price.d=u.discounted_price/100,f.variants=[g],s.push(f)}return s}if(je.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 ue.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 w.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(c=>c.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):(w.error("Item not found after AJAX call for:",r),null)}},Ja=class kd{static INSTANCE;httpService=ae.get(Tt);sentryService=ae.get(Ue);sessionManager=ae.get(qe);runtime=fe.get();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new kd),this.INSTANCE}sendSilently(e){this.send(e).catch(r=>w.error(`Failed to send ${e.name}`,r))}async send(e){if(w.debug(`Sending event ${e.name}`),Kt.prepend(`Sending event <strong>${e.name}</strong> with id ${e.id}`),this.shouldReject(e)){w.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=>{w.log("\u2705 Event tracked:",e.name),Kt.prepend(`\u2705 Event <strong>${r.eventName}</strong> tracked`),this.processEventResponse(e,r)}).catch(r=>{w.error(`Error sending event ${e.name} to server`,r)})}shouldReject(e){return e.trigger?.triggerID==="test"||e.trigger?.triggerID==="preview"?(w.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){w.error("Error fetching Shopify cart before sending the event",r)}}processEventResponse(e,r){this.renderWidgetIfAny(e,r).catch(n=>{w.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){w.log(`Nothing to engage after ${e.name}`);return}w.log(`\u{1F4E3} Engagement(id=${r.triggerData.shortID}) will be shown`,r.triggerData);let n=new Pt(r.triggerData);n.occurred=e.occurred;let i;try{i=await Pi.refreshItems(n)}catch(s){w.error("Failed to refresh the products",s);return}if(n.items=i,n.contentSource===qi.KLAVIYO){new Ka().render(n);return}new Oi().renderEngagement(n).catch(s=>{w.error("Failed to render popup",s),this.sentryService.captureException(s,{event:e,triggerData:n})})}utiliseIntentIfCalculated(e){e.intent&&(Di.trackIntent(e.intent),Xa.trackIntent(e),Kt.prepend(`Intent is <strong>${cn[e.intent]}</strong>`))}addShopifyAttributes(){Ae.isShopify()&&ge.getCurrent().addCooeeAttributes().catch(e=>{w.error("Fail to add attributes in cart",e)})}},ue=class Pd{static INSTANCE;httpApiService=Tt.getInstance();eventAPIService=Ja.getInstance();constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Pd),this.INSTANCE}sendEvent(e){w.debug(`Waiting for auth to send event ${e.name}`),qe.replaySubject.subscribe(async()=>{this.eventAPIService.sendSilently(e)})}updateProfile(e){qe.replaySubject.subscribe(()=>{this.httpApiService.updateUserData(e??{})})}trackOrder(e){qe.replaySubject.subscribe(()=>{this.httpApiService.trackOrder(e)})}updateDeviceProps(e){qe.replaySubject.subscribe(()=>{this.httpApiService.updateDeviceProps({props:e})})}generateDiscount(e){return this.httpApiService.generateDiscount(e)}},Kt=class{static isOn=!1;static element;static watch(){let t=w.getDebugParam();(t==="1"||t==="on")&&ue.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="&#x2022; "+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=c=>{c=c||window.event,c.preventDefault(),r=c.clientX,n=c.clientY,document.onmouseup=o,document.onmousemove=s},s=c=>{c=c||window.event,c.preventDefault(),t=r-c.clientX,e=n-c.clientY,r=c.clientX,n=c.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 zr{static storeName="app";static{this.storage=Kn(this.storeName)}},Qa=class{static processConfiguration(){let t=je.get();!t.gaMeasurementID||!t.gaEnabled||this.sendClientID()}static async sendClientID(){let t=await this.getClientID();t&&ue.getInstance().updateDeviceProps({gaClientID:t})}static async getClientID(){let t=await Ne.get(ne.GA_CLIENT_ID),e=await this.getClientIDViaGTag();if(t!==e)return await Ne.set(ne.GA_CLIENT_ID,e),e}static async getClientIDViaGTag(){let t=je.get().gaMeasurementID;if(!(!t||!window.gtag))return new Promise(e=>{window.gtag("get",t,"client_id",r=>{e(r)})})}},Za=class Rd{static INSTANCE;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Rd),this.INSTANCE}init(){Bo.get(ne.APP_CONFIG,{}).then(e=>this.updateGlobalConfig(e))}async processAppConfigurations(e){w.log("Received app configuration",e),e.currencyCount=e.currencies?.length;let r=this.updateGlobalConfig(e);Bo.set(ne.APP_CONFIG,r).catch(n=>w.error(n)),Qa.processConfiguration(),r.website&&(ht.injectRawScript(r.website.commonJS),ht.injectRawCSS(r.website.commonCSS)),et.get().onToggle().subscribe(async({open:n})=>{w.info("Cart drawer is now",n?"open":"closed"),n&&(ae.get(ar).loadOrRenderWidgetsAfterCartChange(),await this.trackViewCartEvent())})}updateGlobalConfig(e){let r=Se.globalRef.config.update(e);return et.forceUpdate(),w.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};ue.getInstance().sendEvent(new ve(A.EVENT_VIEW_CART,n))}},dd=Jt(vl()),ec=class Ju{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 dd.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 Ju(r);if(this.GOOGLE_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return r={source:"GOOGLE"},new Ju(r)}},Pn=class Ld{static INSTANCE=new Ld;httpAPIService=Tt.getInstance();coreService=Za.getInstance();sentryService=Ue.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(ne.ID,e.userID)),e.deviceID&&(this.deviceID=e.deviceID,await Ne.set(ne.DEVICE_ID,e.deviceID)),e.sdkToken&&(this.sdkToken=e.sdkToken,await Ne.set(ne.SDK_TOKEN,e.sdkToken)),this.updateAPIClient())}async validateSession(e){await this.populateFirstSeen(),await this.populateUserDataFromStorage(),w.log("Validating session with server");let r=await this.getSessionValidateData(e);try{let n=await this.httpAPIService.validateSession(r);w.log("Validating session Response",n),await this.coreService.processAppConfigurations(n.appSettings),await this.storeAndPopulateAuthData(n)}catch(n){throw w.error(n),n}}async populateUserDataFromStorage(){if(this.sdkToken=await Ne.get(ne.SDK_TOKEN),!this.sdkToken){w.warn("No SDK token found in local storage");return}this.userID=await Ne.get(ne.ID),this.deviceID=await Ne.get(ne.DEVICE_ID),this.updateAPIClient()}updateAPIClient(){w.debug("SDK Token:",this.sdkToken),w.log("Device ID:",this.deviceID),w.log("User ID:",this.userID),Di.trackDeviceID(this.deviceID),Kt.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 Ma().get();r.host=location.origin;try{(await pd())?.isPrivate&&(r.private=!0)}catch(i){hd.default.error("Unable to detect private/incognito window",i)}let n=await Ne.get(ne.DEVICE_ID);return n||(n=new Je().toHexString(),await Ne.set(ne.DEVICE_ID,n)),Z(b({deviceID:n,deviceProps:r,appID:this.appID,shopifyShop:this.shopifyShop},e),{sdk:A.SDK,page:_r.parseFromCurrent(),ad:ec.getAdParams(),occurred:this.getSessionStartTime(fe.get().jsLoadTime),currentItem:fe.get().getCurrentItem(),cart:await ge.getCurrent().getNormalisedCart(),properties:{}})}async populateFirstSeen(){let e=await Ne.get(ne.FIRST_SEEN),r=e?new Date(e):new Date;e||await Ne.set(ne.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}},qe=class yc{static replaySubject=new ho(1);static INSTANCE;sentryService=ae.get(Ue);lock=new Xn;constructor(){}static getInstance(){return this.INSTANCE||(this.INSTANCE=new yc),this.INSTANCE}init(e){if(w.debug("Initialising SDK",e),Gf(navigator.userAgent)){w.info("This seems to be a bot. Disabling SDK");return}Pn.getInstance().init(e),yc.INSTANCE.checkForNewSession(!0).then(async()=>{yc.replaySubject.next(!0),yc.replaySubject.complete()}).catch(r=>w.error("Unable to perform device init",r))}getCurrentSessionID(){return at.set(ne.SESSION_LAST_USED_TIME,new Date().getTime()),at.get(ne.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 at.set(ne.SESSION_SYNCED,!0)}this.lock.release()}async startNewSession(){w.debug("Starting new session"),await at.clear(),w.debug("Cleared SessionStorage before starting new session");let e=new Date,r=new Je().toHexString();w.debug("New session ID to be used",r);let n=await Ne.get(ne.SESSION_NUMBER,0)+1;Kt.prepend(`New Session ID: <strong>${r}</strong> & number: ${n}`),await Promise.all([Ne.set(ne.SESSION_NUMBER,n),at.set(ne.ID,r),at.set(ne.SESSION_LAST_USED_TIME,e.getTime()),at.set(ne.SESSION_LANDING_PAGE,_r.parseFromCurrent())])}getLandingPage(){return at.get(ne.SESSION_LANDING_PAGE,{})}getCurrentSessionNumber(){return Ne.get(ne.SESSION_NUMBER,1)}async isNewSessionRequired(){if(!await at.get(ne.ID))return!0;let e=await at.get(ne.SESSION_LAST_USED_TIME,0);return e?(new Date().getTime()-e)/1e3>A.IDLE_TIME_IN_SECONDS:!0}async notSynced(){return!await at.get(ne.SESSION_SYNCED,!1)}},yd=Jt(tn()),gd=Jt(tn()),X_=`
43
39
  mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
44
40
  cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
45
41
  cart {