@elevateab/sdk 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +3 -3
- package/dist/next.cjs.map +1 -1
- package/dist/next.js +2 -2
- package/dist/next.js.map +1 -1
- package/package.json +1 -1
package/dist/next.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var en=Object.create;var Be=Object.defineProperty;var tn=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,on=Object.prototype.hasOwnProperty;var oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var an=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pr=(e,t)=>{for(var r in t)Be(e,r,{get:t[r],enumerable:!0})},fr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of rn(t))!on.call(e,n)&&n!==r&&Be(e,n,{get:()=>t[n],enumerable:!(o=tn(t,n))||o.enumerable});return e};var De=(e,t,r)=>(r=e!=null?en(nn(e)):{},fr(t||!e||!e.__esModule?Be(r,"default",{value:e,enumerable:!0}):r,e)),sn=e=>fr(Be({},"__esModule",{value:!0}),e);function ht(e){let t=0;for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);t=(t<<5)-t+o,t=t&t}return Math.abs(t)}function mr(e){let t=[];for(let[r,o]of Object.entries(e.allTests)){if(!o.data.isLive)continue;let n=[],s=0;for(let[u,f]of Object.entries(o)){if(u==="data")continue;let l=f;if(typeof l=="object"&&l!==null&&"variationName"in l){let g=!!l.isControl,i=l.content,d;i&&typeof i=="object"&&(d={changes:i.changes||[],elements:i.elements||[],blocks:i.blocks||[],customCodes:i.customCodes||[]});let a=l.customCode,c;a&&typeof a=="object"&&a.id&&(c={id:a.id,js:a.js,css:a.css,pathnames:a.pathnames||[],excludePathnames:a.excludePathnames}),n.push({id:u,name:l.variationName,weight:l.trafficPercentage,isControl:g,productId:l.id,handle:l.handle,price:l.price,prices:l.prices,splitUrlTestLinks:l.splitUrlTestLinks,content:d,customCode:c,isA:!g&&s===0,isB:!g&&s===1,isC:!g&&s===2,isD:!g&&s===3}),g||s++}}n.length>0&&t.push({testId:r,name:o.data.name,enabled:o.data.isLive,type:o.data.type,variations:n,data:o.data})}return{tests:t,selectors:e.selectors}}var Me=oe(()=>{"use strict"});var gr=an((he,He)=>{"use strict";(function(e,t){"use strict";var r="1.0.41",o="",n="?",s="function",u="undefined",f="object",l="string",g="major",i="model",d="name",a="type",c="vendor",p="version",_="architecture",k="console",m="mobile",w="tablet",y="smarttv",A="wearable",D="embedded",$=500,Z="Amazon",W="Apple",N="ASUS",de="BlackBerry",Se="Browser",Ie="Chrome",Yr="Edge",Ue="Firefox",Re="Google",er="Honor",tr="Huawei",Qr="Lenovo",Ve="LG",ut="Microsoft",dt="Motorola",lt="Nvidia",rr="OnePlus",le="Opera",pt="OPPO",pe="Samsung",nr="Sharp",fe="Sony",ft="Xiaomi",mt="Zebra",or="Facebook",ir="Chromium OS",ar="Mac OS",sr=" Browser",Xr=function(v,C){var h={};for(var T in v)C[T]&&C[T].length%2===0?h[T]=C[T].concat(v[T]):h[T]=v[T];return h},Oe=function(v){for(var C={},h=0;h<v.length;h++)C[v[h].toUpperCase()]=v[h];return C},cr=function(v,C){return typeof v===l?me(C).indexOf(me(v))!==-1:!1},me=function(v){return v.toLowerCase()},Kr=function(v){return typeof v===l?v.replace(/[^\d\.]/g,o).split(".")[0]:t},gt=function(v,C){if(typeof v===l)return v=v.replace(/^\s\s*/,o),typeof C===u?v:v.substring(0,$)},ge=function(v,C){for(var h=0,T,q,M,x,b,H;h<C.length&&!b;){var wt=C[h],lr=C[h+1];for(T=q=0;T<wt.length&&!b&&wt[T];)if(b=wt[T++].exec(v),b)for(M=0;M<lr.length;M++)H=b[++q],x=lr[M],typeof x===f&&x.length>0?x.length===2?typeof x[1]==s?this[x[0]]=x[1].call(this,H):this[x[0]]=x[1]:x.length===3?typeof x[1]===s&&!(x[1].exec&&x[1].test)?this[x[0]]=H?x[1].call(this,H,x[2]):t:this[x[0]]=H?H.replace(x[1],x[2]):t:x.length===4&&(this[x[0]]=H?x[3].call(this,H.replace(x[1],x[2])):t):this[x]=H||t;h+=2}},we=function(v,C){for(var h in C)if(typeof C[h]===f&&C[h].length>0){for(var T=0;T<C[h].length;T++)if(cr(C[h][T],v))return h===n?t:h}else if(cr(C[h],v))return h===n?t:h;return C.hasOwnProperty("*")?C["*"]:v},Zr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ur={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"},dr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,p],[/opios[\/ ]+([\w\.]+)/i],[p,[d,le+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[d,le+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[d,le]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[d,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[d,"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],[d,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[d,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[d,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[d,"UC"+Se]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[d,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[d,"Smart Lenovo "+Se]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+Se],p],[/\bfocus\/([\w\.]+)/i],[p,[d,Ue+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[d,le+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[d,le+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI"+sr]],[/fxios\/([\w\.-]+)/i],[p,[d,Ue]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[d,"360"]],[/\b(qq)\/([\w\.]+)/i],[[d,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1"+sr],p],[/samsungbrowser\/([\w\.]+)/i],[p,[d,pe+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[p,[d,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[d,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[d,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[d],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,or],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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],[d,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[d,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[d,Ie+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,Ie+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[d,"Android "+Se]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[p,we,Zr]],[/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],p],[/(wolvic|librewolf)\/([\w\.]+)/i],[d,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[d,Ue+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[d,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[d,[p,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[_,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[_,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[_,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[_,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[_,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[_,/ower/,o,me]],[/ sun4\w[;\)]/i],[[_,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[_,me]]],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],[i,[c,pe],[a,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[i,[c,pe],[a,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[i,[c,W],[a,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[i,[c,W],[a,w]],[/(macintosh);/i],[i,[c,W]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[i,[c,nr],[a,m]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[i,[c,er],[a,w]],[/honor([-\w ]+)[;\)]/i],[i,[c,er],[a,m]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[i,[c,tr],[a,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[i,[c,tr],[a,m]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[i,/_/g," "],[c,ft],[a,w]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[i,/_/g," "],[c,ft],[a,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[i,[c,pt],[a,m]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[i,[c,we,{OnePlus:["304","403","203"],"*":pt}],[a,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[i,[c,"Vivo"],[a,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[i,[c,"Realme"],[a,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[i,[c,dt],[a,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[i,[c,dt],[a,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[i,[c,Ve],[a,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[i,[c,Ve],[a,m]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[i,[c,Qr],[a,w]],[/(nokia) (t[12][01])/i],[c,i,[a,w]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[i,/_/g," "],[a,m],[c,"Nokia"]],[/(pixel (c|tablet))\b/i],[i,[c,Re],[a,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[i,[c,Re],[a,m]],[/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],[i,[c,fe],[a,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[i,"Xperia Tablet"],[c,fe],[a,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[i,[c,rr],[a,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[i,[c,Z],[a,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[i,/(.+)/g,"Fire Phone $1"],[c,Z],[a,m]],[/(playbook);[-\w\),; ]+(rim)/i],[i,c,[a,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[i,[c,de],[a,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[i,[c,N],[a,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[i,[c,N],[a,m]],[/(nexus 9)/i],[i,[c,"HTC"],[a,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[c,[i,/_/g," "],[a,m]],[/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],[i,[c,"TCL"],[a,w]],[/(itel) ((\w+))/i],[[c,me],i,[a,we,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[i,[c,"Acer"],[a,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[i,[c,"Meizu"],[a,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[i,[c,"Ulefone"],[a,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[i,[c,"Energizer"],[a,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[i,[c,"Cat"],[a,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[i,[c,"Smartfren"],[a,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[i,[c,"Nothing"],[a,m]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[i,[c,"Archos"],[a,w]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[i,[c,"Archos"],[a,m]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[c,i,[a,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[c,i,[a,m]],[/(kobo)\s(ereader|touch)/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],[c,i,[a,w]],[/(surface duo)/i],[i,[c,ut],[a,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[i,[c,"Fairphone"],[a,m]],[/(u304aa)/i],[i,[c,"AT&T"],[a,m]],[/\bsie-(\w*)/i],[i,[c,"Siemens"],[a,m]],[/\b(rct\w+) b/i],[i,[c,"RCA"],[a,w]],[/\b(venue[\d ]{2,7}) b/i],[i,[c,"Dell"],[a,w]],[/\b(q(?:mv|ta)\w+) b/i],[i,[c,"Verizon"],[a,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[i,[c,"Barnes & Noble"],[a,w]],[/\b(tm\d{3}\w+) b/i],[i,[c,"NuVision"],[a,w]],[/\b(k88) b/i],[i,[c,"ZTE"],[a,w]],[/\b(nx\d{3}j) b/i],[i,[c,"ZTE"],[a,m]],[/\b(gen\d{3}) b.+49h/i],[i,[c,"Swiss"],[a,m]],[/\b(zur\d{3}) b/i],[i,[c,"Swiss"],[a,w]],[/\b((zeki)?tb.*\b) b/i],[i,[c,"Zeki"],[a,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],i,[a,w]],[/\b(ns-?\w{0,9}) b/i],[i,[c,"Insignia"],[a,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[i,[c,"NextBook"],[a,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],i,[a,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],i,[a,m]],[/\b(ph-1) /i],[i,[c,"Essential"],[a,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[i,[c,"Envizen"],[a,w]],[/\b(trio[-\w\. ]+) b/i],[i,[c,"MachSpeed"],[a,w]],[/\btu_(1491) b/i],[i,[c,"Rotor"],[a,w]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[i,[c,lt],[a,w]],[/(sprint) (\w+)/i],[c,i,[a,m]],[/(kin\.[onetw]{3})/i],[[i,/\./g," "],[c,ut],[a,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[i,[c,mt],[a,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[i,[c,mt],[a,m]],[/smart-tv.+(samsung)/i],[c,[a,y]],[/hbbtv.+maple;(\d+)/i],[[i,/^/,"SmartTV"],[c,pe],[a,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,Ve],[a,y]],[/(apple) ?tv/i],[c,[i,W+" TV"],[a,y]],[/crkey/i],[[i,Ie+"cast"],[c,Re],[a,y]],[/droid.+aft(\w+)( bui|\))/i],[i,[c,Z],[a,y]],[/(shield \w+ tv)/i],[i,[c,lt],[a,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[i,[c,nr],[a,y]],[/(bravia[\w ]+)( bui|\))/i],[i,[c,fe],[a,y]],[/(mi(tv|box)-?\w+) bui/i],[i,[c,ft],[a,y]],[/Hbbtv.*(technisat) (.*);/i],[c,i,[a,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[c,gt],[i,gt],[a,y]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[i,[a,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[a,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,i,[a,k]],[/droid.+; (shield)( bui|\))/i],[i,[c,lt],[a,k]],[/(playstation \w+)/i],[i,[c,fe],[a,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[i,[c,ut],[a,k]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[i,[c,pe],[a,A]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[c,i,[a,A]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[i,[c,pt],[a,A]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[i,[c,W],[a,A]],[/(opwwe\d{3})/i],[i,[c,rr],[a,A]],[/(moto 360)/i],[i,[c,dt],[a,A]],[/(smartwatch 3)/i],[i,[c,fe],[a,A]],[/(g watch r)/i],[i,[c,Ve],[a,A]],[/droid.+; (wt63?0{2,3})\)/i],[i,[c,mt],[a,A]],[/droid.+; (glass) \d/i],[i,[c,Re],[a,A]],[/(pico) (4|neo3(?: link|pro)?)/i],[c,i,[a,A]],[/; (quest( \d| pro)?)/i],[i,[c,or],[a,A]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[a,D]],[/(aeobc)\b/i],[i,[c,Z],[a,D]],[/(homepod).+mac os/i],[i,[c,W],[a,D]],[/windows iot/i],[[a,D]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[i,[a,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[i,[a,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[a,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[a,m]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[i,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[d,Yr+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[d,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[d,"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],[d,p],[/ladybird\//i],[[d,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,p],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[d,[p,we,ur]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,we,ur],[d,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,ar],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,d],[/(ubuntu) ([\w\.]+) like android/i],[[d,/(.+)/,"$1 Touch"],p],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[d,p],[/\(bb(10);/i],[p,[d,de]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[p,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[d,Ue+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[d,Ie+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,ir],p],[/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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,p],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,p]]},O=function(v,C){if(typeof v===f&&(C=v,v=t),!(this instanceof O))return new O(v,C).getResult();var h=typeof e!==u&&e.navigator?e.navigator:t,T=v||(h&&h.userAgent?h.userAgent:o),q=h&&h.userAgentData?h.userAgentData:t,M=C?Xr(dr,C):dr,x=h&&h.userAgent==T;return this.getBrowser=function(){var b={};return b[d]=t,b[p]=t,ge.call(b,T,M.browser),b[g]=Kr(b[p]),x&&h&&h.brave&&typeof h.brave.isBrave==s&&(b[d]="Brave"),b},this.getCPU=function(){var b={};return b[_]=t,ge.call(b,T,M.cpu),b},this.getDevice=function(){var b={};return b[c]=t,b[i]=t,b[a]=t,ge.call(b,T,M.device),x&&!b[a]&&q&&q.mobile&&(b[a]=m),x&&b[i]=="Macintosh"&&h&&typeof h.standalone!==u&&h.maxTouchPoints&&h.maxTouchPoints>2&&(b[i]="iPad",b[a]=w),b},this.getEngine=function(){var b={};return b[d]=t,b[p]=t,ge.call(b,T,M.engine),b},this.getOS=function(){var b={};return b[d]=t,b[p]=t,ge.call(b,T,M.os),x&&!b[d]&&q&&q.platform&&q.platform!="Unknown"&&(b[d]=q.platform.replace(/chrome os/i,ir).replace(/macos/i,ar)),b},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 T},this.setUA=function(b){return T=typeof b===l&&b.length>$?gt(b,$):b,this},this.setUA(T),this};O.VERSION=r,O.BROWSER=Oe([d,p,g]),O.CPU=Oe([_]),O.DEVICE=Oe([i,c,a,k,m,y,w,A,D]),O.ENGINE=O.OS=Oe([d,p]),typeof he!==u?(typeof He!==u&&He.exports&&(he=He.exports=O),he.UAParser=O):typeof define===s&&define.amd?define(function(){return O}):typeof e!==u&&(e.UAParser=O);var ne=typeof e!==u&&(e.jQuery||e.Zepto);if(ne&&!ne.ua){var Le=new O;ne.ua=Le.getResult(),ne.ua.get=function(){return Le.getUA()},ne.ua.set=function(v){Le.setUA(v);var C=Le.getResult();for(var h in C)ne.ua[h]=C[h]}}})(typeof window=="object"?window:he)});function ie(){try{if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){let e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(r=>r.toString(16).padStart(2,"0"));return[t.slice(0,4).join(""),t.slice(4,6).join(""),t.slice(6,8).join(""),t.slice(8,10).join(""),t.slice(10,16).join("")].join("-")}}catch(e){console.warn("[ElevateAB] Crypto UUID generation failed, falling back to Math.random()",e)}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function L(e,t){if(typeof document>"u")return;let r=new Date;r.setTime(r.getTime()+365*24*60*60*1e3);let o="; expires="+r.toUTCString();document.cookie=e+"="+(t||"")+o+"; path=/"}function I(e){if(typeof document>"u")return null;let t=e+"=",r=document.cookie.split(";");for(let o=0;o<r.length;o++){let n=r[o];for(;n.charAt(0)===" ";)n=n.substring(1,n.length);if(n.indexOf(t)===0)return n.substring(t.length,n.length)}return null}function V(e){let t=I(e);if(t)try{return JSON.parse(t)}catch(r){return console.error("[ElevateAB] Error parsing JSON from cookie",r),null}return null}function ae(e,t){typeof sessionStorage>"u"||sessionStorage.setItem(e,JSON.stringify(t))}function ee(e){return typeof sessionStorage>"u"?null:sessionStorage.getItem(e)}function kt(e){let t=ee(e);return t?JSON.parse(t):null}function br(){let e=I("eabUserId");return e||(e=ie(),L("eabUserId",e)),e}function se(){return br()}function hr(){let e=ee("eabSessionId");return e||(e=ie(),ae("eabSessionId",e)),e}function We(){return hr()}function Ge(){return{referrer:ee("eabReferrer")||"",entryPage:ee("eabEntry")||""}}var B=oe(()=>{"use strict"});function fn(e){let t={},r={};if(!e)return{assignments:t,views:r};let o=e.split("~");for(let n of o){let s=n.split("_");if(s.length>=2){let u=s[0],f=s[1],l=s[2]==="1";t[u]=f,r[u]=l}}return{assignments:t,views:r}}function F(){if(typeof window>"u")return{isPreview:!1,previewTestId:null,forcedAssignments:{},previewedViews:{}};let e=new URLSearchParams(window.location.search),r=(e.get("eabUserPreview")||I("eabUserPreview"))==="true",o=e.get("abtid");o||(o=ee("eabPreviewTestId"));let n=e.get("eab_tests")||"",{assignments:s,views:u}=fn(n);return e.has("eabUserPreview")&&L("eabUserPreview","true"),e.has("abtid")&&o&&ae("eabPreviewTestId",o),{isPreview:r,previewTestId:o,forcedAssignments:s,previewedViews:u}}function Ct(e,t){if(!t.isPreview)return null;if(t.forcedAssignments[e])return t.forcedAssignments[e];let r=e.slice(-5);return t.forcedAssignments[r]?t.forcedAssignments[r]:null}function xt(){if(!(typeof document>"u")&&(document.cookie="eabUserPreview=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",typeof sessionStorage<"u"&&sessionStorage.removeItem("eabPreviewTestId"),typeof window<"u")){let e=new URL(window.location.href);e.searchParams.delete("eabUserPreview"),e.searchParams.delete("abtid"),e.searchParams.delete("eab_tests"),window.history.replaceState({},"",e.toString())}}function Tt(){return F().isPreview}var ye=oe(()=>{"use strict";B()});function te(){return V("ABTL")||{}}function _r(e){L("ABTL",JSON.stringify(e))}function z(e){return te()[e]||null}function kr(e,t){if(e[t]?.isControl)return-1;let o=0;for(let n=0;n<t;n++)e[n]?.isControl||o++;return o}function mn(e,t){let r=e.every(i=>typeof i.weight=="number"),o=[],n=0;if(r)for(let i of e)n+=i.weight,o.push(n);else{let i=100/e.length;for(let d=0;d<e.length;d++)n+=i,o.push(n)}let u=ht(t)%1e4/100,f=0;for(let i=0;i<o.length;i++)if(u<o[i]){f=i;break}let l=e[f]||e[0],g=kr(e,f);return{...l,isA:g===0,isB:g===1,isC:g===2,isD:g===3}}function yr(e,t){let r=t.findIndex(n=>n.id===e.id),o=kr(t,r);return{...e,isA:o===0,isB:o===1,isC:o===2,isD:o===3}}function Cr(e,t,r,o){if(o?.isPreview){let g=Ct(e,o);if(g){let i=t.variations.find(d=>d.id===g);if(i)return yr(i,t.variations)}}let n=z(e);if(n){let g=t.variations.find(i=>i.id===n);if(g)return yr(g,t.variations)}let s=t.variations.filter(g=>!g.isDone);if(s.length===0)return null;let u=t.isPersonalization,f;u?f=s.find(i=>!i.isControl)||s[0]:f=mn(s,r);let l=te();return l[e]=f.id,_r(l),f}function vr(e){return typeof e.testTrafficPercentage=="number"}function Pt(e,t){let r=se(),o=e.tests,n=te();for(let s of o){if(!s.enabled||n[s.testId]||!gn(s.testId,o,n))continue;let u=s.testTrafficPercentage;!t?.isPreview&&typeof u=="number"&&Math.random()*100>=u||(Cr(s.testId,s,r,t??void 0),n=te())}}function gn(e,t,r){let o=Object.keys(r);if(o.length===0)return!0;if(o.some(u=>{let f=t.find(l=>l.testId===u);return f&&vr(f)}))return!1;let s=t.find(u=>u.testId===e);return s?!vr(s):!0}var G=oe(()=>{"use strict";B();Me();ye()});var Je,Et=oe(()=>{"use strict";Je=`#graphql
|
|
2
|
+
"use strict";var en=Object.create;var Be=Object.defineProperty;var tn=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,on=Object.prototype.hasOwnProperty;var oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var an=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fr=(e,t)=>{for(var r in t)Be(e,r,{get:t[r],enumerable:!0})},pr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of rn(t))!on.call(e,n)&&n!==r&&Be(e,n,{get:()=>t[n],enumerable:!(o=tn(t,n))||o.enumerable});return e};var De=(e,t,r)=>(r=e!=null?en(nn(e)):{},pr(t||!e||!e.__esModule?Be(r,"default",{value:e,enumerable:!0}):r,e)),sn=e=>pr(Be({},"__esModule",{value:!0}),e);function ht(e){let t=0;for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);t=(t<<5)-t+o,t=t&t}return Math.abs(t)}function mr(e){let t=[];for(let[r,o]of Object.entries(e.allTests)){if(!o.data.isLive)continue;let n=[],s=0;for(let[u,p]of Object.entries(o)){if(u==="data")continue;let l=p;if(typeof l=="object"&&l!==null&&"variationName"in l){let g=!!l.isControl,i=l.content,d;i&&typeof i=="object"&&(d={changes:i.changes||[],elements:i.elements||[],blocks:i.blocks||[],customCodes:i.customCodes||[]});let a=l.customCode,c;a&&typeof a=="object"&&a.id&&(c={id:a.id,js:a.js,css:a.css,pathnames:a.pathnames||[],excludePathnames:a.excludePathnames}),n.push({id:u,name:l.variationName,weight:l.trafficPercentage,isControl:g,productId:l.id,handle:l.handle,price:l.price,prices:l.prices,splitUrlTestLinks:l.splitUrlTestLinks,content:d,customCode:c,isA:!g&&s===0,isB:!g&&s===1,isC:!g&&s===2,isD:!g&&s===3}),g||s++}}n.length>0&&t.push({testId:r,name:o.data.name,enabled:o.data.isLive,type:o.data.type,variations:n,data:o.data})}return{tests:t,selectors:e.selectors}}var Me=oe(()=>{"use strict"});var gr=an((he,He)=>{"use strict";(function(e,t){"use strict";var r="1.0.41",o="",n="?",s="function",u="undefined",p="object",l="string",g="major",i="model",d="name",a="type",c="vendor",f="version",_="architecture",k="console",m="mobile",w="tablet",y="smarttv",A="wearable",D="embedded",$=500,Z="Amazon",W="Apple",N="ASUS",de="BlackBerry",Se="Browser",Ie="Chrome",Yr="Edge",Ue="Firefox",Re="Google",er="Honor",tr="Huawei",Qr="Lenovo",Ve="LG",ut="Microsoft",dt="Motorola",lt="Nvidia",rr="OnePlus",le="Opera",ft="OPPO",fe="Samsung",nr="Sharp",pe="Sony",pt="Xiaomi",mt="Zebra",or="Facebook",ir="Chromium OS",ar="Mac OS",sr=" Browser",Xr=function(v,C){var h={};for(var T in v)C[T]&&C[T].length%2===0?h[T]=C[T].concat(v[T]):h[T]=v[T];return h},Oe=function(v){for(var C={},h=0;h<v.length;h++)C[v[h].toUpperCase()]=v[h];return C},cr=function(v,C){return typeof v===l?me(C).indexOf(me(v))!==-1:!1},me=function(v){return v.toLowerCase()},Kr=function(v){return typeof v===l?v.replace(/[^\d\.]/g,o).split(".")[0]:t},gt=function(v,C){if(typeof v===l)return v=v.replace(/^\s\s*/,o),typeof C===u?v:v.substring(0,$)},ge=function(v,C){for(var h=0,T,q,M,x,b,H;h<C.length&&!b;){var wt=C[h],lr=C[h+1];for(T=q=0;T<wt.length&&!b&&wt[T];)if(b=wt[T++].exec(v),b)for(M=0;M<lr.length;M++)H=b[++q],x=lr[M],typeof x===p&&x.length>0?x.length===2?typeof x[1]==s?this[x[0]]=x[1].call(this,H):this[x[0]]=x[1]:x.length===3?typeof x[1]===s&&!(x[1].exec&&x[1].test)?this[x[0]]=H?x[1].call(this,H,x[2]):t:this[x[0]]=H?H.replace(x[1],x[2]):t:x.length===4&&(this[x[0]]=H?x[3].call(this,H.replace(x[1],x[2])):t):this[x]=H||t;h+=2}},we=function(v,C){for(var h in C)if(typeof C[h]===p&&C[h].length>0){for(var T=0;T<C[h].length;T++)if(cr(C[h][T],v))return h===n?t:h}else if(cr(C[h],v))return h===n?t:h;return C.hasOwnProperty("*")?C["*"]:v},Zr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ur={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"},dr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,f],[/opios[\/ ]+([\w\.]+)/i],[f,[d,le+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[d,le+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[d,le]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[d,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[f,[d,"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],[d,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[d,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[d,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[d,"UC"+Se]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[d,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[d,"Smart Lenovo "+Se]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+Se],f],[/\bfocus\/([\w\.]+)/i],[f,[d,Ue+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[d,le+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[d,le+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[d,"MIUI"+sr]],[/fxios\/([\w\.-]+)/i],[f,[d,Ue]],[/\bqihoobrowser\/?([\w\.]*)/i],[f,[d,"360"]],[/\b(qq)\/([\w\.]+)/i],[[d,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1"+sr],f],[/samsungbrowser\/([\w\.]+)/i],[f,[d,fe+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[f,[d,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[d,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[d,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[d],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[f,d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,or],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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],[d,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[d,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[d,Ie+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,Ie+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[d,"Android "+Se]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[f,we,Zr]],[/(webkit|khtml)\/([\w\.]+)/i],[d,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],f],[/(wolvic|librewolf)\/([\w\.]+)/i],[d,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[d,Ue+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[d,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[d,[f,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[_,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[_,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[_,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[_,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[_,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[_,/ower/,o,me]],[/ sun4\w[;\)]/i],[[_,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[_,me]]],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],[i,[c,fe],[a,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[i,[c,fe],[a,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[i,[c,W],[a,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[i,[c,W],[a,w]],[/(macintosh);/i],[i,[c,W]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[i,[c,nr],[a,m]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[i,[c,er],[a,w]],[/honor([-\w ]+)[;\)]/i],[i,[c,er],[a,m]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[i,[c,tr],[a,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[i,[c,tr],[a,m]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[i,/_/g," "],[c,pt],[a,w]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[i,/_/g," "],[c,pt],[a,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[i,[c,ft],[a,m]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[i,[c,we,{OnePlus:["304","403","203"],"*":ft}],[a,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[i,[c,"Vivo"],[a,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[i,[c,"Realme"],[a,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[i,[c,dt],[a,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[i,[c,dt],[a,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[i,[c,Ve],[a,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[i,[c,Ve],[a,m]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[i,[c,Qr],[a,w]],[/(nokia) (t[12][01])/i],[c,i,[a,w]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[i,/_/g," "],[a,m],[c,"Nokia"]],[/(pixel (c|tablet))\b/i],[i,[c,Re],[a,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[i,[c,Re],[a,m]],[/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],[i,[c,pe],[a,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[i,"Xperia Tablet"],[c,pe],[a,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[i,[c,rr],[a,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[i,[c,Z],[a,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[i,/(.+)/g,"Fire Phone $1"],[c,Z],[a,m]],[/(playbook);[-\w\),; ]+(rim)/i],[i,c,[a,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[i,[c,de],[a,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[i,[c,N],[a,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[i,[c,N],[a,m]],[/(nexus 9)/i],[i,[c,"HTC"],[a,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[c,[i,/_/g," "],[a,m]],[/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],[i,[c,"TCL"],[a,w]],[/(itel) ((\w+))/i],[[c,me],i,[a,we,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[i,[c,"Acer"],[a,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[i,[c,"Meizu"],[a,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[i,[c,"Ulefone"],[a,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[i,[c,"Energizer"],[a,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[i,[c,"Cat"],[a,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[i,[c,"Smartfren"],[a,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[i,[c,"Nothing"],[a,m]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[i,[c,"Archos"],[a,w]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[i,[c,"Archos"],[a,m]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[c,i,[a,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[c,i,[a,m]],[/(kobo)\s(ereader|touch)/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],[c,i,[a,w]],[/(surface duo)/i],[i,[c,ut],[a,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[i,[c,"Fairphone"],[a,m]],[/(u304aa)/i],[i,[c,"AT&T"],[a,m]],[/\bsie-(\w*)/i],[i,[c,"Siemens"],[a,m]],[/\b(rct\w+) b/i],[i,[c,"RCA"],[a,w]],[/\b(venue[\d ]{2,7}) b/i],[i,[c,"Dell"],[a,w]],[/\b(q(?:mv|ta)\w+) b/i],[i,[c,"Verizon"],[a,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[i,[c,"Barnes & Noble"],[a,w]],[/\b(tm\d{3}\w+) b/i],[i,[c,"NuVision"],[a,w]],[/\b(k88) b/i],[i,[c,"ZTE"],[a,w]],[/\b(nx\d{3}j) b/i],[i,[c,"ZTE"],[a,m]],[/\b(gen\d{3}) b.+49h/i],[i,[c,"Swiss"],[a,m]],[/\b(zur\d{3}) b/i],[i,[c,"Swiss"],[a,w]],[/\b((zeki)?tb.*\b) b/i],[i,[c,"Zeki"],[a,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],i,[a,w]],[/\b(ns-?\w{0,9}) b/i],[i,[c,"Insignia"],[a,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[i,[c,"NextBook"],[a,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],i,[a,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],i,[a,m]],[/\b(ph-1) /i],[i,[c,"Essential"],[a,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[i,[c,"Envizen"],[a,w]],[/\b(trio[-\w\. ]+) b/i],[i,[c,"MachSpeed"],[a,w]],[/\btu_(1491) b/i],[i,[c,"Rotor"],[a,w]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[i,[c,lt],[a,w]],[/(sprint) (\w+)/i],[c,i,[a,m]],[/(kin\.[onetw]{3})/i],[[i,/\./g," "],[c,ut],[a,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[i,[c,mt],[a,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[i,[c,mt],[a,m]],[/smart-tv.+(samsung)/i],[c,[a,y]],[/hbbtv.+maple;(\d+)/i],[[i,/^/,"SmartTV"],[c,fe],[a,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,Ve],[a,y]],[/(apple) ?tv/i],[c,[i,W+" TV"],[a,y]],[/crkey/i],[[i,Ie+"cast"],[c,Re],[a,y]],[/droid.+aft(\w+)( bui|\))/i],[i,[c,Z],[a,y]],[/(shield \w+ tv)/i],[i,[c,lt],[a,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[i,[c,nr],[a,y]],[/(bravia[\w ]+)( bui|\))/i],[i,[c,pe],[a,y]],[/(mi(tv|box)-?\w+) bui/i],[i,[c,pt],[a,y]],[/Hbbtv.*(technisat) (.*);/i],[c,i,[a,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[c,gt],[i,gt],[a,y]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[i,[a,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[a,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,i,[a,k]],[/droid.+; (shield)( bui|\))/i],[i,[c,lt],[a,k]],[/(playstation \w+)/i],[i,[c,pe],[a,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[i,[c,ut],[a,k]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[i,[c,fe],[a,A]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[c,i,[a,A]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[i,[c,ft],[a,A]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[i,[c,W],[a,A]],[/(opwwe\d{3})/i],[i,[c,rr],[a,A]],[/(moto 360)/i],[i,[c,dt],[a,A]],[/(smartwatch 3)/i],[i,[c,pe],[a,A]],[/(g watch r)/i],[i,[c,Ve],[a,A]],[/droid.+; (wt63?0{2,3})\)/i],[i,[c,mt],[a,A]],[/droid.+; (glass) \d/i],[i,[c,Re],[a,A]],[/(pico) (4|neo3(?: link|pro)?)/i],[c,i,[a,A]],[/; (quest( \d| pro)?)/i],[i,[c,or],[a,A]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[a,D]],[/(aeobc)\b/i],[i,[c,Z],[a,D]],[/(homepod).+mac os/i],[i,[c,W],[a,D]],[/windows iot/i],[[a,D]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[i,[a,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[i,[a,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[a,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[a,m]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[i,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[d,Yr+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[d,f],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[d,"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],[d,f],[/ladybird\//i],[[d,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,f],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[d,[f,we,ur]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,we,ur],[d,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,ar],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,d],[/(ubuntu) ([\w\.]+) like android/i],[[d,/(.+)/,"$1 Touch"],f],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[d,f],[/\(bb(10);/i],[f,[d,de]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[f,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[d,Ue+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[d,Ie+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,ir],f],[/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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,f],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,f]]},O=function(v,C){if(typeof v===p&&(C=v,v=t),!(this instanceof O))return new O(v,C).getResult();var h=typeof e!==u&&e.navigator?e.navigator:t,T=v||(h&&h.userAgent?h.userAgent:o),q=h&&h.userAgentData?h.userAgentData:t,M=C?Xr(dr,C):dr,x=h&&h.userAgent==T;return this.getBrowser=function(){var b={};return b[d]=t,b[f]=t,ge.call(b,T,M.browser),b[g]=Kr(b[f]),x&&h&&h.brave&&typeof h.brave.isBrave==s&&(b[d]="Brave"),b},this.getCPU=function(){var b={};return b[_]=t,ge.call(b,T,M.cpu),b},this.getDevice=function(){var b={};return b[c]=t,b[i]=t,b[a]=t,ge.call(b,T,M.device),x&&!b[a]&&q&&q.mobile&&(b[a]=m),x&&b[i]=="Macintosh"&&h&&typeof h.standalone!==u&&h.maxTouchPoints&&h.maxTouchPoints>2&&(b[i]="iPad",b[a]=w),b},this.getEngine=function(){var b={};return b[d]=t,b[f]=t,ge.call(b,T,M.engine),b},this.getOS=function(){var b={};return b[d]=t,b[f]=t,ge.call(b,T,M.os),x&&!b[d]&&q&&q.platform&&q.platform!="Unknown"&&(b[d]=q.platform.replace(/chrome os/i,ir).replace(/macos/i,ar)),b},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 T},this.setUA=function(b){return T=typeof b===l&&b.length>$?gt(b,$):b,this},this.setUA(T),this};O.VERSION=r,O.BROWSER=Oe([d,f,g]),O.CPU=Oe([_]),O.DEVICE=Oe([i,c,a,k,m,y,w,A,D]),O.ENGINE=O.OS=Oe([d,f]),typeof he!==u?(typeof He!==u&&He.exports&&(he=He.exports=O),he.UAParser=O):typeof define===s&&define.amd?define(function(){return O}):typeof e!==u&&(e.UAParser=O);var ne=typeof e!==u&&(e.jQuery||e.Zepto);if(ne&&!ne.ua){var Le=new O;ne.ua=Le.getResult(),ne.ua.get=function(){return Le.getUA()},ne.ua.set=function(v){Le.setUA(v);var C=Le.getResult();for(var h in C)ne.ua[h]=C[h]}}})(typeof window=="object"?window:he)});function ie(){try{if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){let e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(r=>r.toString(16).padStart(2,"0"));return[t.slice(0,4).join(""),t.slice(4,6).join(""),t.slice(6,8).join(""),t.slice(8,10).join(""),t.slice(10,16).join("")].join("-")}}catch(e){console.warn("[ElevateAB] Crypto UUID generation failed, falling back to Math.random()",e)}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function L(e,t){if(typeof document>"u")return;let r=new Date;r.setTime(r.getTime()+365*24*60*60*1e3);let o="; expires="+r.toUTCString();document.cookie=e+"="+(t||"")+o+"; path=/"}function I(e){if(typeof document>"u")return null;let t=e+"=",r=document.cookie.split(";");for(let o=0;o<r.length;o++){let n=r[o];for(;n.charAt(0)===" ";)n=n.substring(1,n.length);if(n.indexOf(t)===0)return n.substring(t.length,n.length)}return null}function V(e){let t=I(e);if(t)try{return JSON.parse(t)}catch(r){return console.error("[ElevateAB] Error parsing JSON from cookie",r),null}return null}function ae(e,t){typeof sessionStorage>"u"||sessionStorage.setItem(e,JSON.stringify(t))}function ee(e){return typeof sessionStorage>"u"?null:sessionStorage.getItem(e)}function kt(e){let t=ee(e);return t?JSON.parse(t):null}function br(){let e=I("eabUserId");return e||(e=ie(),L("eabUserId",e)),e}function se(){return br()}function hr(){let e=ee("eabSessionId");return e||(e=ie(),ae("eabSessionId",e)),e}function We(){return hr()}function Ge(){return{referrer:ee("eabReferrer")||"",entryPage:ee("eabEntry")||""}}var B=oe(()=>{"use strict"});function pn(e){let t={},r={};if(!e)return{assignments:t,views:r};let o=e.split("~");for(let n of o){let s=n.split("_");if(s.length>=2){let u=s[0],p=s[1],l=s[2]==="1";t[u]=p,r[u]=l}}return{assignments:t,views:r}}function F(){if(typeof window>"u")return{isPreview:!1,previewTestId:null,forcedAssignments:{},previewedViews:{}};let e=new URLSearchParams(window.location.search),r=(e.get("eabUserPreview")||I("eabUserPreview"))==="true",o=e.get("abtid");o||(o=ee("eabPreviewTestId"));let n=e.get("eab_tests")||"",{assignments:s,views:u}=pn(n);return e.has("eabUserPreview")&&L("eabUserPreview","true"),e.has("abtid")&&o&&ae("eabPreviewTestId",o),{isPreview:r,previewTestId:o,forcedAssignments:s,previewedViews:u}}function Ct(e,t){if(!t.isPreview)return null;if(t.forcedAssignments[e])return t.forcedAssignments[e];let r=e.slice(-5);return t.forcedAssignments[r]?t.forcedAssignments[r]:null}function xt(){if(!(typeof document>"u")&&(document.cookie="eabUserPreview=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",typeof sessionStorage<"u"&&sessionStorage.removeItem("eabPreviewTestId"),typeof window<"u")){let e=new URL(window.location.href);e.searchParams.delete("eabUserPreview"),e.searchParams.delete("abtid"),e.searchParams.delete("eab_tests"),window.history.replaceState({},"",e.toString())}}function Tt(){return F().isPreview}var ye=oe(()=>{"use strict";B()});function te(){return V("ABTL")||{}}function _r(e){L("ABTL",JSON.stringify(e))}function z(e){return te()[e]||null}function kr(e,t){if(e[t]?.isControl)return-1;let o=0;for(let n=0;n<t;n++)e[n]?.isControl||o++;return o}function mn(e,t){let r=e.every(i=>typeof i.weight=="number"),o=[],n=0;if(r)for(let i of e)n+=i.weight,o.push(n);else{let i=100/e.length;for(let d=0;d<e.length;d++)n+=i,o.push(n)}let u=ht(t)%1e4/100,p=0;for(let i=0;i<o.length;i++)if(u<o[i]){p=i;break}let l=e[p]||e[0],g=kr(e,p);return{...l,isA:g===0,isB:g===1,isC:g===2,isD:g===3}}function yr(e,t){let r=t.findIndex(n=>n.id===e.id),o=kr(t,r);return{...e,isA:o===0,isB:o===1,isC:o===2,isD:o===3}}function Cr(e,t,r,o){if(o?.isPreview){let g=Ct(e,o);if(g){let i=t.variations.find(d=>d.id===g);if(i)return yr(i,t.variations)}}let n=z(e);if(n){let g=t.variations.find(i=>i.id===n);if(g)return yr(g,t.variations)}let s=t.variations.filter(g=>!g.isDone);if(s.length===0)return null;let u=t.isPersonalization,p;u?p=s.find(i=>!i.isControl)||s[0]:p=mn(s,r);let l=te();return l[e]=p.id,_r(l),p}function vr(e){return typeof e.testTrafficPercentage=="number"}function Pt(e,t){let r=se(),o=e.tests,n=te();for(let s of o){if(!s.enabled||n[s.testId]||!gn(s.testId,o,n))continue;let u=s.testTrafficPercentage;!t?.isPreview&&typeof u=="number"&&Math.random()*100>=u||(Cr(s.testId,s,r,t??void 0),n=te())}}function gn(e,t,r){let o=Object.keys(r);if(o.length===0)return!0;if(o.some(u=>{let p=t.find(l=>l.testId===u);return p&&vr(p)}))return!1;let s=t.find(u=>u.testId===e);return s?!vr(s):!0}var G=oe(()=>{"use strict";B();Me();ye()});var Je,Et=oe(()=>{"use strict";Je=`#graphql
|
|
3
3
|
mutation cartAttributesUpdate($cartId: ID!, $attributes: [AttributeInput!]!) {
|
|
4
4
|
cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {
|
|
5
5
|
cart {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`});var Pr={};pr(Pr,{cleanupCartAttributes:()=>xr,getCartAttributesPayload:()=>At,updateCartAttributes:()=>St});function At(){let e=te(),t=V("ABAU")||{},r=I("eabUserId"),o=I("eabUserPreview")==="true",n=I("abtid"),s={};for(let f in e)t[f]&&(s[f]=e[f]);let u=[{key:"_eabTestsList",value:JSON.stringify(s)},{key:"_eabUserId",value:r||""},{key:"_eabList",value:JSON.stringify(e)}];return o&&n&&u.push({key:"_eabPreviewTest",value:n}),u}async function St(e,t={}){if(typeof window>"u")return{success:!1,error:"Not in browser environment"};if(!t.storefrontAccessToken&&!t.storefrontApiUrl)return console.warn("[ElevateAB] Missing storefrontAccessToken. For Next.js/non-Hydrogen stores, you must provide a Storefront Access Token. This token is SAFE to use client-side - it's a public token with limited permissions. Get it from: Shopify Admin \u2192 Settings \u2192 Apps \u2192 Develop apps"),{success:!1,error:"Missing storefrontAccessToken. Required for direct Storefront API calls."};try{let r=At(),o=e.startsWith("gid://")?e:`gid://shopify/Cart/${e}`,n=t.storefrontApiUrl||`https://${Tr()}/api/2025-01/graphql.json`,s=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.storefrontAccessToken},body:JSON.stringify({query:Je,variables:{cartId:o,attributes:r}})});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);let u=await s.json();if(u.errors||u.data?.cartAttributesUpdate?.userErrors?.length>0){let f=u.errors?.[0]?.message||u.data?.cartAttributesUpdate?.userErrors?.[0]?.message||"Unknown error";return console.error("[ElevateAB] Cart attributes update failed:",f),{success:!1,error:f}}return{success:!0}}catch(r){return console.error("[ElevateAB] Error updating cart attributes:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error"}}}async function xr(e,t={}){if(typeof window>"u")return{success:!1,error:"Not in browser environment"};if(!t.storefrontAccessToken&&!t.storefrontApiUrl)return{success:!1,error:"Missing storefrontAccessToken. Required for direct Storefront API calls."};try{let r=e.startsWith("gid://")?e:`gid://shopify/Cart/${e}`,o=[{key:"_eabTestsList",value:""},{key:"_eabUserId",value:""},{key:"_eabList",value:""},{key:"_eabPreviewTest",value:""}],n=t.storefrontApiUrl||`https://${Tr()}/api/2025-01/graphql.json`,s=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.storefrontAccessToken},body:JSON.stringify({query:Je,variables:{cartId:r,attributes:o}})});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);let u=await s.json();if(u.errors||u.data?.cartAttributesUpdate?.userErrors?.length>0){let f=u.errors?.[0]?.message||u.data?.cartAttributesUpdate?.userErrors?.[0]?.message||"Unknown error";return console.error("[ElevateAB] Cart attributes cleanup failed:",f),{success:!1,error:f}}return{success:!0}}catch(r){return console.error("[ElevateAB] Error cleaning up cart attributes:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error"}}}function Tr(){return typeof window>"u"?"":window.location.hostname}var Ye=oe(()=>{"use strict";G();B();Et()});var jn={};pr(jn,{ElevateNextProvider:()=>Fr,ProductViewTracker:()=>$r,clearPreviewMode:()=>xt,extractShopifyId:()=>U,extractShopifyType:()=>yt,getCountryCode:()=>X,getPreviewState:()=>F,isInPreviewMode:()=>Tt,isShopifyGid:()=>vt,matchesGeoTargeting:()=>Dt,trackAddToCart:()=>It,trackCartView:()=>Rt,trackCheckoutCompleted:()=>Lt,trackCheckoutStarted:()=>Ot,trackPageView:()=>_e,trackProductView:()=>ke,trackRemoveFromCart:()=>Ut,trackSearchSubmitted:()=>Vt,useElevateConfig:()=>be,useExperiment:()=>Kt});module.exports=sn(jn);var Ae=require("react");var R=De(require("react"),1);var bt=De(require("react"),1),Ne=bt.default.createContext(null);function be(){let e=bt.default.useContext(Ne);if(e===null)throw new Error("useElevateConfig must be used within ElevateProvider");return e}Me();function U(e){return e?e.includes("gid://")&&e.split("/").pop()||e:""}function yt(e){return!e||!e.includes("gid://")?null:e.split("/")[3]||null}function vt(e){return!!e&&e.startsWith("gid://shopify/")}var _t=De(gr(),1),wr={"facebook.com":"Facebook","fb.me":"Facebook","m.facebook.com":"Facebook","l.facebook.com":"Facebook","lm.facebook.com":"Facebook","instagram.com":"Instagram","l.instagram.com":"Instagram","youtube.com":"Youtube","youtu.be":"Youtube","m.youtube.com":"Youtube","bing.com":"Bing","www.bing.com":"Bing","msnbc.msn.com":"Bing","dizionario.it.msn.com":"Bing","cc.bingj.com":"Bing","m.bing.com":"Bing","twitter.com":"Twitter","t.co":"Twitter"};function E(e){return typeof e!="string"?String(e):e.replace(/[\\"'`\x00-\x1F\x7F]/g,"")}function P(e){if(e==null)return null;let t=typeof e=="string"?parseFloat(e):Number(e);return isNaN(t)?null:+(Math.round(+(t+"e2"))+"e-2")}function ze(e){if(!e)return null;let t=/gid:\/\/shopify\/Cart\/([^?]+(\?.+)?)/,r=e.match(t);return r?r[1]:null}function qe(e){try{return typeof e!="string"?null:decodeURIComponent(e).split("?")[0]}catch{return e||null}}function cn(e){if(!e)return"";switch(e){case"Mobile Safari":return"Safari";case"Chrome Mobile":case"Chrome Mobile iOS":return"Chrome";case"Firefox Mobile":case"Firefox Mobile iOS":return"Firefox";case"Opera Mobile":case"Opera Mini":case"Opera Mini iOS":return"Opera";case"Yandex Browser Lite":return"Yandex Browser";case"Chrome Webview":case"Mobile App":return"Mobile App";default:return e}}function un(e){let t={};return e.searchParams.forEach((r,o)=>{t[o]||(t[o]=r)}),t}function dn(e){return!!e.host&&["http:","https:"].includes(e.protocol)}function ln(e){return e.replace(/^www\./,"")}function pn(e,t,r){if(t&&{Facebook:"Facebook",Instagram:"Instagram"}[t])return t;let n,s;try{if(e&&e.trim()!=="")n=new URL(e);else return"Direct";if(n?.hostname&&dn(n)){if(s=n.hostname,r&&r===s)return"Direct"}else return""}catch{}if(!s)return"";let u=ln(s);return u?wr[u]?wr[u]:u?.includes("google")?"Google":u:""}function Fe(e){let{referrer:t,entryPage:r,userAgent:o}=e,n={referrer_source:"",browser_info:"",os_info:"",device_type:"",page_entry_path:"",utm_medium:"",utm_source:"",utm_campaign:"",utm_content:"",utm_term:"",referrer_url:t||"",gclid:"",fbclid:"",pins_campaign_id:"",epik:""};try{let s;if(r&&r.trim()!==""&&r.startsWith("http"))try{let u=new URL(r),f=u?.pathname;s=u?.hostname,f&&(n.page_entry_path=f??"");let l=un(u);n.utm_medium=l.utm_medium??"",n.utm_source=l.utm_source??"",n.utm_campaign=l.utm_campaign??"",n.utm_content=l.utm_content??"",n.utm_term=l.utm_term??"",n.gclid=l.gclid??"",n.fbclid=l.fbclid??"",n.pins_campaign_id=l.pins_campaign_id??"",n.epik=l.epik??""}catch{}if(o){let u=(0,_t.UAParser)(o),f=u?.browser?.name,l=cn(f);n.browser_info=l??"",n.os_info=u?.os?.name??"",o&&(n.device_type=(u?.device?.type||"desktop")?.toUpperCase()??"")}return n.referrer_source=pn(t,n?.browser_info,s)??"",n}catch{return n}}function je(e,t){let r=e==="/"||e==="",n=t&&/^\/[a-z]{2}(-[a-z]{2})?\/?$/i.test(e);return r||n?"index":/\/products\//.test(e)?"product":/\/collections\//.test(e)?"collection":/\/pages\//.test(e)?"page":/\/search/.test(e)?"search":/\/cart/.test(e)?"cart":/\/checkouts\//.test(e)?"checkout":"unknown"}function $e(e){if(!e)return"";try{let t=(0,_t.UAParser)(e),r=t?.os,o=t?.device,n="";return r?.name&&(n+=r.name,r.version&&(n+=` ${r.version}`)),o?.type&&(n+=n?` (${o.type})`:o.type),o?.vendor&&(n+=n?` ${o.vendor}`:o.vendor),o?.model&&(n+=n?` ${o.model}`:o.model),n||e}catch{return e}}B();var Bt=require("react"),wn="https://bitter-river-9c62.support-67d.workers.dev",bn="https://d339co84ntxcme.cloudfront.net/Prod/orders",S=null;function ve(e){S=e}function J(e){let t=e?.storeId||S?.storeId;return t||(console.warn("[ElevateAB] No storeId provided. Call initAnalytics() first or pass storeId to tracking function."),"")}function hn(e){return Object.entries(e).filter(([,t])=>typeof t=="string").map(([t,r])=>({test_id:t,variant_id:r}))}function yn(e,t){return Object.entries(e).filter(([r])=>typeof t[r]=="string").map(([r])=>({test_id:r,variant_id:t[r]}))}function vn(){return typeof window>"u"?!1:I("eabUserPreview")==="true"||new URLSearchParams(window.location.search).get("eabUserPreview")==="true"}function Y(e,t,r){if(typeof window>"u"||vn())return null;let o=navigator.userAgent,n=window.location.pathname,s=je(n,r),{referrer:u,entryPage:f}=Ge(),l=Fe({referrer:u,entryPage:f,userAgent:o}),g=V("ABTL")||{},i=V("ABAU")||{},d=hn(g),a=yn(i,g),c=ze(localStorage.getItem("shopifyCartId")),p=new Date().toISOString(),_=sessionStorage.getItem("eabIsFirstVisit")==="true",k=I("localization")||"";return{pixel_event_id:`sh-${ie()}`,shop_name:e,timestamp:p,event_type:t,client_id:I("_shopify_y")||void 0,visitor_id:se(),session_id:We(),cart_token:qe(c||I("cart")),page_url:window.location.href,page_pathname:n,page_search:window.location.search,referrer_url:u,referrer_source:l?.referrer_source,previous_page:document.referrer,page_entry:f,page_entry_path:l?.page_entry_path,page_type:s,utm_medium:l?.utm_medium,utm_source:l?.utm_source,utm_campaign:l?.utm_campaign,utm_content:l?.utm_content,utm_term:l?.utm_term,gclid:l?.gclid,fbclid:l?.fbclid,pins_campaign_id:l?.pins_campaign_id,epik:l?.epik,browser_info:l?.browser_info,os_info:l?.os_info,device_type:l?.device_type,language:navigator.language,root_route:localStorage.getItem("eabRootRoute")||"",user_agent:o,user_agent_no_browser:$e(o),is_first_visit:_,shopify_country:k,ab_test_assignments:d,ab_test_views:a,is_first_order:null}}async function Q(e,t=wn){try{let r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0});if(!r.ok)throw new Error(`Worker error: ${r.status}`)}catch(r){console.error("[ElevateAB] Error sending analytics:",r)}}async function _e(e={}){let t=J(e);if(!t)return;let r=e.hasLocalizedPaths??S?.hasLocalizedPaths,o=e.workerUrl??S?.workerUrl,n=Y(t,"page_viewed",r);if(!n)return;let s={...n,cart_currency:e.currency};await Q(s,o)}async function ke(e){let t=J(e);if(!t)return;let{productId:r,productVendor:o,productPrice:n,productSku:s,currency:u}=e,f=e.hasLocalizedPaths??S?.hasLocalizedPaths,l=e.workerUrl??S?.workerUrl,g=Y(t,"product_viewed",f);if(!g)return;let i={...g,cart_currency:u,product_id:U(r),product_vendor:E(o),product_price:P(n),product_sku:E(s)};await Q(i,l)}async function It(e){let t=J(e);if(!t)return;let{productId:r,variantId:o,productVendor:n,productPrice:s,productQuantity:u,productSku:f,currency:l,cartId:g}=e,i=e.hasLocalizedPaths??S?.hasLocalizedPaths,d=e.workerUrl??S?.workerUrl,a=e.storefrontAccessToken??S?.storefrontAccessToken,c=Y(t,"product_added_to_cart",i);if(!c)return;let p={...c,cart_currency:l,product_id:U(r),variant_id:U(o),product_vendor:E(n),product_price:P(s),product_quantity:u,product_sku:E(f)};if(await Q(p,d),g&&a)try{let{updateCartAttributes:_}=await Promise.resolve().then(()=>(Ye(),Pr));await _(g,{storefrontAccessToken:a})}catch(_){console.error("[ElevateAB] Failed to update cart attributes:",_)}}async function Ut(e){let t=J(e);if(!t)return;let{productId:r,variantId:o,productVendor:n,productPrice:s,productQuantity:u,productSku:f,currency:l}=e,g=e.hasLocalizedPaths??S?.hasLocalizedPaths,i=e.workerUrl??S?.workerUrl,d=Y(t,"product_removed_from_cart",g);if(!d)return;let a={...d,cart_currency:l,product_id:U(r),variant_id:U(o),product_vendor:E(n),product_price:P(s),product_quantity:u,product_sku:E(f)};await Q(a,i)}async function Rt(e){let t=J(e);if(!t)return;let{cartTotalPrice:r,cartTotalQuantity:o,cartItems:n,currency:s}=e,u=e.hasLocalizedPaths??S?.hasLocalizedPaths,f=e.workerUrl??S?.workerUrl,l=Y(t,"cart_viewed",u);if(!l)return;let g={...l,cart_currency:s,cart_total_price:P(r),cart_total_quantity:o,cart_items:n?.map(i=>({product_id:U(i.productId),variant_id:U(i.variantId),product_vendor:E(i.productVendor)||"",product_price:P(i.productPrice),product_quantity:i.productQuantity??null,product_sku:E(i.productSku)||""}))};await Q(g,f)}async function Vt(e){let t=J(e);if(!t)return;let{searchQuery:r,currency:o}=e,n=e.hasLocalizedPaths??S?.hasLocalizedPaths,s=e.workerUrl??S?.workerUrl,u=Y(t,"search_submitted",n);if(!u)return;let f={...u,cart_currency:o,search_query:E(r)};await Q(f,s)}async function Ot(e){let t=J(e);if(!t)return;let{cartTotalPrice:r,cartSubtotalPrice:o,cartShippingPrice:n,cartTaxAmount:s,cartDiscountAmount:u,customerId:f,cartItems:l,currency:g}=e,i=e.hasLocalizedPaths??S?.hasLocalizedPaths,d=e.workerUrl??S?.workerUrl,a=Y(t,"checkout_started",i);if(!a)return;let c=0,p=l?.map(k=>{let m=k.productQuantity??0;return c+=m,{product_id:U(k.productId),variant_id:U(k.variantId),product_vendor:E(k.productVendor)||"",vendor:E(k.productVendor)||"",product_price:P(k.productPrice),total_price:P(k.productPrice),product_quantity:m,quantity:m,product_sku:E(k.productSku)||"",sku:E(k.productSku)||"",total_discount:P(k.totalDiscount)}})||[],_={...a,cart_currency:g,cart_total_price:P(r),cart_subtotal_price:P(o),cart_total_quantity:c,cart_shipping_price:P(n),cart_tax_amount:P(s),cart_discount_amount:P(u),cart_items:p,customer_id:f};await Q(_,d)}async function Lt(e){let t=J(e);if(!t)return;let{orderId:r,cartTotalPrice:o,cartSubtotalPrice:n,cartShippingPrice:s,cartTaxAmount:u,cartDiscountAmount:f,customerId:l,isFirstOrder:g,noteAttributes:i,cartItems:d,currency:a}=e,c=e.hasLocalizedPaths??S?.hasLocalizedPaths,p=e.ordersWorkerUrl??S?.ordersWorkerUrl??bn,_=Y(t,"checkout_completed",c);if(!_)return;let k=0,m=d?.map(y=>{let A=y.productQuantity??0;return k+=A,{product_id:U(y.productId),variant_id:U(y.variantId),product_vendor:E(y.productVendor)||"",vendor:E(y.productVendor)||"",product_price:P(y.productPrice),total_price:P(y.productPrice),product_quantity:A,quantity:A,product_sku:E(y.productSku)||"",sku:E(y.productSku)||"",total_discount:P(y.totalDiscount)}})||[],w={..._,cart_currency:a,cart_total_price:P(o),cart_subtotal_price:P(n),cart_total_quantity:k,cart_shipping_price:P(s),cart_tax_amount:P(u),cart_discount_amount:P(f),cart_items:m,order_id:r,customer_id:l,is_first_order:g??null,note_attributes:i};await Q(w,p)}ye();B();var Qe={SHOPIFY_LOCALIZATION:"localization",EAB_COUNTRY:"eabCountryCode",EAB_GEO:"eabGeoLocation"};function X(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search).get("country");if(t)return L(Qe.EAB_COUNTRY,t.toUpperCase()),t.toUpperCase();let r=I(Qe.SHOPIFY_LOCALIZATION);if(r)return r.toUpperCase();let o=I(Qe.EAB_COUNTRY);if(o)return o.toUpperCase();if(typeof localStorage<"u"){let n=localStorage.getItem(Qe.EAB_COUNTRY);if(n)return n.toUpperCase()}return null}function Er(e,t){let r=t??X();return r?e.map(n=>n.toUpperCase()).includes(r.toUpperCase()):!1}function Ar(e,t){let r=t??X();return r?e.map(n=>n.toUpperCase()).includes(r.toUpperCase()):!1}function Dt(e){let t=X();return!e.includeCountries?.length&&!e.excludeCountries?.length?!0:!t||e.excludeCountries?.length&&Ar(e.excludeCountries,t)?!1:e.includeCountries?.length?Er(e.includeCountries,t):!0}G();B();var Xe="eab:navigate",Ke=!1,Nt=0,Ce=null,xe=null;function _n(){typeof window>"u"||(Nt++,!Ke&&(Ke=!0,Ce=history.pushState.bind(history),xe=history.replaceState.bind(history),history.pushState=function(...e){Ce(...e),window.dispatchEvent(new Event(Xe))},history.replaceState=function(...e){xe(...e),window.dispatchEvent(new Event(Xe))}))}function kn(){typeof window>"u"||(Nt--,!(Nt>0||!Ke)&&(Ce&&(history.pushState=Ce,Ce=null),xe&&(history.replaceState=xe,xe=null),Ke=!1))}function ce(e){if(typeof window>"u")return()=>{};let t=window.location.href,r=()=>{let o=window.location.href;o!==t&&(t=o,e())};return _n(),window.addEventListener(Xe,r),window.addEventListener("popstate",r),()=>{window.removeEventListener(Xe,r),window.removeEventListener("popstate",r),kn()}}function Mt(e){let{configUrl:t,timeout:r=2e3}=e;return`(function(){
|
|
18
|
+
`});var Pr={};fr(Pr,{cleanupCartAttributes:()=>xr,getCartAttributesPayload:()=>At,updateCartAttributes:()=>St});function At(){let e=te(),t=V("ABAU")||{},r=I("eabUserId"),o=I("eabUserPreview")==="true",n=I("abtid"),s={};for(let p in e)t[p]&&(s[p]=e[p]);let u=[{key:"_eabTestsList",value:JSON.stringify(s)},{key:"_eabUserId",value:r||""},{key:"_eabList",value:JSON.stringify(e)}];return o&&n&&u.push({key:"_eabPreviewTest",value:n}),u}async function St(e,t={}){if(typeof window>"u")return{success:!1,error:"Not in browser environment"};if(!t.storefrontAccessToken&&!t.storefrontApiUrl)return console.warn("[ElevateAB] Missing storefrontAccessToken. For Next.js/non-Hydrogen stores, you must provide a Storefront Access Token. This token is SAFE to use client-side - it's a public token with limited permissions. Get it from: Shopify Admin \u2192 Settings \u2192 Apps \u2192 Develop apps"),{success:!1,error:"Missing storefrontAccessToken. Required for direct Storefront API calls."};try{let r=At(),o=e.startsWith("gid://")?e:`gid://shopify/Cart/${e}`,n=t.storefrontApiUrl||`https://${Tr()}/api/2025-01/graphql.json`,s=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.storefrontAccessToken},body:JSON.stringify({query:Je,variables:{cartId:o,attributes:r}})});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);let u=await s.json();if(u.errors||u.data?.cartAttributesUpdate?.userErrors?.length>0){let p=u.errors?.[0]?.message||u.data?.cartAttributesUpdate?.userErrors?.[0]?.message||"Unknown error";return console.error("[ElevateAB] Cart attributes update failed:",p),{success:!1,error:p}}return{success:!0}}catch(r){return console.error("[ElevateAB] Error updating cart attributes:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error"}}}async function xr(e,t={}){if(typeof window>"u")return{success:!1,error:"Not in browser environment"};if(!t.storefrontAccessToken&&!t.storefrontApiUrl)return{success:!1,error:"Missing storefrontAccessToken. Required for direct Storefront API calls."};try{let r=e.startsWith("gid://")?e:`gid://shopify/Cart/${e}`,o=[{key:"_eabTestsList",value:""},{key:"_eabUserId",value:""},{key:"_eabList",value:""},{key:"_eabPreviewTest",value:""}],n=t.storefrontApiUrl||`https://${Tr()}/api/2025-01/graphql.json`,s=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.storefrontAccessToken},body:JSON.stringify({query:Je,variables:{cartId:r,attributes:o}})});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);let u=await s.json();if(u.errors||u.data?.cartAttributesUpdate?.userErrors?.length>0){let p=u.errors?.[0]?.message||u.data?.cartAttributesUpdate?.userErrors?.[0]?.message||"Unknown error";return console.error("[ElevateAB] Cart attributes cleanup failed:",p),{success:!1,error:p}}return{success:!0}}catch(r){return console.error("[ElevateAB] Error cleaning up cart attributes:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error"}}}function Tr(){return typeof window>"u"?"":window.location.hostname}var Ye=oe(()=>{"use strict";G();B();Et()});var $n={};fr($n,{ElevateNextProvider:()=>Fr,ProductViewTracker:()=>$r,clearPreviewMode:()=>xt,extractShopifyId:()=>R,extractShopifyType:()=>yt,getCountryCode:()=>X,getPreviewState:()=>F,isInPreviewMode:()=>Tt,isShopifyGid:()=>vt,matchesGeoTargeting:()=>Dt,trackAddToCart:()=>It,trackCartView:()=>Rt,trackCheckoutCompleted:()=>Lt,trackCheckoutStarted:()=>Ot,trackPageView:()=>_e,trackProductView:()=>ke,trackRemoveFromCart:()=>Ut,trackSearchSubmitted:()=>Vt,useElevateConfig:()=>be,useExperiment:()=>Kt});module.exports=sn($n);var Ae=require("react");var U=De(require("react"),1);var bt=De(require("react"),1),Ne=bt.default.createContext(null);function be(){let e=bt.default.useContext(Ne);if(e===null)throw new Error("useElevateConfig must be used within ElevateProvider");return e}Me();function R(e){return e?e.includes("gid://")&&e.split("/").pop()||e:""}function yt(e){return!e||!e.includes("gid://")?null:e.split("/")[3]||null}function vt(e){return!!e&&e.startsWith("gid://shopify/")}var _t=De(gr(),1),wr={"facebook.com":"Facebook","fb.me":"Facebook","m.facebook.com":"Facebook","l.facebook.com":"Facebook","lm.facebook.com":"Facebook","instagram.com":"Instagram","l.instagram.com":"Instagram","youtube.com":"Youtube","youtu.be":"Youtube","m.youtube.com":"Youtube","bing.com":"Bing","www.bing.com":"Bing","msnbc.msn.com":"Bing","dizionario.it.msn.com":"Bing","cc.bingj.com":"Bing","m.bing.com":"Bing","twitter.com":"Twitter","t.co":"Twitter"};function E(e){return typeof e!="string"?String(e):e.replace(/[\\"'`\x00-\x1F\x7F]/g,"")}function P(e){if(e==null)return null;let t=typeof e=="string"?parseFloat(e):Number(e);return isNaN(t)?null:+(Math.round(+(t+"e2"))+"e-2")}function ze(e){if(!e)return null;let t=/gid:\/\/shopify\/Cart\/([^?]+(\?.+)?)/,r=e.match(t);return r?r[1]:null}function qe(e){try{return typeof e!="string"?null:decodeURIComponent(e).split("?")[0]}catch{return e||null}}function cn(e){if(!e)return"";switch(e){case"Mobile Safari":return"Safari";case"Chrome Mobile":case"Chrome Mobile iOS":return"Chrome";case"Firefox Mobile":case"Firefox Mobile iOS":return"Firefox";case"Opera Mobile":case"Opera Mini":case"Opera Mini iOS":return"Opera";case"Yandex Browser Lite":return"Yandex Browser";case"Chrome Webview":case"Mobile App":return"Mobile App";default:return e}}function un(e){let t={};return e.searchParams.forEach((r,o)=>{t[o]||(t[o]=r)}),t}function dn(e){return!!e.host&&["http:","https:"].includes(e.protocol)}function ln(e){return e.replace(/^www\./,"")}function fn(e,t,r){if(t&&{Facebook:"Facebook",Instagram:"Instagram"}[t])return t;let n,s;try{if(e&&e.trim()!=="")n=new URL(e);else return"Direct";if(n?.hostname&&dn(n)){if(s=n.hostname,r&&r===s)return"Direct"}else return""}catch{}if(!s)return"";let u=ln(s);return u?wr[u]?wr[u]:u?.includes("google")?"Google":u:""}function Fe(e){let{referrer:t,entryPage:r,userAgent:o}=e,n={referrer_source:"",browser_info:"",os_info:"",device_type:"",page_entry_path:"",utm_medium:"",utm_source:"",utm_campaign:"",utm_content:"",utm_term:"",referrer_url:t||"",gclid:"",fbclid:"",pins_campaign_id:"",epik:""};try{let s;if(r&&r.trim()!==""&&r.startsWith("http"))try{let u=new URL(r),p=u?.pathname;s=u?.hostname,p&&(n.page_entry_path=p??"");let l=un(u);n.utm_medium=l.utm_medium??"",n.utm_source=l.utm_source??"",n.utm_campaign=l.utm_campaign??"",n.utm_content=l.utm_content??"",n.utm_term=l.utm_term??"",n.gclid=l.gclid??"",n.fbclid=l.fbclid??"",n.pins_campaign_id=l.pins_campaign_id??"",n.epik=l.epik??""}catch{}if(o){let u=(0,_t.UAParser)(o),p=u?.browser?.name,l=cn(p);n.browser_info=l??"",n.os_info=u?.os?.name??"",o&&(n.device_type=(u?.device?.type||"desktop")?.toUpperCase()??"")}return n.referrer_source=fn(t,n?.browser_info,s)??"",n}catch{return n}}function je(e,t){let r=e==="/"||e==="",n=t&&/^\/[a-z]{2}(-[a-z]{2})?\/?$/i.test(e);return r||n?"index":/\/products\//.test(e)?"product":/\/collections\//.test(e)?"collection":/\/pages\//.test(e)?"page":/\/search/.test(e)?"search":/\/cart/.test(e)?"cart":/\/checkouts\//.test(e)?"checkout":"unknown"}function $e(e){if(!e)return"";try{let t=(0,_t.UAParser)(e),r=t?.os,o=t?.device,n="";return r?.name&&(n+=r.name,r.version&&(n+=` ${r.version}`)),o?.type&&(n+=n?` (${o.type})`:o.type),o?.vendor&&(n+=n?` ${o.vendor}`:o.vendor),o?.model&&(n+=n?` ${o.model}`:o.model),n||e}catch{return e}}B();var Bt=require("react"),wn="https://bitter-river-9c62.support-67d.workers.dev",bn="https://d339co84ntxcme.cloudfront.net/Prod/orders",S=null;function ve(e){S=e}function J(e){let t=e?.storeId||S?.storeId;return t||(console.warn("[ElevateAB] No storeId provided. Call initAnalytics() first or pass storeId to tracking function."),"")}function hn(e){return Object.entries(e).filter(([,t])=>typeof t=="string").map(([t,r])=>({test_id:t,variant_id:r}))}function yn(e,t){return Object.entries(e).filter(([r])=>typeof t[r]=="string").map(([r])=>({test_id:r,variant_id:t[r]}))}function vn(){return typeof window>"u"?!1:I("eabUserPreview")==="true"||new URLSearchParams(window.location.search).get("eabUserPreview")==="true"}function Y(e,t,r){if(typeof window>"u"||vn())return null;let o=navigator.userAgent,n=window.location.pathname,s=je(n,r),{referrer:u,entryPage:p}=Ge(),l=Fe({referrer:u,entryPage:p,userAgent:o}),g=V("ABTL")||{},i=V("ABAU")||{},d=hn(g),a=yn(i,g),c=ze(localStorage.getItem("shopifyCartId")),f=new Date().toISOString(),_=sessionStorage.getItem("eabIsFirstVisit")==="true",k=I("localization")||"";return{pixel_event_id:`sh-${ie()}`,shop_name:e,timestamp:f,event_type:t,client_id:I("_shopify_y")||void 0,visitor_id:se(),session_id:We(),cart_token:qe(c||I("cart")),page_url:window.location.href,page_pathname:n,page_search:window.location.search,referrer_url:u,referrer_source:l?.referrer_source,previous_page:document.referrer,page_entry:p,page_entry_path:l?.page_entry_path,page_type:s,utm_medium:l?.utm_medium,utm_source:l?.utm_source,utm_campaign:l?.utm_campaign,utm_content:l?.utm_content,utm_term:l?.utm_term,gclid:l?.gclid,fbclid:l?.fbclid,pins_campaign_id:l?.pins_campaign_id,epik:l?.epik,browser_info:l?.browser_info,os_info:l?.os_info,device_type:l?.device_type,language:navigator.language,root_route:localStorage.getItem("eabRootRoute")||"",user_agent:o,user_agent_no_browser:$e(o),is_first_visit:_,shopify_country:k,ab_test_assignments:d,ab_test_views:a,is_first_order:null}}async function Q(e,t=wn){try{let r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0});if(!r.ok)throw new Error(`Worker error: ${r.status}`)}catch(r){console.error("[ElevateAB] Error sending analytics:",r)}}async function _e(e={}){let t=J(e);if(!t)return;let r=e.hasLocalizedPaths??S?.hasLocalizedPaths,o=e.workerUrl??S?.workerUrl,n=Y(t,"page_viewed",r);if(!n)return;let s={...n,cart_currency:e.currency};await Q(s,o)}async function ke(e){let t=J(e);if(!t)return;let{productId:r,productVendor:o,productPrice:n,productSku:s,currency:u}=e,p=e.hasLocalizedPaths??S?.hasLocalizedPaths,l=e.workerUrl??S?.workerUrl,g=Y(t,"product_viewed",p);if(!g)return;let i={...g,cart_currency:u,product_id:R(r),product_vendor:E(o),product_price:P(n),product_sku:E(s)};await Q(i,l)}async function It(e){let t=J(e);if(!t)return;let{productId:r,variantId:o,productVendor:n,productPrice:s,productQuantity:u,productSku:p,currency:l,cartId:g}=e,i=e.hasLocalizedPaths??S?.hasLocalizedPaths,d=e.workerUrl??S?.workerUrl,a=e.storefrontAccessToken??S?.storefrontAccessToken,c=Y(t,"product_added_to_cart",i);if(!c)return;let f={...c,cart_currency:l,product_id:R(r),variant_id:R(o),product_vendor:E(n),product_price:P(s),product_quantity:u,product_sku:E(p)};if(await Q(f,d),g&&a)try{let{updateCartAttributes:_}=await Promise.resolve().then(()=>(Ye(),Pr));await _(g,{storefrontAccessToken:a})}catch(_){console.error("[ElevateAB] Failed to update cart attributes:",_)}}async function Ut(e){let t=J(e);if(!t)return;let{productId:r,variantId:o,productVendor:n,productPrice:s,productQuantity:u,productSku:p,currency:l}=e,g=e.hasLocalizedPaths??S?.hasLocalizedPaths,i=e.workerUrl??S?.workerUrl,d=Y(t,"product_removed_from_cart",g);if(!d)return;let a={...d,cart_currency:l,product_id:R(r),variant_id:R(o),product_vendor:E(n),product_price:P(s),product_quantity:u,product_sku:E(p)};await Q(a,i)}async function Rt(e){let t=J(e);if(!t)return;let{cartTotalPrice:r,cartTotalQuantity:o,cartItems:n,currency:s}=e,u=e.hasLocalizedPaths??S?.hasLocalizedPaths,p=e.workerUrl??S?.workerUrl,l=Y(t,"cart_viewed",u);if(!l)return;let g={...l,cart_currency:s,cart_total_price:P(r),cart_total_quantity:o,cart_items:n?.map(i=>({product_id:R(i.productId),variant_id:R(i.variantId),product_vendor:E(i.productVendor)||"",product_price:P(i.productPrice),product_quantity:i.productQuantity??null,product_sku:E(i.productSku)||""}))};await Q(g,p)}async function Vt(e){let t=J(e);if(!t)return;let{searchQuery:r,currency:o}=e,n=e.hasLocalizedPaths??S?.hasLocalizedPaths,s=e.workerUrl??S?.workerUrl,u=Y(t,"search_submitted",n);if(!u)return;let p={...u,cart_currency:o,search_query:E(r)};await Q(p,s)}async function Ot(e){let t=J(e);if(!t)return;let{cartTotalPrice:r,cartSubtotalPrice:o,cartShippingPrice:n,cartTaxAmount:s,cartDiscountAmount:u,customerId:p,cartItems:l,currency:g}=e,i=e.hasLocalizedPaths??S?.hasLocalizedPaths,d=e.workerUrl??S?.workerUrl,a=Y(t,"checkout_started",i);if(!a)return;let c=0,f=l?.map(k=>{let m=k.productQuantity??0;return c+=m,{product_id:R(k.productId),variant_id:R(k.variantId),product_vendor:E(k.productVendor)||"",vendor:E(k.productVendor)||"",product_price:P(k.productPrice),total_price:P(k.productPrice),product_quantity:m,quantity:m,product_sku:E(k.productSku)||"",sku:E(k.productSku)||"",total_discount:P(k.totalDiscount)}})||[],_={...a,cart_currency:g,cart_total_price:P(r),cart_subtotal_price:P(o),cart_total_quantity:c,cart_shipping_price:P(n),cart_tax_amount:P(s),cart_discount_amount:P(u),cart_items:f,customer_id:p};await Q(_,d)}async function Lt(e){let t=J(e);if(!t)return;let{orderId:r,cartTotalPrice:o,cartSubtotalPrice:n,cartShippingPrice:s,cartTaxAmount:u,cartDiscountAmount:p,customerId:l,isFirstOrder:g,noteAttributes:i,cartItems:d,currency:a}=e,c=e.hasLocalizedPaths??S?.hasLocalizedPaths,f=e.ordersWorkerUrl??S?.ordersWorkerUrl??bn,_=Y(t,"checkout_completed",c);if(!_)return;let k=0,m=d?.map(y=>{let A=y.productQuantity??0;return k+=A,{product_id:R(y.productId),variant_id:R(y.variantId),product_vendor:E(y.productVendor)||"",vendor:E(y.productVendor)||"",product_price:P(y.productPrice),total_price:P(y.productPrice),product_quantity:A,quantity:A,product_sku:E(y.productSku)||"",sku:E(y.productSku)||"",total_discount:P(y.totalDiscount)}})||[],w={..._,cart_currency:a,cart_total_price:P(o),cart_subtotal_price:P(n),cart_total_quantity:k,cart_shipping_price:P(s),cart_tax_amount:P(u),cart_discount_amount:P(p),cart_items:m,order_id:r,customer_id:l,is_first_order:g??null,note_attributes:i};await Q(w,f)}ye();B();var Qe={SHOPIFY_LOCALIZATION:"localization",EAB_COUNTRY:"eabCountryCode",EAB_GEO:"eabGeoLocation"};function X(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search).get("country");if(t)return L(Qe.EAB_COUNTRY,t.toUpperCase()),t.toUpperCase();let r=I(Qe.SHOPIFY_LOCALIZATION);if(r)return r.toUpperCase();let o=I(Qe.EAB_COUNTRY);if(o)return o.toUpperCase();if(typeof localStorage<"u"){let n=localStorage.getItem(Qe.EAB_COUNTRY);if(n)return n.toUpperCase()}return null}function Er(e,t){let r=t??X();return r?e.map(n=>n.toUpperCase()).includes(r.toUpperCase()):!1}function Ar(e,t){let r=t??X();return r?e.map(n=>n.toUpperCase()).includes(r.toUpperCase()):!1}function Dt(e){let t=X();return!e.includeCountries?.length&&!e.excludeCountries?.length?!0:!t||e.excludeCountries?.length&&Ar(e.excludeCountries,t)?!1:e.includeCountries?.length?Er(e.includeCountries,t):!0}G();B();var Xe="eab:navigate",Ke=!1,Nt=0,Ce=null,xe=null;function _n(){typeof window>"u"||(Nt++,!Ke&&(Ke=!0,Ce=history.pushState.bind(history),xe=history.replaceState.bind(history),history.pushState=function(...e){Ce(...e),window.dispatchEvent(new Event(Xe))},history.replaceState=function(...e){xe(...e),window.dispatchEvent(new Event(Xe))}))}function kn(){typeof window>"u"||(Nt--,!(Nt>0||!Ke)&&(Ce&&(history.pushState=Ce,Ce=null),xe&&(history.replaceState=xe,xe=null),Ke=!1))}function ce(e){if(typeof window>"u")return()=>{};let t=window.location.href,r=()=>{let o=window.location.href;o!==t&&(t=o,e())};return _n(),window.addEventListener(Xe,r),window.addEventListener("popstate",r),()=>{window.removeEventListener(Xe,r),window.removeEventListener("popstate",r),kn()}}function Mt(e){let{configUrl:t,timeout:r=2e3}=e;return`(function(){
|
|
19
19
|
if(new URLSearchParams(location.search).get('abtr')==='true')return;
|
|
20
20
|
|
|
21
21
|
var style=document.createElement('style');
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
if(window.__eab_reveal)window.__eab_reveal();
|
|
44
44
|
};
|
|
45
45
|
document.head.appendChild(script);
|
|
46
|
-
})();`}function Sr(e){if(!e?.trim())return"";try{let r=`https://${e.trim().replace(/^https?:\/\//,"")}`,o=new URL(r.replace(/\/+$/,""));return o.hostname.startsWith("www.")&&(o.hostname=o.hostname.substring(4)),o.toString().replace(/\/+$/,"")}catch{return e.trim().replace(/\/+$/,"")}}function Ht(e,t){let r=Sr(e.split("?")[0]);for(let o of t){let n=Sr(o.split("?")[0]);if(r===n)return!0;try{let s=new URL(e).pathname,u=new URL(o,e).pathname;if(s===u)return!0}catch{}}return!1}function Cn(e){return e.data?.redirectBehavior||"redirectAll"}function Ir(e){return!!(V("eabRedirectedTests")||{})[e]}function Ur(e){let t=V("eabRedirectedTests")||{};t[e]=!0,L("eabRedirectedTests",JSON.stringify(t))}function xn(e,t){for(let r of e.tests)if(!(r.type!=="SPLIT_URL"||!r.enabled))for(let o of r.variations){let n=o.splitUrlTestLinks||[];if(n.length!==0&&Ht(t,n))return{test:r,matchedVariation:o,isControlUrl:!!o.isControl}}return null}function Tn(e){if(typeof window>"u")return;let t=new URL(e,window.location.origin);t.searchParams.set("abtr","true");let r=t.toString(),o=window.__remixRouter?.navigate??window.next?.router?.push??window.$nuxt?.$router?.push??window.__navigate;if(o&&typeof o=="function")try{let n=t.pathname+t.search;o(n);return}catch{}window.location.href=r}function Te(e,t){if(typeof window>"u")return!1;let r=window.location.href;if(new URLSearchParams(window.location.search).get("abtr")==="true")return!1;let n=xn(e,r);if(!n)return!1;let{test:s,matchedVariation:u,isControlUrl:f}=n,l=s.testId,g=Cn(s),i=z(l);if(!i)return!1;let d=s.variations.find(p=>p.id===i);if(!d)return!1;let a=d.splitUrlTestLinks||[];if(a.length===0||Ht(r,a))return!1;switch(g){case"redirectOnlyControlUrl":if(!f||d.isControl)return!1;break;case"redirectOnce":if(Ir(l))return!1;Ur(l);break;case"redirectOnceControlUrlOnly":if(!f||Ir(l)||d.isControl)return!1;Ur(l);break;default:break}let c=a[0];return Tn(c),!0}function Rr(e){return e.tests.some(t=>t.type==="SPLIT_URL"&&t.enabled)}var zt={type:"SPLIT_URL",shouldActivate(e,t){for(let r of e.variations){let o=r.splitUrlTestLinks||[];if(Ht(t.currentUrl,o))return!0}return!1},getVariantData(){return{handlerActivated:!0}}};G();var Vr="elv-el-",Or={ELEMENT_NODE:1,TEXT_NODE:3},Ze=new Map,et=new Map,tt=new Map,rt=new Map,ue=!1;function j(e,t){if(t==="*")return!0;if(t.startsWith("*")&&t.endsWith("*")){let r=t.slice(1,-1);return e.includes(r)}if(t.startsWith("*")){let r=t.slice(1);return e.endsWith(r)}return t===e}function $t(){return typeof window>"u"?!1:window.innerWidth<768}function Pn(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];o>="A"&&o<="Z"?(r!==0&&(t+="-"),t+=o.toLowerCase()):t+=o}return t}function En(e){return e.nodeType===Or.TEXT_NODE}function qt(e){return e.nodeType===Or.ELEMENT_NODE}function Ft(e,t){Ze.has(e)||Ze.set(e,t.cloneNode(!0))}function Lr(e){let t=e;t=t.replace(/`/g,"`").replace(/$/g,"$");try{t=JSON.parse('"'+t+'"')}catch{}return t}function Br(e){if(typeof window>"u"||e.length===0)return;let t=window.location.pathname,r=e.filter(n=>n.pathnames?.length?n.pathnames.some(s=>j(t,s)):!0);ue=$t();let o=r.map(n=>({...n,style:n.style?{...n.style.lg,...ue&&n.style.sm}:void 0,content:n.content&&ue&&n.content.sm?n.content.sm:n.content?.lg}));o.filter(n=>n.content!==void 0).forEach(n=>{(n.applyAll?Array.from(document.querySelectorAll(n.selector)):[document.querySelector(n.selector)].filter(Boolean)).forEach((u,f)=>{if(!u)return;let l=n.applyAll?`${n.selector}-${f}-${u.id||Math.random().toString(36).substr(2,9)}`:n.selector;Ft(l,u),En(u)?u.nodeValue=n.content:qt(u)&&(u.innerHTML=n.content)})}),o.filter(n=>n.style!==void 0).forEach(n=>{let s=document.querySelector(n.selector);!s||!qt(s)||(Ft(n.selector,s),Object.entries(n.style).forEach(([u,f])=>{let l=Pn(u),g=f.toString().includes("!important"),i=f.toString().replace(/\s*!important\s*$/,"");s.style.setProperty(l,i,g?"important":void 0)}))}),o.filter(n=>n.attributes!==void 0).forEach(n=>{let s=document.querySelector(n.selector);!s||!qt(s)||(Ft(n.selector,s),Object.entries(n.attributes).forEach(([u,f])=>{s.setAttribute(u,f)}))})}function Dr(e){if(typeof window>"u"||e.length===0)return;let t=window.location.pathname;e.filter(o=>o.selector?.pathnames?.length?o.selector.pathnames.some(n=>j(t,n)):!0).forEach(o=>{let n=`${Vr}${o.id}`;if(rt.has(n))return;let s=document.querySelector(o.selector.target);if(!s||s.parentElement?.querySelector(`#${n}`))return;let u=Nr(o);o.selector.placement==="after"?s.after(u):o.selector.placement==="before"&&s.before(u),rt.set(n,u)})}function Nr(e){let t=document.createElement(e.tagName);return t.id=`${Vr}${e.id}`,e.style&&Object.assign(t.style,e.style),e.attributes&&Object.entries(e.attributes).forEach(([r,o])=>{t.setAttribute(r,o)}),e.kind==="text"&&e.content&&(t.innerText=e.content),e.kind==="container"&&e.childrens&&e.childrens.forEach(r=>{let o=Nr(r);t.appendChild(o)}),t}function nt(e,t){if(typeof window>"u"||e.length===0)return;let r=window.location.pathname;e.filter(n=>n.pathnames?.length?n.excludePathnames?.length&&n.excludePathnames.some(u=>j(r,u))?!1:n.pathnames.some(s=>j(r,s)):!0).forEach(n=>{n.id&&(n.css&&An(n.id,n.css),n.js&&Sn(n.id,n.js,t))})}function An(e,t){let r=`css-${e}`;if(et.has(r)||document.getElementById(r))return;let o=document.createElement("style");o.id=r,o.textContent=Lr(t),document.head.appendChild(o),et.set(r,o)}function Sn(e,t,r){let o=`js-${e}`;if(tt.has(o)||document.getElementById(o))return;let n=document.createElement("script");n.id=o,r&&n.setAttribute("nonce",r);let s=Lr(t);n.textContent="(function(){try{"+s+"}catch(e){console.error('[ElevateAB] Custom script error:', e)}})();",document.head.appendChild(n),tt.set(o,n)}function Mr(){Ze.forEach((e,t)=>{let r=document.querySelector(t);r&&r.replaceWith(e.cloneNode(!0))})}function Hr(){et.forEach(e=>e.remove()),et.clear(),tt.forEach(e=>e.remove()),tt.clear(),rt.forEach(e=>e.remove()),rt.clear(),Ze.clear()}function In(e,t){let r=[],o=[],n=[];return e.tests.filter(u=>u.type==="CONTENT"&&u.enabled).forEach(u=>{let f=z(u.testId);if(!f)return;let l=u.variations.find(g=>g.id===f);l?.content&&(l.content.changes?.length&&r.push(...l.content.changes),l.content.elements?.length&&o.push(...l.content.elements),l.content.customCodes?.length&&n.push(...l.content.customCodes))}),{changes:r,elements:o,blocks:[],customCodes:n}}function Pe(e){return e.tests.some(t=>t.type==="CONTENT"&&t.enabled)}function ot(e,t,r){if(typeof window>"u"||!Pe(e))return;let o=In(e,t);(o.changes.length>0||o.elements.length>0||o.customCodes.length>0)&&(Br(o.changes),Dr(o.elements),nt(o.customCodes,r))}function jt(e,t,r){if(typeof window>"u")return;let o=$t();o!==ue&&(Mr(),ue=o),ot(e,t,r)}function Wt(e,t,r,o=!0){if(typeof window>"u")return()=>{};let n=()=>{$t()!==ue&&jt(e,t,r)};window.addEventListener("resize",n);let s=()=>{};return o&&(s=ce(()=>{jt(e,t,r)})),()=>{window.removeEventListener("resize",n),s(),Hr()}}G();function Gt(e){return e.tests.some(t=>t.type==="CUSTOM_CODE"&&t.enabled)}function zr(e,t,r){if(typeof window>"u")return;if(console.log("[ElevateAB Custom Code] All tests:",e.tests.map(s=>({id:s.testId,type:s.type,enabled:s.enabled}))),!Gt(e)){console.log("[ElevateAB Custom Code] No CUSTOM_CODE tests found");return}let o=e.tests.filter(s=>s.type==="CUSTOM_CODE"&&s.enabled);console.log("[ElevateAB Custom Code] Found",o.length,"CUSTOM_CODE tests");let n=[];o.forEach(s=>{let u=z(s.testId);if(console.log("[ElevateAB Custom Code] Test",s.testId,"assigned variant:",u),!u)return;let f=s.variations.find(l=>l.id===u);if(console.log("[ElevateAB Custom Code] Variation data:",f),!f?.customCode){console.log("[ElevateAB Custom Code] No customCode on variation");return}(f.customCode.js||f.customCode.css)&&(console.log("[ElevateAB Custom Code] Adding custom code:",f.customCode),n.push(f.customCode))}),n.length>0?(console.log("[ElevateAB Custom Code] Applying",n.length,"custom code blocks"),nt(n,r)):console.log("[ElevateAB Custom Code] No custom code to apply")}G();var it=require("react/jsx-runtime"),Un="https://ds0wlyksfn0sb.cloudfront.net/headless";function Rn(e){return e.replace(/^https?:\/\//,"").replace(".myshopify.com","")}function qr(e){return`${Un}/${Rn(e)}.js`}function Jt({storeId:e,storefrontAccessToken:t,preventFlickering:r=!1,flickerTimeout:o=3e3,nonce:n,children:s}){let[u,f]=R.default.useState(null),[l,g]=R.default.useState(null),[i,d]=R.default.useState(null);R.default.useEffect(()=>{if(typeof window>"u")return;ve({storeId:e,storefrontAccessToken:t});let m=F();g(m);let w=X();d(w)},[e,t]);let a=(0,R.useCallback)(()=>{typeof window<"u"&&window.__eab_reveal&&window.__eab_reveal()},[]);R.default.useEffect(()=>{async function m(){try{let w=typeof window<"u"?F():null,y=null;if(typeof window<"u"&&window.eab_data)y=window.eab_data;else{let $=qr(e);y=await new Promise((Z,W)=>{let N=document.createElement("script");N.src=$,N.async=!0,N.onload=()=>{let de=window.eab_data;N.remove(),de?Z(de):W(new Error("Failed to load config: window.eab_data is undefined"))},N.onerror=()=>{N.remove(),Z({allTests:{},selectors:{selectorsV2:[]}})},document.head.appendChild(N)})}if(!y||!y.allTests||Object.keys(y.allTests).length===0){f({tests:[],selectors:void 0}),a();return}if(y.subscriptionPaused){console.error(`[ElevateAB] Subscription is paused or stopped for store: ${e}. `+(y.subscriptionMessage||"A/B tests will not run. Please reactivate your subscription.")),f({tests:[],selectors:void 0}),a();return}if(!(Object.keys(y.allTests||{}).length>0)){f({tests:[],selectors:void 0}),a();return}let D=mr(y);if(Pt(D,w),D.tests.some($=>$.type==="SPLIT_URL")&&Te(D,w))return;f(D),a()}catch(w){console.error("[ElevateAB] Failed to load config:",w),f({tests:[],selectors:void 0}),a()}}m()},[e,a]),R.default.useEffect(()=>{if(!u||typeof window>"u")return;let m=()=>{Rr(u)&&Te(u,l)||(Pe(u)&&ot(u,l,n),Gt(u)&&zr(u,l,n))};m();let w=ce(()=>{m()}),y=Pe(u)?Wt(u,l,n,!1):()=>{};return()=>{w(),y()}},[u,l,n]);let c=R.default.useMemo(()=>({config:u,storeId:e,storefrontAccessToken:t,isPreviewMode:l?.isPreview??!1,previewTestId:l?.previewTestId??null,previewState:l,selectors:u?.selectors,countryCode:i}),[u,e,t,l,i]),p=(0,R.useRef)(!1);R.default.useEffect(()=>{!t&&!p.current&&(p.current=!0,console.warn("[ElevateAB] No storefrontAccessToken provided. Orders won't be attributed to test variants."))},[t]);let _=R.default.useMemo(()=>qr(e),[e]),k=R.default.useMemo(()=>Mt({configUrl:_,timeout:r?o:2e3}),[_,r,o]);return(0,it.jsxs)(Ne.Provider,{value:c,children:[(0,it.jsx)("script",{nonce:n,dangerouslySetInnerHTML:{__html:k}}),s]})}var at=require("next/navigation");var Ee=require("react/jsx-runtime");function Vn({currency:e}){let t=(0,at.usePathname)(),r=(0,at.useSearchParams)();return(0,Ae.useEffect)(()=>{r.get("eabUserPreview")!=="true"&&_e({currency:e})},[t,r,e]),null}function Fr({storeId:e,storefrontAccessToken:t,preventFlickering:r=!1,flickerTimeout:o=3e3,currency:n,children:s}){return(0,Ae.useEffect)(()=>{ve({storeId:e,storefrontAccessToken:t})},[e,t]),(0,Ee.jsxs)(Jt,{storeId:e,storefrontAccessToken:t,preventFlickering:r,flickerTimeout:o,children:[(0,Ee.jsx)(Ae.Suspense,{fallback:null,children:(0,Ee.jsx)(Vn,{currency:n})}),s]})}var jr=require("react");function $r({productId:e,productVendor:t,productPrice:r,productSku:o,currency:n}){return(0,jr.useEffect)(()=>{e&&ke({productId:e,productVendor:t,productPrice:r,productSku:o,currency:n})},[e,t,r,o,n]),null}Me();B();G();B();function Wr(e){let t=V("ABAU")||{};t[e]||(t[e]=!0,L("ABAU",JSON.stringify(t)))}function Gr(e){let t=kt("ABAV")||{};t[e]||(t[e]=!0,ae("ABAV",t))}function Yt(e){Wr(e),Gr(e)}ye();Ye();Et();var K=De(require("react"),1);G();ye();var Jr=new Map;function re(e){Jr.set(e.type,e)}function st(e){return Jr.get(e)}function On(e){try{let o=new URL(e,"https://example.com").pathname.match(/\/products\/([^\/\?]+)/);return o?o[1]:null}catch{return null}}function Ln(e,t,r,o){if(typeof window>"u"||!e.prices||!t)return;let n=e.prices[t];if(!n)return;let s=n.price?.[r],u=n.compare?.[r],f=o;if(f?.selectorsV2?.length)for(let l of f.selectorsV2){if(l.price&&s){let g=l.price.replace("{{variant}}",t);document.querySelectorAll(g).forEach(d=>{let a=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(parseFloat(s));d.textContent=a})}if(l.compareAt&&u){let g=l.compareAt.replace("{{variant}}",t);document.querySelectorAll(g).forEach(d=>{let a=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(parseFloat(u));d.textContent=a})}if(l.saving&&s&&u)for(let g of l.saving){let i=g.selector.replace("{{variant}}",t);document.querySelectorAll(i).forEach(a=>{let c=parseFloat(s),p=parseFloat(u),_=p-c;if(g.isPercentage){let k=Math.round(_/p*100);a.textContent=`${k}%`}else{let k=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(_);a.textContent=k}})}}}var Qt={type:"PRICE_PLUS",shouldActivate(e,t){let r=e.data;if(!r)return!1;let{productId:o,productHandle:n}=t,s=n||On(t.currentUrl),u=o&&r.productIds?.includes(o),f=s&&r.handles?.includes(s);return u||f},applyEffect(e,t,r){Ln(t,r.variantId,r.currencyCode||"USD",r.selectors)},getVariantData(e,t,r){let o=e.data;return{prices:t.prices,matchedProductId:r.productId,productIds:o?.productIds,handles:o?.handles,handlerActivated:!0}}};function Bn(e,t){let o=e.data?.pathnames||[];if(!o.length)return!0;try{let s=new URL(t,"https://example.com").pathname;return o.some(u=>j(s,u))}catch{return!1}}var ct={type:"CONTENT",shouldActivate(e,t){return Bn(e,t.currentUrl)},getVariantData(e,t,r){let o=e.data;return{content:t.content,pathnames:o?.pathnames,handlerActivated:!0}}};function Dn(e,t){let o=e.data?.pathnames||[];if(!o.length)return!0;try{let s=new URL(t,"https://example.com").pathname;return o.some(u=>j(s,u))}catch{return!1}}var Xt={type:"CUSTOM_CODE",shouldActivate(e,t){return Dn(e,t.currentUrl)},getVariantData(e,t,r){let o=e.data;return{customCode:t.customCode,pathnames:o?.pathnames,excludePathnames:o?.excludePathnames,handlerActivated:!0}}};re(Qt);re(zt);re(ct);re(Xt);function Hn(e){if(typeof window>"u")return{currentUrl:"",selectors:e};let t=window.location.href,r=window.location.pathname,o,n=r.match(/\/products\/([^\/\?]+)/);n&&(o=n[1]);let s,f=new URLSearchParams(window.location.search).get("variant");return f&&(s=f),{currentUrl:t,productHandle:o,variantId:s,selectors:e,currencyCode:"USD"}}function Kt(e){let{config:t,previewState:r,selectors:o}=be(),[n,s]=K.default.useState(null),[u,f]=K.default.useState(!0),l=K.default.useMemo(()=>t&&t.tests.find(a=>a.testId===e)||null,[t,e]),g=K.default.useMemo(()=>r||F(),[r]),i=K.default.useRef(null),d=K.default.useRef(null);return K.default.useEffect(()=>{let a=!0;if(t===null)return;if(!l){i.current!==e&&(i.current=e,console.warn(`[ElevateAB] Test not found: ${e}`)),a&&f(!1);return}if(!l.enabled&&!g?.isPreview){i.current!==`${e}-disabled`&&(i.current=`${e}-disabled`,console.warn(`[ElevateAB] Test disabled: ${e}`)),a&&f(!1);return}let c=z(e);if(!c){a&&f(!1);return}let p=l.variations.find(w=>w.id===c);if(!p){a&&f(!1);return}let _=st(l.type),k=Hn(o),m={...p};if(_?.shouldActivate(l,k)){let w=`${e}-${p.id}`;_.applyEffect&&d.current!==w&&(d.current=w,_.applyEffect(l,p,k));let y=_.getVariantData(l,p,k);m={...m,...y}}return a&&s(m),g?.isPreview||Yt(e),a&&f(!1),()=>{a=!1}},[t,l,e,g,o]),{variant:n,isLoading:u,isControl:n?.isControl??!1,isA:n?.isA??!1,isB:n?.isB??!1,isC:n?.isC??!1,isD:n?.isD??!1}}var Zt=require("react");B();B();Ye();0&&(module.exports={ElevateNextProvider,ProductViewTracker,clearPreviewMode,extractShopifyId,extractShopifyType,getCountryCode,getPreviewState,isInPreviewMode,isShopifyGid,matchesGeoTargeting,trackAddToCart,trackCartView,trackCheckoutCompleted,trackCheckoutStarted,trackPageView,trackProductView,trackRemoveFromCart,trackSearchSubmitted,useElevateConfig,useExperiment});
|
|
46
|
+
})();`}function Sr(e){if(!e?.trim())return"";try{let r=`https://${e.trim().replace(/^https?:\/\//,"")}`,o=new URL(r.replace(/\/+$/,""));return o.hostname.startsWith("www.")&&(o.hostname=o.hostname.substring(4)),o.toString().replace(/\/+$/,"")}catch{return e.trim().replace(/\/+$/,"")}}function Ht(e,t){let r=Sr(e.split("?")[0]);for(let o of t){let n=Sr(o.split("?")[0]);if(r===n)return!0;try{let s=new URL(e).pathname,u=new URL(o,e).pathname;if(s===u)return!0}catch{}}return!1}function Cn(e){return e.data?.redirectBehavior||"redirectAll"}function Ir(e){return!!(V("eabRedirectedTests")||{})[e]}function Ur(e){let t=V("eabRedirectedTests")||{};t[e]=!0,L("eabRedirectedTests",JSON.stringify(t))}function xn(e,t){for(let r of e.tests)if(!(r.type!=="SPLIT_URL"||!r.enabled))for(let o of r.variations){let n=o.splitUrlTestLinks||[];if(n.length!==0&&Ht(t,n))return{test:r,matchedVariation:o,isControlUrl:!!o.isControl}}return null}function Tn(e){if(typeof window>"u")return;let t=new URL(e,window.location.origin);t.searchParams.set("abtr","true");let r=t.toString(),o=window.__remixRouter?.navigate??window.next?.router?.push??window.$nuxt?.$router?.push??window.__navigate;if(o&&typeof o=="function")try{let n=t.pathname+t.search;o(n);return}catch{}window.location.href=r}function Te(e,t){if(typeof window>"u")return!1;let r=window.location.href;if(new URLSearchParams(window.location.search).get("abtr")==="true")return!1;let n=xn(e,r);if(!n)return!1;let{test:s,matchedVariation:u,isControlUrl:p}=n,l=s.testId,g=Cn(s),i=z(l);if(!i)return!1;let d=s.variations.find(f=>f.id===i);if(!d)return!1;let a=d.splitUrlTestLinks||[];if(a.length===0||Ht(r,a))return!1;switch(g){case"redirectOnlyControlUrl":if(!p||d.isControl)return!1;break;case"redirectOnce":if(Ir(l))return!1;Ur(l);break;case"redirectOnceControlUrlOnly":if(!p||Ir(l)||d.isControl)return!1;Ur(l);break;default:break}let c=a[0];return Tn(c),!0}function Rr(e){return e.tests.some(t=>t.type==="SPLIT_URL"&&t.enabled)}var zt={type:"SPLIT_URL",shouldActivate(e,t){for(let r of e.variations){let o=r.splitUrlTestLinks||[];if(Ht(t.currentUrl,o))return!0}return!1},getVariantData(){return{handlerActivated:!0}}};G();var Vr="elv-el-",Or={ELEMENT_NODE:1,TEXT_NODE:3},Ze=new Map,et=new Map,tt=new Map,rt=new Map,ue=!1;function j(e,t){if(t==="*")return!0;if(t.startsWith("*")&&t.endsWith("*")){let r=t.slice(1,-1);return e.includes(r)}if(t.startsWith("*")){let r=t.slice(1);return e.endsWith(r)}return t===e}function $t(){return typeof window>"u"?!1:window.innerWidth<768}function Pn(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];o>="A"&&o<="Z"?(r!==0&&(t+="-"),t+=o.toLowerCase()):t+=o}return t}function En(e){return e.nodeType===Or.TEXT_NODE}function qt(e){return e.nodeType===Or.ELEMENT_NODE}function Ft(e,t){Ze.has(e)||Ze.set(e,t.cloneNode(!0))}function Lr(e){let t=e;t=t.replace(/`/g,"`").replace(/$/g,"$");try{t=JSON.parse('"'+t+'"')}catch{}return t}function Br(e){if(typeof window>"u"||e.length===0)return;let t=window.location.pathname,r=e.filter(n=>n.pathnames?.length?n.pathnames.some(s=>j(t,s)):!0);ue=$t();let o=r.map(n=>({...n,style:n.style?{...n.style.lg,...ue&&n.style.sm}:void 0,content:n.content&&ue&&n.content.sm?n.content.sm:n.content?.lg}));o.filter(n=>n.content!==void 0).forEach(n=>{(n.applyAll?Array.from(document.querySelectorAll(n.selector)):[document.querySelector(n.selector)].filter(Boolean)).forEach((u,p)=>{if(!u)return;let l=n.applyAll?`${n.selector}-${p}-${u.id||Math.random().toString(36).substr(2,9)}`:n.selector;Ft(l,u),En(u)?u.nodeValue=n.content:qt(u)&&(u.innerHTML=n.content)})}),o.filter(n=>n.style!==void 0).forEach(n=>{let s=document.querySelector(n.selector);!s||!qt(s)||(Ft(n.selector,s),Object.entries(n.style).forEach(([u,p])=>{let l=Pn(u),g=p.toString().includes("!important"),i=p.toString().replace(/\s*!important\s*$/,"");s.style.setProperty(l,i,g?"important":void 0)}))}),o.filter(n=>n.attributes!==void 0).forEach(n=>{let s=document.querySelector(n.selector);!s||!qt(s)||(Ft(n.selector,s),Object.entries(n.attributes).forEach(([u,p])=>{s.setAttribute(u,p)}))})}function Dr(e){if(typeof window>"u"||e.length===0)return;let t=window.location.pathname;e.filter(o=>o.selector?.pathnames?.length?o.selector.pathnames.some(n=>j(t,n)):!0).forEach(o=>{let n=`${Vr}${o.id}`;if(rt.has(n))return;let s=document.querySelector(o.selector.target);if(!s||s.parentElement?.querySelector(`#${n}`))return;let u=Nr(o);o.selector.placement==="after"?s.after(u):o.selector.placement==="before"&&s.before(u),rt.set(n,u)})}function Nr(e){let t=document.createElement(e.tagName);return t.id=`${Vr}${e.id}`,e.style&&Object.assign(t.style,e.style),e.attributes&&Object.entries(e.attributes).forEach(([r,o])=>{t.setAttribute(r,o)}),e.kind==="text"&&e.content&&(t.innerText=e.content),e.kind==="container"&&e.childrens&&e.childrens.forEach(r=>{let o=Nr(r);t.appendChild(o)}),t}function nt(e,t){if(typeof window>"u"||e.length===0)return;let r=window.location.pathname;e.filter(n=>n.pathnames?.length?n.excludePathnames?.length&&n.excludePathnames.some(u=>j(r,u))?!1:n.pathnames.some(s=>j(r,s)):!0).forEach(n=>{n.id&&(n.css&&An(n.id,n.css),n.js&&Sn(n.id,n.js,t))})}function An(e,t){let r=`css-${e}`;if(et.has(r)||document.getElementById(r))return;let o=document.createElement("style");o.id=r,o.textContent=Lr(t),document.head.appendChild(o),et.set(r,o)}function Sn(e,t,r){let o=`js-${e}`;if(tt.has(o)||document.getElementById(o))return;let n=document.createElement("script");n.id=o,r&&n.setAttribute("nonce",r);let s=Lr(t);n.textContent="(function(){try{"+s+"}catch(e){console.error('[ElevateAB] Custom script error:', e)}})();",document.head.appendChild(n),tt.set(o,n)}function Mr(){Ze.forEach((e,t)=>{let r=document.querySelector(t);r&&r.replaceWith(e.cloneNode(!0))})}function Hr(){et.forEach(e=>e.remove()),et.clear(),tt.forEach(e=>e.remove()),tt.clear(),rt.forEach(e=>e.remove()),rt.clear(),Ze.clear()}function In(e,t){let r=[],o=[],n=[];return e.tests.filter(u=>u.type==="CONTENT"&&u.enabled).forEach(u=>{let p=z(u.testId);if(!p)return;let l=u.variations.find(g=>g.id===p);l?.content&&(l.content.changes?.length&&r.push(...l.content.changes),l.content.elements?.length&&o.push(...l.content.elements),l.content.customCodes?.length&&n.push(...l.content.customCodes))}),{changes:r,elements:o,blocks:[],customCodes:n}}function Pe(e){return e.tests.some(t=>t.type==="CONTENT"&&t.enabled)}function ot(e,t,r){if(typeof window>"u"||!Pe(e))return;let o=In(e,t);(o.changes.length>0||o.elements.length>0||o.customCodes.length>0)&&(Br(o.changes),Dr(o.elements),nt(o.customCodes,r))}function jt(e,t,r){if(typeof window>"u")return;let o=$t();o!==ue&&(Mr(),ue=o),ot(e,t,r)}function Wt(e,t,r,o=!0){if(typeof window>"u")return()=>{};let n=()=>{$t()!==ue&&jt(e,t,r)};window.addEventListener("resize",n);let s=()=>{};return o&&(s=ce(()=>{jt(e,t,r)})),()=>{window.removeEventListener("resize",n),s(),Hr()}}G();function Gt(e){return e.tests.some(t=>t.type==="CUSTOM_CODE"&&t.enabled)}function zr(e,t,r){if(typeof window>"u")return;if(console.log("[ElevateAB Custom Code] All tests:",e.tests.map(s=>({id:s.testId,type:s.type,enabled:s.enabled}))),!Gt(e)){console.log("[ElevateAB Custom Code] No CUSTOM_CODE tests found");return}let o=e.tests.filter(s=>s.type==="CUSTOM_CODE"&&s.enabled);console.log("[ElevateAB Custom Code] Found",o.length,"CUSTOM_CODE tests");let n=[];o.forEach(s=>{let u=z(s.testId);if(console.log("[ElevateAB Custom Code] Test",s.testId,"assigned variant:",u),!u)return;let p=s.variations.find(l=>l.id===u);if(console.log("[ElevateAB Custom Code] Variation data:",p),!p?.customCode){console.log("[ElevateAB Custom Code] No customCode on variation");return}(p.customCode.js||p.customCode.css)&&(console.log("[ElevateAB Custom Code] Adding custom code:",p.customCode),n.push(p.customCode))}),n.length>0?(console.log("[ElevateAB Custom Code] Applying",n.length,"custom code blocks"),nt(n,r)):console.log("[ElevateAB Custom Code] No custom code to apply")}G();var it=require("react/jsx-runtime"),Un="https://ds0wlyksfn0sb.cloudfront.net/headless";function Rn(e){return e.replace(/^https?:\/\//,"").replace(".myshopify.com","")}function qr(e){return`${Un}/${Rn(e)}.js`}var Vn=typeof window<"u"?U.default.useLayoutEffect:U.default.useEffect;function Jt({storeId:e,storefrontAccessToken:t,preventFlickering:r=!1,flickerTimeout:o=3e3,nonce:n,children:s}){let[u,p]=U.default.useState(null),[l,g]=U.default.useState(null),[i,d]=U.default.useState(null);U.default.useEffect(()=>{if(typeof window>"u")return;ve({storeId:e,storefrontAccessToken:t});let m=F();g(m);let w=X();d(w)},[e,t]);let a=(0,U.useCallback)(()=>{typeof window<"u"&&window.__eab_reveal&&window.__eab_reveal()},[]);U.default.useEffect(()=>{async function m(){try{let w=typeof window<"u"?F():null,y=null;if(typeof window<"u"&&window.eab_data)y=window.eab_data;else{let $=qr(e);y=await new Promise((Z,W)=>{let N=document.createElement("script");N.src=$,N.async=!0,N.onload=()=>{let de=window.eab_data;N.remove(),de?Z(de):W(new Error("Failed to load config: window.eab_data is undefined"))},N.onerror=()=>{N.remove(),Z({allTests:{},selectors:{selectorsV2:[]}})},document.head.appendChild(N)})}if(!y||!y.allTests||Object.keys(y.allTests).length===0){p({tests:[],selectors:void 0}),a();return}if(y.subscriptionPaused){console.error(`[ElevateAB] Subscription is paused or stopped for store: ${e}. `+(y.subscriptionMessage||"A/B tests will not run. Please reactivate your subscription.")),p({tests:[],selectors:void 0}),a();return}if(!(Object.keys(y.allTests||{}).length>0)){p({tests:[],selectors:void 0}),a();return}let D=mr(y);if(Pt(D,w),D.tests.some($=>$.type==="SPLIT_URL")&&Te(D,w))return;p(D),a()}catch(w){console.error("[ElevateAB] Failed to load config:",w),p({tests:[],selectors:void 0}),a()}}m()},[e,a]),Vn(()=>{if(!u||typeof window>"u")return;let m=()=>{Rr(u)&&Te(u,l)||(Pe(u)&&ot(u,l,n),Gt(u)&&zr(u,l,n))};m();let w=ce(()=>{m()}),y=Pe(u)?Wt(u,l,n,!1):()=>{};return()=>{w(),y()}},[u,l,n]);let c=U.default.useMemo(()=>({config:u,storeId:e,storefrontAccessToken:t,isPreviewMode:l?.isPreview??!1,previewTestId:l?.previewTestId??null,previewState:l,selectors:u?.selectors,countryCode:i}),[u,e,t,l,i]),f=(0,U.useRef)(!1);U.default.useEffect(()=>{!t&&!f.current&&(f.current=!0,console.warn("[ElevateAB] No storefrontAccessToken provided. Orders won't be attributed to test variants."))},[t]);let _=U.default.useMemo(()=>qr(e),[e]),k=U.default.useMemo(()=>Mt({configUrl:_,timeout:r?o:2e3}),[_,r,o]);return(0,it.jsxs)(Ne.Provider,{value:c,children:[(0,it.jsx)("script",{nonce:n,dangerouslySetInnerHTML:{__html:k}}),s]})}var at=require("next/navigation");var Ee=require("react/jsx-runtime");function On({currency:e}){let t=(0,at.usePathname)(),r=(0,at.useSearchParams)();return(0,Ae.useEffect)(()=>{r.get("eabUserPreview")!=="true"&&_e({currency:e})},[t,r,e]),null}function Fr({storeId:e,storefrontAccessToken:t,preventFlickering:r=!1,flickerTimeout:o=3e3,currency:n,children:s}){return(0,Ae.useEffect)(()=>{ve({storeId:e,storefrontAccessToken:t})},[e,t]),(0,Ee.jsxs)(Jt,{storeId:e,storefrontAccessToken:t,preventFlickering:r,flickerTimeout:o,children:[(0,Ee.jsx)(Ae.Suspense,{fallback:null,children:(0,Ee.jsx)(On,{currency:n})}),s]})}var jr=require("react");function $r({productId:e,productVendor:t,productPrice:r,productSku:o,currency:n}){return(0,jr.useEffect)(()=>{e&&ke({productId:e,productVendor:t,productPrice:r,productSku:o,currency:n})},[e,t,r,o,n]),null}Me();B();G();B();function Wr(e){let t=V("ABAU")||{};t[e]||(t[e]=!0,L("ABAU",JSON.stringify(t)))}function Gr(e){let t=kt("ABAV")||{};t[e]||(t[e]=!0,ae("ABAV",t))}function Yt(e){Wr(e),Gr(e)}ye();Ye();Et();var K=De(require("react"),1);G();ye();var Jr=new Map;function re(e){Jr.set(e.type,e)}function st(e){return Jr.get(e)}function Ln(e){try{let o=new URL(e,"https://example.com").pathname.match(/\/products\/([^\/\?]+)/);return o?o[1]:null}catch{return null}}function Bn(e,t,r,o){if(typeof window>"u"||!e.prices||!t)return;let n=e.prices[t];if(!n)return;let s=n.price?.[r],u=n.compare?.[r],p=o;if(p?.selectorsV2?.length)for(let l of p.selectorsV2){if(l.price&&s){let g=l.price.replace("{{variant}}",t);document.querySelectorAll(g).forEach(d=>{let a=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(parseFloat(s));d.textContent=a})}if(l.compareAt&&u){let g=l.compareAt.replace("{{variant}}",t);document.querySelectorAll(g).forEach(d=>{let a=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(parseFloat(u));d.textContent=a})}if(l.saving&&s&&u)for(let g of l.saving){let i=g.selector.replace("{{variant}}",t);document.querySelectorAll(i).forEach(a=>{let c=parseFloat(s),f=parseFloat(u),_=f-c;if(g.isPercentage){let k=Math.round(_/f*100);a.textContent=`${k}%`}else{let k=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(_);a.textContent=k}})}}}var Qt={type:"PRICE_PLUS",shouldActivate(e,t){let r=e.data;if(!r)return!1;let{productId:o,productHandle:n}=t,s=n||Ln(t.currentUrl),u=o&&r.productIds?.includes(o),p=s&&r.handles?.includes(s);return u||p},applyEffect(e,t,r){Bn(t,r.variantId,r.currencyCode||"USD",r.selectors)},getVariantData(e,t,r){let o=e.data;return{prices:t.prices,matchedProductId:r.productId,productIds:o?.productIds,handles:o?.handles,handlerActivated:!0}}};function Dn(e,t){let o=e.data?.pathnames||[];if(!o.length)return!0;try{let s=new URL(t,"https://example.com").pathname;return o.some(u=>j(s,u))}catch{return!1}}var ct={type:"CONTENT",shouldActivate(e,t){return Dn(e,t.currentUrl)},getVariantData(e,t,r){let o=e.data;return{content:t.content,pathnames:o?.pathnames,handlerActivated:!0}}};function Nn(e,t){let o=e.data?.pathnames||[];if(!o.length)return!0;try{let s=new URL(t,"https://example.com").pathname;return o.some(u=>j(s,u))}catch{return!1}}var Xt={type:"CUSTOM_CODE",shouldActivate(e,t){return Nn(e,t.currentUrl)},getVariantData(e,t,r){let o=e.data;return{customCode:t.customCode,pathnames:o?.pathnames,excludePathnames:o?.excludePathnames,handlerActivated:!0}}};re(Qt);re(zt);re(ct);re(Xt);function zn(e){if(typeof window>"u")return{currentUrl:"",selectors:e};let t=window.location.href,r=window.location.pathname,o,n=r.match(/\/products\/([^\/\?]+)/);n&&(o=n[1]);let s,p=new URLSearchParams(window.location.search).get("variant");return p&&(s=p),{currentUrl:t,productHandle:o,variantId:s,selectors:e,currencyCode:"USD"}}function Kt(e){let{config:t,previewState:r,selectors:o}=be(),[n,s]=K.default.useState(null),[u,p]=K.default.useState(!0),l=K.default.useMemo(()=>t&&t.tests.find(a=>a.testId===e)||null,[t,e]),g=K.default.useMemo(()=>r||F(),[r]),i=K.default.useRef(null),d=K.default.useRef(null);return K.default.useEffect(()=>{let a=!0;if(t===null)return;if(!l){i.current!==e&&(i.current=e,console.warn(`[ElevateAB] Test not found: ${e}`)),a&&p(!1);return}if(!l.enabled&&!g?.isPreview){i.current!==`${e}-disabled`&&(i.current=`${e}-disabled`,console.warn(`[ElevateAB] Test disabled: ${e}`)),a&&p(!1);return}let c=z(e);if(!c){a&&p(!1);return}let f=l.variations.find(w=>w.id===c);if(!f){a&&p(!1);return}let _=st(l.type),k=zn(o),m={...f};if(_?.shouldActivate(l,k)){let w=`${e}-${f.id}`;_.applyEffect&&d.current!==w&&(d.current=w,_.applyEffect(l,f,k));let y=_.getVariantData(l,f,k);m={...m,...y}}return a&&s(m),g?.isPreview||Yt(e),a&&p(!1),()=>{a=!1}},[t,l,e,g,o]),{variant:n,isLoading:u,isControl:n?.isControl??!1,isA:n?.isA??!1,isB:n?.isB??!1,isC:n?.isC??!1,isD:n?.isD??!1}}var Zt=require("react");B();B();Ye();0&&(module.exports={ElevateNextProvider,ProductViewTracker,clearPreviewMode,extractShopifyId,extractShopifyType,getCountryCode,getPreviewState,isInPreviewMode,isShopifyGid,matchesGeoTargeting,trackAddToCart,trackCartView,trackCheckoutCompleted,trackCheckoutStarted,trackPageView,trackProductView,trackRemoveFromCart,trackSearchSubmitted,useElevateConfig,useExperiment});
|
|
47
47
|
//# sourceMappingURL=next.cjs.map
|