PageSourceSearch

https://www.bluettipower.com.au/assets/hooks-gmjKbSbY.js

js bluettipower.com.au collected 2026-09-26 00:06:55 UTC 27,332 bytes, 7 lines download raw bytes

1import{j as oe}from"./jsx-runtime-OAcbhNt1.js";import{r as a,J as Ge,l as Me}from"./chunk-UIGDSWPH-Djcsa-7T.js";import{S as I}from"./clsx-DTptNCFb.js";import{r as He,d as ze,f as P,e as B,p as We,v as Ue,i as Fe,j as Ye,k as qe,l as je,n as se,m as $e,s as Ve,u as Ke,b as Je,o as F,q as A,P as Xe}from"./product-CS3JY-8X.js";import{F as Y}from"./utils-D9PkMZrw.js";const N="bluetti_comparison_attribution",R="bluetti_comparison_pending_attribution",Qe=1440*60*1e3,Ze=new Set(["view_item","add_to_cart","purchase"]),et="pages/product-compare",tt="Product Comparison";function nt(e){const t=Date.now();return{timestamp:t,expires:t+Qe,entry_type:e.entry_type,source_id:e.source_id,source_name:e.source_name,product_ids:e.product_ids.filter(Boolean)}}function ie(e){return Array.isArray(e)?e.map(String).filter(Boolean):typeof e=="string"&&e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function ae(e){return{...e,product_ids:ie(e.product_ids)}}function rt(e){if(!(typeof window>"u"))try{localStorage.setItem(N,JSON.stringify(e))}catch{}}function ot(){if(typeof window>"u")return null;try{const e=sessionStorage.getItem(R);return e?(sessionStorage.removeItem(R),ae(JSON.parse(e))):null}catch{return null}}function ln(e){if(!(typeof window>"u"))try{sessionStorage.setItem(R,JSON.stringify(e))}catch{}}function ce(){if(typeof window>"u")return null;try{const e=localStorage.getItem(N);if(!e)return null;const t=ae(JSON.parse(e));return!t.expires||t.expires<=Date.now()?(localStorage.removeItem(N),null):t}catch{return null}}function st(){return ce()!==null}function un(e={}){var s;if(typeof window>"u")return null;const t=ot(),n=ie(e.productIds??[]),r=ce(),o=nt({entry_type:(t==null?void 0:t.entry_type)??e.entryType??(r==null?void 0:r.entry_type)??"collection_page",source_id:(t==null?void 0:t.source_id)??e.sourceId??(r==null?void 0:r.source_id)??et,source_name:(t==null?void 0:t.source_name)??e.sourceName??(r==null?void 0:r.source_name)??tt,product_ids:(t!=null&&t.product_ids.length?t.product_ids:null)??(n.length?n:null)??(r==null?void 0:r.product_ids)??[]});return rt(o),(s=e.pushEvent)==null||s.call(e,at(o)),o}function it(e){return!e.event||!Ze.has(String(e.event))||!st()?e:{...e,from_comparison:!0}}function at(e){return{event:"comparison_start",value:e}}function dn(e){const t=e.get("products");if(t)return t.split(",").map(r=>r.trim()).filter(Boolean);const n=e.get("supportIds");return n?n.split(",").map(r=>r.trim()).filter(Boolean):[]}const le=a.createContext(void 0);function fn({children:e,isMobile:t,shop:n,globalMenu:r,globalConfig:o,announcement:s,cart:i,footerData:c,ladderGiftActivityInfo:d,buyGiftActivityInfo:f,customerInfo:h,clientId:y,authURL:u,isEmbedMode:l=!1}){const[p,w]=a.useState(!1),[g,m]=a.useState(!1),ve=()=>{g&&U(!0),m(!0)},Ee=()=>m(!1),[Se,z]=a.useState(!1),Le=()=>z(!0),Ce=()=>z(!1),[be,W]=a.useState(!1),Ie=()=>W(!0),Pe=()=>W(!1),[Ae,U]=a.useState(!1),Te=()=>U(!1),_e=()=>w(!0),ke=()=>w(!1),xe=()=>w(E=>!E),[De,Oe]=a.useState(t),[Be,Ne]=a.useState("mask"),Re=E=>Ne(E);return a.useEffect(()=>{const E=()=>{Oe(document.documentElement.clientWidth<1024)};return E(),window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]),oe.jsx(le.Provider,{value:{shop:n,isOpen:p,isMobile:De,openCart:_e,closeCart:ke,toggleCart:xe,globalMenu:r,globalConfig:o,cart:i,announcement:s,footerData:c,ladderGiftActivityInfo:d,buyGiftActivityInfo:f,customerInfo:h,clientId:y,authURL:u,isOpenGlobalSearch:g,handleOpenSearch:ve,handleCloseSearch:Ee,openCalculatorDialog:Le,closeCalculatorDialog:Ce,isOpenCalculatorDialog:Se,openGlobalNavbar:Ie,closeGlobalNavbar:Pe,isOpenGlobalNavbar:be,isRepeatClickSearch:Ae,resetRepeatClickSearch:Te,isEmbedMode:l,searchCloseType:Be,handleSetSearchCloseType:Re},children:e})}function hn(){const e=a.useContext(le);if(!e)throw new Error("usePageLayout must be used within a PageLayoutProvider");return e}const G="_landing_page",ct=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","irclickid"],lt=typeof document<"u"?a.useLayoutEffect:a.useEffect,q={analyticsAllowed:!1,marketingAllowed:!1,preferencesAllowed:!1,saleOfDataAllowed:!1},j=()=>{document.dispatchEvent(new CustomEvent("shopifyCustomerPrivacyApiLoaded")),document.dispatchEvent(new CustomEvent("customerPrivacyApiLoaded"))},ue=e=>!!e&&typeof e.setTrackingConsent=="function"&&typeof e.analyticsProcessingAllowed=="function"&&typeof e.marketingAllowed=="function"&&typeof e.preferencesProcessingAllowed=="function"&&typeof e.saleOfDataAllowed=="function",pn=(e=!0)=>{const[t,n]=a.useState(!e);return a.useEffect(()=>{if(!e)return;const r=()=>{var c;return ue((c=window.Shopify)==null?void 0:c.customerPrivacy)?(n(!0),!0):!1};if(r())return;const o=()=>{r()};document.addEventListener("shopifyCustomerPrivacyApiLoaded",o),document.addEventListener("customerPrivacyApiLoaded",o);const s=window.setInterval(()=>{r()&&window.clearInterval(s)},250),i=window.setTimeout(()=>{window.clearInterval(s)},15e3);return()=>{document.removeEventListener("shopifyCustomerPrivacyApiLoaded",o),document.removeEventListener("customerPrivacyApiLoaded",o),window.clearInterval(s),window.clearTimeout(i)}},[e]),t},ut=e=>({analyticsAllowed:!!e.analyticsProcessingAllowed(),marketingAllowed:!!e.marketingAllowed(),preferencesAllowed:!!e.preferencesProcessingAllowed(),saleOfDataAllowed:!!e.saleOfDataAllowed()}),dt=()=>typeof document>"u"?!1:/(?:^|;\s*)_tracking_consent=/.test(document.cookie),b={initialHadCookie:null,hasUserInteracted:!1,snapshotCaptured:!1},ft=()=>
1{b.snapshotCaptured||(b.initialHadCookie=dt(),b.snapshotCaptured=!0)},ht=()=>b.hasUserInteracted||b.initialHadCookie===!0,$="__consentWatcherInstalled",D=e=>{if(e[$])return;let t=e.customerPrivacy??null;Object.defineProperty(e,"customerPrivacy",{configurable:!0,enumerable:!0,get(){return t},set(n){n&&typeof n=="object"&&"setTrackingConsent"in n&&(t=n,j())}}),e[$]=!0,t&&typeof t=="object"&&"setTrackingConsent"in t&&j()},pt=e=>{const[t,n]=a.useState(q);return a.useEffect(()=>{const r=()=>!e||ht(),o=()=>{var c;const i=(c=window.Shopify)==null?void 0:c.customerPrivacy;ue(i)&&n(r()?ut(i):q)},s=i=>{var c,d,f,h;e&&(b.hasUserInteracted=!0),n({analyticsAllowed:!!((c=i.detail)!=null&&c.analyticsAllowed),marketingAllowed:!!((d=i.detail)!=null&&d.marketingAllowed),preferencesAllowed:!!((f=i.detail)!=null&&f.preferencesAllowed),saleOfDataAllowed:!!((h=i.detail)!=null&&h.saleOfDataAllowed)})};return e&&ft(),o(),document.addEventListener("visitorConsentCollected",s),document.addEventListener("shopifyCustomerPrivacyApiLoaded",o),document.addEventListener("customerPrivacyApiLoaded",o),()=>{document.removeEventListener("visitorConsentCollected",s),document.removeEventListener("shopifyCustomerPrivacyApiLoaded",o),document.removeEventListener("customerPrivacyApiLoaded",o)}},[e]),t},H=a.createContext(null),wn=({children:e,strictGate:t=!1})=>{const n=pt(t);return oe.jsx(H.Provider,{value:n,children:e})},de=()=>{const e=a.useContext(H);if(!e)throw new Error("usePrivacyConsent must be used within PrivacyConsentProvider");return e},yn=()=>a.useContext(H),mn=()=>{lt(()=>{window.Shopify&&D(window.Shopify);const e=Object.getOwnPropertyDescriptor(window,"Shopify");if(e&&!e.configurable)return;let t=window.Shopify;Object.defineProperty(window,"Shopify",{configurable:!0,get(){return t},set(n){t=n,n&&D(n)}}),t&&D(t)},[])},gn=e=>{a.useEffect(()=>{if(!(e!=null&&e.withPrivacyBanner)||!e.storefrontAccessToken)return;const{storefrontAccessToken:t,country:n,language:r}=e,o=window.location.host;let s=!1;const i=()=>{if(s)return!1;const h=window.privacyBanner;return h!=null&&h.loadBanner?(h.loadBanner({checkoutRootDomain:o,storefrontAccessToken:t,storefrontRootDomain:o,country:n??"",locale:r??""}),window.privacyBanner=h,!0):!1},c=()=>{i()};i(),document.addEventListener("shopifyCustomerPrivacyApiLoaded",c),document.addEventListener("customerPrivacyApiLoaded",c);const d=window.setInterval(()=>{i()&&window.clearInterval(d)},250),f=window.setTimeout(()=>window.clearInterval(d),15e3);return()=>{s=!0,document.removeEventListener("shopifyCustomerPrivacyApiLoaded",c),document.removeEventListener("customerPrivacyApiLoaded",c),window.clearInterval(d),window.clearTimeout(f)}},[e==null?void 0:e.withPrivacyBanner,e==null?void 0:e.storefrontAccessToken,e==null?void 0:e.country,e==null?void 0:e.language])},V="__bluettiLandingShopifyReplayed";function K(e,t){var r;const n=(r=e.match(new RegExp(`(?:^|;\\s*)${t}=([^;]*)`)))==null?void 0:r[1];if(n)try{return decodeURIComponent(n)}catch{return n}}function fe(e=typeof document<"u"?document.cookie:""){const t={};for(const r of ct){const o=K(e,r);o&&(t[r]=o)}const n=K(e,G);return n&&(t[G]=n),t}const J="__bluettiLandingAttrReplayed";function wt(e="dataLayer"){if(typeof window>"u")return null;const t=fe();if(!Object.keys(t).length)return null;if(sessionStorage.getItem(J))return t;sessionStorage.setItem(J,"1");const n=window,r=n[e]||[];return n[e]=r,r.push({event:"landing_attribution",...t}),t}const vn=e=>{const{analyticsAllowed:t}=de();a.useEffect(()=>{if(!t||typeof window>"u"||!e||sessionStorage.getItem(V))return;const n=fe()[G];n&&(sessionStorage.setItem(V,"1"),e(n.startsWith("http")?n:`${window.location.origin}${n}`))},[t,e])},he=(e="dataLayer")=>{typeof window>"u"||(window[e]=window[e]||[])},En=(e="https://www.googletagmanager.com")=>[{rel:"preconnect",href:e,crossOrigin:"anonymous"},{rel:"dns-prefetch",href:e}],yt=e=>{if(typeof window>"u")return;const{gtmId:t,domain:n="https://www.googletagmanager.com",dataLayer:r="dataLayer",nonce:o}=e;if(window[`gtm_loaded_${t}`])return;he(r),window[r].push({"gtm.start":new Date().getTime(),event:"gtm.js"});const s=document.createElement("script");s.async=!0,s.src=`${n}/gtm.js?id=${t}${r!=="dataLayer"?`&l=${r}`:""}`,o&&(s.nonce=o);const i=document.getElementsByTagName("script")[0];i&&i.parentNode?i.parentNode.insertBefore(s,i):document.head.appendChild(s),window[`gtm_loaded_${t}`]=!0},mt=(e,t)=>{const{analyticsAllowed:n}=de();a.useEffect(()=>{n&&(wt(e.dataLayer),yt({...e,nonce:t}))},[n,t,e.gtmId,e.domain,e.dataLayer])},Sn=({config:e,nonce:t})=>(mt(e,t),null),gt=(e,t,n="dataLayer")=>{if(typeof window>"u")return;he(n);const r=window[n];Array.isArray(r)&&r.push({...e,currency:t})},vt=[{shop:I.AU,domain:"https://sgtm.bluettipower.com.au",enable:!0,gtmId:"GTM-NPR8Q7PR",dataLayer:"dataLayer",currency:"AUD"},{shop:I.US,domain:"https://sgtm.bluettipower.com",enable:!0,gtmId:"GTM-KHBMLQS3",dataLayer:"dataLayer",currency:"USD"},{shop:I.JP,domain:"https://sgtm.bluetti.jp",enable:!0,gtmId:"GTM-TSZDSBN2",dataLayer:"dataLayer",currency:"JPY"},{shop:I.EU,domain:"https://sgtm-eu.bluettipower.eu",enable:!0,gtmId:"GTM-NTRP2DKX",dataLayer:"dataLayer",currency:"EUR"},{shop:I.UK,domain:"https://sgtm.bluettipower.co.uk",enable:!0,gtmId:"GTM-NL5XRDJC",dataLayer:"dataLayer",currency:"GBP"}],k=new WeakMap;let v;const pe=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:ze(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Et=pe("inline","width","offsetWidth"),St=pe("block","height","offsetHeight");function Lt({target:e,borderBoxSize:t}){var n;
1(n=k.get(e))==null||n.forEach(r=>{r(e,{get width(){return Et(e,t)},get height(){return St(e,t)}})})}function Ct(e){e.forEach(Lt)}function bt(){typeof ResizeObserver>"u"||(v=new ResizeObserver(Ct))}function It(e,t){v||bt();const n=He(e);return n.forEach(r=>{let o=k.get(r);o||(o=new Set,k.set(r,o)),o.add(t),v==null||v.observe(r)}),()=>{n.forEach(r=>{const o=k.get(r);o==null||o.delete(t),o!=null&&o.size||v==null||v.unobserve(r)})}}const x=new Set;let C;function Pt(){C=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};x.forEach(t=>t(e))},window.addEventListener("resize",C)}function At(e){return x.add(e),C||Pt(),()=>{x.delete(e),!x.size&&typeof C=="function"&&(window.removeEventListener("resize",C),C=void 0)}}function Tt(e,t){return typeof e=="function"?At(e):It(e,t)}function we(e,t){let n;const r=()=>{const{currentTime:o}=t,i=(o===null?0:o.value)/100;n!==i&&e(i),n=i};return P.preUpdate(r,!0),()=>B(r)}function _t(e,t,n){a.useInsertionEffect(()=>e.on(t,n),[e,t,n])}const kt=50,X=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),xt=()=>({time:0,x:X(),y:X()}),Dt={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Q(e,t,n,r){const o=n[t],{length:s,position:i}=Dt[t],c=o.current,d=n.time;o.current=e[`scroll${i}`],o.scrollLength=e[`scroll${s}`]-e[`client${s}`],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=We(0,o.scrollLength,o.current);const f=r-d;o.velocity=f>kt?0:Ue(o.current-c,f)}function Ot(e,t,n){Q(e,"x",t,n),Q(e,"y",t,n),t.time=n}function Bt(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(Fe(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const o=r.getBoundingClientRect();r=r.parentElement;const s=r.getBoundingClientRect();n.x+=o.left-s.left,n.y+=o.top-s.top}else if(r instanceof SVGGraphicsElement){const{x:o,y:s}=r.getBBox();n.x+=o,n.y+=s;let i=null,c=r.parentNode;for(;!i;)c.tagName==="svg"&&(i=c),c=r.parentNode;r=i}else break;return n}const M={start:0,center:.5,end:1};function Z(e,t,n=0){let r=0;if(e in M&&(e=M[e]),typeof e=="string"){const o=parseFloat(e);e.endsWith("px")?r=o:e.endsWith("%")?e=o/100:e.endsWith("vw")?r=o/100*document.documentElement.clientWidth:e.endsWith("vh")?r=o/100*document.documentElement.clientHeight:e=o}return typeof e=="number"&&(r=t*e),n+r}const Nt=[0,0];function Rt(e,t,n,r){let o=Array.isArray(e)?e:Nt,s=0,i=0;return typeof e=="number"?o=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?o=e.split(" "):o=[e,M[e]?e:"0"]),s=Z(o[0],n,r),i=Z(o[1],t),s-i}const Gt={All:[[0,0],[1,1]]},Mt={x:0,y:0};function Ht(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function zt(e,t,n){const{offset:r=Gt.All}=n,{target:o=e,axis:s="y"}=n,i=s==="y"?"height":"width",c=o!==e?Bt(o,e):Mt,d=o===e?{width:e.scrollWidth,height:e.scrollHeight}:Ht(o),f={width:e.clientWidth,height:e.clientHeight};t[s].offset.length=0;let h=!t[s].interpolate;const y=r.length;for(let u=0;u<y;u++){const l=Rt(r[u],f[i],d[i],c[s]);!h&&l!==t[s].interpolatorOffsets[u]&&(h=!0),t[s].offset[u]=l}h&&(t[s].interpolate=Ye(t[s].offset,qe(r),{clamp:!1}),t[s].interpolatorOffsets=[...t[s].offset]),t[s].progress=je(0,1,t[s].interpolate(t[s].current))}function Wt(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}function Ut(e,t,n,r={}){return{measure:o=>{Wt(e,r.target,n),Ot(e,n,o),(r.offset||r.target)&&zt(e,n,r)},notify:()=>t(n)}}const L=new WeakMap,ee=new WeakMap,O=new WeakMap,te=new WeakMap,T=new WeakMap,ne=e=>e===document.scrollingElement?window:e;function ye(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return se;let o=O.get(t);o||(o=new Set,O.set(t,o));const s=xt(),i=Ut(t,e,s,r);if(o.add(i),!L.has(t)){const d=()=>{for(const u of o)u.measure($e.timestamp);P.preUpdate(f)},f=()=>{for(const u of o)u.notify()},h=()=>P.read(d);L.set(t,h);const y=ne(t);window.addEventListener("resize",h,{passive:!0}),t!==document.documentElement&&ee.set(t,Tt(t,h)),y.addEventListener("scroll",h,{passive:!0}),h()}if(n&&!T.has(t)){const d=L.get(t),f={width:t.scrollWidth,height:t.scrollHeight};te.set(t,f);const h=()=>{const u=t.scrollWidth,l=t.scrollHeight;(f.width!==u||f.height!==l)&&(d(),f.width=u,f.height=l)},y=P.read(h,!0);T.set(t,y)}const c=L.get(t);return P.read(c,!1,!0),()=>{var y;B(c);const d=O.get(t);if(!d||(d.delete(i),d.size))return;const f=L.get(t);L.delete(t),f&&(ne(t).removeEventListener("scroll",f),(y=ee.get(t))==null||y(),window.removeEventListener("resize",f));const h=T.get(t);h&&(B(h),T.delete(t)),te.delete(t)}}const re=new Map;function Ft(e){const t={value:0},n=ye(r=>
1{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function me({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);const o=re.get(t)??new Map;re.set(t,o);const s=n.target??"self",i=o.get(s)??{},c=r+(n.offset??[]).join(",");return i[c]||(i[c]=!n.target&&Ve()?new ScrollTimeline({source:t,axis:r}):Ft({container:t,...n})),i[c]}function Yt(e,t){const n=me(t);return e.attachTimeline({timeline:t.target?void 0:n,observe:r=>(r.pause(),we(o=>{r.time=r.iterationDuration*o},n))})}function qt(e){return e.length===2}function jt(e,t){return qt(e)?ye(n=>{e(n[t.axis].progress,n)},t):we(e,me(t))}function $t(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return se;const o={axis:t,container:n,...r};return typeof e=="function"?jt(e,o):Yt(e,o)}const Vt=()=>({scrollX:A(0),scrollY:A(0),scrollXProgress:A(0),scrollYProgress:A(0)}),_=e=>e?!e.current:!1;function Kt({container:e,target:t,...n}={}){const r=Ke(Vt),o=a.useRef(null),s=a.useRef(!1),i=a.useCallback(()=>(o.current=$t((c,{x:d,y:f})=>{r.scrollX.set(d.current),r.scrollXProgress.set(d.progress),r.scrollY.set(f.current),r.scrollYProgress.set(f.progress)},{...n,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var c;(c=o.current)==null||c.call(o)}),[e,t,JSON.stringify(n.offset)]);return Je(()=>{if(s.current=!1,_(e)||_(t)){s.current=!0;return}else return i()},[i]),a.useEffect(()=>{if(s.current)return F(!_(e)),F(!_(t)),i()},[i]),r}var Jt=Object.defineProperty,Xt=(e,t,n)=>t in e?Jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S=(e,t,n)=>Xt(e,typeof t!="symbol"?t+"":t,n);const Qt=()=>{(function(e,t,n,r,o,s,i){e.fbq||(o=e.fbq=function(){o.callMethod?o.callMethod.apply(o,arguments):o.queue.push(arguments)},e._fbq||(e._fbq=o),o.push=o,o.loaded=!0,o.version="2.0",o.queue=[],s=t.createElement(n),s.async=!0,s.src=r,i=t.getElementsByTagName(n)[0],i.parentNode.insertBefore(s,i))})(window,document,"script","https://connect.facebook.net/en_US/fbevents.js")};class Zt{constructor({pixelID:t,debug:n=!0,pageViewOnInit:r=!0,autoConfig:o=!0}){S(this,"autoConfig"),S(this,"pixelID"),S(this,"debug"),S(this,"consolePrefix","[react-use-facebook-pixel]"),S(this,"initialized",!1),S(this,"pageViewOnInit"),S(this,"externalId"),Qt(),this.pixelID=t,this.debug=n,this.pageViewOnInit=r,this.autoConfig=o}init(t){this.initialized||(this.initialized=!0,window.fbq("set","autoConfig",this.autoConfig,this.pixelID),window.fbq("init",this.pixelID,t),t.external_id&&(this.externalId=t.external_id),this.pageViewOnInit&&this.trackEvent("PageView"),this.debug&&console.log(this.consolePrefix,new Date().toLocaleTimeString(),"Facebook Pixel initialized"))}getExternalId(){return this.externalId}trackEvent(t,n,r){if(!this.initialized&&this.debug){console.error(this.consolePrefix,new Date().toLocaleTimeString(),`
2Error`,`
3You tried to track event before initialization`);return}window.fbq("track",t,n,r),this.debug&&console.log(this.consolePrefix,new Date().toLocaleTimeString(),`
4Event tracked.`,`
5Event name: `,t,`
6Event data: `,n,`
7Event additiona data`,r)}}const en=0,ge=0,tn=async(e,t)=>{try{const n=await e.activity.get("/ladder/activityStatus",{cache:{key:"ladder:activityStatus",ttl:en}});if(n.code===0&&n.data.isOpen){const[r,o]=await Promise.all([e.activity.get("/ladder/ladderDetail",{cache:{key:"ladder:ladderDetail",ttl:ge}}),e.activity.post("/ladder/shoppingCartInfo",t)]);
7return n.code===0?{ladderDetail:r.data,shoppingCartInfo:o.data}:null}}catch(n){return console.error(n),null}},nn=async(e,t)=>{try{const n=await e.activity.get("/buygift/detail",{cache:{key:"buygift:detail",ttl:ge}});if(n.code===0&&n.data.status===1){const r=await e.activity.post("/buygift/gifts",t);return r.code===0?{buyGiftDetail:n.data,buyGiftLineItems:r.data}:{buyGiftDetail:n.data,buyGiftLineItems:{lineItems:[],gifts:[]}}}}catch(n){return console.error(n),null}},Ln=(e=2e3)=>{const[t,n]=a.useState(!1);return a.useEffect(()=>{const r=()=>{"requestIdleCallback"in window?requestIdleCallback(()=>n(!0),{timeout:e}):setTimeout(()=>n(!0),1)};if(document.readyState==="loading")return document.addEventListener("DOMContentLoaded",r),()=>document.removeEventListener("DOMContentLoaded",r);r()},[e]),t},Cn=e=>{const[t,n]=a.useState(""),[r,o]=a.useState(0),[s,i]=a.useState(!1);return a.useEffect(()=>{o(window.scrollY)},[]),a.useEffect(()=>{const c=()=>{const d=window.scrollY;let f="";for(let h=0;h<(e==null?void 0:e.length);h++){const y=e[h],u=document.getElementById(y);if(u){const{top:l,bottom:p}=u.getBoundingClientRect();if(l<=window.innerHeight/3&&p>=window.innerHeight/3){f=y,i(h===(e==null?void 0:e.length)-1);break}}}n(f),o(d)};return c(),window.addEventListener("scroll",c),()=>window.removeEventListener("scroll",c)},[e,r,s,t]),t};function bn(){const[e,t]=a.useState([0,0]);return a.useEffect(()=>{if(typeof window<"u"){const n=()=>{t([window.innerWidth,window.innerHeight])};return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)}},[]),e}const In=e=>{const[t,n]=a.useState(null);return a.useEffect(()=>{if(!Y[e])return;(async()=>{const o=new Zt({pixelID:Y[e],debug:!1});o.init({}),n(o)})()},[e]),t};function Pn(){const e=Ge();return Me().some(r=>r.state!=="idle")||e.state!=="idle"}const An=e=>{const t=vt.find(r=>r.shop===e&&r.enable);return{pushEvent:a.useCallback(r=>{gt(it(r),(t==null?void 0:t.currency)||"USD",(t==null?void 0:t.dataLayer)||"dataLayer")},[t==null?void 0:t.currency,t==null?void 0:t.dataLayer])}},Tn=e=>{const[t,n]=a.useState(!0),[r,o]=a.useState(!0),s=a.useCallback(()=>{e&&e.scrollPrev()},[e]),i=a.useCallback(()=>{e&&e.scrollNext()},[e]),c=a.useCallback(d=>{n(!d.canScrollPrev()),o(!d.canScrollNext())},[]);return a.useEffect(()=>{e&&(c(e),e.on("reInit",c).on("select",c))},[e,c]),{prevBtnDisabled:t,nextBtnDisabled:r,onPrevButtonClick:s,onNextButtonClick:i}},_n=e=>{const[t,n]=a.useState(0),[r,o]=a.useState([]),s=a.useCallback(d=>{e&&e.scrollTo(d)},[e]),i=a.useCallback(d=>{o(d.scrollSnapList())},[]),c=a.useCallback(d=>{n(d.selectedScrollSnap())},[]);return a.useEffect(()=>{e&&(i(e),c(e),e.on("reInit",i).on("reInit",c).on("select",c))},[e,i,c]),{selectedIndex:t,scrollSnaps:r,onDotButtonClick:s}},kn=(e,t,n=!0)=>{const[r,o]=a.useState(null),s=async()=>{var u,l;const i=await e,c=(l=(u=i==null?void 0:i.lines)==null?void 0:u.nodes)==null?void 0:l.map(p=>{var w,g;return{quantity:p.quantity,variantID:Number(Xe(p.merchandise.id,!0)),properties:{_ladder_gift:(g=(w=p.attributes)==null?void 0:w.find(m=>m.key==="_ladder_gift"))==null?void 0:g.value},finalPrice:Number(p.cost.totalAmount.amount)}}),d=tn(t,{shoppingCartInfos:c||[]}),f=nn(t,{lineItems:(c==null?void 0:c.map(p=>({qty:p.quantity,vId:p.variantID})))||[]}),[h,y]=await Promise.all([d,f]);return{ladderGiftActivityInfo:h,buyGiftActivityInfo:y}};return a.useEffect(()=>{n&&(async()=>{const c=await s();o(c)})()},[e]),r},xn=(e=750)=>{const[t,n]=a.useState(!1);return a.useEffect(()=>{if(typeof window>"u")return;const r=`(max-width: ${e-1}px)`,o=window.matchMedia(r),s=()=>{n(o.matches)};return s(),o.addEventListener("change",s),()=>{o.removeEventListener("change",s)}},[e]),t};function Dn(e={}){const{hideOffset:t=260,showOffset:n=100,topAlwaysShow:r=20,deltaThreshold:o=4,userWindowMs:s=100,disabled:i=!1}=e,[c,d]=a.useState(!1),{scrollY:f}=Kt(),h=a.useRef(0),y=a.useRef(!1),u=a.useRef(null);return a.useEffect(()=>{const l=()=>{y.current=!0,u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{y.current=!1},s)};window.addEventListener("wheel",l,{passive:!0}),window.addEventListener("touchmove",l,{passive:!0});const p=w=>{["ArrowUp","ArrowDown","PageUp","PageDown"," "].includes(w.key)&&l()};return window.addEventListener("keydown",p),()=>{window.removeEventListener("wheel",l),window.removeEventListener("touchmove",l),window.removeEventListener("keydown",p),u.current&&window.clearTimeout(u.current)}},[s]),_t(f,"change",l=>{const p=h.current,w=l-p;if(h.current=l,i){d(!1);return}if(y.current&&!(Math.abs(w)<o)){if(l<r){d(!1);return}w>0&&l>t&&d(!0),w<0&&l>n&&d(!1)}}),{hidden:c,setHidden:d}}
7const On=()=>{const[e,t]=a.useState({totalHeight:0,headerHeight:0,announcementBarHeight:0,headerContainerTop:0});return a.useEffect(()=>{if(typeof window>"u")return;const n=document.querySelector(".header-container"),r=document.querySelector(".announcement-bar-container");if(!n)return;const o=()=>{const s=n.getBoundingClientRect();r!=null&&r.clientHeight;const i=s.height,c=Math.max(0,s.top);t({totalHeight:c+i,headerHeight:i,announcementBarHeight:c,headerContainerTop:s.top})};return o(),window.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[]),e};function Bn(e,t){const{containerSelectors:n=[],minZIndex:r=300,isExternalOverlay:o,debug:s=!1}=t||{},i=a.useRef(!1),c=a.useCallback(u=>n.some(l=>u.closest(l)),[n]),d=a.useCallback(u=>{if(c(u))return!1;let l=u;for(;l&&l!==document.body&&l!==document.documentElement;){if(c(l))return!1;const p=window.getComputedStyle(l),w=parseInt(p.zIndex,10);if(!Number.isNaN(w)&&w>r&&(p.position==="fixed"||p.position==="absolute")||(l.getAttribute("role")==="dialog"||l.getAttribute("aria-modal")==="true")&&!c(l))return!0;l=l.parentElement}return!1},[c,r]),f=a.useCallback((u,l)=>{const p=document.elementsFromPoint(u,l);let w=!1,g=!1;for(const m of p)m instanceof HTMLElement&&(c(m)&&(w=!0),(d(m)||((o==null?void 0:o(m))??!1))&&(g=!0));return{stack:p,hasContainer:w,hasExternal:g}},[o,d,c]);a.useEffect(()=>{if(!e)return;const u=new MutationObserver(l=>{l.forEach(p=>{if(p.type==="attributes"&&p.attributeName==="style"){const w=document.body;w.style.pointerEvents==="none"&&(s&&console.log("[usePreventBodyPointerEventsNone] 检测到 body pointer-events: none,强制重置为 auto"),w.style.pointerEvents="auto")}})});return u.observe(document.body,{attributes:!0,attributeFilter:["style"]}),document.body.style.pointerEvents==="none"&&(document.body.style.pointerEvents="auto"),()=>{u.disconnect()}},[e,s]),a.useEffect(()=>{if(!e)return;const u=l=>{const{hasContainer:p,hasExternal:w}=f(l.clientX,l.clientY);if(w){i.current=!0,s&&console.log("[usePreventBodyPointerEventsNone] capture: 外部浮层点击,标记阻止关闭");return}p&&(i.current=!1)};return document.addEventListener("pointerdown",u,!0),()=>document.removeEventListener("pointerdown",u,!0)},[f,s,e]);const h=a.useCallback(u=>{var m;if(u.defaultPrevented)return;const l=(m=u.detail)==null?void 0:m.originalEvent,p=l&&"clientX"in l&&"clientY"in l?{x:l.clientX,y:l.clientY}:null,{hasExternal:w,hasContainer:g}=p?f(p.x,p.y):{hasExternal:i.current,hasContainer:!1};if(w||i.current){s&&console.log("[usePreventBodyPointerEventsNone] 阻止 pointerDownOutside 关闭"),i.current=!0,u.preventDefault();return}g&&s&&console.log("[usePreventBodyPointerEventsNone] 点击容器,允许关闭")},[f,s]),y=a.useCallback((u,l)=>{if(!u&&i.current){i.current=!1,s&&console.log("[usePreventBodyPointerEventsNone] 阻止 onOpenChange(false)");return}i.current=!1,l==null||l(u)},[s]);return{handleOutsidePointerDown:h,guardOpenChange:y}}export{Sn as C,vt as G,fn as P,An as a,Pn as b,_n as c,Tn as d,Bn as e,bn as f,dn as g,In as h,un as i,xn as j,Cn as k,Ln as l,yn as m,pn as 
7n,nt as o,Dn as p,kn as q,wn as r,ln as s,En as t,hn as u,mn as v,gn as w,vn as x,On as y};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.