1import{a as e}from"./CNC7AqOf.js";import{Cn as t,En as n,Hn as r,Vn as i,Yn as a,bn as o,rt as s,xn as c,zn as l}from"./Cj3Ri-bZ.js";import{t as u}from"./Dt3TVEio.js";import{t as d}from"./C0aQe7Ii2.js";import{t as f}from"./gtXM1QXx2.js";import{n as p,t as m}from"./C5KgTtL52.js";import{t as h}from"./DW3OcRNq2.js";import{a as g,l as _,o as v,t as y,u as b}from"./jHVO_sp_2.js";import{$ as x,X as S}from"./YnJeFydF2.js";import{t as C}from"./DTbR38vj2.js";import{i as w}from"./CC23oqCR2.js";import{x as T}from"./IGt-hQ4R2.js";import{t as E}from"./NCpowcsI.js";import{t as D}from"./ljbY2sJ7.js";import{t as O}from"./CxiDkZq2.js";import{t as k}from"./Ci-LqymS.js";/* empty css */import{c as A,r as j,s as M}from"./D0JdoL93.js";import{t as N}from"./DYcQjWLK.js";import{t as P}from"./CtRoGLTe.js";var F=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(!Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},I=(e,t)=>typeof e==`string`?{key:e,values:{}}:F(e)?{key:`key`in e&&typeof e.key==`string`?e.key:t,values:`values`in e&&F(e.values)?e.values:{}}:{key:t,values:{}},L=(e,t)=>{let n=e.params;if(!n?.i18n)return;let{key:r,values:i}=I(n.i18n,`zod:errors.custom`);return t(r,{...i,defaultValue:void 0})},R=e=>t=>{let n=e;switch(t.code){case`invalid_type`:return t.input===void 0||t.input===null?n(`zod:errors.invalid_type_received_nil`,{defaultValue:void 0}):n(`zod:errors.invalid_type`,{defaultValue:void 0});case`invalid_value`:return n(`zod:errors.invalid_type`,{defaultValue:void 0});case`invalid_format`:let e=t.format;return n(e?`zod:errors.invalid_string.${e}`:`zod:errors.invalid_date`,{defaultValue:void 0});case`too_small`:{let e=L(t,n);if(e)return e;let r=t.origin===`date`?new Date(t.minimum):t.minimum,i=t.inclusive??!0;return n(`zod:errors.too_small.${t.origin??`number`}.${i?`inclusive`:`not_inclusive`}`,{minimum:r,count:typeof r==`number`?r:void 0,defaultValue:void 0})}case`too_big`:{let e=L(t,n);if(e)return e;let r=t.origin===`date`?new Date(t.maximum):t.maximum,i=t.inclusive??!0;return n(`zod:errors.too_big.${t.origin??`number`}.${i?`inclusive`:`not_inclusive`}`,{maximum:r,count:typeof r==`number`?r:void 0,defaultValue:void 0})}case`custom`:return L(t,n)??n(`zod:errors.custom`,{defaultValue:void 0});case`not_multiple_of`:return n(`zod:errors.not_multiple_of`,{multipleOf:t.divisor,defaultValue:void 0});default:return n(`zod:errors.invalid_type`,{defaultValue:void 0})}},z=T(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),B=e(p(),1),V=m(),H=({...e})=>(0,V.jsx)(k,{theme:n().bodyBgMode,className:`toaster group`,position:`bottom-center`,icons:{success:(0,V.jsx)(E,{className:`size-4`}),info:(0,V.jsx)(D,{className:`size-4`}),warning:(0,V.jsx)(i,{className:`size-4`}),error:(0,V.jsx)(z,{className:`size-4`}),loading:(0,V.jsx)(r,{className:`size-4 animate-spin`})},style:{"--border-radius":`var(--radius-xl)`},...e}),U=`BE.BG.CZ.DK.DE.EE.IE.EL.ES.FR.HR.IT.CY.LV.LT.LU.HU.MT.NL.AT.PL.PT.RO.SI.SK.FI.SE`.split(`.`),W=[`IS`,`LI`,`NO`],G;(function(e){function n(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(`0x`+t)}))}e.b64=n;function r(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})}e.uuidv4=r;async function i(e,n,i){if(!t.cookiesEnabled())return null;let a=d.getCookie(`vi_uid`);a||(a=r(),d.setSessionCookie(`vi_uid`,a)),await G.trackEvent(`pageview`,i,void 0,n)}e.ttsootu=i;async function a(e,r,i,a){if(!t.cookiesEnabled())return null;let{url:o,ref:s}=c();try{let t=n(JSON.stringify({e,u:o,r:s,s:r,vc:d.getCookie(`vi_vid`),c:d.getCookie(`vi_sid`),...i&&{ci:i},...a&&{i:a}})),c=await(await fetch(C.T_URL()+`/event?payload=`+t)).json();c.vid&&d.setCookieWithMaxAge(`vi_vid`,c.vid,365*24*60*60),c.sid&&d.setCookieWithMaxAge(`vi_sid`,c.sid,2700)}catch(e){console.error(e)}}e.trackEvent=a;
1function o(e,t){e.searchParams.forEach((e,n)=>{n.startsWith(`utm_`)&&!t.searchParams.has(n)&&t.searchParams.set(n,e)})}function s(){try{return!!(window.parent&&window.parent.document)}catch(e){return console.warn(`Cross-origin access to parent blocked:`,e),!1}}function c(){let e=document.URL,t=document.referrer;try{let n=new URL(e),r=n.searchParams.get(`meta[viUrl]`);if(r)return t=n.searchParams.get(`meta[viReferrer]`)??``,o(new URL(r),n),e=n.toString(),{url:e,ref:t};window.self!==window.parent&&s()&&(t=window.parent.document.referrer,o(new URL(window.parent.location.href),n),e=n.toString())}catch(e){console.error(`Error parsing URL:`,e)}return{url:e,ref:t}}})(G||={});var K=o((e,t)=>({queue:[],clearQueue:()=>{let n=t().queue;return n.length?(e({queue:[]}),n):[]},emit:n=>e({queue:[...t().queue,n]})})),q=()=>c(K,e=>e.emit);function J(){let{seller:e}=l(),t=q(),n=_(),r=b(),i=x(()=>{G.trackEvent(`pageview`,e._id,void 0,(()=>{for(let e of r)if(e.id===`routes/events/[slug]`){let t=e.loaderData;if(t?.event?._id)return t.event._id}})()).catch(()=>{}),t({type:`page_view`,context:f.getContext()})});return(0,B.useEffect)(()=>{i()},[n,i]),null}function Y(){let e=q(),t=s(e=>e.customer),{seller:n}=l(),r=U.includes(n.locationCountry)||W.includes(n.locationCountry);return S(`checkout_upserted`,({checkout:t,ctx:n})=>{n.origin===`user_intention`&&(G.trackEvent(`checkout_created`,t.sellerId,t._id),e({type:`checkout_created`,data:{checkout:t},context:f.getContext()}))}),S(`checkout_details_provided`,({checkout:n})=>{G.trackEvent(`details_submitted`,n.sellerId,n._id),e({type:`checkout_details_provided`,data:{checkout:n,tags:t.status===`authenticated`?t.data.tags??[]:[],omitSensitiveData:r},context:f.getContext()})}),S(`checkout_completed`,async({checkout:n})=>{await G.trackEvent(`checkout_completed`,n.sellerId,n._id),e({type:`checkout_completed`,data:{checkout:n,tags:t.status===`authenticated`?t.data.tags??[]:[],omitSensitiveData:r},context:f.getContext()})}),null}function X(){let e=_(),{seller:t}=l();if(e.search.includes(`testing=true`))return null;
1let n=t.shopSettings.tracking.gTagManager?.gtmId||t.shopSettings.tracking.segment?.active||t.shopSettings.tracking.tiktokPixel?.active||t.shopSettings.tracking.facebookPixel?.active;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(J,{}),(0,V.jsx)(Y,{}),n&&(0,V.jsx)(Z,{})]})}function Z(){let{seller:e}=l(),t=(0,B.useRef)(null),n=(0,B.useRef)(!1),[r,i]=(0,B.useState)(!1),a=c(K,e=>e.queue),o=A(e=>e.consent),s=(0,B.useCallback)(()=>{if(!n.current)return;let e=K.getState().clearQueue();if(e.length)for(let t of e)u(t)},[]);P(()=>{s()},[a]),P(()=>{o&&u({type:`consent_changed`,data:{cookieConsent:o},context:f.getContext()})},[o]),(0,B.useEffect)(()=>{i(!0);let t=t=>{let r=f.parseChildMessage(t);r&&(r.type===`ready`?(u({type:`init`,data:{country:e.locationCountry,tracker:{enabled:!0,sellerId:e._id,gTagManagerGtmId:e.shopSettings.tracking.gTagManager?.gtmId,gTagManagerTrackers:e.shopSettings.tracking.gTagManager?.trackers??[],facebookPixelId:e.shopSettings.tracking.facebookPixel?.active?e.shopSettings.tracking.facebookPixel?.pixelId:void 0,facebookConversionEnabled:e.shopSettings.tracking.facebookConversion?.active,segmentWriteKey:e.shopSettings.tracking.segment?.apiKey,segmentTrackers:[],tiktokPixelId:e.shopSettings.tracking.tiktokPixel?.active?e.shopSett
1ings.tracking.tiktokPixel?.pixelId:void 0,trackingUrl:C.T_URL()},cookieConsent:j.getState().consent??M},context:f.initContext()}),n.current=!0,setTimeout(()=>{s()},2e3)):r.type===`api.setCookie`?document.cookie=r.data.cookie:r.type===`api.storageEvent`&&(r.data.storage===`localStorage`?r.data.event===`setItem`?window.localStorage.setItem(r.data.args[0],r.data.args[1]):r.data.event===`clear`?window.localStorage.clear():r.data.event===`removeItem`&&window.localStorage.removeItem(r.data.args[0]):r.data.storage===`sessionStorage`&&(r.data.event===`setItem`?window.sessionStorage.setItem(r.data.args[0],r.data.args[1]):r.data.event===`clear`?window.sessionStorage.clear():r.data.event===`removeItem`&&window.sessionStorage.removeItem(r.data.args[0]))))};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},[e,s]);let u=e=>{t.current?.contentWindow?.postMessage(JSON.stringify(e),`*`)};return(0,V.jsx)(V.Fragment,{children:r&&(0,V.jsx)(`iframe`,{title:`Tracking Container`,ref:t,src:`/web3/_trc.html`,className:`w-0 h-0`,sandbox:`allow-scripts allow-forms`})})}function Q(e,t){let n=new URL(e);return n.searchParams.set(`lang`,t),n.toString()}function $(e){return Object.values(a).map(t=>[{lang:t,url:Q(`https://${e.host}${e.pathname}`,t)},...t===e.defaultLanguage?[{lang:`x-default`,url:Q(`https://${e.host}${e.pathname}`,t)}]:[]]).flat(1)}var ee=()=>[],te=g(function(e){let{domainCtx:t,organization:n,config:r,isPreview:i,meta:a}=e.loaderData,o=e.loaderData.seller,[c,l]=(0,B.useState)(r.menu),[d,f]=(0,B.useState)(r.theme),p=s(e=>e.init),{t:m}=h([`common`,`zod`]),g=_();return(0,B.useEffect)(()=>{if(!i)return;parent.postMessage(JSON.stringify({type:`ipc:init`}),`*`);let e=e=>{if(e.data&&typeof e.data==`string`)try{let t=JSON.parse(e.data);t.type===`ipc:reload`&&t.data?.menu&&l(t.data.menu),t.type===`ipc:reload`&&t.data?.theme&&f(t.data.theme)}catch{}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[i]),(0,B.useEffect)(()=>{p(o)},[p,o]),w(R(m)),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`link`,{rel:`icon`,href:`https://${t.host}/favicon.ico`}),(0,V.jsx)(`link`,{rel:`canonical`,href:`https://${t.primary}${g.pathname}${o.localeSettings.defaultLanguage?`?lang=${o.localeSettings.defaultLanguage}`:``}`}),$({host:t.host,pathname:g.pathname,defaultLanguage:o.localeSettings.defaultLanguage}).map(e=>(0,V.jsx)(`link`,{rel:`alternate`,hrefLang:e.lang,href:e.url},e.lang)),(0,V.jsx)(u,{domainCtx:t,seller:o,organization:n,config:{theme:d,menu:c},meta:a,children:(0,V.jsxs)(N,{children:[(0,V.jsx)(y,{}),(0,V.jsx)(H,{}),(0,V.jsx)(X,{})]})})]})}),ne=()=>!1,re=v(function({error:e}){return(0,V.jsx)(O,{error:e})});export{re as ErrorBoundary,te as default,ee as links,ne as shouldRevalidate};
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.