var O=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);import{s as I,W as L}from"./setup.3kCbVPWU.js";import{w as u}from"./address.D9YqGnWl.js";import"./_commonjsHelpers.C0HnJYVl.js";var te=O((le,p)=>{function g(){}function b(){return typeof WeakMap<"u"?new WeakMap:z()}function z(){return{add:g,delete:g,get:g,set:g,has:function(e){return!1}}}var D=Object.prototype.hasOwnProperty,m=function(e,t){return D.call(e,t)};function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return e}var A=/^[ \t]*(?:\r\n|\r|\n)/,j=/(?:\r\n|\r|\n)[ \t]*$/,q=/^(?:[\r\n]|$)/,K=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,R=/^[ \t]*[\r\n][ \t\r\n]*$/;function y(e,t,n){var i=0,r=e[0].match(K);r&&(i=r[1].length);var o="(\\r\\n|\\r|\\n).{0,"+i+"}",l=new RegExp(o,"g");t&&(e=e.slice(1));var a=n.newline,s=n.trimLeadingNewline,x=n.trimTrailingNewline,h=typeof a=="string",f=e.length,w=e.map(function(c,M){return c=c.replace(l,"$1"),M===0&&s&&(c=c.replace(A,"")),M===f-1&&x&&(c=c.replace(j,"")),h&&(c=c.replace(/\r\n|\n|\r/g,function(ne){return a})),c});return w}function F(e,t){for(var n="",i=0,r=e.length;ie(i,r))},fetchWithAuth(){throw new Error("fetchWithAuth is not available in this context")},graphql(){throw new Error("graphql is not available in this context")}};const t=typeof $wixContext<"u"?$wixContext.client:typeof u.client<"u"?u.client:typeof globalThis.__wix_context__<"u"?globalThis.__wix_context__.client:void 0,n=typeof $wixContext<"u"?$wixContext.elevatedClient:typeof u.elevatedClient<"u"?u.elevatedClient:typeof globalThis.__wix_context__<"u"?globalThis.__wix_context__.elevatedClient:void 0;if(!(!t&&!n))return{initWixModules(i,r){if(r){if(!n)throw new Error("An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules");return v(()=>n.use(i))}if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return v(()=>t.use(i))},fetchWithAuth:(i,r)=>{if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.fetchWithAuth(i,r)},getAuth(){if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.auth},async graphql(i,r,o){if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.graphql(i,r,o)}}}function v(e){const t=globalThis.__wix_context__,n={client:u.client,elevatedClient:u.elevatedClient};let i;globalThis.__wix_context__=void 0,u.client=void 0,u.elevatedClient=void 0,typeof $wixContext<"u"&&(i={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,u.client=n.client,u.elevatedClient=n.elevatedClient,typeof $wixContext<"u"&&($wixContext.client=i.client,$wixContext.elevatedClient=i.elevatedClient)}}function B(e,t){return{...e,...Object.fromEntries(t.map(n=>[n,(...i)=>{const r=G();if(!r)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return r.initWixModules(e)[n].apply(void 0,i)}]))}}function J(e){return B({__type:"host",create:t=>Object.entries(e).reduce((n,[i,r])=>({...n,[i]:r(t)}),{})},Object.keys(e))}var P=class{constructor(e){this.message=e,this.captureException=()=>{console.error(this.message)},this.captureMessage=()=>{console.error(this.message)},this.startSpan=(t,n)=>(console.error(this.message),n(void 0)),this.startSpanManual=()=>(console.error(this.message),{end:()=>{},fail:()=>{}}),this.endSpanManual=()=>{console.error(this.message)},this.addBreadcrumb=()=>{console.error(this.message)}}},X=e=>new P(e);const Q=J({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():X("Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.")});var U=["debug","error","info","log","warn"],$=()=>{try{throw new Error}catch(e){return e?.stack}},V=e=>{e=e??$();const t=e?.trim().split(` `);if(!t)return null;for(let n=t.length-1;n>=0;n--){const i=t[n].match(/https?:\/\/.+?(\/.+):(\d+):(\d+)/)??t[n].match(/.*(\/[^/]+):(\d+):(\d+)/);if(i)return{file:i[1],line:parseInt(i[2],10)??0,column:parseInt(i[3],10)??0}}return null},T="Failed to create a monitoring client",N=()=>{try{return Q.getMonitoringClient()}catch(e){console.error(T,e);return}},Y=e=>{switch(e){case"log":return"info";case"warn":return"warning";default:return e}},Z=e=>{try{return JSON.stringify(e)}catch(t){return`Failed to stringify log value: ${t?.toString()}`}},W=(e,t)=>{for(const n of U){const i=e[n];console[n]=(...r)=>{i(...r),k(t(),{method:n},...r)}}},k=(e,{method:t,stack:n},...i)=>{if(i?.[0]===T)return;const r=i.map(a=>typeof a=="string"?a:a instanceof Error?a.toString():Z(a)).join(" ");n=n??$();const o=V(n),l=o?{__sourceLocation:o}:void 0;e??=N(),e?.captureMessage(r,{level:Y(t),contexts:l})},E,C=()=>(E??=N(),E);function ee(){if(!window.__wixMonitoring){W(console,C);return}const{originalMethods:e,queue:t}=window.__wixMonitoring;W(e,C);for(const{method:n,stack:i,timestamp:r,args:o}of t)k(C(),{method:n,stack:i},...o);delete window.__wixMonitoring}I({clientId:L});ee()});export default te();