@letscooee/web-sdk 9.3.0 → 9.3.1

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
- var ih=Object.create;var 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;var 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));var 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')});var Vi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var 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};var Xt=(t,e,r)=>(r=t!=null?ih(lh(t)):{},ph(e||!t||!t.__esModule?wc(r,"default",{value:t,enumerable:!0}):r,t));var tn=Vi((tp,Yo)=>{"use strict";(function(t){"use strict";var e={};e.VERSION="1.6.1";var r,n={},i=function(m,p){return function(){return p.apply(m,arguments)}},o=function(){var m=arguments,p=m[0],f,d;for(d=1;d<m.length;d++)for(f in m[d])!(f in p)&&m[d].hasOwnProperty(f)&&(p[f]=m[d][f]);return p},s=function(m,p){return{value:m,name:p}};e.TRACE=s(1,"TRACE"),e.DEBUG=s(2,"DEBUG"),e.INFO=s(3,"INFO"),e.TIME=s(4,"TIME"),e.WARN=s(5,"WARN"),e.ERROR=s(8,"ERROR"),e.OFF=s(99,"OFF");var a=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info};a.prototype={setLevel:function(m){m&&"value"in m&&(this.context.filterLevel=m)},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var p=this.context.filterLevel;return m.value>=p.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(m){typeof m=="string"&&m.length>0&&this.invoke(e.TIME,[m,"start"])},timeEnd:function(m){typeof m=="string"&&m.length>0&&this.invoke(e.TIME,[m,"end"])},invoke:function(m,p){r&&this.enabledFor(m)&&r(p,o({level:m},this.context))}};var l=new a({filterLevel:e.OFF});(function(){var m=e;m.enabledFor=i(l,l.enabledFor),m.trace=i(l,l.trace),m.debug=i(l,l.debug),m.time=i(l,l.time),m.timeEnd=i(l,l.timeEnd),m.info=i(l,l.info),m.warn=i(l,l.warn),m.error=i(l,l.error),m.log=m.info})(),e.setHandler=function(m){r=m},e.setLevel=function(m){l.setLevel(m);for(var p in n)n.hasOwnProperty(p)&&n[p].setLevel(m)},e.getLevel=function(){return l.getLevel()},e.get=function(m){return n[m]||(n[m]=new a(o({name:m},l.context)))},e.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(g,E){E.name&&g.unshift("["+E.name+"]")};var p={},f=function(d,g){Function.prototype.apply.call(d,console,g)};return typeof console>"u"?function(){}:function(d,g){d=Array.prototype.slice.call(d);var E=console.log,N;g.level===e.TIME?(N=(g.name?"["+g.name+"] ":"")+d[0],d[1]==="start"?console.time?console.time(N):p[N]=new Date().getTime():console.timeEnd?console.timeEnd(N):f(E,[N+": "+(new Date().getTime()-p[N])+"ms"])):(g.level===e.WARN&&console.warn?E=console.warn:g.level===e.ERROR&&console.error?E=console.error:g.level===e.INFO&&console.info?E=console.info:g.level===e.DEBUG&&console.debug?E=console.debug:g.level===e.TRACE&&console.trace&&(E=console.trace),m.formatter(d,g),f(E,d))}},e.useDefaults=function(m){e.setLevel(m&&m.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(m))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof Yo<"u"&&Yo.exports?Yo.exports=e:(e._prevLogger=t.Logger,e.noConflict=function(){return t.Logger=e._prevLogger,e},t.Logger=e)})(tp)});var Bp=Vi((to,rs)=>{"use strict";(function(t,e){"use strict";var r="1.0.40",n="",i="?",o="function",s="undefined",a="object",l="string",m="major",p="model",f="name",d="type",g="vendor",E="version",N="architecture",P="console",R="mobile",x="tablet",W="smarttv",$="wearable",ie="embedded",k=500,X="Amazon",z="Apple",oe="ASUS",Ce="BlackBerry",de="Browser",be="Chrome",He="Edge",Pe="Firefox",ot="Google",St="Huawei",we="LG",Me="Microsoft",pe="Motorola",te="Opera",ke="Samsung",pt="Sharp",ar="Sony",$r="Xiaomi",en="Zebra",Bn="Facebook",jr="Chromium OS",Un="Mac OS",Mn=" Browser",kn=function(V,J){var G={};for(var he in V)J[he]&&J[he].length%2===0?G[he]=J[he].concat(V[he]):G[he]=V[he];return G},Jt=function(V){for(var J={},G=0;G<V.length;G++)J[V[G].toUpperCase()]=V[G];return J},ft=function(V,J){return typeof V===l?Bt(J).indexOf(Bt(V))!==-1:!1},Bt=function(V){return V.toLowerCase()},Hi=function(V){return typeof V===l?V.replace(/[^\d\.]/g,n).split(".")[0]:e},y=function(V,J){if(typeof V===l)return V=V.replace(/^\s\s*/,n),typeof J===s?V:V.substring(0,k)},c=function(V,J){for(var G=0,he,mt,st,ye,Q,Ct;G<J.length&&!Q;){var Fn=J[G],$i=J[G+1];for(he=mt=0;he<Fn.length&&!Q&&Fn[he];)if(Q=Fn[he++].exec(V),Q)for(st=0;st<$i.length;st++)Ct=Q[++mt],ye=$i[st],typeof ye===a&&ye.length>0?ye.length===2?typeof ye[1]==o?this[ye[0]]=ye[1].call(this,Ct):this[ye[0]]=ye[1]:ye.length===3?typeof ye[1]===o&&!(ye[1].exec&&ye[1].test)?this[ye[0]]=Ct?ye[1].call(this,Ct,ye[2]):e:this[ye[0]]=Ct?Ct.replace(ye[1],ye[2]):e:ye.length===4&&(this[ye[0]]=Ct?ye[3].call(this,Ct.replace(ye[1],ye[2])):e):this[ye]=Ct||e;G+=2}},u=function(V,J){for(var G in J)if(typeof J[G]===a&&J[G].length>0){for(var he=0;he<J[G].length;he++)if(ft(J[G][he],V))return G===i?e:G}else if(ft(J[G],V))return G===i?e:G;return J.hasOwnProperty("*")?J["*"]:V},_={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},D={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"},B={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,E],[/opios[\/ ]+([\w\.]+)/i],[E,[f,te+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[E,[f,te+" GX"]],[/\bopr\/([\w\.]+)/i],[E,[f,te]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[E,[f,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[E,[f,"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],[f,E],[/quark(?:pc)?\/([-\w\.]+)/i],[E,[f,"Quark"]],[/\bddg\/([\w\.]+)/i],[E,[f,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[f,"UC"+de]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[E,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[E,[f,"Smart Lenovo "+de]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+de],E],[/\bfocus\/([\w\.]+)/i],[E,[f,Pe+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[f,te+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[f,te+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[f,"MIUI"+Mn]],[/fxios\/([\w\.-]+)/i],[E,[f,Pe]],[/\bqihoobrowser\/?([\w\.]*)/i],[E,[f,"360"]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,"$1Browser"],E],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1"+Mn],E],[/samsungbrowser\/([\w\.]+)/i],[E,[f,ke+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[E,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,E],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[E,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,Bn],E],[/(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],[f,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[f,be+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,be+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[f,"Android "+de]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[E,u,_]],[/(webkit|khtml)\/([\w\.]+)/i],[f,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],E],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[f,Pe+" 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],[f,[E,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[f,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[N,"amd64"]],[/(ia32(?=;))/i],[[N,Bt]],[/((?:i[346]|x)86)[;\)]/i],[[N,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/windows (ce|mobile); ppc;/i],[[N,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[N,/ower/,n,Bt]],[/(sun4\w)[;\)]/i],[[N,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[N,Bt]]],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],[p,[g,ke],[d,x]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[g,ke],[d,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[g,z],[d,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[g,z],[d,x]],[/(macintosh);/i],[p,[g,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[g,pt],[d,R]],[/(?:honor)([-\w ]+)[;\)]/i],[p,[g,"Honor"],[d,R]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[g,St],[d,x]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[g,St],[d,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],[[p,/_/g," "],[g,$r],[d,R]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[g,$r],[d,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[g,"OPPO"],[d,R]],[/\b(opd2\d{3}a?) bui/i],[p,[g,"OPPO"],[d,x]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[g,"Vivo"],[d,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[g,"Realme"],[d,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],[p,[g,pe],[d,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[g,pe],[d,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[g,we],[d,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[g,we],[d,R]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[g,"Lenovo"],[d,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[g,"Nokia"],[d,R]],[/(pixel c)\b/i],[p,[g,ot],[d,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[g,ot],[d,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],[p,[g,ar],[d,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[g,ar],[d,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[g,"OnePlus"],[d,R]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[g,X],[d,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[g,X],[d,R]],[/(playbook);[-\w\),; ]+(rim)/i],[p,g,[d,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[g,Ce],[d,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[g,oe],[d,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[g,oe],[d,R]],[/(nexus 9)/i],[p,[g,"HTC"],[d,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[p,/_/g," "],[d,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],[p,[g,"TCL"],[d,x]],[/(itel) ((\w+))/i],[[g,Bt],p,[d,u,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[g,"Acer"],[d,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[g,"Meizu"],[d,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[g,"Ulefone"],[d,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[g,"Energizer"],[d,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[g,"Cat"],[d,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[g,"Smartfren"],[d,R]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[g,"Nothing"],[d,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],[g,p,[d,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],[g,p,[d,x]],[/(surface duo)/i],[p,[g,Me],[d,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[g,"Fairphone"],[d,R]],[/(u304aa)/i],[p,[g,"AT&T"],[d,R]],[/\bsie-(\w*)/i],[p,[g,"Siemens"],[d,R]],[/\b(rct\w+) b/i],[p,[g,"RCA"],[d,x]],[/\b(venue[\d ]{2,7}) b/i],[p,[g,"Dell"],[d,x]],[/\b(q(?:mv|ta)\w+) b/i],[p,[g,"Verizon"],[d,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[g,"Barnes & Noble"],[d,x]],[/\b(tm\d{3}\w+) b/i],[p,[g,"NuVision"],[d,x]],[/\b(k88) b/i],[p,[g,"ZTE"],[d,x]],[/\b(nx\d{3}j) b/i],[p,[g,"ZTE"],[d,R]],[/\b(gen\d{3}) b.+49h/i],[p,[g,"Swiss"],[d,R]],[/\b(zur\d{3}) b/i],[p,[g,"Swiss"],[d,x]],[/\b((zeki)?tb.*\b) b/i],[p,[g,"Zeki"],[d,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],p,[d,x]],[/\b(ns-?\w{0,9}) b/i],[p,[g,"Insignia"],[d,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[g,"NextBook"],[d,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],p,[d,R]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],p,[d,R]],[/\b(ph-1) /i],[p,[g,"Essential"],[d,R]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[g,"Envizen"],[d,x]],[/\b(trio[-\w\. ]+) b/i],[p,[g,"MachSpeed"],[d,x]],[/\btu_(1491) b/i],[p,[g,"Rotor"],[d,x]],[/(shield[\w ]+) b/i],[p,[g,"Nvidia"],[d,x]],[/(sprint) (\w+)/i],[g,p,[d,R]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[g,Me],[d,R]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[g,en],[d,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[g,en],[d,R]],[/smart-tv.+(samsung)/i],[g,[d,W]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[g,ke],[d,W]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,we],[d,W]],[/(apple) ?tv/i],[g,[p,z+" TV"],[d,W]],[/crkey/i],[[p,be+"cast"],[g,ot],[d,W]],[/droid.+aft(\w+)( bui|\))/i],[p,[g,X],[d,W]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[g,pt],[d,W]],[/(bravia[\w ]+)( bui|\))/i],[p,[g,ar],[d,W]],[/(mitv-\w{5}) bui/i],[p,[g,$r],[d,W]],[/Hbbtv.*(technisat) (.*);/i],[g,p,[d,W]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,y],[p,y],[d,W]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,W]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,p,[d,P]],[/droid.+; (shield) bui/i],[p,[g,"Nvidia"],[d,P]],[/(playstation [345portablevi]+)/i],[p,[g,ar],[d,P]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[g,Me],[d,P]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[p,[g,ke],[d,$]],[/((pebble))app/i],[g,p,[d,$]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[g,z],[d,$]],[/droid.+; (glass) \d/i],[p,[g,ot],[d,$]],[/droid.+; (wt63?0{2,3})\)/i],[p,[g,en],[d,$]],[/droid.+; (glass) \d/i],[p,[g,ot],[d,$]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,p,[d,$]],[/; (quest( \d| pro)?)/i],[p,[g,Bn],[d,$]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[d,ie]],[/(aeobc)\b/i],[p,[g,X],[d,ie]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[d,R]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[d,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,R]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[f,He+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[f,E],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[f,"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],[f,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,E],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[f,[E,u,D]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[E,u,D],[f,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,Un],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,E],[/\(bb(10);/i],[E,[f,Ce]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[f,Pe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[f,be+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,jr],E],[/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],[f,E],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,E]]},L=function(V,J){if(typeof V===a&&(J=V,V=e),!(this instanceof L))return new L(V,J).getResult();var G=typeof t!==s&&t.navigator?t.navigator:e,he=V||(G&&G.userAgent?G.userAgent:n),mt=G&&G.userAgentData?G.userAgentData:e,st=J?kn(B,J):B,ye=G&&G.userAgent==he;return this.getBrowser=function(){var Q={};return Q[f]=e,Q[E]=e,c.call(Q,he,st.browser),Q[m]=Hi(Q[E]),ye&&G&&G.brave&&typeof G.brave.isBrave==o&&(Q[f]="Brave"),Q},this.getCPU=function(){var Q={};return Q[N]=e,c.call(Q,he,st.cpu),Q},this.getDevice=function(){var Q={};return Q[g]=e,Q[p]=e,Q[d]=e,c.call(Q,he,st.device),ye&&!Q[d]&&mt&&mt.mobile&&(Q[d]=R),ye&&Q[p]=="Macintosh"&&G&&typeof G.standalone!==s&&G.maxTouchPoints&&G.maxTouchPoints>2&&(Q[p]="iPad",Q[d]=x),Q},this.getEngine=function(){var Q={};return Q[f]=e,Q[E]=e,c.call(Q,he,st.engine),Q},this.getOS=function(){var Q={};return Q[f]=e,Q[E]=e,c.call(Q,he,st.os),ye&&!Q[f]&&mt&&mt.platform&&mt.platform!="Unknown"&&(Q[f]=mt.platform.replace(/chrome os/i,jr).replace(/macos/i,Un)),Q},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 he},this.setUA=function(Q){return he=typeof Q===l&&Q.length>k?y(Q,k):Q,this},this.setUA(he),this};L.VERSION=r,L.BROWSER=Jt([f,E,m]),L.CPU=Jt([N]),L.DEVICE=Jt([p,g,d,P,R,W,x,$,ie]),L.ENGINE=L.OS=Jt([f,E]),typeof to!==s?(typeof rs!==s&&rs.exports&&(to=rs.exports=L),to.UAParser=L):typeof define===o&&define.amd?define(function(){return L}):typeof t!==s&&(t.UAParser=L);var re=typeof t!==s&&(t.jQuery||t.Zepto);if(re&&!re.ua){var me=new L;re.ua=me.getResult(),re.ua.get=function(){return me.getUA()},re.ua.set=function(V){me.setUA(V);var J=me.getResult();for(var G in J)re.ua[G]=J[G]}}})(typeof window=="object"?window:to)});var kp=Vi((Mp,Yc)=>{"use strict";(function(t){if(typeof Mp=="object"&&typeof Yc<"u")Yc.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return function n(i,o,s){function a(p,f){if(!o[p]){if(!i[p]){var d=typeof Gi=="function"&&Gi;if(!f&&d)return d(p,!0);if(l)return l(p,!0);var g=new Error("Cannot find module '"+p+"'");throw g.code="MODULE_NOT_FOUND",g}var E=o[p]={exports:{}};i[p][0].call(E.exports,function(N){var P=i[p][1][N];return a(P||N)},E,E.exports,n,i,o,s)}return o[p].exports}for(var l=typeof Gi=="function"&&Gi,m=0;m<s.length;m++)a(s[m]);return a}({1:[function(n,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,l;if(a){var m=0,p=new a(N),f=s.document.createTextNode("");p.observe(f,{characterData:!0}),l=function(){f.data=m=++m%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var d=new s.MessageChannel;d.port1.onmessage=N,l=function(){d.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var R=s.document.createElement("script");R.onreadystatechange=function(){N(),R.onreadystatechange=null,R.parentNode.removeChild(R),R=null},s.document.documentElement.appendChild(R)}:l=function(){setTimeout(N,0)};var g,E=[];function N(){g=!0;for(var R,x,W=E.length;W;){for(x=E,E=[],R=-1;++R<W;)x[R]();W=E.length}g=!1}i.exports=P;function P(R){E.push(R)===1&&!g&&l()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,i,o){"use strict";var s=n(1);function a(){}var l={},m=["REJECTED"],p=["FULFILLED"],f=["PENDING"];i.exports=d;function d(k){if(typeof k!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,k!==a&&P(this,k)}d.prototype.catch=function(k){return this.then(null,k)},d.prototype.then=function(k,X){if(typeof k!="function"&&this.state===p||typeof X!="function"&&this.state===m)return this;var z=new this.constructor(a);if(this.state!==f){var oe=this.state===p?k:X;E(z,oe,this.outcome)}else this.queue.push(new g(z,k,X));return z};function g(k,X,z){this.promise=k,typeof X=="function"&&(this.onFulfilled=X,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(k){l.resolve(this.promise,k)},g.prototype.otherCallFulfilled=function(k){E(this.promise,this.onFulfilled,k)},g.prototype.callRejected=function(k){l.reject(this.promise,k)},g.prototype.otherCallRejected=function(k){E(this.promise,this.onRejected,k)};function E(k,X,z){s(function(){var oe;try{oe=X(z)}catch(Ce){return l.reject(k,Ce)}oe===k?l.reject(k,new TypeError("Cannot resolve promise with itself")):l.resolve(k,oe)})}l.resolve=function(k,X){var z=R(N,X);if(z.status==="error")return l.reject(k,z.value);var oe=z.value;if(oe)P(k,oe);else{k.state=p,k.outcome=X;for(var Ce=-1,de=k.queue.length;++Ce<de;)k.queue[Ce].callFulfilled(X)}return k},l.reject=function(k,X){k.state=m,k.outcome=X;for(var z=-1,oe=k.queue.length;++z<oe;)k.queue[z].callRejected(X);return k};function N(k){var X=k&&k.then;if(k&&(typeof k=="object"||typeof k=="function")&&typeof X=="function")return function(){X.apply(k,arguments)}}function P(k,X){var z=!1;function oe(He){z||(z=!0,l.reject(k,He))}function Ce(He){z||(z=!0,l.resolve(k,He))}function de(){X(Ce,oe)}var be=R(de);be.status==="error"&&oe(be.value)}function R(k,X){var z={};try{z.value=k(X),z.status="success"}catch(oe){z.status="error",z.value=oe}return z}d.resolve=x;function x(k){return k instanceof this?k:l.resolve(new this(a),k)}d.reject=W;function W(k){var X=new this(a);return l.reject(X,k)}d.all=$;function $(k){var X=this;if(Object.prototype.toString.call(k)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=k.length,oe=!1;if(!z)return this.resolve([]);for(var Ce=new Array(z),de=0,be=-1,He=new this(a);++be<z;)Pe(k[be],be);return He;function Pe(ot,St){X.resolve(ot).then(we,function(Me){oe||(oe=!0,l.reject(He,Me))});function we(Me){Ce[St]=Me,++de===z&&!oe&&(oe=!0,l.resolve(He,Ce))}}}d.race=ie;function ie(k){var X=this;if(Object.prototype.toString.call(k)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=k.length,oe=!1;if(!z)return this.resolve([]);for(var Ce=-1,de=new this(a);++Ce<z;)be(k[Ce]);return de;function be(He){X.resolve(He).then(function(Pe){oe||(oe=!0,l.resolve(de,Pe))},function(Pe){oe||(oe=!0,l.reject(de,Pe))})}}},{1:1}],3:[function(n,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h};function a(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}function l(){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 m=l();function p(){try{if(!m||!m.open)return!1;var h=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),S=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!h||S)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(h,S){h=h||[],S=S||{};try{return new Blob(h,S)}catch(I){if(I.name!=="TypeError")throw I;for(var v=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,T=new v,C=0;C<h.length;C+=1)T.append(h[C]);return T.getBlob(S.type)}}typeof Promise>"u"&&n(3);var d=Promise;function g(h,S){S&&h.then(function(v){S(null,v)},function(v){S(v)})}function E(h,S,v){typeof S=="function"&&h.then(S),typeof v=="function"&&h.catch(v)}function N(h){return typeof h!="string"&&(console.warn(h+" used as a key, but it is not a string."),h=String(h)),h}function P(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",x=void 0,W={},$=Object.prototype.toString,ie="readonly",k="readwrite";function X(h){for(var S=h.length,v=new ArrayBuffer(S),T=new Uint8Array(v),C=0;C<S;C++)T[C]=h.charCodeAt(C);return v}function z(h){return new d(function(S){var v=h.transaction(R,k),T=f([""]);v.objectStore(R).put(T,"key"),v.onabort=function(C){C.preventDefault(),C.stopPropagation(),S(!1)},v.oncomplete=function(){var C=navigator.userAgent.match(/Chrome\/(\d+)/),I=navigator.userAgent.match(/Edge\//);S(I||!C||parseInt(C[1],10)>=43)}}).catch(function(){return!1})}function oe(h){return typeof x=="boolean"?d.resolve(x):z(h).then(function(S){return x=S,x})}function Ce(h){var S=W[h.name],v={};v.promise=new d(function(T,C){v.resolve=T,v.reject=C}),S.deferredOperations.push(v),S.dbReady?S.dbReady=S.dbReady.then(function(){return v.promise}):S.dbReady=v.promise}function de(h){var S=W[h.name],v=S.deferredOperations.pop();if(v)return v.resolve(),v.promise}function be(h,S){var v=W[h.name],T=v.deferredOperations.pop();if(T)return T.reject(S),T.promise}function He(h,S){return new d(function(v,T){if(W[h.name]=W[h.name]||ar(),h.db)if(S)Ce(h),h.db.close();else return v(h.db);var C=[h.name];S&&C.push(h.version);var I=m.open.apply(m,C);S&&(I.onupgradeneeded=function(O){var U=I.result;try{U.createObjectStore(h.storeName),O.oldVersion<=1&&U.createObjectStore(R)}catch(F){if(F.name==="ConstraintError")console.warn('The database "'+h.name+'" has been upgraded from version '+O.oldVersion+" to version "+O.newVersion+', but the storage "'+h.storeName+'" already exists.');else throw F}}),I.onerror=function(O){O.preventDefault(),T(I.error)},I.onsuccess=function(){var O=I.result;O.onversionchange=function(U){U.target.close()},v(O),de(h)}})}function Pe(h){return He(h,!1)}function ot(h){return He(h,!0)}function St(h,S){if(!h.db)return!0;var v=!h.db.objectStoreNames.contains(h.storeName),T=h.version<h.db.version,C=h.version>h.db.version;if(T&&(h.version!==S&&console.warn('The database "'+h.name+`" can't be downgraded from version `+h.db.version+" to version "+h.version+"."),h.version=h.db.version),C||v){if(v){var I=h.db.version+1;I>h.version&&(h.version=I)}return!0}return!1}function we(h){return new d(function(S,v){var T=new FileReader;T.onerror=v,T.onloadend=function(C){var I=btoa(C.target.result||"");S({__local_forage_encoded_blob:!0,data:I,type:h.type})},T.readAsBinaryString(h)})}function Me(h){var S=X(atob(h.data));return f([S],{type:h.type})}function pe(h){return h&&h.__local_forage_encoded_blob}function te(h){var S=this,v=S._initReady().then(function(){var T=W[S._dbInfo.name];if(T&&T.dbReady)return T.dbReady});return E(v,h,h),v}function ke(h){Ce(h);for(var S=W[h.name],v=S.forages,T=0;T<v.length;T++){var C=v[T];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return h.db=null,Pe(h).then(function(I){return h.db=I,St(h)?ot(h):I}).then(function(I){h.db=S.db=I;for(var O=0;O<v.length;O++)v[O]._dbInfo.db=I}).catch(function(I){throw be(h,I),I})}function pt(h,S,v,T){T===void 0&&(T=1);try{var C=h.db.transaction(h.storeName,S);v(null,C)}catch(I){if(T>0&&(!h.db||I.name==="InvalidStateError"||I.name==="NotFoundError"))return d.resolve().then(function(){if(!h.db||I.name==="NotFoundError"&&!h.db.objectStoreNames.contains(h.storeName)&&h.version<=h.db.version)return h.db&&(h.version=h.db.version+1),ot(h)}).then(function(){return ke(h).then(function(){pt(h,S,v,T-1)})}).catch(v);v(I)}}function ar(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function $r(h){var S=this,v={db:null};if(h)for(var T in h)v[T]=h[T];var C=W[v.name];C||(C=ar(),W[v.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=te);var I=[];function O(){return d.resolve()}for(var U=0;U<C.forages.length;U++){var F=C.forages[U];F!==S&&I.push(F._initReady().catch(O))}var H=C.forages.slice(0);return d.all(I).then(function(){return v.db=C.db,Pe(v)}).then(function(j){return v.db=j,St(v,S._defaultConfig.version)?ot(v):j}).then(function(j){v.db=C.db=j,S._dbInfo=v;for(var Y=0;Y<H.length;Y++){var le=H[Y];le!==S&&(le._dbInfo.db=v.db,le._dbInfo.version=v.version)}})}function en(h,S){var v=this;h=N(h);var T=new d(function(C,I){v.ready().then(function(){pt(v._dbInfo,ie,function(O,U){if(O)return I(O);try{var F=U.objectStore(v._dbInfo.storeName),H=F.get(h);H.onsuccess=function(){var j=H.result;j===void 0&&(j=null),pe(j)&&(j=Me(j)),C(j)},H.onerror=function(){I(H.error)}}catch(j){I(j)}})}).catch(I)});return g(T,S),T}function Bn(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){pt(v._dbInfo,ie,function(O,U){if(O)return I(O);try{var F=U.objectStore(v._dbInfo.storeName),H=F.openCursor(),j=1;H.onsuccess=function(){var Y=H.result;if(Y){var le=Y.value;pe(le)&&(le=Me(le));var Ie=h(le,Y.key,j++);Ie!==void 0?C(Ie):Y.continue()}else C()},H.onerror=function(){I(H.error)}}catch(Y){I(Y)}})}).catch(I)});return g(T,S),T}function jr(h,S,v){var T=this;h=N(h);var C=new d(function(I,O){var U;T.ready().then(function(){return U=T._dbInfo,$.call(S)==="[object Blob]"?oe(U.db).then(function(F){return F?S:we(S)}):S}).then(function(F){pt(T._dbInfo,k,function(H,j){if(H)return O(H);try{var Y=j.objectStore(T._dbInfo.storeName);F===null&&(F=void 0);var le=Y.put(F,h);j.oncomplete=function(){F===void 0&&(F=null),I(F)},j.onabort=j.onerror=function(){var Ie=le.error?le.error:le.transaction.error;O(Ie)}}catch(Ie){O(Ie)}})}).catch(O)});return g(C,v),C}function Un(h,S){var v=this;h=N(h);var T=new d(function(C,I){v.ready().then(function(){pt(v._dbInfo,k,function(O,U){if(O)return I(O);try{var F=U.objectStore(v._dbInfo.storeName),H=F.delete(h);U.oncomplete=function(){C()},U.onerror=function(){I(H.error)},U.onabort=function(){var j=H.error?H.error:H.transaction.error;I(j)}}catch(j){I(j)}})}).catch(I)});return g(T,S),T}function Mn(h){var S=this,v=new d(function(T,C){S.ready().then(function(){pt(S._dbInfo,k,function(I,O){if(I)return C(I);try{var U=O.objectStore(S._dbInfo.storeName),F=U.clear();O.oncomplete=function(){T()},O.onabort=O.onerror=function(){var H=F.error?F.error:F.transaction.error;C(H)}}catch(H){C(H)}})}).catch(C)});return g(v,h),v}function kn(h){var S=this,v=new d(function(T,C){S.ready().then(function(){pt(S._dbInfo,ie,function(I,O){if(I)return C(I);try{var U=O.objectStore(S._dbInfo.storeName),F=U.count();F.onsuccess=function(){T(F.result)},F.onerror=function(){C(F.error)}}catch(H){C(H)}})}).catch(C)});return g(v,h),v}function Jt(h,S){var v=this,T=new d(function(C,I){if(h<0){C(null);return}v.ready().then(function(){pt(v._dbInfo,ie,function(O,U){if(O)return I(O);try{var F=U.objectStore(v._dbInfo.storeName),H=!1,j=F.openKeyCursor();j.onsuccess=function(){var Y=j.result;if(!Y){C(null);return}h===0||H?C(Y.key):(H=!0,Y.advance(h))},j.onerror=function(){I(j.error)}}catch(Y){I(Y)}})}).catch(I)});return g(T,S),T}function ft(h){var S=this,v=new d(function(T,C){S.ready().then(function(){pt(S._dbInfo,ie,function(I,O){if(I)return C(I);try{var U=O.objectStore(S._dbInfo.storeName),F=U.openKeyCursor(),H=[];F.onsuccess=function(){var j=F.result;if(!j){T(H);return}H.push(j.key),j.continue()},F.onerror=function(){C(F.error)}}catch(j){C(j)}})}).catch(C)});return g(v,h),v}function Bt(h,S){S=P.apply(this,arguments);var v=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||v.name,h.storeName=h.storeName||v.storeName);var T=this,C;if(!h.name)C=d.reject("Invalid arguments");else{var I=h.name===v.name&&T._dbInfo.db,O=I?d.resolve(T._dbInfo.db):Pe(h).then(function(U){var F=W[h.name],H=F.forages;F.db=U;for(var j=0;j<H.length;j++)H[j]._dbInfo.db=U;return U});h.storeName?C=O.then(function(U){if(U.objectStoreNames.contains(h.storeName)){var F=U.version+1;Ce(h);var H=W[h.name],j=H.forages;U.close();for(var Y=0;Y<j.length;Y++){var le=j[Y];le._dbInfo.db=null,le._dbInfo.version=F}var Ie=new d(function(Te,Ge){var $e=m.open(h.name,F);$e.onerror=function(Ut){var Wi=$e.result;Wi.close(),Ge(Ut)},$e.onupgradeneeded=function(){var Ut=$e.result;Ut.deleteObjectStore(h.storeName)},$e.onsuccess=function(){var Ut=$e.result;Ut.close(),Te(Ut)}});return Ie.then(function(Te){H.db=Te;for(var Ge=0;Ge<j.length;Ge++){var $e=j[Ge];$e._dbInfo.db=Te,de($e._dbInfo)}}).catch(function(Te){throw(be(h,Te)||d.resolve()).catch(function(){}),Te})}}):C=O.then(function(U){Ce(h);var F=W[h.name],H=F.forages;U.close();for(var j=0;j<H.length;j++){var Y=H[j];Y._dbInfo.db=null}var le=new d(function(Ie,Te){var Ge=m.deleteDatabase(h.name);Ge.onerror=function(){var $e=Ge.result;$e&&$e.close(),Te(Ge.error)},Ge.onblocked=function(){console.warn('dropInstance blocked for database "'+h.name+'" until all open connections are closed')},Ge.onsuccess=function(){var $e=Ge.result;$e&&$e.close(),Ie($e)}});return le.then(function(Ie){F.db=Ie;for(var Te=0;Te<H.length;Te++){var Ge=H[Te];de(Ge._dbInfo)}}).catch(function(Ie){throw(be(h,Ie)||d.resolve()).catch(function(){}),Ie})})}return g(C,S),C}var Hi={_driver:"asyncStorage",_initStorage:$r,_support:p(),iterate:Bn,getItem:en,setItem:jr,removeItem:Un,clear:Mn,length:kn,key:Jt,keys:ft,dropInstance:Bt};function y(){return typeof openDatabase=="function"}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="~~local_forage_type~",_=/^~~local_forage_type~([^~]+)~/,D="__lfsc__:",B=D.length,L="arbf",re="blob",me="si08",V="ui08",J="uic8",G="si16",he="si32",mt="ur16",st="ui32",ye="fl32",Q="fl64",Ct=B+L.length,Fn=Object.prototype.toString;function $i(h){var S=h.length*.75,v=h.length,T,C=0,I,O,U,F;h[h.length-1]==="="&&(S--,h[h.length-2]==="="&&S--);var H=new ArrayBuffer(S),j=new Uint8Array(H);for(T=0;T<v;T+=4)I=c.indexOf(h[T]),O=c.indexOf(h[T+1]),U=c.indexOf(h[T+2]),F=c.indexOf(h[T+3]),j[C++]=I<<2|O>>4,j[C++]=(O&15)<<4|U>>2,j[C++]=(U&3)<<6|F&63;return H}function yc(h){var S=new Uint8Array(h),v="",T;for(T=0;T<S.length;T+=3)v+=c[S[T]>>2],v+=c[(S[T]&3)<<4|S[T+1]>>4],v+=c[(S[T+1]&15)<<2|S[T+2]>>6],v+=c[S[T+2]&63];return S.length%3===2?v=v.substring(0,v.length-1)+"=":S.length%3===1&&(v=v.substring(0,v.length-2)+"=="),v}function Ed(h,S){var v="";if(h&&(v=Fn.call(h)),h&&(v==="[object ArrayBuffer]"||h.buffer&&Fn.call(h.buffer)==="[object ArrayBuffer]")){var T,C=D;h instanceof ArrayBuffer?(T=h,C+=L):(T=h.buffer,v==="[object Int8Array]"?C+=me:v==="[object Uint8Array]"?C+=V:v==="[object Uint8ClampedArray]"?C+=J:v==="[object Int16Array]"?C+=G:v==="[object Uint16Array]"?C+=mt:v==="[object Int32Array]"?C+=he:v==="[object Uint32Array]"?C+=st:v==="[object Float32Array]"?C+=ye:v==="[object Float64Array]"?C+=Q:S(new Error("Failed to get type for BinaryArray"))),S(C+yc(T))}else if(v==="[object Blob]"){var I=new FileReader;I.onload=function(){var O=u+h.type+"~"+yc(this.result);S(D+re+O)},I.readAsArrayBuffer(h)}else try{S(JSON.stringify(h))}catch(O){console.error("Couldn't convert value into a JSON string: ",h),S(null,O)}}function Sd(h){if(h.substring(0,B)!==D)return JSON.parse(h);var S=h.substring(Ct),v=h.substring(B,Ct),T;if(v===re&&_.test(S)){var C=S.match(_);T=C[1],S=S.substring(C[0].length)}var I=$i(S);switch(v){case L:return I;case re:return f([I],{type:T});case me:return new Int8Array(I);case V:return new Uint8Array(I);case J:return new Uint8ClampedArray(I);case G:return new Int16Array(I);case mt:return new Uint16Array(I);case he:return new Int32Array(I);case st:return new Uint32Array(I);case ye:return new Float32Array(I);case Q:return new Float64Array(I);default:throw new Error("Unkown type: "+v)}}var vc={serialize:Ed,deserialize:Sd,stringToBuffer:$i,bufferToString:yc};function zu(h,S,v,T){h.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],v,T)}function bd(h){var S=this,v={db:null};if(h)for(var T in h)v[T]=typeof h[T]!="string"?h[T].toString():h[T];var C=new d(function(I,O){try{v.db=openDatabase(v.name,String(v.version),v.description,v.size)}catch(U){return O(U)}v.db.transaction(function(U){zu(U,v,function(){S._dbInfo=v,I()},function(F,H){O(H)})},O)});return v.serializer=vc,C}function Wr(h,S,v,T,C,I){h.executeSql(v,T,C,function(O,U){U.code===U.SYNTAX_ERR?O.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[S.storeName],function(F,H){H.rows.length?I(F,U):zu(F,S,function(){F.executeSql(v,T,C,I)},I)},I):I(O,U)},I)}function wd(h,S){var v=this;h=N(h);var T=new d(function(C,I){v.ready().then(function(){var O=v._dbInfo;O.db.transaction(function(U){Wr(U,O,"SELECT * FROM "+O.storeName+" WHERE key = ? LIMIT 1",[h],function(F,H){var j=H.rows.length?H.rows.item(0).value:null;j&&(j=O.serializer.deserialize(j)),C(j)},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Id(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){var O=v._dbInfo;O.db.transaction(function(U){Wr(U,O,"SELECT * FROM "+O.storeName,[],function(F,H){for(var j=H.rows,Y=j.length,le=0;le<Y;le++){var Ie=j.item(le),Te=Ie.value;if(Te&&(Te=O.serializer.deserialize(Te)),Te=h(Te,Ie.key,le+1),Te!==void 0){C(Te);return}}C()},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Yu(h,S,v,T){var C=this;h=N(h);var I=new d(function(O,U){C.ready().then(function(){S===void 0&&(S=null);var F=S,H=C._dbInfo;H.serializer.serialize(S,function(j,Y){Y?U(Y):H.db.transaction(function(le){Wr(le,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[h,j],function(){O(F)},function(Ie,Te){U(Te)})},function(le){if(le.code===le.QUOTA_ERR){if(T>0){O(Yu.apply(C,[h,F,v,T-1]));return}U(le)}})})}).catch(U)});return g(I,v),I}function Td(h,S,v){return Yu.apply(this,[h,S,v,1])}function xd(h,S){var v=this;h=N(h);var T=new d(function(C,I){v.ready().then(function(){var O=v._dbInfo;O.db.transaction(function(U){Wr(U,O,"DELETE FROM "+O.storeName+" WHERE key = ?",[h],function(){C()},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Cd(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(O){Wr(O,I,"DELETE FROM "+I.storeName,[],function(){T()},function(U,F){C(F)})})}).catch(C)});return g(v,h),v}function Dd(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(O){Wr(O,I,"SELECT COUNT(key) as c FROM "+I.storeName,[],function(U,F){var H=F.rows.item(0).c;T(H)},function(U,F){C(F)})})}).catch(C)});return g(v,h),v}function Rd(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){var O=v._dbInfo;O.db.transaction(function(U){Wr(U,O,"SELECT key FROM "+O.storeName+" WHERE id = ? LIMIT 1",[h+1],function(F,H){var j=H.rows.length?H.rows.item(0).key:null;C(j)},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Nd(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(O){Wr(O,I,"SELECT key FROM "+I.storeName,[],function(U,F){for(var H=[],j=0;j<F.rows.length;j++)H.push(F.rows.item(j).key);T(H)},function(U,F){C(F)})})}).catch(C)});return g(v,h),v}function Od(h){return new d(function(S,v){h.transaction(function(T){T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,I){for(var O=[],U=0;U<I.rows.length;U++)O.push(I.rows.item(U).name);S({db:h,storeNames:O})},function(C,I){v(I)})},function(T){v(T)})})}function Ad(h,S){S=P.apply(this,arguments);var v=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||v.name,h.storeName=h.storeName||v.storeName);var T=this,C;return h.name?C=new d(function(I){var O;h.name===v.name?O=T._dbInfo.db:O=openDatabase(h.name,"","",0),h.storeName?I({db:O,storeNames:[h.storeName]}):I(Od(O))}).then(function(I){return new d(function(O,U){I.db.transaction(function(F){function H(Ie){return new d(function(Te,Ge){F.executeSql("DROP TABLE IF EXISTS "+Ie,[],function(){Te()},function($e,Ut){Ge(Ut)})})}for(var j=[],Y=0,le=I.storeNames.length;Y<le;Y++)j.push(H(I.storeNames[Y]));d.all(j).then(function(){O()}).catch(function(Ie){U(Ie)})},function(F){U(F)})})}):C=d.reject("Invalid arguments"),g(C,S),C}var Pd={_driver:"webSQLStorage",_initStorage:bd,_support:y(),iterate:Id,getItem:wd,setItem:Td,removeItem:xd,clear:Cd,length:Dd,key:Rd,keys:Nd,dropInstance:Ad};function Ld(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qu(h,S){var v=h.name+"/";return h.storeName!==S.storeName&&(v+=h.storeName+"/"),v}function Bd(){var h="_localforage_support_test";try{return localStorage.setItem(h,!0),localStorage.removeItem(h),!1}catch{return!0}}function Ud(){return!Bd()||localStorage.length>0}function Md(h){var S=this,v={};if(h)for(var T in h)v[T]=h[T];return v.keyPrefix=qu(h,S._defaultConfig),Ud()?(S._dbInfo=v,v.serializer=vc,d.resolve()):d.reject()}function kd(h){var S=this,v=S.ready().then(function(){for(var T=S._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var I=localStorage.key(C);I.indexOf(T)===0&&localStorage.removeItem(I)}});return g(v,h),v}function Fd(h,S){var v=this;h=N(h);var T=v.ready().then(function(){var C=v._dbInfo,I=localStorage.getItem(C.keyPrefix+h);return I&&(I=C.serializer.deserialize(I)),I});return g(T,S),T}function Hd(h,S){var v=this,T=v.ready().then(function(){for(var C=v._dbInfo,I=C.keyPrefix,O=I.length,U=localStorage.length,F=1,H=0;H<U;H++){var j=localStorage.key(H);if(j.indexOf(I)===0){var Y=localStorage.getItem(j);if(Y&&(Y=C.serializer.deserialize(Y)),Y=h(Y,j.substring(O),F++),Y!==void 0)return Y}}});return g(T,S),T}function $d(h,S){var v=this,T=v.ready().then(function(){var C=v._dbInfo,I;try{I=localStorage.key(h)}catch{I=null}return I&&(I=I.substring(C.keyPrefix.length)),I});return g(T,S),T}function jd(h){var S=this,v=S.ready().then(function(){for(var T=S._dbInfo,C=localStorage.length,I=[],O=0;O<C;O++){var U=localStorage.key(O);U.indexOf(T.keyPrefix)===0&&I.push(U.substring(T.keyPrefix.length))}return I});return g(v,h),v}function Wd(h){var S=this,v=S.keys().then(function(T){return T.length});return g(v,h),v}function Gd(h,S){var v=this;h=N(h);var T=v.ready().then(function(){var C=v._dbInfo;localStorage.removeItem(C.keyPrefix+h)});return g(T,S),T}function Vd(h,S,v){var T=this;h=N(h);var C=T.ready().then(function(){S===void 0&&(S=null);var I=S;return new d(function(O,U){var F=T._dbInfo;F.serializer.serialize(S,function(H,j){if(j)U(j);else try{localStorage.setItem(F.keyPrefix+h,H),O(I)}catch(Y){(Y.name==="QuotaExceededError"||Y.name==="NS_ERROR_DOM_QUOTA_REACHED")&&U(Y),U(Y)}})})});return g(C,v),C}function zd(h,S){if(S=P.apply(this,arguments),h=typeof h!="function"&&h||{},!h.name){var v=this.config();h.name=h.name||v.name,h.storeName=h.storeName||v.storeName}var T=this,C;return h.name?C=new d(function(I){h.storeName?I(qu(h,T._defaultConfig)):I(h.name+"/")}).then(function(I){for(var O=localStorage.length-1;O>=0;O--){var U=localStorage.key(O);U.indexOf(I)===0&&localStorage.removeItem(U)}}):C=d.reject("Invalid arguments"),g(C,S),C}var Yd={_driver:"localStorageWrapper",_initStorage:Md,_support:Ld(),iterate:Hd,getItem:Fd,setItem:Vd,removeItem:Gd,clear:kd,length:Wd,key:$d,keys:jd,dropInstance:zd},qd=function(S,v){return S===v||typeof S=="number"&&typeof v=="number"&&isNaN(S)&&isNaN(v)},Kd=function(S,v){for(var T=S.length,C=0;C<T;){if(qd(S[C],v))return!0;C++}return!1},Ku=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"},ji={},Ju={},Hn={INDEXEDDB:Hi,WEBSQL:Pd,LOCALSTORAGE:Yd},Jd=[Hn.INDEXEDDB._driver,Hn.WEBSQL._driver,Hn.LOCALSTORAGE._driver],zo=["dropInstance"],_c=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(zo),Xd={description:"",driver:Jd.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Qd(h,S){h[S]=function(){var v=arguments;return h.ready().then(function(){return h[S].apply(h,v)})}}function Ec(){for(var h=1;h<arguments.length;h++){var S=arguments[h];if(S)for(var v in S)S.hasOwnProperty(v)&&(Ku(S[v])?arguments[0][v]=S[v].slice():arguments[0][v]=S[v])}return arguments[0]}var Zd=function(){function h(S){a(this,h);for(var v in Hn)if(Hn.hasOwnProperty(v)){var T=Hn[v],C=T._driver;this[v]=C,ji[C]||this.defineDriver(T)}this._defaultConfig=Ec({},Xd),this._config=Ec({},this._defaultConfig,S),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return h.prototype.config=function(v){if((typeof v>"u"?"undefined":s(v))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var T in v){if(T==="storeName"&&(v[T]=v[T].replace(/\W/g,"_")),T==="version"&&typeof v[T]!="number")return new Error("Database version must be a number.");this._config[T]=v[T]}return"driver"in v&&v.driver?this.setDriver(this._config.driver):!0}else return typeof v=="string"?this._config[v]:this._config},h.prototype.defineDriver=function(v,T,C){var I=new d(function(O,U){try{var F=v._driver,H=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!v._driver){U(H);return}for(var j=_c.concat("_initStorage"),Y=0,le=j.length;Y<le;Y++){var Ie=j[Y],Te=!Kd(zo,Ie);if((Te||v[Ie])&&typeof v[Ie]!="function"){U(H);return}}var Ge=function(){for(var Wi=function(rh){return function(){var nh=new Error("Method "+rh+" is not implemented by the current driver"),Xu=d.reject(nh);return g(Xu,arguments[arguments.length-1]),Xu}},Sc=0,th=zo.length;Sc<th;Sc++){var bc=zo[Sc];v[bc]||(v[bc]=Wi(bc))}};Ge();var $e=function(Wi){ji[F]&&console.info("Redefining LocalForage driver: "+F),ji[F]=v,Ju[F]=Wi,O()};"_support"in v?v._support&&typeof v._support=="function"?v._support().then($e,U):$e(!!v._support):$e(!0)}catch(Ut){U(Ut)}});return E(I,T,C),I},h.prototype.driver=function(){return this._driver||null},h.prototype.getDriver=function(v,T,C){var I=ji[v]?d.resolve(ji[v]):d.reject(new Error("Driver not found."));return E(I,T,C),I},h.prototype.getSerializer=function(v){var T=d.resolve(vc);return E(T,v),T},h.prototype.ready=function(v){var T=this,C=T._driverSet.then(function(){return T._ready===null&&(T._ready=T._initDriver()),T._ready});return E(C,v,v),C},h.prototype.setDriver=function(v,T,C){var I=this;Ku(v)||(v=[v]);var O=this._getSupportedDrivers(v);function U(){I._config.driver=I.driver()}function F(Y){return I._extend(Y),U(),I._ready=I._initStorage(I._config),I._ready}function H(Y){return function(){var le=0;function Ie(){for(;le<Y.length;){var Te=Y[le];return le++,I._dbInfo=null,I._ready=null,I.getDriver(Te).then(F).catch(Ie)}U();var Ge=new Error("No available storage method found.");return I._driverSet=d.reject(Ge),I._driverSet}return Ie()}}var j=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=j.then(function(){var Y=O[0];return I._dbInfo=null,I._ready=null,I.getDriver(Y).then(function(le){I._driver=le._driver,U(),I._wrapLibraryMethodsWithReady(),I._initDriver=H(O)})}).catch(function(){U();var Y=new Error("No available storage method found.");return I._driverSet=d.reject(Y),I._driverSet}),E(this._driverSet,T,C),this._driverSet},h.prototype.supports=function(v){return!!Ju[v]},h.prototype._extend=function(v){Ec(this,v)},h.prototype._getSupportedDrivers=function(v){for(var T=[],C=0,I=v.length;C<I;C++){var O=v[C];this.supports(O)&&T.push(O)}return T},h.prototype._wrapLibraryMethodsWithReady=function(){for(var v=0,T=_c.length;v<T;v++)Qd(this,_c[v])},h.prototype.createInstance=function(v){return new h(v)},h}(),eh=new Zd;i.exports=eh},{3:3}]},{},[4])(4)})});var vl=Vi(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.URLBuilder=void 0;var kg=function(){function t(e){try{this.base=new URL(e),this.params=new URLSearchParams(this.base.search.slice(1))}catch(r){console.error("Un-parsable URL",r)}}return t.prototype.appendQueryParam=function(e,r){this.params.append(e,r?r.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(e){this.params.delete(e)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(e){if(!this.params)return"";var r=this.params.get(e);return!r||r==="undefined"||r==="null"?void 0:r},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(e){return this.base.pathname=e,this},t.prototype.setQueryParam=function(e,r){return this.params.set(e,r?r.toString():""),this},t.prototype.setQueryString=function(e){if(e)return e[0]==="?"&&(e=e.slice(1)),this.params=new URLSearchParams(e),this},t.prototype.toString=function(){var e=this.params.toString();return e===""?this.base.search="":this.base.search="?"+e,this.base.toString()},t}();Os.URLBuilder=kg});var fd=Vi((Wu,Gu)=>{"use strict";(function(t,e){typeof Wu=="object"&&typeof Gu<"u"?Gu.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})(Wu,function(){"use strict";var t=function(n,i){if(i=i||{},typeof n!="function")throw new r("fetch must be a function");if(typeof i!="object")throw new r("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new r("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new r("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(a,l){var m=i.retries,p=i.retryDelay,f=i.retryOn;if(l&&l.retries!==void 0)if(e(l.retries))m=l.retries;else throw new r("retries must be a positive integer");if(l&&l.retryDelay!==void 0)if(e(l.retryDelay)||typeof l.retryDelay=="function")p=l.retryDelay;else throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(l&&l.retryOn)if(Array.isArray(l.retryOn)||typeof l.retryOn=="function")f=l.retryOn;else throw new r("retryOn property expects an array or function");return new Promise(function(d,g){var E=function(P){var R=typeof Request<"u"&&a instanceof Request?a.clone():a;n(R,l).then(function(x){if(Array.isArray(f)&&f.indexOf(x.status)===-1)d(x);else if(typeof f=="function")try{return Promise.resolve(f(P,null,x)).then(function(W){W?N(P,null,x):d(x)}).catch(g)}catch(W){g(W)}else P<m?N(P,null,x):d(x)}).catch(function(x){if(typeof f=="function")try{Promise.resolve(f(P,x,null)).then(function(W){W?N(P,x,null):g(x)}).catch(function(W){g(W)})}catch(W){g(W)}else P<m?N(P,x,null):g(x)})};function N(P,R,x){var W=typeof p=="function"?p(P,R,x):p;setTimeout(function(){E(++P)},W)}E(0)})}};function e(n){return Number.isInteger(n)&&n>=0}function r(n){this.name="ArgumentError",this.message=n}return t})});var Gr={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production"};var Dt=Xt(tn());var rp="9.3.0";var A=class t{static SDK_VERSION=rp;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 CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static{let e=t.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");t.SDK_VERSION_CODE=parseInt(e,10)}};var w=class{static log(...e){Dt.default.info(...e)}static debug(...e){Dt.default.debug(...e)}static error(...e){Dt.default.error(...e)}static warn(...e){Dt.default.warn(...e)}static info(...e){Dt.default.info(...e)}static trace(...e){Dt.default.trace(...e)}static configure(e=A.LOG_PREFIX){Dt.default.useDefaults({formatter:function(n){n.unshift(`${e} (v${A.SDK_VERSION}):`)}});let r=this.getDebugParam();(r==="1"||r==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Dt.default.setLevel(Dt.default[localStorage.cooeeLogLevel]):Dt.default.setLevel(Gr.debug?Dt.default.TRACE:Dt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let e=`
1
+ var ih=Object.create;var 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;var 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));var 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')});var Vi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var 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};var Xt=(t,e,r)=>(r=t!=null?ih(lh(t)):{},ph(e||!t||!t.__esModule?wc(r,"default",{value:t,enumerable:!0}):r,t));var tn=Vi((tp,Yo)=>{"use strict";(function(t){"use strict";var e={};e.VERSION="1.6.1";var r,n={},i=function(m,p){return function(){return p.apply(m,arguments)}},o=function(){var m=arguments,p=m[0],f,d;for(d=1;d<m.length;d++)for(f in m[d])!(f in p)&&m[d].hasOwnProperty(f)&&(p[f]=m[d][f]);return p},s=function(m,p){return{value:m,name:p}};e.TRACE=s(1,"TRACE"),e.DEBUG=s(2,"DEBUG"),e.INFO=s(3,"INFO"),e.TIME=s(4,"TIME"),e.WARN=s(5,"WARN"),e.ERROR=s(8,"ERROR"),e.OFF=s(99,"OFF");var a=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info};a.prototype={setLevel:function(m){m&&"value"in m&&(this.context.filterLevel=m)},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var p=this.context.filterLevel;return m.value>=p.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(m){typeof m=="string"&&m.length>0&&this.invoke(e.TIME,[m,"start"])},timeEnd:function(m){typeof m=="string"&&m.length>0&&this.invoke(e.TIME,[m,"end"])},invoke:function(m,p){r&&this.enabledFor(m)&&r(p,o({level:m},this.context))}};var l=new a({filterLevel:e.OFF});(function(){var m=e;m.enabledFor=i(l,l.enabledFor),m.trace=i(l,l.trace),m.debug=i(l,l.debug),m.time=i(l,l.time),m.timeEnd=i(l,l.timeEnd),m.info=i(l,l.info),m.warn=i(l,l.warn),m.error=i(l,l.error),m.log=m.info})(),e.setHandler=function(m){r=m},e.setLevel=function(m){l.setLevel(m);for(var p in n)n.hasOwnProperty(p)&&n[p].setLevel(m)},e.getLevel=function(){return l.getLevel()},e.get=function(m){return n[m]||(n[m]=new a(o({name:m},l.context)))},e.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(g,E){E.name&&g.unshift("["+E.name+"]")};var p={},f=function(d,g){Function.prototype.apply.call(d,console,g)};return typeof console>"u"?function(){}:function(d,g){d=Array.prototype.slice.call(d);var E=console.log,N;g.level===e.TIME?(N=(g.name?"["+g.name+"] ":"")+d[0],d[1]==="start"?console.time?console.time(N):p[N]=new Date().getTime():console.timeEnd?console.timeEnd(N):f(E,[N+": "+(new Date().getTime()-p[N])+"ms"])):(g.level===e.WARN&&console.warn?E=console.warn:g.level===e.ERROR&&console.error?E=console.error:g.level===e.INFO&&console.info?E=console.info:g.level===e.DEBUG&&console.debug?E=console.debug:g.level===e.TRACE&&console.trace&&(E=console.trace),m.formatter(d,g),f(E,d))}},e.useDefaults=function(m){e.setLevel(m&&m.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(m))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof Yo<"u"&&Yo.exports?Yo.exports=e:(e._prevLogger=t.Logger,e.noConflict=function(){return t.Logger=e._prevLogger,e},t.Logger=e)})(tp)});var Bp=Vi((to,rs)=>{"use strict";(function(t,e){"use strict";var r="1.0.40",n="",i="?",o="function",s="undefined",a="object",l="string",m="major",p="model",f="name",d="type",g="vendor",E="version",N="architecture",P="console",R="mobile",x="tablet",W="smarttv",$="wearable",ie="embedded",k=500,X="Amazon",z="Apple",oe="ASUS",Ce="BlackBerry",de="Browser",be="Chrome",He="Edge",Pe="Firefox",ot="Google",St="Huawei",we="LG",Me="Microsoft",pe="Motorola",te="Opera",ke="Samsung",pt="Sharp",ar="Sony",$r="Xiaomi",en="Zebra",Bn="Facebook",jr="Chromium OS",Un="Mac OS",Mn=" Browser",kn=function(V,J){var G={};for(var he in V)J[he]&&J[he].length%2===0?G[he]=J[he].concat(V[he]):G[he]=V[he];return G},Jt=function(V){for(var J={},G=0;G<V.length;G++)J[V[G].toUpperCase()]=V[G];return J},ft=function(V,J){return typeof V===l?Bt(J).indexOf(Bt(V))!==-1:!1},Bt=function(V){return V.toLowerCase()},Hi=function(V){return typeof V===l?V.replace(/[^\d\.]/g,n).split(".")[0]:e},y=function(V,J){if(typeof V===l)return V=V.replace(/^\s\s*/,n),typeof J===s?V:V.substring(0,k)},c=function(V,J){for(var G=0,he,mt,st,ye,Q,Ct;G<J.length&&!Q;){var Fn=J[G],$i=J[G+1];for(he=mt=0;he<Fn.length&&!Q&&Fn[he];)if(Q=Fn[he++].exec(V),Q)for(st=0;st<$i.length;st++)Ct=Q[++mt],ye=$i[st],typeof ye===a&&ye.length>0?ye.length===2?typeof ye[1]==o?this[ye[0]]=ye[1].call(this,Ct):this[ye[0]]=ye[1]:ye.length===3?typeof ye[1]===o&&!(ye[1].exec&&ye[1].test)?this[ye[0]]=Ct?ye[1].call(this,Ct,ye[2]):e:this[ye[0]]=Ct?Ct.replace(ye[1],ye[2]):e:ye.length===4&&(this[ye[0]]=Ct?ye[3].call(this,Ct.replace(ye[1],ye[2])):e):this[ye]=Ct||e;G+=2}},u=function(V,J){for(var G in J)if(typeof J[G]===a&&J[G].length>0){for(var he=0;he<J[G].length;he++)if(ft(J[G][he],V))return G===i?e:G}else if(ft(J[G],V))return G===i?e:G;return J.hasOwnProperty("*")?J["*"]:V},_={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},D={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"},B={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,E],[/opios[\/ ]+([\w\.]+)/i],[E,[f,te+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[E,[f,te+" GX"]],[/\bopr\/([\w\.]+)/i],[E,[f,te]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[E,[f,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[E,[f,"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],[f,E],[/quark(?:pc)?\/([-\w\.]+)/i],[E,[f,"Quark"]],[/\bddg\/([\w\.]+)/i],[E,[f,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[f,"UC"+de]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[E,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[E,[f,"Smart Lenovo "+de]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+de],E],[/\bfocus\/([\w\.]+)/i],[E,[f,Pe+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[f,te+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[f,te+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[f,"MIUI"+Mn]],[/fxios\/([\w\.-]+)/i],[E,[f,Pe]],[/\bqihoobrowser\/?([\w\.]*)/i],[E,[f,"360"]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,"$1Browser"],E],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1"+Mn],E],[/samsungbrowser\/([\w\.]+)/i],[E,[f,ke+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[E,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,E],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[E,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,Bn],E],[/(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],[f,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[f,be+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,be+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[f,"Android "+de]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[E,u,_]],[/(webkit|khtml)\/([\w\.]+)/i],[f,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],E],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[f,Pe+" 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],[f,[E,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[f,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[N,"amd64"]],[/(ia32(?=;))/i],[[N,Bt]],[/((?:i[346]|x)86)[;\)]/i],[[N,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/windows (ce|mobile); ppc;/i],[[N,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[N,/ower/,n,Bt]],[/(sun4\w)[;\)]/i],[[N,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[N,Bt]]],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],[p,[g,ke],[d,x]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[g,ke],[d,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[g,z],[d,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[g,z],[d,x]],[/(macintosh);/i],[p,[g,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[g,pt],[d,R]],[/(?:honor)([-\w ]+)[;\)]/i],[p,[g,"Honor"],[d,R]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[g,St],[d,x]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[g,St],[d,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],[[p,/_/g," "],[g,$r],[d,R]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[g,$r],[d,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[g,"OPPO"],[d,R]],[/\b(opd2\d{3}a?) bui/i],[p,[g,"OPPO"],[d,x]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[g,"Vivo"],[d,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[g,"Realme"],[d,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],[p,[g,pe],[d,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[g,pe],[d,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[g,we],[d,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[g,we],[d,R]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[g,"Lenovo"],[d,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[g,"Nokia"],[d,R]],[/(pixel c)\b/i],[p,[g,ot],[d,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[g,ot],[d,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],[p,[g,ar],[d,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[g,ar],[d,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[g,"OnePlus"],[d,R]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[g,X],[d,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[g,X],[d,R]],[/(playbook);[-\w\),; ]+(rim)/i],[p,g,[d,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[g,Ce],[d,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[g,oe],[d,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[g,oe],[d,R]],[/(nexus 9)/i],[p,[g,"HTC"],[d,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[p,/_/g," "],[d,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],[p,[g,"TCL"],[d,x]],[/(itel) ((\w+))/i],[[g,Bt],p,[d,u,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[g,"Acer"],[d,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[g,"Meizu"],[d,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[g,"Ulefone"],[d,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[g,"Energizer"],[d,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[g,"Cat"],[d,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[g,"Smartfren"],[d,R]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[g,"Nothing"],[d,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],[g,p,[d,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],[g,p,[d,x]],[/(surface duo)/i],[p,[g,Me],[d,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[g,"Fairphone"],[d,R]],[/(u304aa)/i],[p,[g,"AT&T"],[d,R]],[/\bsie-(\w*)/i],[p,[g,"Siemens"],[d,R]],[/\b(rct\w+) b/i],[p,[g,"RCA"],[d,x]],[/\b(venue[\d ]{2,7}) b/i],[p,[g,"Dell"],[d,x]],[/\b(q(?:mv|ta)\w+) b/i],[p,[g,"Verizon"],[d,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[g,"Barnes & Noble"],[d,x]],[/\b(tm\d{3}\w+) b/i],[p,[g,"NuVision"],[d,x]],[/\b(k88) b/i],[p,[g,"ZTE"],[d,x]],[/\b(nx\d{3}j) b/i],[p,[g,"ZTE"],[d,R]],[/\b(gen\d{3}) b.+49h/i],[p,[g,"Swiss"],[d,R]],[/\b(zur\d{3}) b/i],[p,[g,"Swiss"],[d,x]],[/\b((zeki)?tb.*\b) b/i],[p,[g,"Zeki"],[d,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],p,[d,x]],[/\b(ns-?\w{0,9}) b/i],[p,[g,"Insignia"],[d,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[g,"NextBook"],[d,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],p,[d,R]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],p,[d,R]],[/\b(ph-1) /i],[p,[g,"Essential"],[d,R]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[g,"Envizen"],[d,x]],[/\b(trio[-\w\. ]+) b/i],[p,[g,"MachSpeed"],[d,x]],[/\btu_(1491) b/i],[p,[g,"Rotor"],[d,x]],[/(shield[\w ]+) b/i],[p,[g,"Nvidia"],[d,x]],[/(sprint) (\w+)/i],[g,p,[d,R]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[g,Me],[d,R]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[g,en],[d,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[g,en],[d,R]],[/smart-tv.+(samsung)/i],[g,[d,W]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[g,ke],[d,W]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,we],[d,W]],[/(apple) ?tv/i],[g,[p,z+" TV"],[d,W]],[/crkey/i],[[p,be+"cast"],[g,ot],[d,W]],[/droid.+aft(\w+)( bui|\))/i],[p,[g,X],[d,W]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[g,pt],[d,W]],[/(bravia[\w ]+)( bui|\))/i],[p,[g,ar],[d,W]],[/(mitv-\w{5}) bui/i],[p,[g,$r],[d,W]],[/Hbbtv.*(technisat) (.*);/i],[g,p,[d,W]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,y],[p,y],[d,W]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,W]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,p,[d,P]],[/droid.+; (shield) bui/i],[p,[g,"Nvidia"],[d,P]],[/(playstation [345portablevi]+)/i],[p,[g,ar],[d,P]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[g,Me],[d,P]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[p,[g,ke],[d,$]],[/((pebble))app/i],[g,p,[d,$]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[g,z],[d,$]],[/droid.+; (glass) \d/i],[p,[g,ot],[d,$]],[/droid.+; (wt63?0{2,3})\)/i],[p,[g,en],[d,$]],[/droid.+; (glass) \d/i],[p,[g,ot],[d,$]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,p,[d,$]],[/; (quest( \d| pro)?)/i],[p,[g,Bn],[d,$]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[d,ie]],[/(aeobc)\b/i],[p,[g,X],[d,ie]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[d,R]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[d,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,R]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[f,He+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[f,E],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[f,"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],[f,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,E],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[f,[E,u,D]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[E,u,D],[f,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,Un],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,E],[/\(bb(10);/i],[E,[f,Ce]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[f,Pe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[f,be+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,jr],E],[/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],[f,E],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,E]]},L=function(V,J){if(typeof V===a&&(J=V,V=e),!(this instanceof L))return new L(V,J).getResult();var G=typeof t!==s&&t.navigator?t.navigator:e,he=V||(G&&G.userAgent?G.userAgent:n),mt=G&&G.userAgentData?G.userAgentData:e,st=J?kn(B,J):B,ye=G&&G.userAgent==he;return this.getBrowser=function(){var Q={};return Q[f]=e,Q[E]=e,c.call(Q,he,st.browser),Q[m]=Hi(Q[E]),ye&&G&&G.brave&&typeof G.brave.isBrave==o&&(Q[f]="Brave"),Q},this.getCPU=function(){var Q={};return Q[N]=e,c.call(Q,he,st.cpu),Q},this.getDevice=function(){var Q={};return Q[g]=e,Q[p]=e,Q[d]=e,c.call(Q,he,st.device),ye&&!Q[d]&&mt&&mt.mobile&&(Q[d]=R),ye&&Q[p]=="Macintosh"&&G&&typeof G.standalone!==s&&G.maxTouchPoints&&G.maxTouchPoints>2&&(Q[p]="iPad",Q[d]=x),Q},this.getEngine=function(){var Q={};return Q[f]=e,Q[E]=e,c.call(Q,he,st.engine),Q},this.getOS=function(){var Q={};return Q[f]=e,Q[E]=e,c.call(Q,he,st.os),ye&&!Q[f]&&mt&&mt.platform&&mt.platform!="Unknown"&&(Q[f]=mt.platform.replace(/chrome os/i,jr).replace(/macos/i,Un)),Q},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 he},this.setUA=function(Q){return he=typeof Q===l&&Q.length>k?y(Q,k):Q,this},this.setUA(he),this};L.VERSION=r,L.BROWSER=Jt([f,E,m]),L.CPU=Jt([N]),L.DEVICE=Jt([p,g,d,P,R,W,x,$,ie]),L.ENGINE=L.OS=Jt([f,E]),typeof to!==s?(typeof rs!==s&&rs.exports&&(to=rs.exports=L),to.UAParser=L):typeof define===o&&define.amd?define(function(){return L}):typeof t!==s&&(t.UAParser=L);var re=typeof t!==s&&(t.jQuery||t.Zepto);if(re&&!re.ua){var me=new L;re.ua=me.getResult(),re.ua.get=function(){return me.getUA()},re.ua.set=function(V){me.setUA(V);var J=me.getResult();for(var G in J)re.ua[G]=J[G]}}})(typeof window=="object"?window:to)});var kp=Vi((Mp,Yc)=>{"use strict";(function(t){if(typeof Mp=="object"&&typeof Yc<"u")Yc.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return function n(i,o,s){function a(p,f){if(!o[p]){if(!i[p]){var d=typeof Gi=="function"&&Gi;if(!f&&d)return d(p,!0);if(l)return l(p,!0);var g=new Error("Cannot find module '"+p+"'");throw g.code="MODULE_NOT_FOUND",g}var E=o[p]={exports:{}};i[p][0].call(E.exports,function(N){var P=i[p][1][N];return a(P||N)},E,E.exports,n,i,o,s)}return o[p].exports}for(var l=typeof Gi=="function"&&Gi,m=0;m<s.length;m++)a(s[m]);return a}({1:[function(n,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,l;if(a){var m=0,p=new a(N),f=s.document.createTextNode("");p.observe(f,{characterData:!0}),l=function(){f.data=m=++m%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var d=new s.MessageChannel;d.port1.onmessage=N,l=function(){d.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var R=s.document.createElement("script");R.onreadystatechange=function(){N(),R.onreadystatechange=null,R.parentNode.removeChild(R),R=null},s.document.documentElement.appendChild(R)}:l=function(){setTimeout(N,0)};var g,E=[];function N(){g=!0;for(var R,x,W=E.length;W;){for(x=E,E=[],R=-1;++R<W;)x[R]();W=E.length}g=!1}i.exports=P;function P(R){E.push(R)===1&&!g&&l()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,i,o){"use strict";var s=n(1);function a(){}var l={},m=["REJECTED"],p=["FULFILLED"],f=["PENDING"];i.exports=d;function d(k){if(typeof k!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,k!==a&&P(this,k)}d.prototype.catch=function(k){return this.then(null,k)},d.prototype.then=function(k,X){if(typeof k!="function"&&this.state===p||typeof X!="function"&&this.state===m)return this;var z=new this.constructor(a);if(this.state!==f){var oe=this.state===p?k:X;E(z,oe,this.outcome)}else this.queue.push(new g(z,k,X));return z};function g(k,X,z){this.promise=k,typeof X=="function"&&(this.onFulfilled=X,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(k){l.resolve(this.promise,k)},g.prototype.otherCallFulfilled=function(k){E(this.promise,this.onFulfilled,k)},g.prototype.callRejected=function(k){l.reject(this.promise,k)},g.prototype.otherCallRejected=function(k){E(this.promise,this.onRejected,k)};function E(k,X,z){s(function(){var oe;try{oe=X(z)}catch(Ce){return l.reject(k,Ce)}oe===k?l.reject(k,new TypeError("Cannot resolve promise with itself")):l.resolve(k,oe)})}l.resolve=function(k,X){var z=R(N,X);if(z.status==="error")return l.reject(k,z.value);var oe=z.value;if(oe)P(k,oe);else{k.state=p,k.outcome=X;for(var Ce=-1,de=k.queue.length;++Ce<de;)k.queue[Ce].callFulfilled(X)}return k},l.reject=function(k,X){k.state=m,k.outcome=X;for(var z=-1,oe=k.queue.length;++z<oe;)k.queue[z].callRejected(X);return k};function N(k){var X=k&&k.then;if(k&&(typeof k=="object"||typeof k=="function")&&typeof X=="function")return function(){X.apply(k,arguments)}}function P(k,X){var z=!1;function oe(He){z||(z=!0,l.reject(k,He))}function Ce(He){z||(z=!0,l.resolve(k,He))}function de(){X(Ce,oe)}var be=R(de);be.status==="error"&&oe(be.value)}function R(k,X){var z={};try{z.value=k(X),z.status="success"}catch(oe){z.status="error",z.value=oe}return z}d.resolve=x;function x(k){return k instanceof this?k:l.resolve(new this(a),k)}d.reject=W;function W(k){var X=new this(a);return l.reject(X,k)}d.all=$;function $(k){var X=this;if(Object.prototype.toString.call(k)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=k.length,oe=!1;if(!z)return this.resolve([]);for(var Ce=new Array(z),de=0,be=-1,He=new this(a);++be<z;)Pe(k[be],be);return He;function Pe(ot,St){X.resolve(ot).then(we,function(Me){oe||(oe=!0,l.reject(He,Me))});function we(Me){Ce[St]=Me,++de===z&&!oe&&(oe=!0,l.resolve(He,Ce))}}}d.race=ie;function ie(k){var X=this;if(Object.prototype.toString.call(k)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=k.length,oe=!1;if(!z)return this.resolve([]);for(var Ce=-1,de=new this(a);++Ce<z;)be(k[Ce]);return de;function be(He){X.resolve(He).then(function(Pe){oe||(oe=!0,l.resolve(de,Pe))},function(Pe){oe||(oe=!0,l.reject(de,Pe))})}}},{1:1}],3:[function(n,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h};function a(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}function l(){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 m=l();function p(){try{if(!m||!m.open)return!1;var h=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),S=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!h||S)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(h,S){h=h||[],S=S||{};try{return new Blob(h,S)}catch(I){if(I.name!=="TypeError")throw I;for(var v=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,T=new v,C=0;C<h.length;C+=1)T.append(h[C]);return T.getBlob(S.type)}}typeof Promise>"u"&&n(3);var d=Promise;function g(h,S){S&&h.then(function(v){S(null,v)},function(v){S(v)})}function E(h,S,v){typeof S=="function"&&h.then(S),typeof v=="function"&&h.catch(v)}function N(h){return typeof h!="string"&&(console.warn(h+" used as a key, but it is not a string."),h=String(h)),h}function P(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",x=void 0,W={},$=Object.prototype.toString,ie="readonly",k="readwrite";function X(h){for(var S=h.length,v=new ArrayBuffer(S),T=new Uint8Array(v),C=0;C<S;C++)T[C]=h.charCodeAt(C);return v}function z(h){return new d(function(S){var v=h.transaction(R,k),T=f([""]);v.objectStore(R).put(T,"key"),v.onabort=function(C){C.preventDefault(),C.stopPropagation(),S(!1)},v.oncomplete=function(){var C=navigator.userAgent.match(/Chrome\/(\d+)/),I=navigator.userAgent.match(/Edge\//);S(I||!C||parseInt(C[1],10)>=43)}}).catch(function(){return!1})}function oe(h){return typeof x=="boolean"?d.resolve(x):z(h).then(function(S){return x=S,x})}function Ce(h){var S=W[h.name],v={};v.promise=new d(function(T,C){v.resolve=T,v.reject=C}),S.deferredOperations.push(v),S.dbReady?S.dbReady=S.dbReady.then(function(){return v.promise}):S.dbReady=v.promise}function de(h){var S=W[h.name],v=S.deferredOperations.pop();if(v)return v.resolve(),v.promise}function be(h,S){var v=W[h.name],T=v.deferredOperations.pop();if(T)return T.reject(S),T.promise}function He(h,S){return new d(function(v,T){if(W[h.name]=W[h.name]||ar(),h.db)if(S)Ce(h),h.db.close();else return v(h.db);var C=[h.name];S&&C.push(h.version);var I=m.open.apply(m,C);S&&(I.onupgradeneeded=function(O){var U=I.result;try{U.createObjectStore(h.storeName),O.oldVersion<=1&&U.createObjectStore(R)}catch(F){if(F.name==="ConstraintError")console.warn('The database "'+h.name+'" has been upgraded from version '+O.oldVersion+" to version "+O.newVersion+', but the storage "'+h.storeName+'" already exists.');else throw F}}),I.onerror=function(O){O.preventDefault(),T(I.error)},I.onsuccess=function(){var O=I.result;O.onversionchange=function(U){U.target.close()},v(O),de(h)}})}function Pe(h){return He(h,!1)}function ot(h){return He(h,!0)}function St(h,S){if(!h.db)return!0;var v=!h.db.objectStoreNames.contains(h.storeName),T=h.version<h.db.version,C=h.version>h.db.version;if(T&&(h.version!==S&&console.warn('The database "'+h.name+`" can't be downgraded from version `+h.db.version+" to version "+h.version+"."),h.version=h.db.version),C||v){if(v){var I=h.db.version+1;I>h.version&&(h.version=I)}return!0}return!1}function we(h){return new d(function(S,v){var T=new FileReader;T.onerror=v,T.onloadend=function(C){var I=btoa(C.target.result||"");S({__local_forage_encoded_blob:!0,data:I,type:h.type})},T.readAsBinaryString(h)})}function Me(h){var S=X(atob(h.data));return f([S],{type:h.type})}function pe(h){return h&&h.__local_forage_encoded_blob}function te(h){var S=this,v=S._initReady().then(function(){var T=W[S._dbInfo.name];if(T&&T.dbReady)return T.dbReady});return E(v,h,h),v}function ke(h){Ce(h);for(var S=W[h.name],v=S.forages,T=0;T<v.length;T++){var C=v[T];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return h.db=null,Pe(h).then(function(I){return h.db=I,St(h)?ot(h):I}).then(function(I){h.db=S.db=I;for(var O=0;O<v.length;O++)v[O]._dbInfo.db=I}).catch(function(I){throw be(h,I),I})}function pt(h,S,v,T){T===void 0&&(T=1);try{var C=h.db.transaction(h.storeName,S);v(null,C)}catch(I){if(T>0&&(!h.db||I.name==="InvalidStateError"||I.name==="NotFoundError"))return d.resolve().then(function(){if(!h.db||I.name==="NotFoundError"&&!h.db.objectStoreNames.contains(h.storeName)&&h.version<=h.db.version)return h.db&&(h.version=h.db.version+1),ot(h)}).then(function(){return ke(h).then(function(){pt(h,S,v,T-1)})}).catch(v);v(I)}}function ar(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function $r(h){var S=this,v={db:null};if(h)for(var T in h)v[T]=h[T];var C=W[v.name];C||(C=ar(),W[v.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=te);var I=[];function O(){return d.resolve()}for(var U=0;U<C.forages.length;U++){var F=C.forages[U];F!==S&&I.push(F._initReady().catch(O))}var H=C.forages.slice(0);return d.all(I).then(function(){return v.db=C.db,Pe(v)}).then(function(j){return v.db=j,St(v,S._defaultConfig.version)?ot(v):j}).then(function(j){v.db=C.db=j,S._dbInfo=v;for(var Y=0;Y<H.length;Y++){var le=H[Y];le!==S&&(le._dbInfo.db=v.db,le._dbInfo.version=v.version)}})}function en(h,S){var v=this;h=N(h);var T=new d(function(C,I){v.ready().then(function(){pt(v._dbInfo,ie,function(O,U){if(O)return I(O);try{var F=U.objectStore(v._dbInfo.storeName),H=F.get(h);H.onsuccess=function(){var j=H.result;j===void 0&&(j=null),pe(j)&&(j=Me(j)),C(j)},H.onerror=function(){I(H.error)}}catch(j){I(j)}})}).catch(I)});return g(T,S),T}function Bn(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){pt(v._dbInfo,ie,function(O,U){if(O)return I(O);try{var F=U.objectStore(v._dbInfo.storeName),H=F.openCursor(),j=1;H.onsuccess=function(){var Y=H.result;if(Y){var le=Y.value;pe(le)&&(le=Me(le));var Ie=h(le,Y.key,j++);Ie!==void 0?C(Ie):Y.continue()}else C()},H.onerror=function(){I(H.error)}}catch(Y){I(Y)}})}).catch(I)});return g(T,S),T}function jr(h,S,v){var T=this;h=N(h);var C=new d(function(I,O){var U;T.ready().then(function(){return U=T._dbInfo,$.call(S)==="[object Blob]"?oe(U.db).then(function(F){return F?S:we(S)}):S}).then(function(F){pt(T._dbInfo,k,function(H,j){if(H)return O(H);try{var Y=j.objectStore(T._dbInfo.storeName);F===null&&(F=void 0);var le=Y.put(F,h);j.oncomplete=function(){F===void 0&&(F=null),I(F)},j.onabort=j.onerror=function(){var Ie=le.error?le.error:le.transaction.error;O(Ie)}}catch(Ie){O(Ie)}})}).catch(O)});return g(C,v),C}function Un(h,S){var v=this;h=N(h);var T=new d(function(C,I){v.ready().then(function(){pt(v._dbInfo,k,function(O,U){if(O)return I(O);try{var F=U.objectStore(v._dbInfo.storeName),H=F.delete(h);U.oncomplete=function(){C()},U.onerror=function(){I(H.error)},U.onabort=function(){var j=H.error?H.error:H.transaction.error;I(j)}}catch(j){I(j)}})}).catch(I)});return g(T,S),T}function Mn(h){var S=this,v=new d(function(T,C){S.ready().then(function(){pt(S._dbInfo,k,function(I,O){if(I)return C(I);try{var U=O.objectStore(S._dbInfo.storeName),F=U.clear();O.oncomplete=function(){T()},O.onabort=O.onerror=function(){var H=F.error?F.error:F.transaction.error;C(H)}}catch(H){C(H)}})}).catch(C)});return g(v,h),v}function kn(h){var S=this,v=new d(function(T,C){S.ready().then(function(){pt(S._dbInfo,ie,function(I,O){if(I)return C(I);try{var U=O.objectStore(S._dbInfo.storeName),F=U.count();F.onsuccess=function(){T(F.result)},F.onerror=function(){C(F.error)}}catch(H){C(H)}})}).catch(C)});return g(v,h),v}function Jt(h,S){var v=this,T=new d(function(C,I){if(h<0){C(null);return}v.ready().then(function(){pt(v._dbInfo,ie,function(O,U){if(O)return I(O);try{var F=U.objectStore(v._dbInfo.storeName),H=!1,j=F.openKeyCursor();j.onsuccess=function(){var Y=j.result;if(!Y){C(null);return}h===0||H?C(Y.key):(H=!0,Y.advance(h))},j.onerror=function(){I(j.error)}}catch(Y){I(Y)}})}).catch(I)});return g(T,S),T}function ft(h){var S=this,v=new d(function(T,C){S.ready().then(function(){pt(S._dbInfo,ie,function(I,O){if(I)return C(I);try{var U=O.objectStore(S._dbInfo.storeName),F=U.openKeyCursor(),H=[];F.onsuccess=function(){var j=F.result;if(!j){T(H);return}H.push(j.key),j.continue()},F.onerror=function(){C(F.error)}}catch(j){C(j)}})}).catch(C)});return g(v,h),v}function Bt(h,S){S=P.apply(this,arguments);var v=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||v.name,h.storeName=h.storeName||v.storeName);var T=this,C;if(!h.name)C=d.reject("Invalid arguments");else{var I=h.name===v.name&&T._dbInfo.db,O=I?d.resolve(T._dbInfo.db):Pe(h).then(function(U){var F=W[h.name],H=F.forages;F.db=U;for(var j=0;j<H.length;j++)H[j]._dbInfo.db=U;return U});h.storeName?C=O.then(function(U){if(U.objectStoreNames.contains(h.storeName)){var F=U.version+1;Ce(h);var H=W[h.name],j=H.forages;U.close();for(var Y=0;Y<j.length;Y++){var le=j[Y];le._dbInfo.db=null,le._dbInfo.version=F}var Ie=new d(function(Te,Ge){var $e=m.open(h.name,F);$e.onerror=function(Ut){var Wi=$e.result;Wi.close(),Ge(Ut)},$e.onupgradeneeded=function(){var Ut=$e.result;Ut.deleteObjectStore(h.storeName)},$e.onsuccess=function(){var Ut=$e.result;Ut.close(),Te(Ut)}});return Ie.then(function(Te){H.db=Te;for(var Ge=0;Ge<j.length;Ge++){var $e=j[Ge];$e._dbInfo.db=Te,de($e._dbInfo)}}).catch(function(Te){throw(be(h,Te)||d.resolve()).catch(function(){}),Te})}}):C=O.then(function(U){Ce(h);var F=W[h.name],H=F.forages;U.close();for(var j=0;j<H.length;j++){var Y=H[j];Y._dbInfo.db=null}var le=new d(function(Ie,Te){var Ge=m.deleteDatabase(h.name);Ge.onerror=function(){var $e=Ge.result;$e&&$e.close(),Te(Ge.error)},Ge.onblocked=function(){console.warn('dropInstance blocked for database "'+h.name+'" until all open connections are closed')},Ge.onsuccess=function(){var $e=Ge.result;$e&&$e.close(),Ie($e)}});return le.then(function(Ie){F.db=Ie;for(var Te=0;Te<H.length;Te++){var Ge=H[Te];de(Ge._dbInfo)}}).catch(function(Ie){throw(be(h,Ie)||d.resolve()).catch(function(){}),Ie})})}return g(C,S),C}var Hi={_driver:"asyncStorage",_initStorage:$r,_support:p(),iterate:Bn,getItem:en,setItem:jr,removeItem:Un,clear:Mn,length:kn,key:Jt,keys:ft,dropInstance:Bt};function y(){return typeof openDatabase=="function"}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="~~local_forage_type~",_=/^~~local_forage_type~([^~]+)~/,D="__lfsc__:",B=D.length,L="arbf",re="blob",me="si08",V="ui08",J="uic8",G="si16",he="si32",mt="ur16",st="ui32",ye="fl32",Q="fl64",Ct=B+L.length,Fn=Object.prototype.toString;function $i(h){var S=h.length*.75,v=h.length,T,C=0,I,O,U,F;h[h.length-1]==="="&&(S--,h[h.length-2]==="="&&S--);var H=new ArrayBuffer(S),j=new Uint8Array(H);for(T=0;T<v;T+=4)I=c.indexOf(h[T]),O=c.indexOf(h[T+1]),U=c.indexOf(h[T+2]),F=c.indexOf(h[T+3]),j[C++]=I<<2|O>>4,j[C++]=(O&15)<<4|U>>2,j[C++]=(U&3)<<6|F&63;return H}function yc(h){var S=new Uint8Array(h),v="",T;for(T=0;T<S.length;T+=3)v+=c[S[T]>>2],v+=c[(S[T]&3)<<4|S[T+1]>>4],v+=c[(S[T+1]&15)<<2|S[T+2]>>6],v+=c[S[T+2]&63];return S.length%3===2?v=v.substring(0,v.length-1)+"=":S.length%3===1&&(v=v.substring(0,v.length-2)+"=="),v}function Ed(h,S){var v="";if(h&&(v=Fn.call(h)),h&&(v==="[object ArrayBuffer]"||h.buffer&&Fn.call(h.buffer)==="[object ArrayBuffer]")){var T,C=D;h instanceof ArrayBuffer?(T=h,C+=L):(T=h.buffer,v==="[object Int8Array]"?C+=me:v==="[object Uint8Array]"?C+=V:v==="[object Uint8ClampedArray]"?C+=J:v==="[object Int16Array]"?C+=G:v==="[object Uint16Array]"?C+=mt:v==="[object Int32Array]"?C+=he:v==="[object Uint32Array]"?C+=st:v==="[object Float32Array]"?C+=ye:v==="[object Float64Array]"?C+=Q:S(new Error("Failed to get type for BinaryArray"))),S(C+yc(T))}else if(v==="[object Blob]"){var I=new FileReader;I.onload=function(){var O=u+h.type+"~"+yc(this.result);S(D+re+O)},I.readAsArrayBuffer(h)}else try{S(JSON.stringify(h))}catch(O){console.error("Couldn't convert value into a JSON string: ",h),S(null,O)}}function Sd(h){if(h.substring(0,B)!==D)return JSON.parse(h);var S=h.substring(Ct),v=h.substring(B,Ct),T;if(v===re&&_.test(S)){var C=S.match(_);T=C[1],S=S.substring(C[0].length)}var I=$i(S);switch(v){case L:return I;case re:return f([I],{type:T});case me:return new Int8Array(I);case V:return new Uint8Array(I);case J:return new Uint8ClampedArray(I);case G:return new Int16Array(I);case mt:return new Uint16Array(I);case he:return new Int32Array(I);case st:return new Uint32Array(I);case ye:return new Float32Array(I);case Q:return new Float64Array(I);default:throw new Error("Unkown type: "+v)}}var vc={serialize:Ed,deserialize:Sd,stringToBuffer:$i,bufferToString:yc};function zu(h,S,v,T){h.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],v,T)}function bd(h){var S=this,v={db:null};if(h)for(var T in h)v[T]=typeof h[T]!="string"?h[T].toString():h[T];var C=new d(function(I,O){try{v.db=openDatabase(v.name,String(v.version),v.description,v.size)}catch(U){return O(U)}v.db.transaction(function(U){zu(U,v,function(){S._dbInfo=v,I()},function(F,H){O(H)})},O)});return v.serializer=vc,C}function Wr(h,S,v,T,C,I){h.executeSql(v,T,C,function(O,U){U.code===U.SYNTAX_ERR?O.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[S.storeName],function(F,H){H.rows.length?I(F,U):zu(F,S,function(){F.executeSql(v,T,C,I)},I)},I):I(O,U)},I)}function wd(h,S){var v=this;h=N(h);var T=new d(function(C,I){v.ready().then(function(){var O=v._dbInfo;O.db.transaction(function(U){Wr(U,O,"SELECT * FROM "+O.storeName+" WHERE key = ? LIMIT 1",[h],function(F,H){var j=H.rows.length?H.rows.item(0).value:null;j&&(j=O.serializer.deserialize(j)),C(j)},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Id(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){var O=v._dbInfo;O.db.transaction(function(U){Wr(U,O,"SELECT * FROM "+O.storeName,[],function(F,H){for(var j=H.rows,Y=j.length,le=0;le<Y;le++){var Ie=j.item(le),Te=Ie.value;if(Te&&(Te=O.serializer.deserialize(Te)),Te=h(Te,Ie.key,le+1),Te!==void 0){C(Te);return}}C()},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Yu(h,S,v,T){var C=this;h=N(h);var I=new d(function(O,U){C.ready().then(function(){S===void 0&&(S=null);var F=S,H=C._dbInfo;H.serializer.serialize(S,function(j,Y){Y?U(Y):H.db.transaction(function(le){Wr(le,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[h,j],function(){O(F)},function(Ie,Te){U(Te)})},function(le){if(le.code===le.QUOTA_ERR){if(T>0){O(Yu.apply(C,[h,F,v,T-1]));return}U(le)}})})}).catch(U)});return g(I,v),I}function Td(h,S,v){return Yu.apply(this,[h,S,v,1])}function xd(h,S){var v=this;h=N(h);var T=new d(function(C,I){v.ready().then(function(){var O=v._dbInfo;O.db.transaction(function(U){Wr(U,O,"DELETE FROM "+O.storeName+" WHERE key = ?",[h],function(){C()},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Cd(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(O){Wr(O,I,"DELETE FROM "+I.storeName,[],function(){T()},function(U,F){C(F)})})}).catch(C)});return g(v,h),v}function Dd(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(O){Wr(O,I,"SELECT COUNT(key) as c FROM "+I.storeName,[],function(U,F){var H=F.rows.item(0).c;T(H)},function(U,F){C(F)})})}).catch(C)});return g(v,h),v}function Rd(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){var O=v._dbInfo;O.db.transaction(function(U){Wr(U,O,"SELECT key FROM "+O.storeName+" WHERE id = ? LIMIT 1",[h+1],function(F,H){var j=H.rows.length?H.rows.item(0).key:null;C(j)},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Nd(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(O){Wr(O,I,"SELECT key FROM "+I.storeName,[],function(U,F){for(var H=[],j=0;j<F.rows.length;j++)H.push(F.rows.item(j).key);T(H)},function(U,F){C(F)})})}).catch(C)});return g(v,h),v}function Od(h){return new d(function(S,v){h.transaction(function(T){T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,I){for(var O=[],U=0;U<I.rows.length;U++)O.push(I.rows.item(U).name);S({db:h,storeNames:O})},function(C,I){v(I)})},function(T){v(T)})})}function Ad(h,S){S=P.apply(this,arguments);var v=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||v.name,h.storeName=h.storeName||v.storeName);var T=this,C;return h.name?C=new d(function(I){var O;h.name===v.name?O=T._dbInfo.db:O=openDatabase(h.name,"","",0),h.storeName?I({db:O,storeNames:[h.storeName]}):I(Od(O))}).then(function(I){return new d(function(O,U){I.db.transaction(function(F){function H(Ie){return new d(function(Te,Ge){F.executeSql("DROP TABLE IF EXISTS "+Ie,[],function(){Te()},function($e,Ut){Ge(Ut)})})}for(var j=[],Y=0,le=I.storeNames.length;Y<le;Y++)j.push(H(I.storeNames[Y]));d.all(j).then(function(){O()}).catch(function(Ie){U(Ie)})},function(F){U(F)})})}):C=d.reject("Invalid arguments"),g(C,S),C}var Pd={_driver:"webSQLStorage",_initStorage:bd,_support:y(),iterate:Id,getItem:wd,setItem:Td,removeItem:xd,clear:Cd,length:Dd,key:Rd,keys:Nd,dropInstance:Ad};function Ld(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qu(h,S){var v=h.name+"/";return h.storeName!==S.storeName&&(v+=h.storeName+"/"),v}function Bd(){var h="_localforage_support_test";try{return localStorage.setItem(h,!0),localStorage.removeItem(h),!1}catch{return!0}}function Ud(){return!Bd()||localStorage.length>0}function Md(h){var S=this,v={};if(h)for(var T in h)v[T]=h[T];return v.keyPrefix=qu(h,S._defaultConfig),Ud()?(S._dbInfo=v,v.serializer=vc,d.resolve()):d.reject()}function kd(h){var S=this,v=S.ready().then(function(){for(var T=S._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var I=localStorage.key(C);I.indexOf(T)===0&&localStorage.removeItem(I)}});return g(v,h),v}function Fd(h,S){var v=this;h=N(h);var T=v.ready().then(function(){var C=v._dbInfo,I=localStorage.getItem(C.keyPrefix+h);return I&&(I=C.serializer.deserialize(I)),I});return g(T,S),T}function Hd(h,S){var v=this,T=v.ready().then(function(){for(var C=v._dbInfo,I=C.keyPrefix,O=I.length,U=localStorage.length,F=1,H=0;H<U;H++){var j=localStorage.key(H);if(j.indexOf(I)===0){var Y=localStorage.getItem(j);if(Y&&(Y=C.serializer.deserialize(Y)),Y=h(Y,j.substring(O),F++),Y!==void 0)return Y}}});return g(T,S),T}function $d(h,S){var v=this,T=v.ready().then(function(){var C=v._dbInfo,I;try{I=localStorage.key(h)}catch{I=null}return I&&(I=I.substring(C.keyPrefix.length)),I});return g(T,S),T}function jd(h){var S=this,v=S.ready().then(function(){for(var T=S._dbInfo,C=localStorage.length,I=[],O=0;O<C;O++){var U=localStorage.key(O);U.indexOf(T.keyPrefix)===0&&I.push(U.substring(T.keyPrefix.length))}return I});return g(v,h),v}function Wd(h){var S=this,v=S.keys().then(function(T){return T.length});return g(v,h),v}function Gd(h,S){var v=this;h=N(h);var T=v.ready().then(function(){var C=v._dbInfo;localStorage.removeItem(C.keyPrefix+h)});return g(T,S),T}function Vd(h,S,v){var T=this;h=N(h);var C=T.ready().then(function(){S===void 0&&(S=null);var I=S;return new d(function(O,U){var F=T._dbInfo;F.serializer.serialize(S,function(H,j){if(j)U(j);else try{localStorage.setItem(F.keyPrefix+h,H),O(I)}catch(Y){(Y.name==="QuotaExceededError"||Y.name==="NS_ERROR_DOM_QUOTA_REACHED")&&U(Y),U(Y)}})})});return g(C,v),C}function zd(h,S){if(S=P.apply(this,arguments),h=typeof h!="function"&&h||{},!h.name){var v=this.config();h.name=h.name||v.name,h.storeName=h.storeName||v.storeName}var T=this,C;return h.name?C=new d(function(I){h.storeName?I(qu(h,T._defaultConfig)):I(h.name+"/")}).then(function(I){for(var O=localStorage.length-1;O>=0;O--){var U=localStorage.key(O);U.indexOf(I)===0&&localStorage.removeItem(U)}}):C=d.reject("Invalid arguments"),g(C,S),C}var Yd={_driver:"localStorageWrapper",_initStorage:Md,_support:Ld(),iterate:Hd,getItem:Fd,setItem:Vd,removeItem:Gd,clear:kd,length:Wd,key:$d,keys:jd,dropInstance:zd},qd=function(S,v){return S===v||typeof S=="number"&&typeof v=="number"&&isNaN(S)&&isNaN(v)},Kd=function(S,v){for(var T=S.length,C=0;C<T;){if(qd(S[C],v))return!0;C++}return!1},Ku=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"},ji={},Ju={},Hn={INDEXEDDB:Hi,WEBSQL:Pd,LOCALSTORAGE:Yd},Jd=[Hn.INDEXEDDB._driver,Hn.WEBSQL._driver,Hn.LOCALSTORAGE._driver],zo=["dropInstance"],_c=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(zo),Xd={description:"",driver:Jd.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Qd(h,S){h[S]=function(){var v=arguments;return h.ready().then(function(){return h[S].apply(h,v)})}}function Ec(){for(var h=1;h<arguments.length;h++){var S=arguments[h];if(S)for(var v in S)S.hasOwnProperty(v)&&(Ku(S[v])?arguments[0][v]=S[v].slice():arguments[0][v]=S[v])}return arguments[0]}var Zd=function(){function h(S){a(this,h);for(var v in Hn)if(Hn.hasOwnProperty(v)){var T=Hn[v],C=T._driver;this[v]=C,ji[C]||this.defineDriver(T)}this._defaultConfig=Ec({},Xd),this._config=Ec({},this._defaultConfig,S),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return h.prototype.config=function(v){if((typeof v>"u"?"undefined":s(v))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var T in v){if(T==="storeName"&&(v[T]=v[T].replace(/\W/g,"_")),T==="version"&&typeof v[T]!="number")return new Error("Database version must be a number.");this._config[T]=v[T]}return"driver"in v&&v.driver?this.setDriver(this._config.driver):!0}else return typeof v=="string"?this._config[v]:this._config},h.prototype.defineDriver=function(v,T,C){var I=new d(function(O,U){try{var F=v._driver,H=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!v._driver){U(H);return}for(var j=_c.concat("_initStorage"),Y=0,le=j.length;Y<le;Y++){var Ie=j[Y],Te=!Kd(zo,Ie);if((Te||v[Ie])&&typeof v[Ie]!="function"){U(H);return}}var Ge=function(){for(var Wi=function(rh){return function(){var nh=new Error("Method "+rh+" is not implemented by the current driver"),Xu=d.reject(nh);return g(Xu,arguments[arguments.length-1]),Xu}},Sc=0,th=zo.length;Sc<th;Sc++){var bc=zo[Sc];v[bc]||(v[bc]=Wi(bc))}};Ge();var $e=function(Wi){ji[F]&&console.info("Redefining LocalForage driver: "+F),ji[F]=v,Ju[F]=Wi,O()};"_support"in v?v._support&&typeof v._support=="function"?v._support().then($e,U):$e(!!v._support):$e(!0)}catch(Ut){U(Ut)}});return E(I,T,C),I},h.prototype.driver=function(){return this._driver||null},h.prototype.getDriver=function(v,T,C){var I=ji[v]?d.resolve(ji[v]):d.reject(new Error("Driver not found."));return E(I,T,C),I},h.prototype.getSerializer=function(v){var T=d.resolve(vc);return E(T,v),T},h.prototype.ready=function(v){var T=this,C=T._driverSet.then(function(){return T._ready===null&&(T._ready=T._initDriver()),T._ready});return E(C,v,v),C},h.prototype.setDriver=function(v,T,C){var I=this;Ku(v)||(v=[v]);var O=this._getSupportedDrivers(v);function U(){I._config.driver=I.driver()}function F(Y){return I._extend(Y),U(),I._ready=I._initStorage(I._config),I._ready}function H(Y){return function(){var le=0;function Ie(){for(;le<Y.length;){var Te=Y[le];return le++,I._dbInfo=null,I._ready=null,I.getDriver(Te).then(F).catch(Ie)}U();var Ge=new Error("No available storage method found.");return I._driverSet=d.reject(Ge),I._driverSet}return Ie()}}var j=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=j.then(function(){var Y=O[0];return I._dbInfo=null,I._ready=null,I.getDriver(Y).then(function(le){I._driver=le._driver,U(),I._wrapLibraryMethodsWithReady(),I._initDriver=H(O)})}).catch(function(){U();var Y=new Error("No available storage method found.");return I._driverSet=d.reject(Y),I._driverSet}),E(this._driverSet,T,C),this._driverSet},h.prototype.supports=function(v){return!!Ju[v]},h.prototype._extend=function(v){Ec(this,v)},h.prototype._getSupportedDrivers=function(v){for(var T=[],C=0,I=v.length;C<I;C++){var O=v[C];this.supports(O)&&T.push(O)}return T},h.prototype._wrapLibraryMethodsWithReady=function(){for(var v=0,T=_c.length;v<T;v++)Qd(this,_c[v])},h.prototype.createInstance=function(v){return new h(v)},h}(),eh=new Zd;i.exports=eh},{3:3}]},{},[4])(4)})});var vl=Vi(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.URLBuilder=void 0;var kg=function(){function t(e){try{this.base=new URL(e),this.params=new URLSearchParams(this.base.search.slice(1))}catch(r){console.error("Un-parsable URL",r)}}return t.prototype.appendQueryParam=function(e,r){this.params.append(e,r?r.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(e){this.params.delete(e)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(e){if(!this.params)return"";var r=this.params.get(e);return!r||r==="undefined"||r==="null"?void 0:r},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(e){return this.base.pathname=e,this},t.prototype.setQueryParam=function(e,r){return this.params.set(e,r?r.toString():""),this},t.prototype.setQueryString=function(e){if(e)return e[0]==="?"&&(e=e.slice(1)),this.params=new URLSearchParams(e),this},t.prototype.toString=function(){var e=this.params.toString();return e===""?this.base.search="":this.base.search="?"+e,this.base.toString()},t}();Os.URLBuilder=kg});var fd=Vi((Wu,Gu)=>{"use strict";(function(t,e){typeof Wu=="object"&&typeof Gu<"u"?Gu.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})(Wu,function(){"use strict";var t=function(n,i){if(i=i||{},typeof n!="function")throw new r("fetch must be a function");if(typeof i!="object")throw new r("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new r("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new r("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(a,l){var m=i.retries,p=i.retryDelay,f=i.retryOn;if(l&&l.retries!==void 0)if(e(l.retries))m=l.retries;else throw new r("retries must be a positive integer");if(l&&l.retryDelay!==void 0)if(e(l.retryDelay)||typeof l.retryDelay=="function")p=l.retryDelay;else throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(l&&l.retryOn)if(Array.isArray(l.retryOn)||typeof l.retryOn=="function")f=l.retryOn;else throw new r("retryOn property expects an array or function");return new Promise(function(d,g){var E=function(P){var R=typeof Request<"u"&&a instanceof Request?a.clone():a;n(R,l).then(function(x){if(Array.isArray(f)&&f.indexOf(x.status)===-1)d(x);else if(typeof f=="function")try{return Promise.resolve(f(P,null,x)).then(function(W){W?N(P,null,x):d(x)}).catch(g)}catch(W){g(W)}else P<m?N(P,null,x):d(x)}).catch(function(x){if(typeof f=="function")try{Promise.resolve(f(P,x,null)).then(function(W){W?N(P,x,null):g(x)}).catch(function(W){g(W)})}catch(W){g(W)}else P<m?N(P,x,null):g(x)})};function N(P,R,x){var W=typeof p=="function"?p(P,R,x):p;setTimeout(function(){E(++P)},W)}E(0)})}};function e(n){return Number.isInteger(n)&&n>=0}function r(n){this.name="ArgumentError",this.message=n}return t})});var Gr={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production"};var Dt=Xt(tn());var rp="9.3.1";var A=class t{static SDK_VERSION=rp;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 CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static{let e=t.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");t.SDK_VERSION_CODE=parseInt(e,10)}};var w=class{static log(...e){Dt.default.info(...e)}static debug(...e){Dt.default.debug(...e)}static error(...e){Dt.default.error(...e)}static warn(...e){Dt.default.warn(...e)}static info(...e){Dt.default.info(...e)}static trace(...e){Dt.default.trace(...e)}static configure(e=A.LOG_PREFIX){Dt.default.useDefaults({formatter:function(n){n.unshift(`${e} (v${A.SDK_VERSION}):`)}});let r=this.getDebugParam();(r==="1"||r==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Dt.default.setLevel(Dt.default[localStorage.cooeeLogLevel]):Dt.default.setLevel(Gr.debug?Dt.default.TRACE:Dt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let e=`
2
2
  display: inline-block;
3
3
  font-size: 14px;
4
4
  background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
@@ -58,4 +58,4 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
58
58
  <span class="${n}"
59
59
  style="background-color: ${e.pagination.color?.rgba};">
60
60
  </span>
61
- `},navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:!1}:!1,autoHeight:!0});return t.style.setProperty("--swiper-navigation-size",`${e.navigation.size}px`),r}function nc(t,e,r){let n={color:t.navigation.color?.rgba};return t.pagination.enabled&&(n.transform="translateY(-25%)"),M("div",{class:"swiper-container",ref:e,children:[M("div",{class:"swiper-wrapper",children:r()}),t.navigation.enabled&&M("div",{class:"swiper-button-next",style:n,children:M("span",{})}),t.navigation.enabled&&M("div",{class:"swiper-button-prev",style:n,children:M("span",{})}),t.pagination.enabled&&M("div",{className:"swiper-pagination",style:{bottom:0,top:"unset",position:"relative",color:t.pagination.color?.rgba}})]})}var $o=class extends De{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,r){super(e,r),this.configuration=this.renderer.isMobile()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+"px"}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&tc().then(()=>{this.swiperInstance=rc(this.swiperRef,this.props.element.conf[this.deviceTypeKey])})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let r;if(this.configuration.disp===2){let n=o=>{this.swiperRef=o},i=()=>e?.map(o=>M("div",{class:"swiper-slide",children:this.getProductFragment(o)}));r=M("div",{style:Z(b({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:nc(this.configuration,n,i)})}else r=M("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((n,i)=>this.getProductFragment(n,i!==e.length-1))});return r}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),r={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(r.flexDirection==="row"){if(e)r.maxWidth="100%",r.overflowY="auto";else if(this.configuration.disp===1){let n=this.props.triggerContext.triggerData,i=n.items.length,o;n.isBundle()?o=this.props.element.prod.symbol?.hide!==!0?i*2-1:i:o=this.props.element.conf[this.deviceTypeKey].maxInRow,r.gridTemplateColumns=`repeat(${o}, auto)`}}return r}getProductFragment(e,r=!1){return M(fr,{children:[M(Hr,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&r&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&M("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:M(Et,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var jo=class extends De{swiperRef=null;swiperInstance=null;constructor(e,r){super(e,r)}componentDidMount(){tc().then(()=>{this.swiperInstance=rc(this.swiperRef,this.props.element.conf)})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.element,r=i=>{this.swiperRef=i},n=()=>e.values?.map(i=>M("div",{class:"swiper-slide",onClick:()=>this.onClick({clickAction:this.getClickAction(i)}),children:this.renderElement(i)}));return nc(e.conf,r,n)}getComponentStyles(){return{}}renderElement(e){let r=this.valueAddedSlide(this.props.element.slide,e);switch(r?.t){case 1:return M(kr,{element:r,triggerContext:this.props.triggerContext});case 4:return M(Fr,{elements:r.elems,element:r,triggerContext:this.props.triggerContext});default:w.warn("Unknown slide type for carousal")}}valueAddedSlide(e,r){let n=JSON.stringify(e),i=Zt.render(n,{form:r});return At.getParsedElement(JSON.parse(i))}getClickAction(e){let r=b({},this.props.element.clc),n=JSON.stringify(r),i=Zt.render(n,{form:e});return JSON.parse(i)}};var Zr=class extends De{constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"})),nt(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}))})}renderElement(e){if(!e.hide){if(e.t===4){let r=e;return M(Fr,{element:r,triggerContext:this.props.triggerContext,elements:r.elems})}if(e.t===61)return M(Uo,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?M(Ln,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return M(Et,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return M(kr,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return M($o,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return M(Hr,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return M(jo,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}};var Wo=class extends De{clickAction;isClickable;constructor(e,r){super(e,r),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===4&&this.clickAction.gu?.u}componentDidMount(){nt(()=>{let e=this.props.triggerContext.triggerData,r=this.props.triggerContext.selectedItems;e.calculateDiscountData(r,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return M(fr,{children:[M("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:()=>{this.onClick({clickAction:this.clickAction})},children:M(Zr,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id==="preview"&&M("div",{class:"letscooee-preview-badge",children:["#",this.props.triggerContext.triggerData.shortID," preview"]})]})}getComponentStyles(){let e={position:"relative",overflow:"hidden",display:"block"};return this.isClickable&&(e.cursor="pointer"),e}async onClick(e){if(this.isClickable)return super.onClick(e)}};var xt=class t{constructor(e){this.engagementTrigger=e;this.triggerContext=new Ri(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=fe.get();widgetAPIService=se.get(sr);safeHTTPService=se.get(ue);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(e=>Ue.getInstance().captureException(e,b({},this.engagementTrigger.sentryContext())))}destroy(){w.log(`${this.engagementTrigger} will be destroyed`),this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect()}),this.rootContainer?.remove(),t.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID)}async render(){if(this.engagementTrigger.hasMultiplePlacement){let e=await this.getVariation();this.handleVariationResponse(e)}if(this.rootContainer=await this.getWidgetContainer(!0),!this.rootContainer){w.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),!this.shouldStopRendering()&&(await this.startRendering(),this.attachScroll(),await this.checkAndSendEvent(),this.triggerContext.renderer=this)}isSameTrigger(e){return this.engagementTrigger.shortID===e.shortID}update(e){yd.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(e.items,this.engagementTrigger.items)}shouldStopRendering(){return!this.widget&&!this.isExclusionWithBVariation}async getVariationIfRequired(){if(this.engagementTrigger.isSingleContent()||this.engagementTrigger.widget){w.log(`${this.engagementTrigger} already has required data to render widget`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e)}handleVariationResponse(e){e&&(w.log(`${this.engagementTrigger} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(this.engagementTrigger.items=e.items.map(r=>new wt(r)),this.engagementTrigger.nonMutableItems=e.items.map(r=>new wt(r))),e.bundleFrom&&(this.engagementTrigger.bundleFrom=new wt(e.bundleFrom)),e.discount&&(this.engagementTrigger.discount=e.discount),e.placement&&(this.triggerContext.triggerData.placement=e.placement),e.props&&kt.hasKeys(e.props)&&(this.engagementTrigger.props=b(b({},this.engagementTrigger.props),e.props)),this.triggerContext.triggerData.widget=this.widget=new li(e.widget),this.triggerContext.triggerData.contentID=e.contentID,this.triggerContext.triggerData.variation=this.variation=e.variation,this.triggerContext.triggerData.placement=e.placement,this.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){t.renderedEngagements.push(this)}async getVariation(){w.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id==="preview"};try{return await this.widgetAPIService.getVariation(e)}catch(r){w.error(`${this.engagementTrigger} unable to get the variation`,r);return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){w.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,r={root:null,rootMargin:`-${e}px 0px ${e}px 0px`,threshold:0};return await this.isInViewport()?this.getVariation():new Promise(n=>{let i=new IntersectionObserver((o,s)=>{o.forEach(async a=>{if(a.isIntersecting){w.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);let l=await this.getVariation();n(l),s.unobserve(this.rootContainer)}})},r);i.observe(this.rootContainer),this.observers.push(i)})}attachScroll(){this.scrollSubscription=En(window,"scroll").pipe(tr(t.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(t.engagementIDsWithTrackedDisplay.has(e)||!await this.isInViewport())return;let n={};this.triggerContext.triggerData.items?.length&&(n.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let i=this.isExclusionWithBVariation?A.EVENT_CAMPAIGN_HOLDOUT:A.EVENT_TRIGGER_DISPLAYED,o=new ve(i,n,this.engagementTrigger);o.name===A.EVENT_CAMPAIGN_HOLDOUT&&(o.trigger.holdout=!0),this.safeHTTPService.sendEvent(o),t.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}async isInViewport(){let e=(await this.getWidgetContainer())?.getBoundingClientRect();if(!e)return!1;let r=window.innerHeight||document.documentElement.clientHeight,i=(Math.min(e.bottom,r)-Math.max(e.top,0))*e.width,o=e.width*e.height,s=i/o*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(e);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(e){let r=this.engagementTrigger.placement;if(!r?.selector)return w.warn(`${this.engagementTrigger} does not have a selector`),null;w.debug(`${this.engagementTrigger} attempt to render ${r.position}-${r.selector}`);let n=await ce.retrySelector(r.selector);if(!n)return w.warn(`${this.engagementTrigger} no placement found with ${r.selector}`),null;let i=this.generateParentElementID(),o=this.getParentElement(i);if(!e)return o;switch(r.position){case $n.BEFORE:{n.parentElement?.insertBefore(o,n);break}case $n.INSIDE_FIRST:{n.insertBefore(o,n.firstChild);break}case $n.INSIDE_LAST:{n.appendChild(o);break}case $n.AFTER:default:n.parentElement?.insertBefore(o,n.nextSibling)}return o}async startRendering(){let e;try{e=await Pi.refreshItems(this.engagementTrigger)}catch(r){w.error(`${this.engagementTrigger} error refreshing the items`,r);return}if(!e?.length&&this.engagementTrigger.isProductPromoted()){w.warn(`${this.engagementTrigger} is of ${this.engagementTrigger.objective} but no product found`);return}this.engagementTrigger.items=e,this.renderContainer()}getParentElement(e){let r=document.getElementById(e);if(r)return r;let n=this.engagementTrigger.shortID;return r=document.createElement("div"),r.id=e,r.className=`letscooee letscooee-engagement engagement-${n}`,r.dataset.engagementId=n,this.engagementTrigger.id==="preview"&&(r.className+=" letscooee-preview"),r.style.display="block",r.style.minHeight="0.5px",r}renderContainer(){if(!this.widget)return;let e=this.rootContainer;if(this.triggerContext.triggerData.hasSwiperElement()){let n=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),i=qe.get().website.commonCSS;i&&It.injectRawCSS(i,n),It.injectStylesheet("https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@latest/dist/widget-sdk.min.css",n),It.injectStylesheet("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",n),e=n}Qo(Ji(Wo,{element:this.widget.cont,triggerContext:this.triggerContext,elements:this.widget.elems}),e),this.addToRendered()}updateItems(e,r){let n=this.getItemDiff(e,r),i=this.getItemDiff(r,e);r.push(...n);for(let o of i)jn.remove(r,o)}getItemDiff(e,r){return e.filter(n=>!r.some(i=>i.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}};var Rr=class t extends xt{static renderedEngagements=[];constructor(e){super(e)}addToRendered(){t.renderedEngagements.push(this)}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}async checkAndSendEvent(){if(!et.get().isOpen()&&this.runtimeData.pageName!=="cart"){w.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}};var ic=class t{constructor(e,r){this.engagementTrigger=e;this.element=r;this.cartItems=ge.getCurrent().items}cartItems;static renderCartUpsell(e){let r=e.placement;if(!r?.selector){w.warn(`No placement available for ${e.objective}`,e.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){w.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let i of n)new t(e,i).render()}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(p=>p.mID===e.product_id.toString());if(!r)return;let n=r.vars.find(p=>p.mID===e.id.toString());if(!n)return;let i=new mr(n),o=e.selling_plan_allocation?.selling_plan;if(o)for(let p of i.sellingPlans??[])p.mID===o.id.toString()&&(p.isSelected=!0,i.changeSellingPlan(p));let s=new wt(r);s.vars=[i],s.selectedOrFirstVariant.value=i;let a=`lc-cart-item-${this.engagementTrigger.shortID}-${r.mID}`;this.element.classList.add(a);let l=new Pt(this.engagementTrigger);l.placement.selector=`.${a}`,l.items=[s];let m=new Rr(l);m.renderSilently(),this.watchForCartItemDeletion(m,a)}watchForCartItemDeletion(e,r){let n=new MutationObserver(i=>{i.forEach(o=>{o.removedNodes.forEach(s=>{s===this.element&&(w.debug(`${r} has been removed`),e.destroy(),n.disconnect())})})});n.observe(this.element.parentElement,{childList:!0,subtree:!0})}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(r=>{if(!(e.includes(r.url)||e.includes(r.variant_id))&&(!e.includes(r.product_title)||r.variant_title&&!e.includes(r.variant_title)))return!1;let n=r.selling_plan_allocation?.selling_plan?.name;return!(n&&!e.includes(n))})}};var oc=class extends Rr{ctaListener=new Mr;constructor(e){super(e),Dr.get().subscriber(A.CART_UPDATE_BROADCAST).pipe(Cl(null)).subscribe(this.checkMilestone.bind(this))}update(e){super.update(e),this.widgetElement.update()}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-progressbar");e.className="cooee-root",e.cart=ge.getCurrent(),e.engagementTrigger=this.engagementTrigger,e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}async checkMilestone(){let e=await ge.getCurrent().getNormalisedCart(),i=[...this.engagementTrigger.progressBarConfig.milestones].reverse().find(o=>o.minValue<e.amount);if(!i){w.log("No milestone achieved yet");return}if(w.log("Current milestone",i),i.rewardType===Tc.FREE_AUTO_GIFT){let o=i.items[0];if(e.items.find(a=>a.vID===o.vID||a.mID===o.mID)){w.log(`Item(vID:${o.vID}) already present in the cart. Updating item's properties`),await this.ctaListener.performUpdate(o,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});return}else{let a=await this.ctaListener.performAddToCart([o],this.engagementTrigger);et.get().refreshUI(a,!1),await this.removeOtherFreeGifts(o)}}}async removeOtherFreeGifts(e){let n=(await ge.getCurrent().getNormalisedCart()).items.filter(i=>i.vID!==e?.vID&&i.properties[A.CAMPAIGN_ATTRIBUTE]===this.engagementTrigger.shortID);if(n.length)for(let i of n)await this.ctaListener.performUpdate(i,{quantity:0})}};var vd=new hr({t:12,style:{lg:{spc:{p:5,pl:5,pr:5,pt:5,pb:5},size:{w:"100%",h:"auto"},br:{r:4,w:0,s:1,c:{h:"#94a3b8",a:100}}},sm:{spc:{p:5,pl:5,pr:5,pt:5,pb:5},size:{w:"240px",h:"auto"},br:{r:0,w:0,s:1,c:{h:"#94a3b8",a:100}}}},elems:[{t:4,style:{lg:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:10,dir:"row",wrap:"nowrap",jc:"center",ai:"center"}},sm:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:10,dir:"row",wrap:"nowrap",jc:"center",ai:"center"}}},clc:{},elems:[{t:13,style:{lg:{spc:{mb:5},size:{w:"70px",h:"auto"},lout:{of:"cover"}},sm:{spc:{mb:5},size:{w:"80px",h:"auto"},lout:{of:"cover"}}},src:"{{{ product.image_url }}}"},{t:4,style:{lg:{spc:{mb:10},lout:{of:"cover",disp:"flex"},flex:{gap:5,dir:"column",wrap:"nowrap",jc:"start",ai:"start"}},sm:{spc:{mb:10},lout:{of:"cover",disp:"flex"},flex:{gap:7,dir:"column",wrap:"nowrap",jc:"start",ai:"start"}}},clc:{},elems:[{t:14,style:{lg:{spc:{},size:{w:"auto",h:"auto"},typo:{italic:!1,bold:!1,lh:1.2,fs:13,tc:{h:"#313131",a:100},ta:0,fw:600,ls:0,fam:{name:"Arial",g:!0}}},sm:{spc:{},size:{w:"auto",h:"auto"},typo:{italic:!1,bold:!1,lh:1.2,fs:12,tc:{h:"#575757",a:100},ta:0,fw:500,ls:0,fam:{name:"Arial",g:!0}}}},text:"{{ product.name }}"},{t:4,style:{lg:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:10,dir:"row",wrap:"nowrap",jc:"start",ai:"start"}},sm:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:10,dir:"row",wrap:"nowrap",jc:"start",ai:"center"}}},clc:{},elems:[{t:2,style:{lg:{spc:{},typo:{italic:!1,bold:!1,lh:1.2,td:"line-through",fs:14,tc:{h:"#64748b",a:100},ta:1,fw:400,ls:0,fam:{name:"Arial",g:!0}}},sm:{spc:{},typo:{italic:!1,bold:!1,lh:1.2,td:"line-through",fs:12,tc:{h:"#64748b",a:100},ta:1,fw:400,ls:0,fam:{name:"Arial",g:!0}}}},text:"{{ product.compare_price }}"},{t:2,style:{lg:{spc:{},typo:{italic:!1,bold:!1,lh:1.2,fs:14,tc:{h:"#000000",a:100},ta:1,fw:500,ls:0,fam:{name:"Arial",g:!0}}},sm:{spc:{},typo:{italic:!1,bold:!1,lh:1.2,fs:13,tc:{h:"#000000",a:100},ta:1,fw:500,ls:0,fam:{name:"Arial",g:!0}}}},text:"{{ product.price }}"},{t:2,style:{lg:{spc:{p:0,pl:0,pr:0,pt:0,pb:0,m:0,ml:0,mr:10,mt:0,mb:0},typo:{italic:!1,bold:!1,lh:1.2,fs:18,tc:{h:"#64748b",a:100},ta:1,fw:600,ls:0}},sm:{spc:{p:0,m:0,mr:10},typo:{italic:!1,bold:!1,lh:1.2,fs:18,tc:{h:"#64748b",a:100},ta:1,fw:600,ls:0}}},hide:!0,text:"Save {{ product.discount_price }}",when:{lhs:"{{ product.discount_price }}",op:"gt",rhs:0}},{t:2,style:{lg:{spc:{p:0,pl:0,pr:0,pt:0,pb:0,m:0,ml:0,mr:10,mt:0,mb:0},typo:{italic:!1,bold:!1,lh:1.2,fs:12,tc:{h:"#0d8d00",a:100},ta:1,fw:400,ls:0,fam:{name:"DINNextRoundedLTPro-Medium"}}},sm:{spc:{p:0,m:0,mr:10},typo:{italic:!1,bold:!1,lh:1.2,fs:18,tc:{h:"#64748b",a:100},ta:1,fw:600,ls:0}}},hide:!0,text:"({{ product.discount_percent }}% off)",when:{lhs:"{{ product.discount_percent }}",op:"gt",rhs:0}}]},{t:4,style:{lg:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:5,dir:"row",wrap:"nowrap",jc:"start",ai:"center"}},sm:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:5,dir:"row",wrap:"nowrap",jc:"start",ai:"center"}}},clc:{},elems:[{t:3,style:{lg:{spc:{p:7,pl:7,pr:7,pt:7,pb:7},size:{w:"100%",h:"auto"},bg:{s:{h:"#000000",a:100}},br:{r:0,w:0,s:1,c:{a:100}},typo:{italic:!1,bold:!1,lh:1.2,fs:12,tc:{h:"#ffffff",a:100},ta:1,fw:400,ls:0,fam:{name:"Arial",g:!0}}},sm:{spc:{p:7,pl:7,pr:7,pt:8,pb:8},size:{w:"70%",h:"auto"},bg:{s:{h:"#000000",a:100}},br:{r:0,w:0,s:1,c:{a:100}},typo:{italic:!1,bold:!1,lh:1.2,fs:12,tc:{h:"#ffffff",a:100},ta:1,fw:400,ls:0,fam:{name:"Arial",g:!0}}}},text:"Add",clc:{at:102},allowedTypes:[102]}]}]}]}]}),_d=new Ve({t:2,style:{lg:{spc:{mb:15},typo:{italic:!1,bold:!1,lh:1.2,fs:16,tc:{h:"#333333",a:100},ta:1,fw:700,ls:.5,fam:{name:"Arial",g:!0}}},sm:{spc:{mb:15},typo:{italic:!1,bold:!1,lh:1.2,fs:16,tc:{h:"#333333",a:100},ta:1,fw:700,ls:.5,fam:{name:"Arial",g:!0}}}},text:"WATCH & SHOP - NEW LAUNCHES"});var Go=class extends De{render(){return M("div",{style:{marginTop:30},class:"lc-container",children:[M(Et,{element:_d,triggerContext:this.props.triggerContext}),M("div",{style:this.getComponentStyles(),children:this.props.triggerContext.triggerData.items.map(e=>{if(e.portraitVideos?.length)return M("div",{class:"lc-shoppable-video",style:{flex:"1 1 0",width:"260px"},children:[M("a",{href:e.link,onClick:()=>{this.sendTriggerClicked([new bt(e)],{from:"video"})},children:M("video",{width:"100%",autoplay:!0,muted:!0,loop:!0,children:this.getSources(e.portraitVideos[0].sources)})}),M(Hr,{element:vd,item:e,triggerContext:this.props.triggerContext})]})})})]})}getSources(e){let r=e.map(o=>M("source",{src:o.url,type:o.mimeType,media:`(max-width:${o.width}px)`})),n=e.filter(o=>o.format==="mp4").sort((o,s)=>s.width-o.width)[0];n&&r.push(M("source",{src:n.url,type:n.mimeType}));let i=e.filter(o=>o.format==="m3u8").sort((o,s)=>s.width-o.width)[0];return i&&r.push(M("source",{src:i.url,type:i.mimeType})),r}getComponentStyles(){return{display:"flex",gap:10,overflowX:"auto",margin:10}}};var sc=class extends xt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){Qo(Ji(Go,{element:this.widget?.cont,triggerContext:this.triggerContext}),this.rootContainer)}};var ac=class extends xt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(A.ADD_BUNDLE_CTA_INBOUND_EVENT,this.inboundCTAListener.bind(this),!1)}async inboundCTAListener(e){let r=this.engagementTrigger,n=`Engagement(id: ${r.engagementID}, shortID: ${r.shortID})`,i=e.detail;if(!kt.hasKeys(i)){w.error(`No detail received for ${n}`);return}w.log("Detail received for BYOB",i);let o=i.campaignID??i.campaignId??i.campaign_id;if(o!==r.shortID&&o!==r.engagementID){w.warn(`Current ${n} is not BYOB. Received: ${o}`);return}let s=i.items;if(!s?.length)return;let a=s.map(l=>new bt({mID:l.product_id,vID:l.variant_id,quantity:l.quantity||1}));await new Li(this.triggerContext).execute({embeddedItems:a,clickAction:{at:108,applyDiscount:!0}})}};var Ui=class{runtimeData=fe.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let r=[...Rr.renderedEngagements];Rr.renderedEngagements.length=0;for(let n of e)w.log(`\u{1F4E3} ${n} received as cart embed`),!this.findAndUpdateCurrent(n,r)&&(w.log(`${n} is new`),n.isProgressBar()?new oc(n).renderSilently():n.isSubscriptionUpsell()?ic.renderCartUpsell(n):new Rr(n).renderSilently());this.removeOldWidgets(r)}processPageWidgetResponse(e){let r=[...xt.renderedEngagements];xt.renderedEngagements.length=0;for(let n of e)w.log(`\u{1F4E3} ${n} received as page embed`),!this.findAndUpdateCurrent(n,r)&&(w.log(`${n} is new`),n.isShoppableVideo()?new sc(n).renderSilently():n.isBYOB()?new ac(n).renderSilently():new xt(n).renderSilently());this.removeOldWidgets(r)}findAndUpdateCurrent(e,r){let n=r.findIndex(i=>i.isSameTrigger(e));return n<0||e.isSubscriptionUpsell()?!1:(r[n].update(e),r[n].renderSilently(),r.splice(n,1),!0)}removeOldWidgets(e){for(let r of e)r.destroy()}};var sr=class t{static INSTANCE;httpService=se.get(Tt);sessionManager=se.get(Ye);runtimeData=fe.get();loadWidgetsSubject=new ht;constructor(){this.loadWidgetsSubject.pipe(tr(300)).subscribe(()=>{this.loadCartWidgets().catch(e=>w.error("Unable to initiate cart widgets",e)),this.loadPageWidgets().catch(e=>w.error("Unable to initiate page widgets",e))}),Dr.get().subscriber(A.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){Ye.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(e=>w.error("Unable to initiate load page widgets",e))})}loadCartWidgetsSilently(){Ye.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(e=>w.error("Unable to initiate cart widgets",e))})}loadWidgetsSilently(){Ye.replaySubject.subscribe(async()=>{this.loadWidgetsSubject.next()})}async loadPageWidgets(){let e=await this.getWidgetProps();w.log("Load widgets",e),this.httpService.post("/v1/engagement/page-widgets",e).then(async r=>{let n=r.widgets.map(i=>new Pt(i));new Ui().processPageWidgetResponse(n)}).catch(r=>{w.error("Error sending widget getter",r)})}async loadCartWidgets(){let e=await this.getWidgetProps();w.log("Load cart widgets",e),this.httpService.post("/v1/engagement/cart-widgets",e).then(async r=>{let n=r.widgets.map(i=>new Pt(i));new Ui().processCartWidgetResponse(n)}).catch(r=>{w.error("Error sending widget getter",r)})}async getVariation(e){let r=await this.getWidgetProps();return this.httpService.post("/v1/engagement/get-variant",b(b({},e),r))}renderCachedCartWidgets(){new Ui().processCartWidgetResponse(this.runtimeData.cartEngagements)}async addSessionContext(e){let r=await this.sessionManager.checkSessionAndGetContext();e.sessionID=r[0],e.sessionNumber=r[1],e.landingPage=r[2],e.page=vr.parseFromCurrent()}addAvailableEngagementShortIDs(){let e=document.querySelectorAll(".letscooee-engagement"),r=[];return e.forEach(n=>{let i=n.dataset.engagementId;i&&+i&&r.push(i)}),r}async getWidgetProps(){let e={};e.engagementIDs=this.addAvailableEngagementShortIDs(),await this.addSessionContext(e),e.currentItem=this.runtimeData.getCurrentItem();try{e.cart=await ge.getCurrent().getNormalisedCart()}catch(o){w.error("Error fetching Shopify cart before sending widget call",o)}let r=new URLSearchParams(location.search),n=r.get("cooee-preview");n?e.previewIDs=n.trim().split(",").filter(o=>Number.isInteger(+o)):this.runtimeData.previewIDs?.length&&(e.previewIDs=this.runtimeData.previewIDs);let i=r.get("cooee-variant");return i?e.previewVariant=i:this.runtimeData.previewVariant&&(e.previewVariant=this.runtimeData.previewVariant),e}};var cc=class{runtimeData=fe.get();widgetAPIService=se.get(sr);meddle(){let e=Se.globalRef;e.account=e.account??[],e.profile=e.profile??[],e.events=e.events??[],e.screen=e.screen??[],e.page=e.page??[],this.meddlePage(),this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.meddleScreen(),this.exposeMethods()}exposeMethods(){let e=Se.globalRef;e.loadPageWidgets=()=>{this.widgetAPIService.loadPageWidgetsSilently()},e.loadCartWidgets=()=>{this.widgetAPIService.loadCartWidgetsSilently()},e.previewWidget=Se.previewWidget.bind(Se),e.previewPopup=Se.previewPopup.bind(Se)}overwritePush(e,r){Xn(e,"push",r)}meddleAccount(){this.overwritePush(Se.globalRef.account,(...e)=>{this.processAccount(e[0])}),Se.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(Se.globalRef.events,(...e)=>{this.processEvent(e[0])}),Se.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(Se.globalRef.profile,(...e)=>{this.processProfile(e[0])}),Se.globalRef.profile.forEach(this.processProfile.bind(this))}meddleScreen(){this.overwritePush(Se.globalRef.screen,(...e)=>{this.processPageName(e[0])}),Se.globalRef.screen.forEach(this.processPageName.bind(this))}processAccount(e){e&&(e.appID&&Se.authenticate(e),e.flags&&An.setFlags(e.flags))}processEvent(e){e&&(A.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?Se.sendEvent(e[0],e[1],this.runtimeData.jsLoadTime):Se.sendEvent(e[0],e[1]))}processProfile(e){e&&Se.updateProfile(e)}processPageName(e){e&&Se.setPageName(e)}meddlePage(){this.overwritePush(Se.globalRef.page,(...e)=>{this.processPage(e[0])}),Se.globalRef.page.forEach(this.processPage.bind(this))}processPage(e){e.currentItem&&this.runtimeData.setCurrentItem(e.currentItem),e.currency&&(this.runtimeData.currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.pageName&&Se.setPageName(e.pageName)}};var Mi=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=A.COOEE.concat("-");static getString(e,r){return this.getItem(e)||r}static setString(e,r){this.setItem(e,r)}static remove(e){this.removeItem(e)}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,r){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),r)}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}};var ki=class t{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=se.get(ue);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(e){this._lastScreenOrScroll=e}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}resetScrollID(e){Mi.remove(A.SESSION_STORAGE_SCROLL_ID),this.lastScreenOrScroll=e??new Date}listen(){if(window.scrollY){let e=this.getPercentScrolledY();this.shouldSendScroll(e)&&this.sendScroll(e)}ce.onDocumentLoaded(()=>{this.observeWindowScroll()})}observeWindowScroll(){En(window,"scroll").pipe(tr(t.DEBOUNCE_TIME),_n(()=>{let e=this.getPercentScrolledY();if(e>100){w.warn("Received scroll percent is more than 100",e);return}if(this.shouldSendScroll(e))return e})).subscribe(e=>{this.sendScroll(e)})}shouldSendScroll(e){return Math.abs(this.lastPercent-e)>=t.THRESHOLD||this.lastPercent!==e&&e===100}sendScroll(e){if(e==null)return;let r={percent:e,timeMS:new Date().getTime()-this._lastScreenOrScroll.getTime()};this.lastPercent=e;let n=Mi.getString(A.SESSION_STORAGE_SCROLL_ID,""),i=new ve(A.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),Mi.setString(A.SESSION_STORAGE_SCROLL_ID,i.id.toHexString()),this._lastScreenOrScroll=new Date(i.occurred)}getPercentScrolledY(){let e=window.document.body.scrollHeight,r=window.innerHeight;return Math.ceil((window.scrollY+r)/e*100)}};var lc=class t{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=se.get(ue);runtimeData=fe.get();listen(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?this.onVisible():document.visibilityState==="hidden"&&this.onHidden()}}async onVisible(){}async onHidden(){let e=await this.runtimeData.setInactive();if(e===0){w.info("Not sending background event as user was inactive on website");return}w.info(`Sending background event with ${e} seconds`);let r={};r[t.ACTIVE_DURATION]=e,this.apiService.sendEvent(new ve(A.EVENT_APP_BACKGROUND,r))}};var uc=class{compareCartItemSubject=new ht;constructor(){this.compareCartItemSubject.pipe(tr(100)).subscribe(this.compareCartItems.bind(this))}listen(){this.compareCartItemSubject.next(),this.overwriteXMLHttpRequest(),this.overwriteFetchMethod()}overwriteXMLHttpRequest(){let e=this,r=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){e.performEvent(this._url).catch(n=>w.error("Unable to process cart change in XMLHttpRequest",n))}),r.apply(this,arguments)},w.debug("Securely overwritten window.XMLHttpRequest.send method")}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=function(n){return r.apply(window,arguments).then(i=>(e.performEvent(n.toString()).catch(o=>w.error("Unable to process cart change in fetch",o)),i))},w.debug("Securely overwritten window.fetch method")}async performEvent(e){this.isCartManipulationURL(e)&&(fe.get().isCartDirty=!0,this.compareCartItemSubject.next())}isCartManipulationURL(e){return/\/cart\/(add|change|update|clear)/.test(e)}sendChangesAsEvents(e,r){let n=e?.items,i=r.items,o=[],s=[];if(w.debug(`Comparing cart change with old count ${n?.length} to new count ${i.length}`),i?.forEach(a=>{let l=n?.find(m=>m.vID===a.vID);if(l){if(l.quantity!==a.quantity){let m=l.quantity<a.quantity,p=Math.abs(l.quantity-a.quantity),f=Z(b({},a),{quantity:p});m?o.push(f):s.push(f)}n&&ce.removeFromArray(n,l)}else o.push(a)}),n)for(let a of n)s.push(a);w.debug(`Cart delta: added: ${o.length}, removed: ${s.length}`),o.length&&this.sendEvent(A.EVENT_ADD_TO_CART,{items:o}),s.length&&e.token===r.token&&this.sendEvent(A.EVENT_REMOVE_FROM_CART,{items:s}),(s.length||o.length)&&Dr.get().broadcast(A.CART_UPDATE_BROADCAST,{itemsAdded:o,itemsRemoved:s})}sendEvent(e,r){let n=new ve(e,r);se.get(ue).sendEvent(n)}async compareCartItems(){let e=await Ne.get(ne.CURRENT_CART,{}),r=await ge.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,r)}};var pc=class{listen(){return this.overwriteFetchMethod(),this}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=async function(n,i){try{await e.modifyRequest(n,i)}catch(o){Ue.getInstance().captureError("Failed to modify graphql request",o,{body:JSON.stringify(i?.body)})}return r(n,i)},w.debug("Securely overwritten window.fetch method for graphql query")}async modifyRequest(e,r){let n=typeof e=="string"?e:e instanceof Request?e.url:"";if(!(n.includes("graphql.json")&&r?.method==="POST")||!r.body)return;w.log("Intercepted fetch request of:",n);let i=typeof r.body=="string"?JSON.parse(r.body):r.body;i.query.includes("cartCreate")&&(r.body=await this.updatedBody(i),this.sendBuyNowEvent())}async updatedBody(e){let r=await Ne.get(ne.DEVICE_ID),n=await se.get(Ye).getCurrentSessionID(),i=e.variables.input.attributes??[],o=[{key:"letscooee_did",value:r},{key:"letscooee_sid",value:n},{key:"__letscooee_time",value:new Date().toLocaleString()},{key:"__letscooee_via",value:"Buy Now"}];return e.variables.input.attributes=[...i,...o],JSON.stringify(e)}sendBuyNowEvent(){let e=fe.get().getCurrentItem();if(!e)return;let r=new ve(A.EVENT_BUY_NOW_CLICKED,{items:[e]});ue.getInstance().sendEvent(r)}};var Fi=class{constructor(e,r){this.selectors=e;this.eventName=r;this.selectorString=e.join(",")}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let r=e.currentTarget,n=new ve(this.eventName,{class:r.className||void 0,tagName:r.tagName||void 0,id:r.id||void 0});ue.getInstance().sendEvent(n),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>w.error(e))}async listen(){this.elements=await ce.retrySelectorForElements(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(r=>{r.removeEventListener("click",e)})}};var fc=class t extends Fi{static selectors=[".product__thumbnail-list-inner > button","product-gallery-navigation > button",".product-media--thumb-container",".product-images-inner > img",".m-product-media",".swiper-button-control",".media__thumb",".slick-arrow",".productView-img-container.product-single__media",".product-gallery__thumbnail_item_inner"];constructor(){super(t.selectors,A.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var mc=class t extends Fi{static selectors=[".jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup","reviewsio-product-ratings",".ruk_rating_snippet.tracked:not(.hidden)","a > .loox-rating",".yotpo-reviews-star-ratings-widget",".yotpo.lp-hero__reviews",".pr-rating > a",".rivyoReviewWidget"];constructor(){super(t.selectors,A.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var dc=class{selector=[".gokwik-checkout button","button.cart__checkout-button","button.cart__checkout","button#checkout","button#checkout2",'button[id*="checkout" i]','button[name*="checkout" i]','button[class*="checkout" i]'].join(",");listen(){ce.onDocumentLoaded(()=>{w.debug("Execution order:","document ready"),this.useLocationHash()})}useLocationHash(){let e=window.location.hash?.substring(1);if(e)if(e.includes(A.HASH_INITIATE_CHECKOUT)){document.dispatchEvent(new Event(A.THIRD_PARTY_CHECKOUT_EVENT));let r=document.querySelector(this.selector);if(!r){w.debug("No clickable cart checkout button found");return}w.debug("Clickable cart checkout button found",r),r.click()}else e.includes(A.HASH_OPEN_CART_DRAWER)&&et.get().open()}};var hc=class{trackSilently(){this.track().catch(e=>Ue.getInstance().captureException(e))}async track(){let e=window.Shopify?.checkout,r=window.Shopify?.Checkout;if(!e&&!r)return;let n={};this.processSmallCheckout(e,n),this.processBigCheckout(r,n);let i=this.getTokenFromCurrentURLPath();if(i&&(n.urlToken=i),!Object.keys(n).length){w.warn("No processable data found in",e,r);return}n.referrer=document.referrer,n.url=location.href;let o=await se.get(Ye).checkSessionAndGetContext();n.sessionID=o[0],this.trackOrder(n)}processSmallCheckout(e,r){e&&(e.order_id&&(r.orderID=e.order_id.toString()),e.token&&(r.checkoutToken=e.token.toString()),e.customer_id&&(r.customerID=e.customer_id.toString()))}processBigCheckout(e,r){e&&(e.token&&!r.checkoutToken&&(r.checkoutToken=e.token.toString()),e.cartToken&&(r.cartToken=e.cartToken.toString()))}trackOrder(e){w.info("Found order to be send",e),ue.getInstance().trackOrder(e)}getTokenFromCurrentURLPath(){let e=new RegExp("[A-Fa-f0-9]{28,32}");return location.pathname?.split("/").find(r=>r.length&&e.test(r))}};var Vo=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await ge.getCurrent().getNormalisedCart(),r={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},n=new ve(A.EVENT_CHECKOUT_STARTED,r);ue.getInstance().sendEvent(n)})}};var gc=class{async migrate(){}};Zt.escape=np.escapeHtml;var Se=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new gc().migrate(),this.autoAuthenticate(),new cc().meddle(),new lc().listen(),new hc().trackSilently(),new Mr().listen(),new uc().listen(),new pc().listen(),new dc().listen(),se.get(ki).listen(),se.get(mc).listenSilently(),se.get(fc).listenSilently(),se.get(sr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),Kt.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||Xn(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,Xn(this.globalRef,"config",new qe),Xn(this.globalRef,"runtimeData",new fe),w.debug("Global reference initialised")}static injectWidgetAssets(){if(document.currentScript.src.indexOf("localhost")){let r="http://localhost:8002";It.injectScriptURL(`${r}/main.js`),It.injectStylesheet(`${r}/styles.css`)}else{let n=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${A.SDK_VERSION}`;It.injectScriptURL(`${n}/dist/widget-sdk.min.js`,"cooee-widget-sdk"),It.injectStylesheet(`${n}/dist/widget-sdk.min.css`)}}static autoAuthenticate(){let e=Oe.getShopName();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let r=e.appID?.trim(),n=e.shopifyShop;if((ce.isNull(r)||r.length!==24)&&ce.isNull(n)){w.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,se.get(Ye).init(e)}static sendEvent(e,r,n){for(let o in r)if(o.length>3&&o.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");let i=new ve(e,r);i.occurred=n??new Date,se.get(ue).sendEvent(i)}static updateProfile(e){for(let r in e)if(r.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");se.get(ue).updateProfile(e)}static setPageName(e){if(!e)return;let r=fe.get(),n=r.pageName;if(e===n)return;if(r.pageName=e,e==="cart"&&se.get(sr).loadOrRenderWidgetsAfterCartChange(),A.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){se.get(ki).resetScrollID();return}let i={};n&&(i.ps=n);let o=new ve(A.EVENT_SCREEN_VIEW,i);o.occurred=r.jsLoadTime,se.get(ue).sendEvent(o),se.get(ki).resetScrollID(o.occurred)}static previewPopup(e,r){new Ai(r).render(e)}static previewWidget(e){new xt(new Pt(e)).render()}static setupPreviewListeners(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(e){w.error(e)}window.addEventListener("message",e=>{if(w.debug("Received event",e),!e.origin.includes("letscooee.com")&&!e.origin.includes("localhost"))return;let r=e.data;typeof r=="object"&&(r.action==="POPUP_PREVIEW"?(this.previewPopup(r.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)):r.action==="WIDGET_PREVIEW"&&(this.previewWidget(r.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)))})}}static attachGoKwikListeners(){let e=fe.get();window.addEventListener("kp-modal:opened",()=>{e.isGoKwikPopupOpen=!0}),window.addEventListener("user-loggedin",r=>{let{token:n}=r.detail;n&&this.updateProfile({goKwikToken:n})}),window.gokwikSdk?Vo.attachCheckoutListener():window.addEventListener("gokwikLoaded",Vo.attachCheckoutListener)}static storePreviewParams(){let e=fe.get(),r=new URLSearchParams(location.search),n=r.get("cooee-preview");n&&(e.previewIDs=n.trim().split(",").filter(o=>Number.isInteger(+o)));let i=r.get("cooee-variant");i&&(e.previewVariant=i)}};w.configure();w.logBrand();w.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(w.debug("Execution order:","IIFE start"),await Se.initForMerchantWebsiteOnly(),await Se.initForAll(),w.debug("Execution order:","IIFE end")))());w.debug("Execution order:","bottom");
61
+ `},navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:!1}:!1,autoHeight:!0});return t.style.setProperty("--swiper-navigation-size",`${e.navigation.size}px`),r}function nc(t,e,r){let n={color:t.navigation.color?.rgba};return t.pagination.enabled&&(n.transform="translateY(-25%)"),M("div",{class:"swiper-container",ref:e,children:[M("div",{class:"swiper-wrapper",children:r()}),t.navigation.enabled&&M("div",{class:"swiper-button-next",style:n,children:M("span",{})}),t.navigation.enabled&&M("div",{class:"swiper-button-prev",style:n,children:M("span",{})}),t.pagination.enabled&&M("div",{className:"swiper-pagination",style:{bottom:0,top:"unset",position:"relative",color:t.pagination.color?.rgba}})]})}var $o=class extends De{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,r){super(e,r),this.configuration=this.renderer.isMobile()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+"px"}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&tc().then(()=>{this.swiperInstance=rc(this.swiperRef,this.props.element.conf[this.deviceTypeKey])})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let r;if(this.configuration.disp===2){let n=o=>{this.swiperRef=o},i=()=>e?.map(o=>M("div",{class:"swiper-slide",children:this.getProductFragment(o)}));r=M("div",{style:Z(b({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:nc(this.configuration,n,i)})}else r=M("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((n,i)=>this.getProductFragment(n,i!==e.length-1))});return r}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),r={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(r.flexDirection==="row"){if(e)r.maxWidth="100%",r.overflowY="auto";else if(this.configuration.disp===1){let n=this.props.triggerContext.triggerData,i=n.items.length,o;n.isBundle()?o=this.props.element.prod.symbol?.hide!==!0?i*2-1:i:o=this.props.element.conf[this.deviceTypeKey].maxInRow,r.gridTemplateColumns=`repeat(${o}, auto)`}}return r}getProductFragment(e,r=!1){return M(fr,{children:[M(Hr,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&r&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&M("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:M(Et,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var jo=class extends De{swiperRef=null;swiperInstance=null;constructor(e,r){super(e,r)}componentDidMount(){tc().then(()=>{this.swiperInstance=rc(this.swiperRef,this.props.element.conf)})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.element,r=i=>{this.swiperRef=i},n=()=>e.values?.map(i=>M("div",{class:"swiper-slide",onClick:()=>this.onClick({clickAction:this.getClickAction(i)}),children:this.renderElement(i)}));return nc(e.conf,r,n)}getComponentStyles(){return{}}renderElement(e){let r=this.valueAddedSlide(this.props.element.slide,e);switch(r?.t){case 1:return M(kr,{element:r,triggerContext:this.props.triggerContext});case 4:return M(Fr,{elements:r.elems,element:r,triggerContext:this.props.triggerContext});default:w.warn("Unknown slide type for carousal")}}valueAddedSlide(e,r){let n=JSON.stringify(e),i=Zt.render(n,{form:r});return At.getParsedElement(JSON.parse(i))}getClickAction(e){let r=b({},this.props.element.clc),n=JSON.stringify(r),i=Zt.render(n,{form:e});return JSON.parse(i)}};var Zr=class extends De{constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"})),nt(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}))})}renderElement(e){if(!e.hide){if(e.t===4){let r=e;return M(Fr,{element:r,triggerContext:this.props.triggerContext,elements:r.elems})}if(e.t===61)return M(Uo,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?M(Ln,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return M(Et,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return M(kr,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return M($o,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return M(Hr,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return M(jo,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}};var Wo=class extends De{clickAction;isClickable;constructor(e,r){super(e,r),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===4&&this.clickAction.gu?.u}componentDidMount(){nt(()=>{let e=this.props.triggerContext.triggerData,r=this.props.triggerContext.selectedItems;e.calculateDiscountData(r,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return M(fr,{children:[M("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:()=>{this.onClick({clickAction:this.clickAction})},children:M(Zr,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id==="preview"&&M("div",{class:"letscooee-preview-badge",children:["#",this.props.triggerContext.triggerData.shortID," preview"]})]})}getComponentStyles(){let e={position:"relative",overflow:"hidden",display:"block"};return this.isClickable&&(e.cursor="pointer"),e}async onClick(e){if(this.isClickable)return super.onClick(e)}};var xt=class t{constructor(e){this.engagementTrigger=e;this.triggerContext=new Ri(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=fe.get();widgetAPIService=se.get(sr);safeHTTPService=se.get(ue);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(e=>Ue.getInstance().captureException(e,b({},this.engagementTrigger.sentryContext())))}destroy(){w.log(`${this.engagementTrigger} will be destroyed`),this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect()}),this.rootContainer?.remove(),t.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID)}async render(){if(this.engagementTrigger.hasMultiplePlacement){let e=await this.getVariation();this.handleVariationResponse(e)}if(this.rootContainer=await this.getWidgetContainer(!0),!this.rootContainer){w.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),!this.shouldStopRendering()&&(await this.startRendering(),this.attachScroll(),await this.checkAndSendEvent(),this.triggerContext.renderer=this)}isSameTrigger(e){return this.engagementTrigger.shortID===e.shortID}update(e){yd.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(e.items,this.engagementTrigger.items)}shouldStopRendering(){return!this.widget&&!this.isExclusionWithBVariation}async getVariationIfRequired(){if(this.engagementTrigger.isSingleContent()||this.engagementTrigger.widget){w.log(`${this.engagementTrigger} already has required data to render widget`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e)}handleVariationResponse(e){e&&(w.log(`${this.engagementTrigger} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(this.engagementTrigger.items=e.items.map(r=>new wt(r)),this.engagementTrigger.nonMutableItems=e.items.map(r=>new wt(r))),e.bundleFrom&&(this.engagementTrigger.bundleFrom=new wt(e.bundleFrom)),e.discount&&(this.engagementTrigger.discount=e.discount),e.placement&&(this.triggerContext.triggerData.placement=e.placement),e.props&&kt.hasKeys(e.props)&&(this.engagementTrigger.props=b(b({},this.engagementTrigger.props),e.props)),this.triggerContext.triggerData.widget=this.widget=new li(e.widget),this.triggerContext.triggerData.contentID=e.contentID,this.triggerContext.triggerData.variation=this.variation=e.variation,this.triggerContext.triggerData.placement=e.placement,this.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){t.renderedEngagements.push(this)}async getVariation(){w.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id==="preview"};try{return await this.widgetAPIService.getVariation(e)}catch(r){w.error(`${this.engagementTrigger} unable to get the variation`,r);return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){w.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,r={root:null,rootMargin:`-${e}px 0px ${e}px 0px`,threshold:0};return await this.isInViewport()?this.getVariation():new Promise(n=>{let i=new IntersectionObserver((o,s)=>{o.forEach(async a=>{if(a.isIntersecting){w.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);let l=await this.getVariation();n(l),s.unobserve(this.rootContainer)}})},r);i.observe(this.rootContainer),this.observers.push(i)})}attachScroll(){this.scrollSubscription=En(window,"scroll").pipe(tr(t.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(t.engagementIDsWithTrackedDisplay.has(e)||!await this.isInViewport())return;let n={};this.triggerContext.triggerData.items?.length&&(n.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let i=this.isExclusionWithBVariation?A.EVENT_CAMPAIGN_HOLDOUT:A.EVENT_TRIGGER_DISPLAYED,o=new ve(i,n,this.engagementTrigger);o.name===A.EVENT_CAMPAIGN_HOLDOUT&&(o.trigger.holdout=!0),this.safeHTTPService.sendEvent(o),t.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}async isInViewport(){let e=(await this.getWidgetContainer())?.getBoundingClientRect();if(!e)return!1;let r=window.innerHeight||document.documentElement.clientHeight,i=(Math.min(e.bottom,r)-Math.max(e.top,0))*e.width,o=e.width*e.height,s=i/o*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(e);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(e){let r=this.engagementTrigger.placement;if(!r?.selector)return w.warn(`${this.engagementTrigger} does not have a selector`),null;w.debug(`${this.engagementTrigger} attempt to render ${r.position}-${r.selector}`);let n=await ce.retrySelector(r.selector);if(!n)return w.warn(`${this.engagementTrigger} no placement found with ${r.selector}`),null;let i=this.generateParentElementID(),o=this.getParentElement(i);if(!e)return o;switch(r.position){case $n.BEFORE:{n.parentElement?.insertBefore(o,n);break}case $n.INSIDE_FIRST:{n.insertBefore(o,n.firstChild);break}case $n.INSIDE_LAST:{n.appendChild(o);break}case $n.AFTER:default:n.parentElement?.insertBefore(o,n.nextSibling)}return o}async startRendering(){let e;try{e=await Pi.refreshItems(this.engagementTrigger)}catch(r){w.error(`${this.engagementTrigger} error refreshing the items`,r);return}if(!e?.length&&this.engagementTrigger.isProductPromoted()){w.warn(`${this.engagementTrigger} is of ${this.engagementTrigger.objective} but no product found`);return}this.engagementTrigger.items=e,this.renderContainer()}getParentElement(e){let r=document.getElementById(e);if(r)return r;let n=this.engagementTrigger.shortID;return r=document.createElement("div"),r.id=e,r.className=`letscooee letscooee-engagement engagement-${n}`,r.dataset.engagementId=n,this.engagementTrigger.id==="preview"&&(r.className+=" letscooee-preview"),r.style.display="block",r.style.minHeight="0.5px",r}renderContainer(){if(!this.widget)return;let e=this.rootContainer;if(this.triggerContext.triggerData.hasSwiperElement()){let n=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),i=qe.get().website.commonCSS;i&&It.injectRawCSS(i,n),It.injectStylesheet("https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@latest/dist/widget-sdk.min.css",n),It.injectStylesheet("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",n),e=n}Qo(Ji(Wo,{element:this.widget.cont,triggerContext:this.triggerContext,elements:this.widget.elems}),e),this.addToRendered()}updateItems(e,r){let n=this.getItemDiff(e,r),i=this.getItemDiff(r,e);r.push(...n);for(let o of i)jn.remove(r,o)}getItemDiff(e,r){return e.filter(n=>!r.some(i=>i.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}};var Rr=class t extends xt{static renderedEngagements=[];constructor(e){super(e)}addToRendered(){t.renderedEngagements.push(this)}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}async checkAndSendEvent(){if(!et.get().isOpen()&&this.runtimeData.pageName!=="cart"){w.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}};var ic=class t{constructor(e,r){this.engagementTrigger=e;this.element=r;this.cartItems=ge.getCurrent().items}cartItems;static renderCartUpsell(e){let r=e.placement;if(!r?.selector){w.warn(`No placement available for ${e.objective}`,e.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){w.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let i of n)new t(e,i).render()}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(p=>p.mID===e.product_id.toString());if(!r)return;let n=r.vars.find(p=>p.mID===e.id.toString());if(!n)return;let i=new mr(n),o=e.selling_plan_allocation?.selling_plan;if(o)for(let p of i.sellingPlans??[])p.mID===o.id.toString()&&(p.isSelected=!0,i.changeSellingPlan(p));let s=new wt(r);s.vars=[i],s.selectedOrFirstVariant.value=i;let a=`lc-cart-item-${this.engagementTrigger.shortID}-${r.mID}`;this.element.classList.add(a);let l=new Pt(this.engagementTrigger);l.placement.selector=`.${a}`,l.items=[s];let m=new Rr(l);m.renderSilently(),this.watchForCartItemDeletion(m,a)}watchForCartItemDeletion(e,r){let n=new MutationObserver(i=>{i.forEach(o=>{o.removedNodes.forEach(s=>{s===this.element&&(w.debug(`${r} has been removed`),e.destroy(),n.disconnect())})})});n.observe(this.element.parentElement,{childList:!0,subtree:!0})}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(r=>{if(!(e.includes(r.url)||e.includes(r.variant_id))&&(!e.includes(r.product_title)||r.variant_title&&!e.includes(r.variant_title)))return!1;let n=r.selling_plan_allocation?.selling_plan?.name;return!(n&&!e.includes(n))})}};var oc=class extends Rr{ctaListener=new Mr;constructor(e){super(e),Dr.get().subscriber(A.CART_UPDATE_BROADCAST).pipe(Cl(null)).subscribe(this.checkMilestone.bind(this))}update(e){super.update(e),this.widgetElement.update()}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-progressbar");e.className="cooee-root",e.cart=ge.getCurrent(),e.engagementTrigger=this.engagementTrigger,e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}async checkMilestone(){let e=await ge.getCurrent().getNormalisedCart(),i=[...this.engagementTrigger.progressBarConfig.milestones].reverse().find(o=>o.minValue<e.amount);if(!i){w.log("No milestone achieved yet");return}if(w.log("Current milestone",i),i.rewardType===Tc.FREE_AUTO_GIFT){let o=i.items[0];if(e.items.find(a=>a.vID===o.vID||a.mID===o.mID)){w.log(`Item(vID:${o.vID}) already present in the cart. Updating item's properties`),await this.ctaListener.performUpdate(o,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});return}else{let a=await this.ctaListener.performAddToCart([o],this.engagementTrigger);et.get().refreshUI(a,!1),await this.removeOtherFreeGifts(o)}}}async removeOtherFreeGifts(e){let n=(await ge.getCurrent().getNormalisedCart()).items.filter(i=>i.vID!==e?.vID&&i.properties[A.CAMPAIGN_ATTRIBUTE]===this.engagementTrigger.shortID);if(n.length)for(let i of n)await this.ctaListener.performUpdate(i,{quantity:0})}};var vd=new hr({t:12,style:{lg:{spc:{p:5,pl:5,pr:5,pt:5,pb:5},size:{w:"100%",h:"auto"},br:{r:4,w:0,s:1,c:{h:"#94a3b8",a:100}}},sm:{spc:{p:5,pl:5,pr:5,pt:5,pb:5},size:{w:"240px",h:"auto"},br:{r:0,w:0,s:1,c:{h:"#94a3b8",a:100}}}},elems:[{t:4,style:{lg:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:10,dir:"row",wrap:"nowrap",jc:"center",ai:"center"}},sm:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:10,dir:"row",wrap:"nowrap",jc:"center",ai:"center"}}},clc:{},elems:[{t:13,style:{lg:{spc:{mb:5},size:{w:"70px",h:"auto"},lout:{of:"cover"}},sm:{spc:{mb:5},size:{w:"80px",h:"auto"},lout:{of:"cover"}}},src:"{{{ product.image_url }}}"},{t:4,style:{lg:{spc:{mb:10},lout:{of:"cover",disp:"flex"},flex:{gap:5,dir:"column",wrap:"nowrap",jc:"start",ai:"start"}},sm:{spc:{mb:10},lout:{of:"cover",disp:"flex"},flex:{gap:7,dir:"column",wrap:"nowrap",jc:"start",ai:"start"}}},clc:{},elems:[{t:14,style:{lg:{spc:{},size:{w:"auto",h:"auto"},typo:{italic:!1,bold:!1,lh:1.2,fs:13,tc:{h:"#313131",a:100},ta:0,fw:600,ls:0,fam:{name:"Arial",g:!0}}},sm:{spc:{},size:{w:"auto",h:"auto"},typo:{italic:!1,bold:!1,lh:1.2,fs:12,tc:{h:"#575757",a:100},ta:0,fw:500,ls:0,fam:{name:"Arial",g:!0}}}},text:"{{ product.name }}"},{t:4,style:{lg:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:10,dir:"row",wrap:"nowrap",jc:"start",ai:"start"}},sm:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:10,dir:"row",wrap:"nowrap",jc:"start",ai:"center"}}},clc:{},elems:[{t:2,style:{lg:{spc:{},typo:{italic:!1,bold:!1,lh:1.2,td:"line-through",fs:14,tc:{h:"#64748b",a:100},ta:1,fw:400,ls:0,fam:{name:"Arial",g:!0}}},sm:{spc:{},typo:{italic:!1,bold:!1,lh:1.2,td:"line-through",fs:12,tc:{h:"#64748b",a:100},ta:1,fw:400,ls:0,fam:{name:"Arial",g:!0}}}},text:"{{ product.compare_price }}"},{t:2,style:{lg:{spc:{},typo:{italic:!1,bold:!1,lh:1.2,fs:14,tc:{h:"#000000",a:100},ta:1,fw:500,ls:0,fam:{name:"Arial",g:!0}}},sm:{spc:{},typo:{italic:!1,bold:!1,lh:1.2,fs:13,tc:{h:"#000000",a:100},ta:1,fw:500,ls:0,fam:{name:"Arial",g:!0}}}},text:"{{ product.price }}"},{t:2,style:{lg:{spc:{p:0,pl:0,pr:0,pt:0,pb:0,m:0,ml:0,mr:10,mt:0,mb:0},typo:{italic:!1,bold:!1,lh:1.2,fs:18,tc:{h:"#64748b",a:100},ta:1,fw:600,ls:0}},sm:{spc:{p:0,m:0,mr:10},typo:{italic:!1,bold:!1,lh:1.2,fs:18,tc:{h:"#64748b",a:100},ta:1,fw:600,ls:0}}},hide:!0,text:"Save {{ product.discount_price }}",when:{lhs:"{{ product.discount_price }}",op:"gt",rhs:0}},{t:2,style:{lg:{spc:{p:0,pl:0,pr:0,pt:0,pb:0,m:0,ml:0,mr:10,mt:0,mb:0},typo:{italic:!1,bold:!1,lh:1.2,fs:12,tc:{h:"#0d8d00",a:100},ta:1,fw:400,ls:0,fam:{name:"DINNextRoundedLTPro-Medium"}}},sm:{spc:{p:0,m:0,mr:10},typo:{italic:!1,bold:!1,lh:1.2,fs:18,tc:{h:"#64748b",a:100},ta:1,fw:600,ls:0}}},hide:!0,text:"({{ product.discount_percent }}% off)",when:{lhs:"{{ product.discount_percent }}",op:"gt",rhs:0}}]},{t:4,style:{lg:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:5,dir:"row",wrap:"nowrap",jc:"start",ai:"center"}},sm:{spc:{},lout:{of:"cover",disp:"flex"},flex:{gap:5,dir:"row",wrap:"nowrap",jc:"start",ai:"center"}}},clc:{},elems:[{t:3,style:{lg:{spc:{p:7,pl:7,pr:7,pt:7,pb:7},size:{w:"100%",h:"auto"},bg:{s:{h:"#000000",a:100}},br:{r:0,w:0,s:1,c:{a:100}},typo:{italic:!1,bold:!1,lh:1.2,fs:12,tc:{h:"#ffffff",a:100},ta:1,fw:400,ls:0,fam:{name:"Arial",g:!0}}},sm:{spc:{p:7,pl:7,pr:7,pt:8,pb:8},size:{w:"70%",h:"auto"},bg:{s:{h:"#000000",a:100}},br:{r:0,w:0,s:1,c:{a:100}},typo:{italic:!1,bold:!1,lh:1.2,fs:12,tc:{h:"#ffffff",a:100},ta:1,fw:400,ls:0,fam:{name:"Arial",g:!0}}}},text:"Add",clc:{at:102},allowedTypes:[102]}]}]}]}]}),_d=new Ve({t:2,style:{lg:{spc:{mb:15},typo:{italic:!1,bold:!1,lh:1.2,fs:16,tc:{h:"#333333",a:100},ta:1,fw:700,ls:.5,fam:{name:"Arial",g:!0}}},sm:{spc:{mb:15},typo:{italic:!1,bold:!1,lh:1.2,fs:16,tc:{h:"#333333",a:100},ta:1,fw:700,ls:.5,fam:{name:"Arial",g:!0}}}},text:"WATCH & SHOP - NEW LAUNCHES"});var Go=class extends De{render(){return M("div",{style:{marginTop:30},class:"lc-container",children:[M(Et,{element:_d,triggerContext:this.props.triggerContext}),M("div",{style:this.getComponentStyles(),children:this.props.triggerContext.triggerData.items.map(e=>{if(e.portraitVideos?.length)return M("div",{class:"lc-shoppable-video",style:{flex:"1 1 0",width:"260px"},children:[M("a",{href:e.link,onClick:()=>{this.sendTriggerClicked([new bt(e)],{from:"video"})},children:M("video",{width:"100%",autoplay:!0,muted:!0,loop:!0,children:this.getSources(e.portraitVideos[0].sources)})}),M(Hr,{element:vd,item:e,triggerContext:this.props.triggerContext})]})})})]})}getSources(e){let r=e.map(o=>M("source",{src:o.url,type:o.mimeType,media:`(max-width:${o.width}px)`})),n=e.filter(o=>o.format==="mp4").sort((o,s)=>s.width-o.width)[0];n&&r.push(M("source",{src:n.url,type:n.mimeType}));let i=e.filter(o=>o.format==="m3u8").sort((o,s)=>s.width-o.width)[0];return i&&r.push(M("source",{src:i.url,type:i.mimeType})),r}getComponentStyles(){return{display:"flex",gap:10,overflowX:"auto",margin:10}}};var sc=class extends xt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){Qo(Ji(Go,{element:this.widget?.cont,triggerContext:this.triggerContext}),this.rootContainer)}};var ac=class extends xt{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(A.ADD_BUNDLE_CTA_INBOUND_EVENT,this.inboundCTAListener.bind(this),!1)}async inboundCTAListener(e){let r=this.engagementTrigger,n=`Engagement(id: ${r.engagementID}, shortID: ${r.shortID})`,i=e.detail;if(!kt.hasKeys(i)){w.error(`No detail received for ${n}`);return}w.log("Detail received for BYOB",i);let o=i.campaignID??i.campaignId??i.campaign_id;if(o!==r.shortID&&o!==r.engagementID){w.warn(`Current ${n} is not BYOB. Received: ${o}`);return}let s=i.items;if(!s?.length)return;let a=s.map(l=>new bt({mID:l.product_id,vID:l.variant_id,quantity:l.quantity||1}));await new Li(this.triggerContext).execute({embeddedItems:a,clickAction:{at:108,applyDiscount:!0}})}};var Ui=class{runtimeData=fe.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let r=[...Rr.renderedEngagements];Rr.renderedEngagements.length=0;for(let n of e)w.log(`\u{1F4E3} ${n} received as cart embed`),!this.findAndUpdateCurrent(n,r)&&(w.log(`${n} is new`),n.isProgressBar()?new oc(n).renderSilently():n.isSubscriptionUpsell()?ic.renderCartUpsell(n):new Rr(n).renderSilently());this.removeOldWidgets(r)}processPageWidgetResponse(e){let r=[...xt.renderedEngagements];xt.renderedEngagements.length=0;for(let n of e)w.log(`\u{1F4E3} ${n} received as page embed`),!this.findAndUpdateCurrent(n,r)&&(w.log(`${n} is new`),n.isShoppableVideo()?new sc(n).renderSilently():n.isBYOB()?new ac(n).renderSilently():new xt(n).renderSilently());this.removeOldWidgets(r)}findAndUpdateCurrent(e,r){let n=r.findIndex(i=>i.isSameTrigger(e));return n<0||e.isSubscriptionUpsell()?!1:(r[n].update(e),r[n].renderSilently(),r.splice(n,1),!0)}removeOldWidgets(e){for(let r of e)r.destroy()}};var sr=class t{static INSTANCE;httpService=se.get(Tt);sessionManager=se.get(Ye);runtimeData=fe.get();loadWidgetsSubject=new ht;constructor(){this.loadWidgetsSubject.pipe(tr(300)).subscribe(()=>{this.loadCartWidgets().catch(e=>w.error("Unable to initiate cart widgets",e)),this.loadPageWidgets().catch(e=>w.error("Unable to initiate page widgets",e))}),Dr.get().subscriber(A.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){Ye.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(e=>w.error("Unable to initiate load page widgets",e))})}loadCartWidgetsSilently(){Ye.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(e=>w.error("Unable to initiate cart widgets",e))})}loadWidgetsSilently(){Ye.replaySubject.subscribe(async()=>{this.loadWidgetsSubject.next()})}async loadPageWidgets(){let e=await this.getWidgetProps();w.log("Load widgets",e),this.httpService.post("/v1/engagement/page-widgets",e).then(async r=>{let n=r.widgets.map(i=>new Pt(i));new Ui().processPageWidgetResponse(n)}).catch(r=>{w.error("Error sending widget getter",r)})}async loadCartWidgets(){let e=await this.getWidgetProps();w.log("Load cart widgets",e),this.httpService.post("/v1/engagement/cart-widgets",e).then(async r=>{let n=r.widgets.map(i=>new Pt(i));new Ui().processCartWidgetResponse(n)}).catch(r=>{w.error("Error sending widget getter",r)})}async getVariation(e){let r=await this.getWidgetProps();return this.httpService.post("/v1/engagement/get-variant",b(b({},e),r))}renderCachedCartWidgets(){new Ui().processCartWidgetResponse(this.runtimeData.cartEngagements)}async addSessionContext(e){let r=await this.sessionManager.checkSessionAndGetContext();e.sessionID=r[0],e.sessionNumber=r[1],e.landingPage=r[2],e.page=vr.parseFromCurrent()}addAvailableEngagementShortIDs(){let e=document.querySelectorAll(".letscooee-engagement"),r=[];return e.forEach(n=>{let i=n.dataset.engagementId;i&&+i&&r.push(i)}),r}async getWidgetProps(){let e={};e.engagementIDs=this.addAvailableEngagementShortIDs(),await this.addSessionContext(e),e.currentItem=this.runtimeData.getCurrentItem();try{e.cart=await ge.getCurrent().getNormalisedCart()}catch(o){w.error("Error fetching Shopify cart before sending widget call",o)}let r=new URLSearchParams(location.search),n=r.get("cooee-preview");n?e.previewIDs=n.trim().split(",").filter(o=>Number.isInteger(+o)):this.runtimeData.previewIDs?.length&&(e.previewIDs=this.runtimeData.previewIDs);let i=r.get("cooee-variant");return i?e.previewVariant=i:this.runtimeData.previewVariant&&(e.previewVariant=this.runtimeData.previewVariant),e}};var cc=class{runtimeData=fe.get();widgetAPIService=se.get(sr);meddle(){let e=Se.globalRef;e.account=e.account??[],e.profile=e.profile??[],e.events=e.events??[],e.screen=e.screen??[],e.page=e.page??[],this.meddlePage(),this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.meddleScreen(),this.exposeMethods()}exposeMethods(){let e=Se.globalRef;e.loadPageWidgets=()=>{this.widgetAPIService.loadPageWidgetsSilently()},e.loadCartWidgets=()=>{this.widgetAPIService.loadCartWidgetsSilently()},e.previewWidget=Se.previewWidget.bind(Se),e.previewPopup=Se.previewPopup.bind(Se)}overwritePush(e,r){Xn(e,"push",r)}meddleAccount(){this.overwritePush(Se.globalRef.account,(...e)=>{this.processAccount(e[0])}),Se.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(Se.globalRef.events,(...e)=>{this.processEvent(e[0])}),Se.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(Se.globalRef.profile,(...e)=>{this.processProfile(e[0])}),Se.globalRef.profile.forEach(this.processProfile.bind(this))}meddleScreen(){this.overwritePush(Se.globalRef.screen,(...e)=>{this.processPageName(e[0])}),Se.globalRef.screen.forEach(this.processPageName.bind(this))}processAccount(e){e&&(e.appID&&Se.authenticate(e),e.flags&&An.setFlags(e.flags))}processEvent(e){e&&(A.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?Se.sendEvent(e[0],e[1],this.runtimeData.jsLoadTime):Se.sendEvent(e[0],e[1]))}processProfile(e){e&&Se.updateProfile(e)}processPageName(e){e&&Se.setPageName(e)}meddlePage(){this.overwritePush(Se.globalRef.page,(...e)=>{this.processPage(e[0])}),Se.globalRef.page.forEach(this.processPage.bind(this))}processPage(e){e.currentItem&&this.runtimeData.setCurrentItem(e.currentItem),e.currency&&(this.runtimeData.currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.pageName&&Se.setPageName(e.pageName)}};var Mi=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=A.COOEE.concat("-");static getString(e,r){return this.getItem(e)||r}static setString(e,r){this.setItem(e,r)}static remove(e){this.removeItem(e)}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,r){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),r)}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}};var ki=class t{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=se.get(ue);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(e){this._lastScreenOrScroll=e}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}resetScrollID(e){Mi.remove(A.SESSION_STORAGE_SCROLL_ID),this.lastScreenOrScroll=e??new Date}listen(){if(window.scrollY){let e=this.getPercentScrolledY();this.shouldSendScroll(e)&&this.sendScroll(e)}ce.onDocumentLoaded(()=>{this.observeWindowScroll()})}observeWindowScroll(){En(window,"scroll").pipe(tr(t.DEBOUNCE_TIME),_n(()=>{let e=this.getPercentScrolledY();if(e>100){w.warn("Received scroll percent is more than 100",e);return}if(this.shouldSendScroll(e))return e})).subscribe(e=>{this.sendScroll(e)})}shouldSendScroll(e){return Math.abs(this.lastPercent-e)>=t.THRESHOLD||this.lastPercent!==e&&e===100}sendScroll(e){if(e==null)return;let r={percent:e,timeMS:new Date().getTime()-this._lastScreenOrScroll.getTime()};this.lastPercent=e;let n=Mi.getString(A.SESSION_STORAGE_SCROLL_ID,""),i=new ve(A.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),Mi.setString(A.SESSION_STORAGE_SCROLL_ID,i.id.toHexString()),this._lastScreenOrScroll=new Date(i.occurred)}getPercentScrolledY(){let e=window.document.body.scrollHeight,r=window.innerHeight;return Math.ceil((window.scrollY+r)/e*100)}};var lc=class t{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=se.get(ue);runtimeData=fe.get();listen(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?this.onVisible():document.visibilityState==="hidden"&&this.onHidden()}}async onVisible(){}async onHidden(){let e=await this.runtimeData.setInactive();if(e===0){w.info("Not sending background event as user was inactive on website");return}w.info(`Sending background event with ${e} seconds`);let r={};r[t.ACTIVE_DURATION]=e,this.apiService.sendEvent(new ve(A.EVENT_APP_BACKGROUND,r))}};var uc=class{compareCartItemSubject=new ht;constructor(){this.compareCartItemSubject.pipe(tr(100)).subscribe(this.compareCartItems.bind(this))}listen(){this.compareCartItemSubject.next(),this.overwriteXMLHttpRequest(),this.overwriteFetchMethod()}overwriteXMLHttpRequest(){let e=this,r=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){e.performEvent(this._url).catch(n=>w.error("Unable to process cart change in XMLHttpRequest",n))}),r.apply(this,arguments)},w.debug("Securely overwritten window.XMLHttpRequest.send method")}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=function(n){return r.apply(window,arguments).then(i=>(e.performEvent(n.toString()).catch(o=>w.error("Unable to process cart change in fetch",o)),i))},w.debug("Securely overwritten window.fetch method")}async performEvent(e){this.isCartManipulationURL(e)&&(fe.get().isCartDirty=!0,this.compareCartItemSubject.next())}isCartManipulationURL(e){return/\/cart\/(add|change|update|clear)/.test(e)}sendChangesAsEvents(e,r){let n=e?.items,i=r.items,o=[],s=[];if(w.debug(`Comparing cart change with old count ${n?.length} to new count ${i.length}`),i?.forEach(a=>{let l=n?.find(m=>m.vID===a.vID);if(l){if(l.quantity!==a.quantity){let m=l.quantity<a.quantity,p=Math.abs(l.quantity-a.quantity),f=Z(b({},a),{quantity:p});m?o.push(f):s.push(f)}n&&ce.removeFromArray(n,l)}else o.push(a)}),n)for(let a of n)s.push(a);w.debug(`Cart delta: added: ${o.length}, removed: ${s.length}`),o.length&&this.sendEvent(A.EVENT_ADD_TO_CART,{items:o}),s.length&&e.token===r.token&&this.sendEvent(A.EVENT_REMOVE_FROM_CART,{items:s}),(s.length||o.length)&&Dr.get().broadcast(A.CART_UPDATE_BROADCAST,{itemsAdded:o,itemsRemoved:s})}sendEvent(e,r){let n=new ve(e,r);se.get(ue).sendEvent(n)}async compareCartItems(){let e=await Ne.get(ne.CURRENT_CART,{}),r=await ge.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,r)}};var pc=class{listen(){return this.overwriteFetchMethod(),this}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=async function(n,i){try{await e.modifyRequest(n,i)}catch(o){Ue.getInstance().captureError("Failed to modify graphql request",o,{body:JSON.stringify(i?.body)})}return r(n,i)},w.debug("Securely overwritten window.fetch method for graphql query")}async modifyRequest(e,r){let n=typeof e=="string"?e:e instanceof Request?e.url:"";if(!(n.includes("graphql.json")&&r?.method==="POST")||!r.body)return;w.log("Intercepted fetch request of:",n);let i=typeof r.body=="string"?JSON.parse(r.body):r.body;i.query.includes("cartCreate")&&(r.body=await this.updatedBody(i),this.sendBuyNowEvent())}async updatedBody(e){let r=await Ne.get(ne.DEVICE_ID),n=await se.get(Ye).getCurrentSessionID(),i=e.variables.input.attributes??[],o=[{key:"letscooee_did",value:r},{key:"letscooee_sid",value:n},{key:"__letscooee_time",value:new Date().toLocaleString()},{key:"__letscooee_via",value:"Buy Now"}];return e.variables.input.attributes=[...i,...o],JSON.stringify(e)}sendBuyNowEvent(){let e=fe.get().getCurrentItem();if(!e)return;let r=new ve(A.EVENT_BUY_NOW_CLICKED,{items:[e]});ue.getInstance().sendEvent(r)}};var Fi=class{constructor(e,r){this.selectors=e;this.eventName=r;this.selectorString=e.join(",")}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let r=e.currentTarget,n=new ve(this.eventName,{class:r.className||void 0,tagName:r.tagName||void 0,id:r.id||void 0});ue.getInstance().sendEvent(n),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>w.error(e))}async listen(){this.elements=await ce.retrySelectorForElements(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(r=>{r.removeEventListener("click",e)})}};var fc=class t extends Fi{static selectors=[".product__thumbnail-list-inner > button","product-gallery-navigation > button",".product-media--thumb-container",".product-images-inner > img",".m-product-media",".swiper-button-control",".media__thumb",".slick-arrow",".productView-img-container.product-single__media",".product-gallery__thumbnail_item_inner"];constructor(){super(t.selectors,A.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var mc=class t extends Fi{static selectors=[".jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup","reviewsio-product-ratings",".ruk_rating_snippet.tracked:not(.hidden)","a > .loox-rating",".yotpo-reviews-star-ratings-widget",".yotpo.lp-hero__reviews",".pr-rating > a",".rivyoReviewWidget"];constructor(){super(t.selectors,A.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var dc=class{selector=[".gokwik-checkout button","button.cart__checkout-button","button.cart__checkout","button#checkout","button#checkout2",'button[id*="checkout" i]','button[name*="checkout" i]','button[class*="checkout" i]'].join(",");listen(){ce.onDocumentLoaded(()=>{w.debug("Execution order:","document ready"),this.useLocationHash()})}useLocationHash(){let e=window.location.hash?.substring(1);if(e)if(e.includes(A.HASH_INITIATE_CHECKOUT)){document.dispatchEvent(new Event(A.THIRD_PARTY_CHECKOUT_EVENT));let r=document.querySelector(this.selector);if(!r){w.debug("No clickable cart checkout button found");return}w.debug("Clickable cart checkout button found",r),r.click()}else e.includes(A.HASH_OPEN_CART_DRAWER)&&et.get().open()}};var hc=class{trackSilently(){this.track().catch(e=>Ue.getInstance().captureException(e))}async track(){let e=window.Shopify?.checkout,r=window.Shopify?.Checkout;if(!e&&!r)return;let n={};this.processSmallCheckout(e,n),this.processBigCheckout(r,n);let i=this.getTokenFromCurrentURLPath();if(i&&(n.urlToken=i),!Object.keys(n).length){w.warn("No processable data found in",e,r);return}n.referrer=document.referrer,n.url=location.href;let o=await se.get(Ye).checkSessionAndGetContext();n.sessionID=o[0],this.trackOrder(n)}processSmallCheckout(e,r){e&&(e.order_id&&(r.orderID=e.order_id.toString()),e.token&&(r.checkoutToken=e.token.toString()),e.customer_id&&(r.customerID=e.customer_id.toString()))}processBigCheckout(e,r){e&&(e.token&&!r.checkoutToken&&(r.checkoutToken=e.token.toString()),e.cartToken&&(r.cartToken=e.cartToken.toString()))}trackOrder(e){w.info("Found order to be send",e),ue.getInstance().trackOrder(e)}getTokenFromCurrentURLPath(){let e=new RegExp("[A-Fa-f0-9]{28,32}");return location.pathname?.split("/").find(r=>r.length&&e.test(r))}};var Vo=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await ge.getCurrent().getNormalisedCart(),r={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},n=new ve(A.EVENT_CHECKOUT_STARTED,r);ue.getInstance().sendEvent(n)})}};var gc=class{async migrate(){}};Zt.escape=np.escapeHtml;var Se=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new gc().migrate(),this.autoAuthenticate(),new cc().meddle(),new lc().listen(),new hc().trackSilently(),new Mr().listen(),new uc().listen(),new pc().listen(),new dc().listen(),se.get(ki).listen(),se.get(mc).listenSilently(),se.get(fc).listenSilently(),se.get(sr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),Kt.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||Xn(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,Xn(this.globalRef,"config",new qe),Xn(this.globalRef,"runtimeData",new fe),w.debug("Global reference initialised")}static injectWidgetAssets(){if(document.currentScript.src.includes("localhost")){let r="http://localhost:8002";It.injectScriptURL(`${r}/main.js`),It.injectStylesheet(`${r}/styles.css`)}else{let n=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${A.SDK_VERSION}`;It.injectScriptURL(`${n}/dist/widget-sdk.min.js`,"cooee-widget-sdk"),It.injectStylesheet(`${n}/dist/widget-sdk.min.css`)}}static autoAuthenticate(){let e=Oe.getShopName();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let r=e.appID?.trim(),n=e.shopifyShop;if((ce.isNull(r)||r.length!==24)&&ce.isNull(n)){w.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,se.get(Ye).init(e)}static sendEvent(e,r,n){for(let o in r)if(o.length>3&&o.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");let i=new ve(e,r);i.occurred=n??new Date,se.get(ue).sendEvent(i)}static updateProfile(e){for(let r in e)if(r.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");se.get(ue).updateProfile(e)}static setPageName(e){if(!e)return;let r=fe.get(),n=r.pageName;if(e===n)return;if(r.pageName=e,e==="cart"&&se.get(sr).loadOrRenderWidgetsAfterCartChange(),A.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){se.get(ki).resetScrollID();return}let i={};n&&(i.ps=n);let o=new ve(A.EVENT_SCREEN_VIEW,i);o.occurred=r.jsLoadTime,se.get(ue).sendEvent(o),se.get(ki).resetScrollID(o.occurred)}static previewPopup(e,r){new Ai(r).render(e)}static previewWidget(e){new xt(new Pt(e)).render()}static setupPreviewListeners(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(e){w.error(e)}window.addEventListener("message",e=>{if(w.debug("Received event",e),!e.origin.includes("letscooee.com")&&!e.origin.includes("localhost"))return;let r=e.data;typeof r=="object"&&(r.action==="POPUP_PREVIEW"?(this.previewPopup(r.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)):r.action==="WIDGET_PREVIEW"&&(this.previewWidget(r.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)))})}}static attachGoKwikListeners(){let e=fe.get();window.addEventListener("kp-modal:opened",()=>{e.isGoKwikPopupOpen=!0}),window.addEventListener("user-loggedin",r=>{let{token:n}=r.detail;n&&this.updateProfile({goKwikToken:n})}),window.gokwikSdk?Vo.attachCheckoutListener():window.addEventListener("gokwikLoaded",Vo.attachCheckoutListener)}static storePreviewParams(){let e=fe.get(),r=new URLSearchParams(location.search),n=r.get("cooee-preview");n&&(e.previewIDs=n.trim().split(",").filter(o=>Number.isInteger(+o)));let i=r.get("cooee-variant");i&&(e.previewVariant=i)}};w.configure();w.logBrand();w.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(w.debug("Execution order:","IIFE start"),await Se.initForMerchantWebsiteOnly(),await Se.initForAll(),w.debug("Execution order:","IIFE end")))());w.debug("Execution order:","bottom");