@wix/bookings 1.0.1777 → 1.0.1779
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/build/cjs/context-booking-checkout.d.ts +243 -108
- package/build/cjs/context-booking-checkout.js +176 -182
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.d.ts +16 -143
- package/build/cjs/context-categories.js +411 -411
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.d.ts +16 -287
- package/build/cjs/context-locations.js +335 -335
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.d.ts +2 -2
- package/build/cjs/context-service.d.ts +71 -33
- package/build/cjs/context-service.js +97 -95
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +10 -0
- package/build/cjs/context-time-slots.js +1 -1
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +243 -108
- package/build/es/context-booking-checkout.mjs +176 -179
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.d.mts +16 -143
- package/build/es/context-categories.mjs +411 -411
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.d.mts +16 -287
- package/build/es/context-locations.mjs +335 -335
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.d.mts +2 -2
- package/build/es/context-service.d.mts +71 -33
- package/build/es/context-service.mjs +97 -95
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +10 -0
- package/build/es/context-time-slots.mjs +1 -1
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +243 -108
- package/build/internal/cjs/context-categories.d.ts +16 -143
- package/build/internal/cjs/context-locations.d.ts +16 -287
- package/build/internal/cjs/context-service-addons.d.ts +2 -2
- package/build/internal/cjs/context-service.d.ts +71 -33
- package/build/internal/cjs/context-time-slots.d.ts +10 -0
- package/build/internal/es/context-booking-checkout.d.mts +243 -108
- package/build/internal/es/context-categories.d.mts +16 -143
- package/build/internal/es/context-locations.d.mts +16 -287
- package/build/internal/es/context-service-addons.d.mts +2 -2
- package/build/internal/es/context-service.d.mts +71 -33
- package/build/internal/es/context-time-slots.d.mts +10 -0
- package/context-runtime/context-booking-checkout/runtime.d.ts +243 -108
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-categories/runtime.d.ts +16 -143
- package/context-runtime/context-categories/runtime.js +2 -2
- package/context-runtime/context-locations/runtime.d.ts +16 -287
- package/context-runtime/context-locations/runtime.js +2 -2
- package/context-runtime/context-service/runtime.d.ts +71 -33
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-service-addons/runtime.d.ts +2 -2
- package/context-runtime/context-time-slots/runtime.d.ts +10 -0
- package/context-runtime/context-time-slots/runtime.js +2 -2
- package/package.json +7 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Component as e,Suspense as t,createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c,useSyncExternalStore as l}from"react";import{useGetService as u,useService as d}from"@wix/services-manager-react";import{jsx as f}from"react/jsx-runtime";var p={};function m(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var h=e=>{switch(e){case`get`:case`GET`:return`GET`;case`post`:case`POST`:return`POST`;case`put`:case`PUT`:return`PUT`;case`delete`:case`DELETE`:return`DELETE`;case`patch`:case`PATCH`:return`PATCH`;case`head`:case`HEAD`:return`HEAD`;case`options`:case`OPTIONS`:return`OPTIONS`;default:throw Error(`Unknown method: ${e}`)}},g=e=>t=>async n=>{let r,i=t=>{if(r=e(n)(t),r.url===void 0)throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);let{method:i,url:a,params:o}=r;return{...r,method:h(i),url:a,data:r.data,params:o}};try{let e=await t.request(i);if(r===void 0)throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);let n=Array.isArray(r.transformResponse)?r.transformResponse:[r.transformResponse],a=e.data;return n.forEach(t=>{t&&(a=t(e.data,e.headers))}),a}catch(e){throw typeof e==`object`&&e&&`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response?e.response.data:e}},_=e=>e.__isAmbassador?!0:!!e().__isAmbassador,v=`__metadata`,y=`edge.wixapis.com`,b=class extends Error{message;response;constructor(e,t){super(e),this.message=e,this.response=t}async details(){let e=await this.response.json();return x(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},x=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),ee=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},te=e=>e&&typeof e==`object`&&!Array.isArray(e),S=e=>e.__type===`host`;function C(e,t){return e.create(t)}var w=`x-wix-bi-gateway`;function ne(e,t,n){return{[w]:re({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function re(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ie(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var ae={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function oe(e){return de(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var se=/([\p{Ll}\d])(\p{Lu})/gu,ce=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,le=`$1\0$2`,ue=/[^\p{L}\d]+/giu;function de(e){let t=e.trim();t=t.replace(se,le).replace(ce,le),t=t.replace(ue,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var fe=e=>`validationError`in(e.response?.data?.details??{}),pe=e=>`applicationError`in(e.response?.data?.details??{}),me=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function he(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(fe(e))return ge(e,t,n);if(pe(e))return _e(e);if(me(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:oe(n),data:{}},requestId:e.requestId};return T(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return ve(e)}var ge=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=ye(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return T(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},T=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),_e=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??oe(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return T(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},ve=e=>T(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:oe(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),ye=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:be(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,be(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},be=(e,t)=>{let n=xe(e);return n==null?e:e.replace(`$[${n}]`,t[n])},xe=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Se(e,t,n,r,i,a,o,s,c,l,u){return ie(()=>e({request:async e=>{let i=e({host:s?.HTTPHost||`www.wixapis.com`}),a=i;a.method===`GET`&&a.fallback?.length&&(a.params?.toString().length??0)>4e3&&(a=i.fallback[0]);let o=s?.HTTPHost??`www.wixapis.com`,u=`https://${l?y:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=ne(i,t,c),o={method:a.method,...a.data&&{body:JSON.stringify(a.data)},headers:{...e}},s=await n(u,o);if(s.status!==200){let e=null;try{e=await s.json()}catch{}let t=we(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=he(t);throw r?.handleError(n,{requestOptions:{url:a.url,method:a.method,entityFqdn:i.entityFqdn,methodFqn:i.methodFqn}}),t}let l=await s.json();return{data:a.migrationOptions?.optInTransformResponse&&a.transformResponse?Array.isArray(a.transformResponse)?a.transformResponse[0](l):a.transformResponse(l):l,headers:s.headers,status:s.status,statusText:s.statusText}}catch(e){throw e.message?.includes(`fetch is not defined`)&&console.error(`Node.js v18+ is required`),e}},fetchWithAuth:n,wixAPIFetch:i,getActiveToken:a,getAuthHeaders:o},{validateRequestSchema:u}))}var Ce=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},we=(e,t,n,r)=>new Ce({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),Te=`.`;function Ee(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=De(t),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;break}let a=r[e+1];(!(t in i)||i[t]==null||typeof i[t]!=`object`||i[t]===null)&&(i[t]=typeof a==`number`?[]:{}),i=i[t]}return e}function De(e){return Array.isArray(e)?e:e.split(Te).map(e=>Oe(e)?Number(e):e)}function Oe(e){return/^\d+$/.test(e)}function ke(e){let t={};for(let[n,r]of Object.entries(e))Ae(n)||Ee(t,De(n),r);return t}function Ae(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var je=class{BRACKET_PATTERN=/\[(\d+)\]/g;NUMERIC_PATTERN=/^\d+$/;ESCAPED_DOT_PATTERN=/\\\./g;ESCAPED_LEFT_BRACKET_PATTERN=/\\\[/g;ESCAPED_RIGHT_BRACKET_PATTERN=/\\\]/g;SPLIT_PATTERN=/\.|\[(\d+)\]/g;DOT_BEFORE_BRACKET_PATTERN=/\.\[/g;ESCAPED_DOT_PLACEHOLDER=`__DOT__`;ESCAPED_RIGHT_BRACKET_PLACEHOLDER=`__RB__`;ESCAPED_LEFT_BRACKET_PLACEHOLDER=`__LB__`;modifiedFields;cleanedModifiedFields;constructor(e){this.modifiedFields=e}replaceEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PATTERN,this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN,this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN,this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER)}restoreEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PLACEHOLDER,`\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER,`\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER,`\\[`)}unflatten(){return this.cleanedModifiedFields=Object.fromEntries(Object.entries(this.modifiedFields).map(([e,t])=>[this.replaceEscapedCharacters(this.bracketToDotNotation(e)),t])),ke(this.cleanedModifiedFields)}flatten(e){let t={};for(let n of Object.keys(this.cleanedModifiedFields)){let r=this.splitPath(n),i=this.navigatePath(e,r);t={...t,...i}}return Object.fromEntries(Object.entries(t).map(([e,t])=>[this.restoreEscapedCharacters(e),t]))}splitPath(e){let t=[],n=0,r=Array.from(e.matchAll(this.SPLIT_PATTERN));for(let i of r)i.index>n&&t.push(e.substring(n,i.index)),i[1]&&t.push(i[1]),n=i.index+i[0].length;return n<e.length&&t.push(e.substring(n)),t}navigatePath(e,t){let n=e,r=[],i=e=>{if(!Array.isArray(n))throw Error(`Expected array at path ${this.buildPathString(r)}, but got ${typeof n}`);r.push(`[${e}]`),n=n[parseInt(e,10)]},a=(e,t)=>{let i=e in ae?ae[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Fe(e);if(a&&a in t){r.push(a),n=t[a];return}throw Error(`Cannot find key '${e}' or its transformations at path ${this.buildPathString(r)}`)},o=(e,t)=>{r.push(e),n=t[e]};for(let e of t){if(this.NUMERIC_PATTERN.test(e)){i(e);continue}if(typeof n!=`object`||!n)throw Error(`Cannot access property '${e}' on ${typeof n} at path ${this.buildPathString(r)}`);let t=n;if(e in n){o(e,t);continue}a(e,t)}return{[this.buildPathString(r)]:n}}buildPathString(e){return e.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN,`[`)}bracketToDotNotation(e){return e.replace(this.BRACKET_PATTERN,(t,n,r)=>r>0&&e[r-1]===`\\`?t:`.`+n)}};function Me(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Ne(n);if(!r)return null;let{unflattenedModifiedFields:i,modifiedFieldsManipulator:a}=r;e={...e,modifiedFields:i};let o=t(e),s=o?.modifiedFields;if(!s)return null;let c=Pe(s,a);return c===null?null:(o.modifiedFields=c,o)}function Ne(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new je(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Pe(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Fe(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Ie(){return{emit(e,...t){for(let n=0,r=this.events[e]||[],i=r.length;n<i;n++)r[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}}var Le=e=>e.__type===`event-definition`;function Re(e,t,n,r){let i;if(e.isDomainEvent){let{deletedEvent:e,actionEvent:t,createdEvent:a,updatedEvent:o,...s}=n,c={...r,...s};i=e?e?.deletedEntity?{entity:e?.deletedEntity,metadata:c}:{metadata:c}:t?{data:t.body,metadata:c}:o?{entity:o.currentEntity,metadata:c,...o.modifiedFields?{modifiedFields:o.modifiedFields}:{}}:{entity:a?.entity,metadata:c}}else i={data:n,metadata:r};let a=e.transformations??(e=>e),o=i,s=i;if(s.modifiedFields){let e=s.modifiedFields;if(typeof e==`object`&&e&&!Array.isArray(e)){o=structuredClone(i);let e=Me(s,a);if(e)return t(e)}}return t(a(o))}function ze(e){let t=new Map,n=Ie();return{initModule(e){return r=>{let i=t.get(e.type)??[];i.push({eventDefinition:e,handler:r}),t.set(e.type,i),n.emit(`registered`,e)}},client:{...n,getRegisteredEvents:()=>t,async process(e,n={expectedEvents:[]}){let{eventType:r,identity:i,instanceId:a,payload:o,accountInfo:s}=await this.parseJWT(e),c=[...n.expectedEvents,...Array.from(t.keys()).map(e=>({type:e}))];if(c.length>0&&!c.some(({type:e})=>e===r))throw Error(`Unexpected event type: ${r}. Expected one of: ${c.map(e=>e.type).join(`, `)}`);let l=t.get(r)??[];return await Promise.all(l.map(({eventDefinition:e,handler:t})=>Re(e,t,o,{instanceId:a,identity:i,accountInfo:s}))),{instanceId:a,eventType:r,payload:o,identity:i,accountInfo:s}},async processRequest(e,t){let n=await e.text();return this.process(n,t)},async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`string`)throw Error(`Unexpected type of JWT data: expected string, got ${typeof r.data}`);let a=JSON.parse(r.data),o=a.eventType,s=a.accountInfo,c=a.instanceId,l=a.identity?JSON.parse(a.identity):void 0;return{instanceId:c,eventType:o,payload:JSON.parse(a.data),identity:l,accountInfo:s}},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async executeHandlers(e){let n=Array.from(t.keys()).map(e=>({type:e}));if(n.length>0&&!n.some(({type:t})=>t===e.eventType))throw Error(`Unexpected event type: ${e.eventType}. Expected one of: ${n.map(e=>e.type).join(`, `)}`);let r=t.get(e.eventType)??[];await Promise.all(r.map(({eventDefinition:t,handler:n})=>Re(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:m(`AppInstalled`)(),AppRemoved:m(`AppRemoved`)()}}}}var Be=e=>e.__type===`service-plugin-definition`;function Ve(e){let t=new Map,n=Ie();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var E=`X-Wix-Consistent`;function He(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[E]:t[E]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=D(e);return a&&(t[E]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=D(e);return a&&(t[E]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=Ve(i),{client:u,initModule:d}=ze(i),f=async(n,r)=>{let i=o(),s=await a(),c=ee(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[E]:t[E]}:{}}}),u=D(l);return u&&(t[E]=u),l},m=(t,n)=>{if(Le(t))return d(t);if(Be(t))return l(t);if(S(t)&&e.host)return C(t,e.host);if(typeof t==`function`){if(`__type`in t&&t.__type===`wix_spi_error`)return t;let r=e.host?.apiBaseUrl??`www.wixapis.com`,o=e.useCDN===void 0?i().shouldUseCDN:e.useCDN;return Se(ie(()=>_(t))?g(t):t,n??{},f,e.host?.getErrorHandler?.(),(e,t)=>{let n=new URL(e,`https://${r}`);return n.host=r,n.protocol=`https`,f(n.toString(),t)},i().getActiveToken,async()=>a(),{HTTPHost:r},e.host?.name,o,e.validateRequestSchema)}return te(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,m(n,t[v])])):t},h=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?m(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:h,use:m,enableContext(e,t={elevated:!1}){e===`global`?globalThis.__wix_context__==null?t.elevated?globalThis.__wix_context__={elevatedClient:this}:globalThis.__wix_context__={client:this}:t.elevated?globalThis.__wix_context__.elevatedClient=this:globalThis.__wix_context__.client=this:t.elevated?p.elevatedClient=this:p.client=this},fetch:(t,n)=>{let r=e.host?.apiBaseUrl??`www.wixapis.com`,i=new URL(t,`https://${r}`);return i.host=r,i.protocol=`https`,f(i.toString(),n)},fetchWithAuth:s,async graphql(t,n,r={apiVersion:`alpha`}){let i=e?.host?.apiBaseUrl??`www.wixapis.com`,a=await f(`https://${i}/graphql/${r.apiVersion}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:t,variables:n})});if(a.status!==200)throw new b(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:u,servicePlugins:c}}function D(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var Ue={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},We={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function Ge(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var Ke=`sort.fieldName`;function qe(e,t,n){return(e===Ke||e.endsWith(`.${Ke}`))&&typeof t==`string`?Ge(t,n):t}function Je(e,t,n){let r=e=>n.includes(e),i=(e,n)=>{if(Array.isArray(e))e.forEach(e=>{i(e,n)});else if(typeof e==`object`&&e){let a=e;Object.keys(a).forEach(e=>{let o=n===``?e:`${n}.${e}`;if(r(o))return;let s=Ye(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=qe(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function Ye(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function Xe(e,t=[]){return Je(e,Ue,t)}function Ze(e,t=[]){return Je(e,We,t)}var Qe=new WeakMap;function O(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function $e(e,t){let n=e.get(t);return n||(n=O(),e.set(t,n)),n}function et(e,t){return t===`*`?(e.anyField??=O(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,$e(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,$e(e.fields,t))}function tt(e){let t=O();for(let n of e){let e=n.path.split(`.`).reduce(et,t);e.leaves??=[],e.leaves.push(n)}return t}function nt(e){let t=Qe.get(e);return t||(t=tt(e),Qe.set(e,t)),t}function k(e){return typeof e==`object`&&!!e}function rt(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?k(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function A(e,t,n){k(e)&&ot(e,t,n)}function it(e,t,n){for(let[r,i]of t){if(!(r in e))continue;if(i.leaves)for(let t of i.leaves)e[r]=rt(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>A(e,i,n)):A(t,i,n)}}function at(e,t,n){for(let[r,i]of t){let t=e[r];k(t)&&Object.values(t).forEach(e=>A(e,i,n))}}function ot(e,{fields:t,mapFields:n,anyField:r},i){t&&it(e,t,i),n&&at(e,n,i),r&&Object.values(e).forEach(e=>A(e,r,i))}function st(e,t){if(!k(e))return e;for(let{paths:n,transformFn:r}of t)ot(e,nt(n),r);return e}function ct(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function j(e){return pt(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var lt=/([\p{Ll}\d])(\p{Lu})/gu,ut=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,dt=`$1\0$2`,ft=/[^\p{L}\d]+/giu;function pt(e){let t=e.trim();t=t.replace(lt,dt).replace(ut,dt),t=t.replace(ft,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var mt=e=>`validationError`in(e.response?.data?.details??{}),ht=e=>`applicationError`in(e.response?.data?.details??{}),gt=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function _t(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(mt(e))return vt(e,t,n);if(ht(e))return yt(e);if(gt(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:j(n),data:{}},requestId:e.requestId};return M(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return bt(e)}var vt=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=xt(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return M(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},M=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),yt=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??j(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return M(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},bt=e=>M(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:j(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),xt=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:St(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,St(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},St=(e,t)=>{let n=Ct(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Ct=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function wt(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return N(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:p.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:p.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:p.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:p.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw 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 N(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return N(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function N(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function Tt(e,t){return((...n)=>{let r=wt();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function Et(e,t=!1){return Tt(e,t)}function Dt(e){let t=Bt(Rt(e.host),e.domainToMappings);return Yt(Kt(e.protoPath,e.data||{}),t)}var Ot=[`wix.com`,`editorx.com`],kt=`_`,At=`*.`,jt=RegExp(`\\.(${Ot.join(`|`)})$`),Mt=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Nt={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Pt=`dev.wix-code.com`,Ft=/{(.*)}/,It=RegExp(`\\.(${Mt.join(`|`)})$`),Lt=RegExp(`.*\\.${Pt}$`);function Rt(e){return zt(e).replace(jt,`._base_domain_`).replace(It,`._api_base_domain_`).replace(Lt,`*.dev.wix-code.com`)}function zt(e){return Nt[e]??e}function Bt(e,t){let n=t[e];if(n)return n;let r=Vt(e,t)??Ht(e,t);if(!r){if(Wt(e)){let e=t[Gt];if(e)return e}let n=t[kt];if(n)return n}return r??[]}function Vt(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function Ht(e,t){let[n]=Object.entries(t).filter(([t])=>Ut(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function Ut(e,t){if(!t.startsWith(At))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function Wt(e){return!!e.match(/\._base_domain_$/)}var Gt=`www._base_domain_`;function Kt(e,t){return e.split(`/`).map(e=>qt(e,t)).join(`/`)}function qt(e,t){let n=e.match(Ft)||[],r=n[1];return r?Jt(t,r,e,e.replace(n[0],``)):e}function Jt(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function Yt(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function Xt(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}function Zt(e){return e&&ct({formatted:e.formattedAddress,location:e.geocode,addressLine1:e.addressLine,addressLine2:e.addressLine2,streetAddress:e.streetAddress&&{name:e.streetAddress.name,number:e.streetAddress.number,apt:e.streetAddress.apt,formattedAddressLine:e.streetAddress.formattedAddressLine},hint:e.hint,city:e.city,subdivision:e.subdivision,country:e.country,postalCode:e.postalCode,countryFullname:e.countryFullname,subdivisionFullname:e.subdivisionFullname})}var P;(function(e){e.QUERY_PARAM=`QUERY_PARAM`,e.SUBDOMAIN=`SUBDOMAIN`,e.SUBDIRECTORY=`SUBDIRECTORY`})(P||={});var Qt={cs:`Čeština`,da:`Dansk`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,hi:`हिन्दी`,id:`Bahasa Indonesia`,it:`Italiano`,ja:`日本語`,ko:`한국어`,nl:`Nederlands`,no:`Norsk`,pl:`Polski`,pt:`Português`,ru:`Русский`,sv:`Svenska`,th:`ไทย`,tr:`Türkçe`,uk:`Українська`,vi:`Tiếng Việt`,zh:`繁體中文`,sq:`Shqip`,am:`አማርኛ`,ar:`العربية`,hy:`Հայերեն`,az:`Azərbaycan dili`,eu:`Euskara`,be:`Беларуская`,bn:`বাংলা`,bs:`Bosanski`,bg:`Български`,ca:`Català`,ny:`ChiCheŵa`,co:`Corsu`,hr:`Hrvatski`,et:`Eesti`,fj:`Vosa Vakaviti`,fi:`Suomi`,ga:`Gaeilge`,gl:`Galego`,ka:`ქართული`,el:`Ελληνικά`,gu:`ગુજરાતી`,ht:`Kreyòl Ayisyen`,ha:`Hausa`,he:`עברית`,hu:`Magyar`,is:`Íslenska`,ig:`Igbo`,kn:`ಕನ್ನಡ`,kk:`Қазақ тілі`,km:`ភាសាខ្មែរ`,ku:`Kurdî`,ky:`Кыргызча`,lb:`Lëtzebuergesch`,lo:`ລາວ`,la:`Latina`,lv:`Latviešu`,lt:`Lietuvių`,mk:`Македонски`,mg:`Malagasy`,ms:`Bahasa Melayu`,ml:`മലയാളം`,mt:`Malti`,mn:`Монгол`,ne:`नेपाली`,ps:`پښتو`,fa:`فارسی`,ro:`Română`,sm:`Gagana Samoa`,sr:`Српски`,sn:`Shona`,sd:`سنڌي`,si:`සිංහල`,sk:`Slovenčina`,sl:`Slovenščina`,so:`Soomaaliga`,su:`Basa Sunda`,sw:`Kiswahili`,tl:`Filipino`,tg:`Тоҷикӣ`,ta:`தமிழ்`,te:`తెలుగు`,tk:`Türkmen`,ur:`اردو`,uz:`O'zbek`,cy:`Cymraeg`,xh:`isiXhosa`,yi:`ייִדיש`,yo:`Yorùbá`,zu:`isiZulu`,kl:`Kalaallisut`,fo:`Føroyskt`,ln:`Lingála`,mi:`Māori`,mr:`मराठी`,my:`မြန်မာ`,se:`Sámegiella`,ug:`ئۇيغۇرچە`,qu:`Runa Simi`,aa:`Afar`,ab:`Аҧсуа`,ae:`Avestan`,ak:`Akan`,an:`Aragonés`,as:`অসমীয়া`,av:`Авар`,ay:`Aymar aru`,ba:`Башҡортса`,bh:`भोजपुरी`,bi:`Bislama`,bm:`Bamanankan`,bo:`བོད་སྐད་`,br:`Brezhoneg`,ce:`Нохчийн`,ch:`Chamoru`,cr:`ᓀᐦᐃᔭᐍᐏᐣ`,cu:`Црькъвьнословѣньскъ`,cv:`Чӑвашла`,dv:`ދިވެހިބަސް`,dz:`རྫོང་ཁ`,ee:`Eʋegbe`,eo:`Esperanto`,ff:`Fulah`,fy:`Frysk`,gd:`Gàidhlig`,gn:`Avañe'ẽ`,gv:`Gaelg`,ho:`Hiri Motu`,hz:`Otjiherero`,ia:`Interlingua`,ie:`Interlingue`,ii:`ꆈꌠꉙ`,ik:`Iñupiaq`,io:`Ido`,iu:`ᐃᓄᒃᑎᑐᑦ`,jv:`Basa Jawa`,ki:`Gikuyu`,kr:`Kanuri`,ks:`کٲشُر`,kw:`Kernewek`,lg:`Luganda`,li:`Limburgs`,lu:`Tshiluba`,mh:`Kajin M̧ajeļ`,na:`Dorerin Naoero`,nb:`Norsk Bokmål`,nd:`isiNdebele`,ng:`Oshiwambo`,nn:`Norsk Nynorsk`,nr:`isiNdebele (South)`,nv:`Diné Bizaad`,oc:`Occitan`,oj:`Anishinaabemowin`,om:`Afaan Oromoo`,or:`ଓଡ଼ିଆ`,os:`Ирон`,pa:`ਪੰਜਾਬੀ`,pi:`𑀅𑀯𑀢`,rm:`Rumantsch`,rn:`Ikirundi`,rw:`Kinyarwanda`,sa:`संस्कृतम्`,sc:`Sardu`,sg:`Sängö`,ss:`SiSwati`,st:`Sesotho`,ti:`ትግርኛ`,tn:`Setswana`,to:`Faka Tonga`,ts:`Xitsonga`,tt:`Татарча`,tw:`Twi`,ty:`Reo Tahiti`,ve:`Tshivenḓa`,vo:`Volapük`,wa:`Walon`,wo:`Wolof`,za:`Saɯ cueŋƅ`},$t=(e,t)=>{e.searchParams.set(`lang`,t)},en=(e,t)=>{let n=e.hostname.split(`.`);n[0]===`www`&&(n=n.slice(1)),n=[t,...n],e.hostname=n.join(`.`)},tn=(e,t)=>{e.pathname=`/${t}${e.pathname}`},nn=(e,t)=>{if(!t.languageCode||!t?.resolutionMethod)return e;let n=new URL(e);return(t?.resolutionMethod===`QUERY_PARAM`?$t:t?.resolutionMethod===`SUBDOMAIN`?en:tn)(n,t.languageCode),n.href},rn=(e,t)=>{if(!e?.length)return e;let n;try{n=new URL(e)}catch{return e}n.searchParams.delete(`lang`);let r=n.pathname.split(`/`)[1]?.toLowerCase();if(t.includes(r??``)){let e=n.pathname.split(`/`);e.splice(1,1),n.pathname=e.join(`/`)}let i=n.hostname.split(`.`)[0]?.toLowerCase();if(t.includes(i??``)){let e=n.hostname.split(`.`);e.shift(),n.hostname=e.join(`.`)}return n.href};function an(){let e=on();return e?sn(e):[]}function on(){let e=typeof globals<`u`?globals?.$ns?.[`wix-window`]?.multilingual:void 0,t=typeof window<`u`?window?.essentials?.multilingual:void 0;return e??t??globalThis?.__wix_site_metadata__?.multilingual}function sn(e){try{if(e?.supportedLanguages?.length){let t=e.supportedLanguages,n=t.map(e=>e.languageCode).filter(Boolean),r=e.cleanUrl??dn(n);return t.map(e=>({id:e.languageCode,displayName:cn(e),regionalFormat:[e.locale?.languageCode,e.locale?.country].filter(Boolean).join(`-`),url:ln(e,r),primary:e.isPrimary,resolutionMethod:e.resolutionMethod}))}if(e?.siteLanguages?.length){let t=e.siteLanguages,n=dn(t.map(e=>e.languageCode).filter(Boolean));return t.map(e=>({id:e.languageCode,displayName:cn(e),regionalFormat:e.locale,url:ln(e,n),primary:e.isPrimaryLanguage,resolutionMethod:e.resolutionMethod?un(e.resolutionMethod):void 0}))}}catch(e){return console.warn(`[Multilingual Manager] listSupportedLanguages failed`,e),[]}return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`),[]}function cn(e){let t=Qt[e.languageCode];if(t)return t;let n=e.name??e.countryCode;if(n)return n}function ln(e,t){if(e.url||!t||!e.resolutionMethod)return e.url;if(e.languageCode)try{return nn(t,{languageCode:e.languageCode,countryCode:e.countryCode,resolutionMethod:un(e.resolutionMethod),locale:{languageCode:e.languageCode,country:e.countryCode}})}catch(e){console.warn(`[Multilingual Manager] buildUrlForLanguage failed`,e);return}}function un(e){switch(e){case`QUERY_PARAM`:case`QueryParam`:return P.QUERY_PARAM;case`SUBDOMAIN`:case`Subdomain`:return P.SUBDOMAIN;case`SUBDIRECTORY`:case`Subdirectory`:return P.SUBDIRECTORY;default:return}}function dn(e){let t=typeof window<`u`&&window.location?.href?window.location.href:``;try{return rn(t,e)}catch(e){return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`,e),t}}var fn=`x-wix-linguist`,pn=`00000000-0000-0000-0000-000000000000`,mn=`false`,hn=()=>{let e=F(`language`),t=F(`locale`);if(e)return{[fn]:[e,t||e,mn,pn].join(`|`)}};function gn(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var _n=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,F=e=>_n()?.[e],vn=({createHost:e})=>({__type:`host`,create:e=>({}),host:t=>{let{applicationId:n,componentId:r}=t??{},i=typeof window<`u`?window.wixEmbedsAPI:void 0,a=e(t),o=bn();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:F(`language`),locale:F(`locale`),get passThroughHeaders(){return hn()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&yn()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=gn();return{getAuthHeaders:async()=>{if(!e&&n&&(e=await i),!e)throw Error(`Failed to resolve auth token`);return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(n=!0,e=>{r(e)})}}});function yn(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function bn(){let e=(typeof window<`u`?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!==`/`?`${t.hostname}${t.pathname}`:t.hostname}var xn=({clientSdk:e,applicationId:t})=>({invoke:async({namespace:n,method:r,args:i})=>{if(!e)throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);return e.invoke({namespace:n,method:r,args:i,applicationId:t,accessToken:`accessToken`})},getAccessToken:()=>{throw Error(`Not implemented`)},observeState:()=>({disconnect:()=>{}})}),Sn=vn({createHost:function(e){let t=(typeof $wixContext<`u`?$wixContext.clientSdk:void 0)??e?.clientSdk??(typeof window<`u`?window?.clientSdk:void 0),{applicationId:n}=e||{};if(!n)throw Error(`"createHost" was called without a required field "applicationId"`);return{channel:xn({clientSdk:t,applicationId:n}),close:()=>{}}}}),Cn=(e,t)=>{let n=Sn.host({applicationId:e,componentId:t}),r=Sn.auth();return He({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},wn=e=>Cn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,e);function Tn(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return En(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:p.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:p.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:p.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:p.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw 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 En(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return En(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function En(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function Dn(e,t){return{...e,...Object.fromEntries(t.map(t=>[t,(...n)=>{let r=Tn();if(!r)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return r.initWixModules(e)[t].apply(void 0,n)}]))}}function On(e){return Dn({__type:`host`,create:t=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r(t)}),{})},Object.keys(e))}var I=e=>typeof e==`string`,L=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},kn=e=>e==null?``:``+e,An=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},jn=/###/g,Mn=e=>e&&e.indexOf(`###`)>-1?e.replace(jn,`.`):e,Nn=e=>!e||I(e),R=(e,t,n)=>{let r=I(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Nn(e))return{};let t=Mn(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Nn(e)?{}:{obj:e,k:Mn(r[i])}},Pn=(e,t,n)=>{let{obj:r,k:i}=R(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=R(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=R(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Fn=(e,t,n,r)=>{let{obj:i,k:a}=R(e,t,Object);i[a]=i[a]||[],i[a].push(n)},z=(e,t)=>{let{obj:n,k:r}=R(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},In=(e,t,n)=>{let r=z(e,n);return r===void 0?z(t,n):r},Ln=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?I(e[r])||e[r]instanceof String||I(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Ln(e[r],t[r],n):e[r]=t[r]);return e},B=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Rn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},zn=e=>I(e)?e.replace(/[&<>"'\/]/g,e=>Rn[e]):e,Bn=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Vn=[` `,`,`,`?`,`!`,`;`],Hn=new Bn(20),Un=(e,t,n)=>{t||=``,n||=``;let r=Vn.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Hn.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},Wn=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},V=e=>e?.replace(/_/g,`-`),Gn={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},H=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Gn,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(I(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},U=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},Kn=class extends U{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):I(n)&&i?o.push(...n.split(i)):o.push(n)));let s=z(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!I(n)?s:Wn(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Pn(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(I(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=z(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Ln(s,n,i):s={...s,...n},Pn(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},qn={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Jn=Symbol(`i18next/PATH_KEY`);function Yn(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Jn?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function W(e,t){let{[Jn]:n}=e(Yn()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Xn={},Zn=e=>!I(e)&&typeof e!=`boolean`&&typeof e!=`number`,Qn=class e extends U{constructor(e,t={}){super(),An([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=H.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Zn(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Un(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:I(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:I(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=W(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?W(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!I(i.count),x=e.hasDefaultValue(i),ee=b?this.pluralResolver.getSuffix(d,i.count,i):``,te=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,S=b&&!i.ordinal&&i.count===0,C=S&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${ee}`]||i[`defaultValue${te}`]||i.defaultValue,w=m;y&&!m&&x&&(w=C);let ne=Zn(w),re=Object.prototype.toString.apply(w);if(y&&w&&ne&&_.indexOf(re)<0&&!(I(v)&&Array.isArray(w))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,w,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(w),t=e?[]:{},n=e?g:h;for(let e in w)if(Object.prototype.hasOwnProperty.call(w,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:Zn(C)?C[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=w[e])}m=t}}else if(y&&I(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=C),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&C!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?C:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);S&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||C)})}):n(e,s,C))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=I(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!I(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=I(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=qn.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return I(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?W(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!I(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(I(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!Xn[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(Xn[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!I(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},$n=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=H.create(`languageUtils`)}getScriptPartFromCode(e){if(e=V(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=V(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(I(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),I(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return I(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):I(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},er={zero:0,one:1,two:2,few:3,many:4,other:5},tr={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},nr=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=H.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=V(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),tr;if(!e.match(/-|_/))return tr;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>er[e]-er[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},rr=(e,t,n,r=`.`,i=!0)=>{let a=In(e,t,n);return!a&&i&&I(n)&&(a=Wn(e,n,r),a===void 0&&(a=Wn(t,n,r))),a},ir=e=>e.replace(/\$/g,`$$$$`),ar=class{constructor(e={}){this.logger=H.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?zn:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?B(i):a||`{{`,this.suffix=o?B(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?B(d):f||B(`$t(`),this.nestingSuffix=p?B(p):m||B(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=rr(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(rr(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>ir(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?ir(this.escape(e)):ir(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0){if(typeof l==`function`){let t=l(e,i,r);a=I(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else!I(a)&&!this.useRawValueToEscape&&(a=kn(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${B(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!I(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!I(i))return i;I(i)||(i=kn(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},or=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},sr=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(V(r),i),t[o]=s),s(n)}},cr=e=>(t,n,r)=>e(V(n),r)(t),lr=class{constructor(e={}){this.logger=H.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?sr:cr;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=sr(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=or(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},ur=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},dr=class extends U{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=H.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Fn(n.loaded,[i],a),ur(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();I(e)&&(e=this.languageUtils.toResolveHierarchy(e)),I(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},fr=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),I(e[1])&&(t.defaultValue=e[1]),I(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),pr=e=>(I(e.ns)&&(e.ns=[e.ns]),I(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),I(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),G=()=>{},mr=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},hr=`__i18next_supportNoticeShown`,gr=()=>!!(typeof globalThis<`u`&&globalThis[hr]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),_r=()=>{typeof globalThis<`u`&&(globalThis[hr]=!0)},vr=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),K=class e extends U{constructor(e={},t){if(super(),this.options=pr(e),this.services={},this.logger=H,this.modules={external:[]},mr(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(I(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=fr();this.options={...n,...this.options,...pr(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!vr(this)&&!gr()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),_r());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?H.init(r(this.modules.logger),this.options):H.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:lr;let t=new $n(this.options);this.store=new Kn(this.options.resources,this.options);let i=this.services;i.logger=H,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new nr(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new ar(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new dr(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Qn(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=G,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=L(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=G){let n=t,r=I(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=L();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=G,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&qn.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=L();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=I(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(I(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=W(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=W(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=W(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return I(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=L();return this.options.ns?(I(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=L();I(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new $n(fr());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=G){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Kn(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...fr().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new ar(n)}return a.translator=new Qn(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();K.createInstance,K.dir,K.init,K.loadResources,K.reloadResources,K.use,K.changeLanguage,K.getFixedT,K.t,K.exists,K.setDefaultNamespace,K.hasLoadedNamespace,K.loadNamespaces,K.loadLanguages;var yr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,br={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`…`,"…":`…`,"/":`/`,"/":`/`},xr=e=>br[e],Sr={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(yr,xr),transDefaultProps:void 0},Cr=(e={})=>{Sr={...Sr,...e}},wr={type:`3rdParty`,init(e){Cr(e.options.react)}},q=new Map,Tr=500,J;function Er(){if(J===void 0)try{J=new Intl.NumberFormat(`en-US`,{useGrouping:!1,maximumFractionDigits:0}).format(`9007199254740993`)===`9007199254740993`}catch{J=!1}return J}var Dr=15;function Or(e){if(!(typeof e!=`string`||Er())&&e.replace(/[^0-9]/g,``).replace(/^0+/,``).length>Dr)throw Error(`Cannot format the amount '${e}' exactly: this runtime's Intl implementation predates ES2023 string support and would lose precision. Use a runtime with ES2023 Intl support (for example Node 20+), or pass a value within 15 significant digits.`)}function kr(e,t,n){return`${e}|${t}|${Object.entries(n).filter(([,e])=>e!==void 0).sort(([e],[t])=>e<t?-1:1).map(([e,t])=>`${e}=${String(t)}`).join(`&`)}`}function Ar(e,t,n){let r=kr(e,t,n),i=q.get(r);return i||(i=new Intl.NumberFormat(e,{...n,style:`currency`,currency:t}),q.size>=Tr&&q.clear(),q.set(r,i)),i}function jr(e,{value:t,currency:n},r={}){return Or(t),Ar(e,n,r).format(t)}function Mr(e,{value:t,currency:n},r={}){return Or(t),Ar(e,n,r).formatToParts(t)}function Nr(e){return an().find(e=>e.primary)?.id??e}function Pr(e,t){let{locale:n,...r}=t??{},i=n??e.essentials?.locale;if(!i)throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);return{locale:i,formatOptions:r}}var Fr=On({getLanguage:e=>()=>{let t=e.essentials?.language;if(!t)throw Error(`Host language is not available on the current host. Make sure to use an updated version of the host initialization package.`);return t},getLocale:e=>()=>{let t=e.essentials?.locale;if(!t)throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);return t},formatCurrency:e=>(t,n)=>{let{locale:r,formatOptions:i}=Pr(e,n);return jr(r,t,i)},formatCurrencyToParts:e=>(t,n)=>{let{locale:r,formatOptions:i}=Pr(e,n);return Mr(r,t,i)},getTranslationFunction:e=>()=>{let t=e.translations?.();if(!t)throw Error(`Host translation resources are not available.`);let n=K.createInstance(),r=Nr(e.essentials?.language)||`en`,i={lng:e.essentials?.language||r,fallbackLng:r,resources:t};return n.use(wr).init(i,e=>{if(e)throw e}),n.t.bind(n)}}),Ir=class{constructor(e){this.message=e,this.captureException=()=>{console.error(this.message)},this.captureMessage=()=>{console.error(this.message)},this.startSpan=(e,t)=>(console.error(this.message),t(void 0)),this.startSpanManual=()=>(console.error(this.message),{end:()=>{},fail:()=>{}}),this.endSpanManual=()=>{console.error(this.message)},this.addBreadcrumb=()=>{console.error(this.message)}}},Lr=e=>new Ir(e),Rr=On({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():Lr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`)}),zr={service:`service`,services:`services`,categories:`categories`,locations:`locations`,sessions:`sessions`,timeSlots:`time-slots`,serviceAddOns:`service-addons`,bookingsSettings:`bookings-settings`,serviceCta:`service-cta`,preferences:`preferences`,bookingSummary:`booking-summary`,bookingCheckout:`booking-checkout`,formValues:`form-values`,paymentOptions:`payment-options`,seo:`seo`,warmup:`warmup`,reschedule:`reschedule`};function Br(e){try{let t=Rr.getMonitoringClient?.();return t&&typeof t[e]==`function`?t:null}catch{return null}}function Vr(e,{feature:t,action:n,level:r=`error`,contexts:i}){let a=Br(`captureException`);if(!a)return;let o=e instanceof Error?e:Error(String(e));a.captureException(o,{level:r,tags:{feature:t,action:n},...i?{contexts:i}:{}})}function Hr(e,{feature:t,tags:n},r){let i=Br(`startSpanManual`);if(!i)return r;let a=i.startSpanManual({name:e,tags:{feature:t,...n}});return r.then(()=>a.end(),e=>a.fail(e)),r}var Ur=class extends e{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Vr(e,{feature:this.props.feature??`service`,action:`render`,contexts:{react:{componentStack:t.componentStack}}})}render(){return this.state.hasError?this.props.fallback:this.props.children}};function Wr(e){let t=e;if(t.__state||(t.__state={status:`pending`},t.then(e=>{t.__state={status:`fulfilled`,value:e}},e=>{t.__state={status:`rejected`,reason:e}})),t.__state.status===`fulfilled`)return t.__state.value;throw t.__state.status===`rejected`?t.__state.reason:t}function Gr(e){let t=Promise.resolve(e);return t.__state={status:`fulfilled`,value:e},t}var Kr=new WeakMap;function qr(e,t,n){let r=Kr.get(e);r||(r=new WeakMap,Kr.set(e,r));let i=r.get(t);i||(i=new WeakMap,r.set(t,i));let a=i.get(n);if(!a){let r=e;a=r.__state?.status===`fulfilled`?Gr(t(r.__state.value)):r.__state?.status===`rejected`?Gr(n(r.__state.reason)):e.then(t,n),i.set(n,a)}return a}function Y(e){return e}var Jr=Y(`@wix/site-service-url`),Yr=`appSectionParams`;function Xr(e){let t=e.searchParams.get(Yr);if(t===null)return e;let n=new URL(e);n.searchParams.delete(Yr);for(let[e,r]of Object.entries(Zr(t)))typeof r==`string`&&!n.searchParams.has(e)&&n.searchParams.set(e,r);return n}function Zr(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var Qr=`bookings-uou:url-change`,$r=e=>{let t=new URL(e);return t.searchParams.sort(),t.href};function ei(e,{disableScrollToTop:t,skipHistory:n}={}){let r=globalThis.window;if(!r?.history)return;let i=new URL(r.location.href);if($r(i)===$r(e))return;let a={scrollY:r.scrollY};if(n)r.history.replaceState(a,``,e.href);else{r.history.replaceState(a,``,i.href);try{r.history.pushState(t?a:null,``,e.href)}catch{return}}r.dispatchEvent(new Event(Qr))}function ti(e){let t=globalThis.window;return t?(t.addEventListener(Qr,e),t.addEventListener(`popstate`,e),()=>{t.removeEventListener(Qr,e),t.removeEventListener(`popstate`,e)}):()=>{}}var ni=e=>{try{return decodeURIComponent(e)}catch{return e}};function ri(e,t){let n=t?new URL(t).pathname:`/`;return`./${ni(new URL(e).pathname.replace(n,``).replace(/^\/|\/$/g,``))}`}function ii(){let e=d(Jr),t=r(()=>e.currentUrl,[e]),n=l(ti,t,t),i=o(()=>Xr(new URL(n)),[n]),a=e.siteUrl.replace(/\/$/,``);return{pathname:i.pathname,search:i.search,searchParams:i.searchParams,href:i.href,getParsedUrl:()=>Xr(new URL(e.currentUrl)),getRelativeUrl:()=>ri(e.currentUrl,a),getExternalBaseUrl:()=>a,pushUrl:ei}}var X={category:`category`,location:`location`,page:`page`,blob:`b`,resource:`resource`,referral:`referral`,timezone:`timezone`,bookingId:`bookingId`,token:`token`,rescheduleRedirectUrl:`rescheduleRedirectUrl`},ai=Y(`@wix/site-service-warmup-data`);function oi(){try{return u()}catch{return null}}function si(e){try{return e?e(ai):null}catch{return null}}function ci(){let e=si(oi()),t=typeof window>`u`;return{scope:e??void 0,get:async n=>{if(t||!e)return null;try{return await e.get(n)}catch(e){return Vr(e,{feature:zr.warmup,action:`read`,level:`warning`,contexts:{warmup:{key:n}}}),null}},set:(n,r)=>{if(t&&e)try{e.set(n,r)}catch{}}}}var li=Y(`@wix/site-service-locale`),ui=Y,di=ui(`@wix/viewer-service-multilingual`);function fi(){try{return Fr.getLanguage()??`en`}catch{return`en`}}function pi(e){try{return d(e)}catch{return null}}function mi(){let e=pi(li),t=pi(di);return t?.multilingualEnabled&&t.currentLocale?.languageCode||e?.language||fi()}var hi=`bookings-uou`;function gi(e){return`${hi}:${e}:locations:all`}var _i=5e3,vi=100,yi=`wix-warmup-data`,bi=null;function xi(e){if(typeof document<`u`)try{let t=document.getElementById(yi)?.textContent;return t?(bi?.text!==t&&(bi={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),bi.data[e]??void 0):void 0}catch{return}}var Si=()=>({promises:new Map,invalidatedWarmup:new Set}),Ci=Si(),wi=new WeakMap,Ti=new WeakMap;function Ei(e){if(!e)return Ci;let t=wi.get(e);return t||(t=Si(),wi.set(e,t)),t}function Di({key:e,warmupData:t,fetchData:n,refresh:r=!1}){if(e===null)return n();if(typeof window>`u`){let r=()=>n().then(n=>(t.set(e,n),n)),{scope:i}=t;if(!i)return r();let a=Ti.get(i);a||(a=new Map,Ti.set(i,a));let o=a.get(e);if(o)return o;let s=r();return a.set(e,s),s.catch(()=>a.delete(e)),s}let i=Ei(t.scope),a=Date.now();for(let[e,t]of i.promises)t.expiresAt<=a&&i.promises.delete(e);let o=i.promises.get(e);if(o&&!r)return o.promise;r&&i.invalidatedWarmup.add(e);let s=!i.invalidatedWarmup.has(e);if(s){let t=xi(e);if(t!==void 0){let n=Gr(t);return i.promises.set(e,{promise:n,expiresAt:a+_i}),n}}let c=(async()=>{if(s){let n=await t.get(e);if(n!=null)return n}return n()})();i.promises.size>=vi&&i.promises.delete(i.promises.keys().next().value);let l={promise:c,expiresAt:1/0};return i.promises.set(e,l),c.then(()=>{l.expiresAt=Date.now()+_i},()=>{i.promises.get(e)===l&&i.promises.delete(e)}),c}var Oi=[{path:`businessLocations.locations.business.address.geocode.latitude`},{path:`businessLocations.locations.business.address.geocode.longitude`},{path:`businessLocations.locations.custom.address.geocode.latitude`},{path:`businessLocations.locations.custom.address.geocode.longitude`},{path:`businessLocations.locations.calculatedAddress.geocode.latitude`},{path:`businessLocations.locations.calculatedAddress.geocode.longitude`}];function ki(e){return Dt(Object.assign(e,{domainToMappings:{"*.dev.wix-code.com":[{srcPath:`/_api/services-2`,destPath:``},{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"www.wixapis.com":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`},{srcPath:`/bookings/services/v2/bulk/services`,destPath:`/v2/bulk/services`}],"manage._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"editor._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"blocks._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"create.editorx":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],_:[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"www._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"bo._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"wixbo.ai":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"wix-bo.com":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"editor.wixapps.net":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"api._api_base_domain_":[{srcPath:`/services-2`,destPath:``}]}}))}var Ai=`@wix/auto_sdk_bookings_services`;function ji(e){function t({host:t}){return{entityFqdn:`wix.bookings.services.v2.service`,method:`POST`,methodFqn:`wix.bookings.services.v2.ServicesService.QueryLocations`,packageName:Ai,migrationOptions:{optInTransformResponse:!0},url:ki({protoPath:`/v2/services/locations/query`,data:e,host:t}),data:e,transformResponse:e=>st(e,[{transformFn:Xt,paths:Oi}])}}return t}var Mi=[{path:`businessLocations.locations.calculatedAddress`},{path:`businessLocations.locations.business.address`},{path:`businessLocations.locations.custom.address`}];async function Ni(e){let{httpClient:t,sideEffects:n}=arguments[1],r=ji(Xe({filter:e?.filter}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),Ze(st(e.data,[{transformFn:Zt,paths:Mi}]))}catch(e){let t=_t(e,{spreadPathsToArguments:{},explicitPathsToArguments:{filter:`$[0].filter`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function Pi(e){return t=>Ni(t,{httpClient:e})}var Fi=Et(Pi),Ii=`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,Li=function(e){return e.BOOK_ONLINE=`bookingsBookOnline`,e.SERVICE_PAGE=`bookingsServicePage`,e.CALENDAR_PAGE=`bookingsCalendar`,e.FORM_PAGE=`bookingsForm`,e}({});function Z(e){return e.business?._id??null}function Q(e){return e.business?.name??null}async function Ri(){let e=await Fi({filter:{services:{appId:Ii,hidden:!1}}});return{locations:[...e.businessLocations?.locations??[]].sort((e,t)=>(Q(e)??``).localeCompare(Q(t)??``)),hasOtherLocations:!!(e.customLocations?.exists||e.customerLocations?.exists)}}function zi({isLoading:e,hasError:t,refetch:n,children:r}){let{searchParams:i}=ii(),a={locations:[],locationItems:[],selectedLocationId:i.get(X.location),selectedLocationIndex:-1,selectedLocation:null,selectedLocationName:null,hasOtherLocations:!1,hasMultipleLocations:!1,isLoading:e,hasError:t,refetch:n,selectLocation:()=>{}};return f($.Provider,{value:a,children:r})}function Bi({refetch:e,children:t}){return f(zi,{isLoading:!0,hasError:!1,refetch:e,children:t})}function Vi({refetch:e,children:t}){return f(zi,{isLoading:!1,hasError:!0,refetch:e,children:t})}var Hi=ui(`@wix/site-service-business-logger`);function Ui(e){return{evid:32,src:16,endpoint:``,params:e}}var Wi={SERVICES:`services_context`,SERVICE:`service_context`,TIME_SLOTS:`time_slots_context`,BOOKING_CHECKOUT:`booking_checkout_context`,CATEGORIES:`categories_context`,LOCATIONS:`locations_context`,SERVICE_ADD_ONS:`service_addons_context`,PREFERENCES:`preferences_context`};Li.BOOK_ONLINE;var Gi=`new_bookings_server`,Ki=e=>{let{reportBi:t}=d(Hi);return r(n=>{t({widget_name:e,bookingsPlatform:Gi,is_over_editor:!1,...n.params,src:n.src,evid:n.evid},{endpoint:n.endpoint})},[t,e])},qi=(e,t=!0)=>{let n=Ki(e),{getParsedUrl:r}=ii(),i=s(!1);a(()=>{t&&!i.current&&(i.current=!0,n(Ui({referralInfo:r().searchParams.get(X.referral)??void 0})))},[t,n,r])},$=n(null),Ji=`useLocationsContext must be used within LocationsContextProvider`;function Yi(){let e=i($);if(!e)throw Error(Ji);return e}function Xi(e,t){let n=Z(e);return{locationId:n,locationName:Q(e),isSelected:n!=null&&n===t}}var Zi=e=>({...e,hasError:!1}),Qi=()=>({locations:[],hasOtherLocations:!1,hasError:!0});function $i({locationsPromise:e,initialLocationId:t,refetch:n,children:i}){let{locations:c,hasOtherLocations:l,hasError:u}=Wr(e),{pathname:d,searchParams:p,pushUrl:m,getExternalBaseUrl:h}=ii(),g=p.get(X.location),_=r(e=>{let t=new URLSearchParams(p);e?t.set(X.location,e):t.delete(X.location),t.delete(X.page);let n=t.toString(),r=n?`${d}?${n}`:d;m(new URL(r,`${h()}/`),{disableScrollToTop:!0,skipHistory:!1})},[d,p,m,h]),v=s(!1);a(()=>{v.current||(v.current=!0,t&&!p.get(X.location)&&_(t))},[t,p,_]);let y=c.findIndex(e=>Z(e)===g),b=c.find(e=>Z(e)===g)??null,x=c.filter(e=>Z(e)).length+ +!!l,ee=o(()=>({locations:c,locationItems:c.map(e=>Xi(e,g)),selectedLocationId:g,selectedLocationIndex:y,selectedLocation:b,selectedLocationName:b?Q(b):null,hasOtherLocations:l,hasMultipleLocations:x>1,isLoading:!1,hasError:u,refetch:n,selectLocation:_}),[c,g,y,b,l,u,x,n,_]);return f($.Provider,{value:ee,children:i})}function ea({initialLocationId:e,children:n}){qi(Wi.LOCATIONS);let i=ci(),a=mi(),[s,l]=c(0),u=o(()=>qr(Di({key:gi(a),refresh:s!==0,warmupData:i,fetchData:()=>Hr(`locations-context-load`,{feature:zr.locations},Ri())}),Zi,Qi),[s,a]),d=r(()=>l(e=>e+1),[]);return f(Ur,{fallback:f(Vi,{refetch:d,children:n}),feature:zr.locations,children:f(t,{fallback:f(Bi,{refetch:d,children:n}),children:f($i,{locationsPromise:u,initialLocationId:e,refetch:d,children:n})})})}var ta=wn(`c151d9f7-1582-407c-bb59-59030f244b47`);export{Ji as LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,ea as default,ta as injectAccessTokenGetter,$ as locationsContext,Yi as useLocationsContext};
|
|
2
|
-
//# sourceMappingURL=context-provider-c151d9f7-1582-407c-bb59-59030f244b47-
|
|
1
|
+
import{Component as e,Suspense as t,createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c,useSyncExternalStore as l}from"react";import{useGetService as u,useService as d}from"@wix/services-manager-react";import{jsx as f}from"react/jsx-runtime";var p={};function m(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var h=e=>{switch(e){case`get`:case`GET`:return`GET`;case`post`:case`POST`:return`POST`;case`put`:case`PUT`:return`PUT`;case`delete`:case`DELETE`:return`DELETE`;case`patch`:case`PATCH`:return`PATCH`;case`head`:case`HEAD`:return`HEAD`;case`options`:case`OPTIONS`:return`OPTIONS`;default:throw Error(`Unknown method: ${e}`)}},g=e=>t=>async n=>{let r,i=t=>{if(r=e(n)(t),r.url===void 0)throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);let{method:i,url:a,params:o}=r;return{...r,method:h(i),url:a,data:r.data,params:o}};try{let e=await t.request(i);if(r===void 0)throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);let n=Array.isArray(r.transformResponse)?r.transformResponse:[r.transformResponse],a=e.data;return n.forEach(t=>{t&&(a=t(e.data,e.headers))}),a}catch(e){throw typeof e==`object`&&e&&`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response?e.response.data:e}},_=e=>e.__isAmbassador?!0:!!e().__isAmbassador,v=`__metadata`,y=`edge.wixapis.com`,b=class extends Error{message;response;constructor(e,t){super(e),this.message=e,this.response=t}async details(){let e=await this.response.json();return x(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},x=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),ee=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},te=e=>e&&typeof e==`object`&&!Array.isArray(e),S=e=>e.__type===`host`;function C(e,t){return e.create(t)}var w=`x-wix-bi-gateway`;function ne(e,t,n){return{[w]:re({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function re(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ie(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var ae={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function oe(e){return de(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var se=/([\p{Ll}\d])(\p{Lu})/gu,ce=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,le=`$1\0$2`,ue=/[^\p{L}\d]+/giu;function de(e){let t=e.trim();t=t.replace(se,le).replace(ce,le),t=t.replace(ue,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var fe=e=>`validationError`in(e.response?.data?.details??{}),pe=e=>`applicationError`in(e.response?.data?.details??{}),me=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function he(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(fe(e))return ge(e,t,n);if(pe(e))return _e(e);if(me(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:oe(n),data:{}},requestId:e.requestId};return T(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return ve(e)}var ge=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=ye(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return T(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},T=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),_e=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??oe(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return T(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},ve=e=>T(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:oe(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),ye=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:be(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,be(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},be=(e,t)=>{let n=xe(e);return n==null?e:e.replace(`$[${n}]`,t[n])},xe=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Se(e,t,n,r,i,a,o,s,c,l,u){return ie(()=>e({request:async e=>{let i=e({host:s?.HTTPHost||`www.wixapis.com`}),a=i;a.method===`GET`&&a.fallback?.length&&(a.params?.toString().length??0)>4e3&&(a=i.fallback[0]);let o=s?.HTTPHost??`www.wixapis.com`,u=`https://${l?y:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=ne(i,t,c),o={method:a.method,...a.data&&{body:JSON.stringify(a.data)},headers:{...e}},s=await n(u,o);if(s.status!==200){let e=null;try{e=await s.json()}catch{}let t=we(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=he(t);throw r?.handleError(n,{requestOptions:{url:a.url,method:a.method,entityFqdn:i.entityFqdn,methodFqn:i.methodFqn}}),t}let l=await s.json();return{data:a.migrationOptions?.optInTransformResponse&&a.transformResponse?Array.isArray(a.transformResponse)?a.transformResponse[0](l):a.transformResponse(l):l,headers:s.headers,status:s.status,statusText:s.statusText}}catch(e){throw e.message?.includes(`fetch is not defined`)&&console.error(`Node.js v18+ is required`),e}},fetchWithAuth:n,wixAPIFetch:i,getActiveToken:a,getAuthHeaders:o},{validateRequestSchema:u}))}var Ce=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},we=(e,t,n,r)=>new Ce({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),Te=`.`;function Ee(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=De(t),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;break}let a=r[e+1];(!(t in i)||i[t]==null||typeof i[t]!=`object`||i[t]===null)&&(i[t]=typeof a==`number`?[]:{}),i=i[t]}return e}function De(e){return Array.isArray(e)?e:e.split(Te).map(e=>Oe(e)?Number(e):e)}function Oe(e){return/^\d+$/.test(e)}function ke(e){let t={};for(let[n,r]of Object.entries(e))Ae(n)||Ee(t,De(n),r);return t}function Ae(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var je=class{BRACKET_PATTERN=/\[(\d+)\]/g;NUMERIC_PATTERN=/^\d+$/;ESCAPED_DOT_PATTERN=/\\\./g;ESCAPED_LEFT_BRACKET_PATTERN=/\\\[/g;ESCAPED_RIGHT_BRACKET_PATTERN=/\\\]/g;SPLIT_PATTERN=/\.|\[(\d+)\]/g;DOT_BEFORE_BRACKET_PATTERN=/\.\[/g;ESCAPED_DOT_PLACEHOLDER=`__DOT__`;ESCAPED_RIGHT_BRACKET_PLACEHOLDER=`__RB__`;ESCAPED_LEFT_BRACKET_PLACEHOLDER=`__LB__`;modifiedFields;cleanedModifiedFields;constructor(e){this.modifiedFields=e}replaceEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PATTERN,this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN,this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN,this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER)}restoreEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PLACEHOLDER,`\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER,`\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER,`\\[`)}unflatten(){return this.cleanedModifiedFields=Object.fromEntries(Object.entries(this.modifiedFields).map(([e,t])=>[this.replaceEscapedCharacters(this.bracketToDotNotation(e)),t])),ke(this.cleanedModifiedFields)}flatten(e){let t={};for(let n of Object.keys(this.cleanedModifiedFields)){let r=this.splitPath(n),i=this.navigatePath(e,r);t={...t,...i}}return Object.fromEntries(Object.entries(t).map(([e,t])=>[this.restoreEscapedCharacters(e),t]))}splitPath(e){let t=[],n=0,r=Array.from(e.matchAll(this.SPLIT_PATTERN));for(let i of r)i.index>n&&t.push(e.substring(n,i.index)),i[1]&&t.push(i[1]),n=i.index+i[0].length;return n<e.length&&t.push(e.substring(n)),t}navigatePath(e,t){let n=e,r=[],i=e=>{if(!Array.isArray(n))throw Error(`Expected array at path ${this.buildPathString(r)}, but got ${typeof n}`);r.push(`[${e}]`),n=n[parseInt(e,10)]},a=(e,t)=>{let i=e in ae?ae[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Fe(e);if(a&&a in t){r.push(a),n=t[a];return}throw Error(`Cannot find key '${e}' or its transformations at path ${this.buildPathString(r)}`)},o=(e,t)=>{r.push(e),n=t[e]};for(let e of t){if(this.NUMERIC_PATTERN.test(e)){i(e);continue}if(typeof n!=`object`||!n)throw Error(`Cannot access property '${e}' on ${typeof n} at path ${this.buildPathString(r)}`);let t=n;if(e in n){o(e,t);continue}a(e,t)}return{[this.buildPathString(r)]:n}}buildPathString(e){return e.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN,`[`)}bracketToDotNotation(e){return e.replace(this.BRACKET_PATTERN,(t,n,r)=>r>0&&e[r-1]===`\\`?t:`.`+n)}};function Me(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Ne(n);if(!r)return null;let{unflattenedModifiedFields:i,modifiedFieldsManipulator:a}=r;e={...e,modifiedFields:i};let o=t(e),s=o?.modifiedFields;if(!s)return null;let c=Pe(s,a);return c===null?null:(o.modifiedFields=c,o)}function Ne(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new je(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Pe(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Fe(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Ie(){return{emit(e,...t){for(let n=0,r=this.events[e]||[],i=r.length;n<i;n++)r[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}}var Le=e=>e.__type===`event-definition`;function Re(e,t,n,r){let i;if(e.isDomainEvent){let{deletedEvent:e,actionEvent:t,createdEvent:a,updatedEvent:o,...s}=n,c={...r,...s};i=e?e?.deletedEntity?{entity:e?.deletedEntity,metadata:c}:{metadata:c}:t?{data:t.body,metadata:c}:o?{entity:o.currentEntity,metadata:c,...o.modifiedFields?{modifiedFields:o.modifiedFields}:{}}:{entity:a?.entity,metadata:c}}else i={data:n,metadata:r};let a=e.transformations??(e=>e),o=i,s=i;if(s.modifiedFields){let e=s.modifiedFields;if(typeof e==`object`&&e&&!Array.isArray(e)){o=structuredClone(i);let e=Me(s,a);if(e)return t(e)}}return t(a(o))}function ze(e){let t=new Map,n=Ie();return{initModule(e){return r=>{let i=t.get(e.type)??[];i.push({eventDefinition:e,handler:r}),t.set(e.type,i),n.emit(`registered`,e)}},client:{...n,getRegisteredEvents:()=>t,async process(e,n={expectedEvents:[]}){let{eventType:r,identity:i,instanceId:a,payload:o,accountInfo:s}=await this.parseJWT(e),c=[...n.expectedEvents,...Array.from(t.keys()).map(e=>({type:e}))];if(c.length>0&&!c.some(({type:e})=>e===r))throw Error(`Unexpected event type: ${r}. Expected one of: ${c.map(e=>e.type).join(`, `)}`);let l=t.get(r)??[];return await Promise.all(l.map(({eventDefinition:e,handler:t})=>Re(e,t,o,{instanceId:a,identity:i,accountInfo:s}))),{instanceId:a,eventType:r,payload:o,identity:i,accountInfo:s}},async processRequest(e,t){let n=await e.text();return this.process(n,t)},async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`string`)throw Error(`Unexpected type of JWT data: expected string, got ${typeof r.data}`);let a=JSON.parse(r.data),o=a.eventType,s=a.accountInfo,c=a.instanceId,l=a.identity?JSON.parse(a.identity):void 0;return{instanceId:c,eventType:o,payload:JSON.parse(a.data),identity:l,accountInfo:s}},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async executeHandlers(e){let n=Array.from(t.keys()).map(e=>({type:e}));if(n.length>0&&!n.some(({type:t})=>t===e.eventType))throw Error(`Unexpected event type: ${e.eventType}. Expected one of: ${n.map(e=>e.type).join(`, `)}`);let r=t.get(e.eventType)??[];await Promise.all(r.map(({eventDefinition:t,handler:n})=>Re(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:m(`AppInstalled`)(),AppRemoved:m(`AppRemoved`)()}}}}var Be=e=>e.__type===`service-plugin-definition`;function Ve(e){let t=new Map,n=Ie();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var E=`X-Wix-Consistent`;function He(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[E]:t[E]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=D(e);return a&&(t[E]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=D(e);return a&&(t[E]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=Ve(i),{client:u,initModule:d}=ze(i),f=async(n,r)=>{let i=o(),s=await a(),c=ee(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[E]:t[E]}:{}}}),u=D(l);return u&&(t[E]=u),l},m=(t,n)=>{if(Le(t))return d(t);if(Be(t))return l(t);if(S(t)&&e.host)return C(t,e.host);if(typeof t==`function`){if(`__type`in t&&t.__type===`wix_spi_error`)return t;let r=e.host?.apiBaseUrl??`www.wixapis.com`,o=e.useCDN===void 0?i().shouldUseCDN:e.useCDN;return Se(ie(()=>_(t))?g(t):t,n??{},f,e.host?.getErrorHandler?.(),(e,t)=>{let n=new URL(e,`https://${r}`);return n.host=r,n.protocol=`https`,f(n.toString(),t)},i().getActiveToken,async()=>a(),{HTTPHost:r},e.host?.name,o,e.validateRequestSchema)}return te(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,m(n,t[v])])):t},h=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?m(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:h,use:m,enableContext(e,t={elevated:!1}){e===`global`?globalThis.__wix_context__==null?t.elevated?globalThis.__wix_context__={elevatedClient:this}:globalThis.__wix_context__={client:this}:t.elevated?globalThis.__wix_context__.elevatedClient=this:globalThis.__wix_context__.client=this:t.elevated?p.elevatedClient=this:p.client=this},fetch:(t,n)=>{let r=e.host?.apiBaseUrl??`www.wixapis.com`,i=new URL(t,`https://${r}`);return i.host=r,i.protocol=`https`,f(i.toString(),n)},fetchWithAuth:s,async graphql(t,n,r={apiVersion:`alpha`}){let i=e?.host?.apiBaseUrl??`www.wixapis.com`,a=await f(`https://${i}/graphql/${r.apiVersion}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:t,variables:n})});if(a.status!==200)throw new b(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:u,servicePlugins:c}}function D(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var Ue={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},We={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function Ge(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var Ke=`sort.fieldName`;function qe(e,t,n){return(e===Ke||e.endsWith(`.${Ke}`))&&typeof t==`string`?Ge(t,n):t}function Je(e,t,n){let r=e=>n.includes(e),i=(e,n)=>{if(Array.isArray(e))e.forEach(e=>{i(e,n)});else if(typeof e==`object`&&e){let a=e;Object.keys(a).forEach(e=>{let o=n===``?e:`${n}.${e}`;if(r(o))return;let s=Ye(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=qe(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function Ye(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function Xe(e,t=[]){return Je(e,Ue,t)}function Ze(e,t=[]){return Je(e,We,t)}var Qe=new WeakMap;function O(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function $e(e,t){let n=e.get(t);return n||(n=O(),e.set(t,n)),n}function et(e,t){return t===`*`?(e.anyField??=O(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,$e(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,$e(e.fields,t))}function tt(e){let t=O();for(let n of e){let e=n.path.split(`.`).reduce(et,t);e.leaves??=[],e.leaves.push(n)}return t}function nt(e){let t=Qe.get(e);return t||(t=tt(e),Qe.set(e,t)),t}function k(e){return typeof e==`object`&&!!e}function rt(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?k(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function A(e,t,n){k(e)&&ot(e,t,n)}function it(e,t,n){for(let[r,i]of t){if(!(r in e))continue;if(i.leaves)for(let t of i.leaves)e[r]=rt(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>A(e,i,n)):A(t,i,n)}}function at(e,t,n){for(let[r,i]of t){let t=e[r];k(t)&&Object.values(t).forEach(e=>A(e,i,n))}}function ot(e,{fields:t,mapFields:n,anyField:r},i){t&&it(e,t,i),n&&at(e,n,i),r&&Object.values(e).forEach(e=>A(e,r,i))}function st(e,t){if(!k(e))return e;for(let{paths:n,transformFn:r}of t)ot(e,nt(n),r);return e}function ct(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function j(e){return pt(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var lt=/([\p{Ll}\d])(\p{Lu})/gu,ut=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,dt=`$1\0$2`,ft=/[^\p{L}\d]+/giu;function pt(e){let t=e.trim();t=t.replace(lt,dt).replace(ut,dt),t=t.replace(ft,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var mt=e=>`validationError`in(e.response?.data?.details??{}),ht=e=>`applicationError`in(e.response?.data?.details??{}),gt=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function _t(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(mt(e))return vt(e,t,n);if(ht(e))return yt(e);if(gt(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:j(n),data:{}},requestId:e.requestId};return M(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return bt(e)}var vt=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=xt(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return M(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},M=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),yt=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??j(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return M(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},bt=e=>M(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:j(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),xt=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:St(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,St(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},St=(e,t)=>{let n=Ct(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Ct=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function wt(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return N(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:p.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:p.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:p.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:p.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw 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 N(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return N(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function N(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function Tt(e,t){return((...n)=>{let r=wt();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function Et(e,t=!1){return Tt(e,t)}function Dt(e){let t=Bt(Rt(e.host),e.domainToMappings);return Yt(Kt(e.protoPath,e.data||{}),t)}var Ot=[`wix.com`,`editorx.com`],kt=`_`,At=`*.`,jt=RegExp(`\\.(${Ot.join(`|`)})$`),Mt=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Nt={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Pt=`dev.wix-code.com`,Ft=/{(.*)}/,It=RegExp(`\\.(${Mt.join(`|`)})$`),Lt=RegExp(`.*\\.${Pt}$`);function Rt(e){return zt(e).replace(jt,`._base_domain_`).replace(It,`._api_base_domain_`).replace(Lt,`*.dev.wix-code.com`)}function zt(e){return Nt[e]??e}function Bt(e,t){let n=t[e];if(n)return n;let r=Vt(e,t)??Ht(e,t);if(!r){if(Wt(e)){let e=t[Gt];if(e)return e}let n=t[kt];if(n)return n}return r??[]}function Vt(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function Ht(e,t){let[n]=Object.entries(t).filter(([t])=>Ut(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function Ut(e,t){if(!t.startsWith(At))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function Wt(e){return!!e.match(/\._base_domain_$/)}var Gt=`www._base_domain_`;function Kt(e,t){return e.split(`/`).map(e=>qt(e,t)).join(`/`)}function qt(e,t){let n=e.match(Ft)||[],r=n[1];return r?Jt(t,r,e,e.replace(n[0],``)):e}function Jt(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function Yt(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function Xt(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}function Zt(e){return e&&ct({formatted:e.formattedAddress,location:e.geocode,addressLine1:e.addressLine,addressLine2:e.addressLine2,streetAddress:e.streetAddress&&{name:e.streetAddress.name,number:e.streetAddress.number,apt:e.streetAddress.apt,formattedAddressLine:e.streetAddress.formattedAddressLine},hint:e.hint,city:e.city,subdivision:e.subdivision,country:e.country,postalCode:e.postalCode,countryFullname:e.countryFullname,subdivisionFullname:e.subdivisionFullname})}var P;(function(e){e.QUERY_PARAM=`QUERY_PARAM`,e.SUBDOMAIN=`SUBDOMAIN`,e.SUBDIRECTORY=`SUBDIRECTORY`})(P||={});var Qt={cs:`Čeština`,da:`Dansk`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,hi:`हिन्दी`,id:`Bahasa Indonesia`,it:`Italiano`,ja:`日本語`,ko:`한국어`,nl:`Nederlands`,no:`Norsk`,pl:`Polski`,pt:`Português`,ru:`Русский`,sv:`Svenska`,th:`ไทย`,tr:`Türkçe`,uk:`Українська`,vi:`Tiếng Việt`,zh:`繁體中文`,sq:`Shqip`,am:`አማርኛ`,ar:`العربية`,hy:`Հայերեն`,az:`Azərbaycan dili`,eu:`Euskara`,be:`Беларуская`,bn:`বাংলা`,bs:`Bosanski`,bg:`Български`,ca:`Català`,ny:`ChiCheŵa`,co:`Corsu`,hr:`Hrvatski`,et:`Eesti`,fj:`Vosa Vakaviti`,fi:`Suomi`,ga:`Gaeilge`,gl:`Galego`,ka:`ქართული`,el:`Ελληνικά`,gu:`ગુજરાતી`,ht:`Kreyòl Ayisyen`,ha:`Hausa`,he:`עברית`,hu:`Magyar`,is:`Íslenska`,ig:`Igbo`,kn:`ಕನ್ನಡ`,kk:`Қазақ тілі`,km:`ភាសាខ្មែរ`,ku:`Kurdî`,ky:`Кыргызча`,lb:`Lëtzebuergesch`,lo:`ລາວ`,la:`Latina`,lv:`Latviešu`,lt:`Lietuvių`,mk:`Македонски`,mg:`Malagasy`,ms:`Bahasa Melayu`,ml:`മലയാളം`,mt:`Malti`,mn:`Монгол`,ne:`नेपाली`,ps:`پښتو`,fa:`فارسی`,ro:`Română`,sm:`Gagana Samoa`,sr:`Српски`,sn:`Shona`,sd:`سنڌي`,si:`සිංහල`,sk:`Slovenčina`,sl:`Slovenščina`,so:`Soomaaliga`,su:`Basa Sunda`,sw:`Kiswahili`,tl:`Filipino`,tg:`Тоҷикӣ`,ta:`தமிழ்`,te:`తెలుగు`,tk:`Türkmen`,ur:`اردو`,uz:`O'zbek`,cy:`Cymraeg`,xh:`isiXhosa`,yi:`ייִדיש`,yo:`Yorùbá`,zu:`isiZulu`,kl:`Kalaallisut`,fo:`Føroyskt`,ln:`Lingála`,mi:`Māori`,mr:`मराठी`,my:`မြန်မာ`,se:`Sámegiella`,ug:`ئۇيغۇرچە`,qu:`Runa Simi`,aa:`Afar`,ab:`Аҧсуа`,ae:`Avestan`,ak:`Akan`,an:`Aragonés`,as:`অসমীয়া`,av:`Авар`,ay:`Aymar aru`,ba:`Башҡортса`,bh:`भोजपुरी`,bi:`Bislama`,bm:`Bamanankan`,bo:`བོད་སྐད་`,br:`Brezhoneg`,ce:`Нохчийн`,ch:`Chamoru`,cr:`ᓀᐦᐃᔭᐍᐏᐣ`,cu:`Црькъвьнословѣньскъ`,cv:`Чӑвашла`,dv:`ދިވެހިބަސް`,dz:`རྫོང་ཁ`,ee:`Eʋegbe`,eo:`Esperanto`,ff:`Fulah`,fy:`Frysk`,gd:`Gàidhlig`,gn:`Avañe'ẽ`,gv:`Gaelg`,ho:`Hiri Motu`,hz:`Otjiherero`,ia:`Interlingua`,ie:`Interlingue`,ii:`ꆈꌠꉙ`,ik:`Iñupiaq`,io:`Ido`,iu:`ᐃᓄᒃᑎᑐᑦ`,jv:`Basa Jawa`,ki:`Gikuyu`,kr:`Kanuri`,ks:`کٲشُر`,kw:`Kernewek`,lg:`Luganda`,li:`Limburgs`,lu:`Tshiluba`,mh:`Kajin M̧ajeļ`,na:`Dorerin Naoero`,nb:`Norsk Bokmål`,nd:`isiNdebele`,ng:`Oshiwambo`,nn:`Norsk Nynorsk`,nr:`isiNdebele (South)`,nv:`Diné Bizaad`,oc:`Occitan`,oj:`Anishinaabemowin`,om:`Afaan Oromoo`,or:`ଓଡ଼ିଆ`,os:`Ирон`,pa:`ਪੰਜਾਬੀ`,pi:`𑀅𑀯𑀢`,rm:`Rumantsch`,rn:`Ikirundi`,rw:`Kinyarwanda`,sa:`संस्कृतम्`,sc:`Sardu`,sg:`Sängö`,ss:`SiSwati`,st:`Sesotho`,ti:`ትግርኛ`,tn:`Setswana`,to:`Faka Tonga`,ts:`Xitsonga`,tt:`Татарча`,tw:`Twi`,ty:`Reo Tahiti`,ve:`Tshivenḓa`,vo:`Volapük`,wa:`Walon`,wo:`Wolof`,za:`Saɯ cueŋƅ`},$t=(e,t)=>{e.searchParams.set(`lang`,t)},en=(e,t)=>{let n=e.hostname.split(`.`);n[0]===`www`&&(n=n.slice(1)),n=[t,...n],e.hostname=n.join(`.`)},tn=(e,t)=>{e.pathname=`/${t}${e.pathname}`},nn=(e,t)=>{if(!t.languageCode||!t?.resolutionMethod)return e;let n=new URL(e);return(t?.resolutionMethod===`QUERY_PARAM`?$t:t?.resolutionMethod===`SUBDOMAIN`?en:tn)(n,t.languageCode),n.href},rn=(e,t)=>{if(!e?.length)return e;let n;try{n=new URL(e)}catch{return e}n.searchParams.delete(`lang`);let r=n.pathname.split(`/`)[1]?.toLowerCase();if(t.includes(r??``)){let e=n.pathname.split(`/`);e.splice(1,1),n.pathname=e.join(`/`)}let i=n.hostname.split(`.`)[0]?.toLowerCase();if(t.includes(i??``)){let e=n.hostname.split(`.`);e.shift(),n.hostname=e.join(`.`)}return n.href};function an(){let e=on();return e?sn(e):[]}function on(){let e=typeof globals<`u`?globals?.$ns?.[`wix-window`]?.multilingual:void 0,t=typeof window<`u`?window?.essentials?.multilingual:void 0;return e??t??globalThis?.__wix_site_metadata__?.multilingual}function sn(e){try{if(e?.supportedLanguages?.length){let t=e.supportedLanguages,n=t.map(e=>e.languageCode).filter(Boolean),r=e.cleanUrl??dn(n);return t.map(e=>({id:e.languageCode,displayName:cn(e),regionalFormat:[e.locale?.languageCode,e.locale?.country].filter(Boolean).join(`-`),url:ln(e,r),primary:e.isPrimary,resolutionMethod:e.resolutionMethod}))}if(e?.siteLanguages?.length){let t=e.siteLanguages,n=dn(t.map(e=>e.languageCode).filter(Boolean));return t.map(e=>({id:e.languageCode,displayName:cn(e),regionalFormat:e.locale,url:ln(e,n),primary:e.isPrimaryLanguage,resolutionMethod:e.resolutionMethod?un(e.resolutionMethod):void 0}))}}catch(e){return console.warn(`[Multilingual Manager] listSupportedLanguages failed`,e),[]}return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`),[]}function cn(e){let t=Qt[e.languageCode];if(t)return t;let n=e.name??e.countryCode;if(n)return n}function ln(e,t){if(e.url||!t||!e.resolutionMethod)return e.url;if(e.languageCode)try{return nn(t,{languageCode:e.languageCode,countryCode:e.countryCode,resolutionMethod:un(e.resolutionMethod),locale:{languageCode:e.languageCode,country:e.countryCode}})}catch(e){console.warn(`[Multilingual Manager] buildUrlForLanguage failed`,e);return}}function un(e){switch(e){case`QUERY_PARAM`:case`QueryParam`:return P.QUERY_PARAM;case`SUBDOMAIN`:case`Subdomain`:return P.SUBDOMAIN;case`SUBDIRECTORY`:case`Subdirectory`:return P.SUBDIRECTORY;default:return}}function dn(e){let t=typeof window<`u`&&window.location?.href?window.location.href:``;try{return rn(t,e)}catch(e){return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`,e),t}}var fn=`x-wix-linguist`,pn=`00000000-0000-0000-0000-000000000000`,mn=`false`,hn=()=>{let e=F(`language`),t=F(`locale`);if(e)return{[fn]:[e,t||e,mn,pn].join(`|`)}};function gn(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var _n=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,F=e=>_n()?.[e],vn=({createHost:e})=>({__type:`host`,create:e=>({}),host:t=>{let{applicationId:n,componentId:r}=t??{},i=typeof window<`u`?window.wixEmbedsAPI:void 0,a=e(t),o=bn();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:F(`language`),locale:F(`locale`),get passThroughHeaders(){return hn()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&yn()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=gn();return{getAuthHeaders:async()=>{if(!e&&n&&(e=await i),!e)throw Error(`Failed to resolve auth token`);return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(n=!0,e=>{r(e)})}}});function yn(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function bn(){let e=(typeof window<`u`?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!==`/`?`${t.hostname}${t.pathname}`:t.hostname}var xn=({clientSdk:e,applicationId:t})=>({invoke:async({namespace:n,method:r,args:i})=>{if(!e)throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);return e.invoke({namespace:n,method:r,args:i,applicationId:t,accessToken:`accessToken`})},getAccessToken:()=>{throw Error(`Not implemented`)},observeState:()=>({disconnect:()=>{}})}),Sn=vn({createHost:function(e){let t=(typeof $wixContext<`u`?$wixContext.clientSdk:void 0)??e?.clientSdk??(typeof window<`u`?window?.clientSdk:void 0),{applicationId:n}=e||{};if(!n)throw Error(`"createHost" was called without a required field "applicationId"`);return{channel:xn({clientSdk:t,applicationId:n}),close:()=>{}}}}),Cn=(e,t)=>{let n=Sn.host({applicationId:e,componentId:t}),r=Sn.auth();return He({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},wn=e=>Cn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,e);function Tn(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return I(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:p.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:p.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:p.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:p.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw 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 I(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return I(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function I(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function En(e,t){return{...e,...Object.fromEntries(t.map(t=>[t,(...n)=>{let r=Tn();if(!r)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return r.initWixModules(e)[t].apply(void 0,n)}]))}}function Dn(e){return En({__type:`host`,create:t=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r(t)}),{})},Object.keys(e))}var L=e=>typeof e==`string`,R=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},On=e=>e==null?``:``+e,kn=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},An=/###/g,jn=e=>e&&e.indexOf(`###`)>-1?e.replace(An,`.`):e,Mn=e=>!e||L(e),z=(e,t,n)=>{let r=L(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Mn(e))return{};let t=jn(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Mn(e)?{}:{obj:e,k:jn(r[i])}},Nn=(e,t,n)=>{let{obj:r,k:i}=z(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=z(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=z(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Pn=(e,t,n,r)=>{let{obj:i,k:a}=z(e,t,Object);i[a]=i[a]||[],i[a].push(n)},B=(e,t)=>{let{obj:n,k:r}=z(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Fn=(e,t,n)=>{let r=B(e,n);return r===void 0?B(t,n):r},In=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?L(e[r])||e[r]instanceof String||L(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):In(e[r],t[r],n):e[r]=t[r]);return e},V=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Ln={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Rn=e=>L(e)?e.replace(/[&<>"'\/]/g,e=>Ln[e]):e,zn=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Bn=[` `,`,`,`?`,`!`,`;`],Vn=new zn(20),Hn=(e,t,n)=>{t||=``,n||=``;let r=Bn.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Vn.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},H=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},U=e=>e?.replace(/_/g,`-`),Un={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},W=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Un,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(L(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},G=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},Wn=class extends G{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):L(n)&&i?o.push(...n.split(i)):o.push(n)));let s=B(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!L(n)?s:H(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Nn(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(L(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=B(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?In(s,n,i):s={...s,...n},Nn(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Gn={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Kn=Symbol(`i18next/PATH_KEY`);function qn(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Kn?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function K(e,t){let{[Kn]:n}=e(qn()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Jn={},Yn=e=>!L(e)&&typeof e!=`boolean`&&typeof e!=`number`,Xn=class e extends G{constructor(e,t={}){super(),kn([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=W.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Yn(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Hn(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:L(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:L(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=K(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?K(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!L(i.count),x=e.hasDefaultValue(i),ee=b?this.pluralResolver.getSuffix(d,i.count,i):``,te=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,S=b&&!i.ordinal&&i.count===0,C=S&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${ee}`]||i[`defaultValue${te}`]||i.defaultValue,w=m;y&&!m&&x&&(w=C);let ne=Yn(w),re=Object.prototype.toString.apply(w);if(y&&w&&ne&&_.indexOf(re)<0&&!(L(v)&&Array.isArray(w))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,w,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(w),t=e?[]:{},n=e?g:h;for(let e in w)if(Object.prototype.hasOwnProperty.call(w,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:Yn(C)?C[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=w[e])}m=t}}else if(y&&L(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=C),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&C!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?C:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);S&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||C)})}):n(e,s,C))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=L(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!L(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=L(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Gn.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return L(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?K(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!L(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(L(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!Jn[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(Jn[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!L(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},Zn=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=W.create(`languageUtils`)}getScriptPartFromCode(e){if(e=U(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=U(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(L(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),L(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return L(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):L(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Qn={zero:0,one:1,two:2,few:3,many:4,other:5},$n={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},er=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=W.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=U(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),$n;if(!e.match(/-|_/))return $n;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Qn[e]-Qn[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},tr=(e,t,n,r=`.`,i=!0)=>{let a=Fn(e,t,n);return!a&&i&&L(n)&&(a=H(e,n,r),a===void 0&&(a=H(t,n,r))),a},nr=e=>e.replace(/\$/g,`$$$$`),rr=class{constructor(e={}){this.logger=W.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Rn:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?V(i):a||`{{`,this.suffix=o?V(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?V(d):f||V(`$t(`),this.nestingSuffix=p?V(p):m||V(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=tr(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(tr(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>nr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?nr(this.escape(e)):nr(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0){if(typeof l==`function`){let t=l(e,i,r);a=L(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else!L(a)&&!this.useRawValueToEscape&&(a=On(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${V(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!L(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!L(i))return i;L(i)||(i=On(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},ir=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},ar=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(U(r),i),t[o]=s),s(n)}},or=e=>(t,n,r)=>e(U(n),r)(t),sr=class{constructor(e={}){this.logger=W.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?ar:or;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ar(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=ir(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},cr=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},lr=class extends G{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=W.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Pn(n.loaded,[i],a),cr(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();L(e)&&(e=this.languageUtils.toResolveHierarchy(e)),L(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},ur=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),L(e[1])&&(t.defaultValue=e[1]),L(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),dr=e=>(L(e.ns)&&(e.ns=[e.ns]),L(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),L(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),q=()=>{},fr=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},pr=`__i18next_supportNoticeShown`,mr=()=>!!(typeof globalThis<`u`&&globalThis[pr]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),hr=()=>{typeof globalThis<`u`&&(globalThis[pr]=!0)},gr=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),J=class e extends G{constructor(e={},t){if(super(),this.options=dr(e),this.services={},this.logger=W,this.modules={external:[]},fr(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(L(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=ur();this.options={...n,...this.options,...dr(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!gr(this)&&!mr()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),hr());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?W.init(r(this.modules.logger),this.options):W.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:sr;let t=new Zn(this.options);this.store=new Wn(this.options.resources,this.options);let i=this.services;i.logger=W,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new er(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new rr(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new lr(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Xn(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=q,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=R(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=q){let n=t,r=L(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=R();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=q,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Gn.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=R();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=L(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(L(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=K(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=K(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=K(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return L(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=R();return this.options.ns?(L(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=R();L(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new Zn(ur());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=q){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Wn(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...ur().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new rr(n)}return a.translator=new Xn(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();J.createInstance,J.dir,J.init,J.loadResources,J.reloadResources,J.use,J.changeLanguage,J.getFixedT,J.t,J.exists,J.setDefaultNamespace,J.hasLoadedNamespace,J.loadNamespaces,J.loadLanguages;var _r=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,vr={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`…`,"…":`…`,"/":`/`,"/":`/`},yr=e=>vr[e],br={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(_r,yr),transDefaultProps:void 0},xr=(e={})=>{br={...br,...e}},Sr={type:`3rdParty`,init(e){xr(e.options.react)}},Y=new Map,Cr=500,X;function wr(){if(X===void 0)try{X=new Intl.NumberFormat(`en-US`,{useGrouping:!1,maximumFractionDigits:0}).format(`9007199254740993`)===`9007199254740993`}catch{X=!1}return X}var Tr=15;function Er(e){if(!(typeof e!=`string`||wr())&&e.replace(/[^0-9]/g,``).replace(/^0+/,``).length>Tr)throw Error(`Cannot format the amount '${e}' exactly: this runtime's Intl implementation predates ES2023 string support and would lose precision. Use a runtime with ES2023 Intl support (for example Node 20+), or pass a value within 15 significant digits.`)}function Dr(e,t,n){return`${e}|${t}|${Object.entries(n).filter(([,e])=>e!==void 0).sort(([e],[t])=>e<t?-1:1).map(([e,t])=>`${e}=${String(t)}`).join(`&`)}`}function Or(e,t,n){let r=Dr(e,t,n),i=Y.get(r);return i||(i=new Intl.NumberFormat(e,{...n,style:`currency`,currency:t}),Y.size>=Cr&&Y.clear(),Y.set(r,i)),i}function kr(e,{value:t,currency:n},r={}){return Er(t),Or(e,n,r).format(t)}function Ar(e,{value:t,currency:n},r={}){return Er(t),Or(e,n,r).formatToParts(t)}function jr(e){return an().find(e=>e.primary)?.id??e}function Mr(e,t){let{locale:n,...r}=t??{},i=n??e.essentials?.locale;if(!i)throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);return{locale:i,formatOptions:r}}var Nr=Dn({getLanguage:e=>()=>{let t=e.essentials?.language;if(!t)throw Error(`Host language is not available on the current host. Make sure to use an updated version of the host initialization package.`);return t},getLocale:e=>()=>{let t=e.essentials?.locale;if(!t)throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);return t},formatCurrency:e=>(t,n)=>{let{locale:r,formatOptions:i}=Mr(e,n);return kr(r,t,i)},formatCurrencyToParts:e=>(t,n)=>{let{locale:r,formatOptions:i}=Mr(e,n);return Ar(r,t,i)},getTranslationFunction:e=>()=>{let t=e.translations?.();if(!t)throw Error(`Host translation resources are not available.`);let n=J.createInstance(),r=jr(e.essentials?.language)||`en`,i={lng:e.essentials?.language||r,fallbackLng:r,resources:t};return n.use(Sr).init(i,e=>{if(e)throw e}),n.t.bind(n)}}),Pr=class{constructor(e){this.message=e,this.captureException=()=>{console.error(this.message)},this.captureMessage=()=>{console.error(this.message)},this.startSpan=(e,t)=>(console.error(this.message),t(void 0)),this.startSpanManual=()=>(console.error(this.message),{end:()=>{},fail:()=>{}}),this.endSpanManual=()=>{console.error(this.message)},this.addBreadcrumb=()=>{console.error(this.message)}}},Fr=e=>new Pr(e),Ir=Dn({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():Fr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`)}),Lr={service:`service`,services:`services`,categories:`categories`,locations:`locations`,sessions:`sessions`,timeSlots:`time-slots`,serviceAddOns:`service-addons`,bookingsSettings:`bookings-settings`,serviceCta:`service-cta`,preferences:`preferences`,bookingSummary:`booking-summary`,bookingCheckout:`booking-checkout`,formValues:`form-values`,paymentOptions:`payment-options`,seo:`seo`,warmup:`warmup`,reschedule:`reschedule`};function Rr(e){try{let t=Ir.getMonitoringClient?.();return t&&typeof t[e]==`function`?t:null}catch{return null}}function zr(e,{feature:t,action:n,level:r=`error`,contexts:i}){let a=Rr(`captureException`);if(!a)return;let o=e instanceof Error?e:Error(String(e));a.captureException(o,{level:r,tags:{feature:t,action:n},...i?{contexts:i}:{}})}function Br(e,{feature:t,tags:n},r){let i=Rr(`startSpanManual`);if(!i)return r;let a=i.startSpanManual({name:e,tags:{feature:t,...n}});return r.then(()=>a.end(),e=>a.fail(e)),r}var Vr=class extends e{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){zr(e,{feature:this.props.feature??`service`,action:`render`,contexts:{react:{componentStack:t.componentStack}}})}render(){return this.state.hasError?this.props.fallback:this.props.children}};function Hr(e){let t=e;if(t.__state||(t.__state={status:`pending`},t.then(e=>{t.__state={status:`fulfilled`,value:e}},e=>{t.__state={status:`rejected`,reason:e}})),t.__state.status===`fulfilled`)return t.__state.value;throw t.__state.status===`rejected`?t.__state.reason:t}function Ur(e){let t=Promise.resolve(e);return t.__state={status:`fulfilled`,value:e},t}var Wr=new WeakMap;function Gr(e,t,n){let r=Wr.get(e);r||(r=new WeakMap,Wr.set(e,r));let i=r.get(t);i||(i=new WeakMap,r.set(t,i));let a=i.get(n);if(!a){let r=e;a=r.__state?.status===`fulfilled`?Ur(t(r.__state.value)):r.__state?.status===`rejected`?Ur(n(r.__state.reason)):e.then(t,n),i.set(n,a)}return a}function Z(e){return e}var Kr=Z(`@wix/site-service-url`),qr=`appSectionParams`;function Jr(e){let t=e.searchParams.get(qr);if(t===null)return e;let n=new URL(e);n.searchParams.delete(qr);for(let[e,r]of Object.entries(Yr(t)))typeof r==`string`&&!n.searchParams.has(e)&&n.searchParams.set(e,r);return n}function Yr(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var Xr=`bookings-uou:url-change`,Zr=e=>{let t=new URL(e);return t.searchParams.sort(),t.href};function Qr(e,{disableScrollToTop:t,skipHistory:n}={}){let r=globalThis.window;if(!r?.history)return;let i=new URL(r.location.href);if(Zr(i)===Zr(e))return;let a={scrollY:r.scrollY};if(n)r.history.replaceState(a,``,e.href);else{r.history.replaceState(a,``,i.href);try{r.history.pushState(t?a:null,``,e.href)}catch{return}}r.dispatchEvent(new Event(Xr))}function $r(e){let t=globalThis.window;return t?(t.addEventListener(Xr,e),t.addEventListener(`popstate`,e),()=>{t.removeEventListener(Xr,e),t.removeEventListener(`popstate`,e)}):()=>{}}var ei=e=>{try{return decodeURIComponent(e)}catch{return e}};function ti(e,t){let n=t?new URL(t).pathname:`/`;return`./${ei(new URL(e).pathname.replace(n,``).replace(/^\/|\/$/g,``))}`}function ni(){let e=d(Kr),t=r(()=>e.currentUrl,[e]),n=l($r,t,t),i=o(()=>Jr(new URL(n)),[n]),a=e.siteUrl.replace(/\/$/,``);return{pathname:i.pathname,search:i.search,searchParams:i.searchParams,href:i.href,getParsedUrl:()=>Jr(new URL(e.currentUrl)),getRelativeUrl:()=>ti(e.currentUrl,a),getExternalBaseUrl:()=>a,pushUrl:Qr}}var Q={category:`category`,location:`location`,page:`page`,blob:`b`,resource:`resource`,referral:`referral`,timezone:`timezone`,bookingId:`bookingId`,token:`token`,rescheduleRedirectUrl:`rescheduleRedirectUrl`},ri=Z(`@wix/site-service-warmup-data`);function ii(){try{return u()}catch{return null}}function ai(e){try{return e?e(ri):null}catch{return null}}function oi(){let e=ai(ii()),t=typeof window>`u`;return{scope:e??void 0,get:async n=>{if(t||!e)return null;try{return await e.get(n)}catch(e){return zr(e,{feature:Lr.warmup,action:`read`,level:`warning`,contexts:{warmup:{key:n}}}),null}},set:(n,r)=>{if(t&&e)try{e.set(n,r)}catch{}}}}var si=Z(`@wix/site-service-locale`),ci=Z,li=ci(`@wix/viewer-service-multilingual`);function ui(){try{return Nr.getLanguage()??`en`}catch{return`en`}}function di(e){try{return d(e)}catch{return null}}function fi(){let e=di(si),t=di(li);return t?.multilingualEnabled&&t.currentLocale?.languageCode||e?.language||ui()}var pi=`bookings-uou`;function mi(e){return`${pi}:${e}:locations:all`}var hi=5e3,gi=100,_i=`wix-warmup-data`,vi=null;function yi(e){if(typeof document<`u`)try{let t=document.getElementById(_i)?.textContent;return t?(vi?.text!==t&&(vi={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),vi.data[e]??void 0):void 0}catch{return}}var bi=()=>({promises:new Map,invalidatedWarmup:new Set}),xi=bi(),Si=new WeakMap,Ci=new WeakMap;function wi(e){if(!e)return xi;let t=Si.get(e);return t||(t=bi(),Si.set(e,t)),t}function Ti({key:e,warmupData:t,fetchData:n,refresh:r=!1}){if(e===null)return n();if(typeof window>`u`){let r=()=>n().then(n=>(t.set(e,n),n)),{scope:i}=t;if(!i)return r();let a=Ci.get(i);a||(a=new Map,Ci.set(i,a));let o=a.get(e);if(o)return o;let s=r();return a.set(e,s),s.catch(()=>a.delete(e)),s}let i=wi(t.scope),a=Date.now();for(let[e,t]of i.promises)t.expiresAt<=a&&i.promises.delete(e);let o=i.promises.get(e);if(o&&!r)return o.promise;r&&i.invalidatedWarmup.add(e);let s=!i.invalidatedWarmup.has(e);if(s){let t=yi(e);if(t!==void 0){let n=Ur(t);return i.promises.set(e,{promise:n,expiresAt:a+hi}),n}}let c=(async()=>{if(s){let n=await t.get(e);if(n!=null)return n}return n()})();i.promises.size>=gi&&i.promises.delete(i.promises.keys().next().value);let l={promise:c,expiresAt:1/0};return i.promises.set(e,l),c.then(()=>{l.expiresAt=Date.now()+hi},()=>{i.promises.get(e)===l&&i.promises.delete(e)}),c}var Ei=[{path:`businessLocations.locations.business.address.geocode.latitude`},{path:`businessLocations.locations.business.address.geocode.longitude`},{path:`businessLocations.locations.custom.address.geocode.latitude`},{path:`businessLocations.locations.custom.address.geocode.longitude`},{path:`businessLocations.locations.calculatedAddress.geocode.latitude`},{path:`businessLocations.locations.calculatedAddress.geocode.longitude`}];function Di(e){return Dt(Object.assign(e,{domainToMappings:{"*.dev.wix-code.com":[{srcPath:`/_api/services-2`,destPath:``},{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"www.wixapis.com":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`},{srcPath:`/bookings/services/v2/bulk/services`,destPath:`/v2/bulk/services`}],"manage._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"editor._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"blocks._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"create.editorx":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],_:[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"www._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"bo._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"wixbo.ai":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"wix-bo.com":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"editor.wixapps.net":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"api._api_base_domain_":[{srcPath:`/services-2`,destPath:``}]}}))}var Oi=`@wix/auto_sdk_bookings_services`;function ki(e){function t({host:t}){return{entityFqdn:`wix.bookings.services.v2.service`,method:`POST`,methodFqn:`wix.bookings.services.v2.ServicesService.QueryLocations`,packageName:Oi,migrationOptions:{optInTransformResponse:!0},url:Di({protoPath:`/v2/services/locations/query`,data:e,host:t}),data:e,transformResponse:e=>st(e,[{transformFn:Xt,paths:Ei}])}}return t}var Ai=[{path:`businessLocations.locations.calculatedAddress`},{path:`businessLocations.locations.business.address`},{path:`businessLocations.locations.custom.address`}];async function ji(e){let{httpClient:t,sideEffects:n}=arguments[1],r=ki(Xe({filter:e?.filter}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),Ze(st(e.data,[{transformFn:Zt,paths:Ai}]))}catch(e){let t=_t(e,{spreadPathsToArguments:{},explicitPathsToArguments:{filter:`$[0].filter`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function Mi(e){return t=>ji(t,{httpClient:e})}var Ni=Et(Mi),Pi=`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,Fi=function(e){return e.BOOK_ONLINE=`bookingsBookOnline`,e.SERVICE_PAGE=`bookingsServicePage`,e.CALENDAR_PAGE=`bookingsCalendar`,e.FORM_PAGE=`bookingsForm`,e}({});function Ii(e){return e.business?._id??null}function Li(e){return e.business?.name??null}async function Ri(){let e=await Ni({filter:{services:{appId:Pi,hidden:!1}}});return{locations:[...e.businessLocations?.locations??[]].sort((e,t)=>(Li(e)??``).localeCompare(Li(t)??``)),hasOtherLocations:!!(e.customLocations?.exists||e.customerLocations?.exists)}}function zi({isLoading:e,hasError:t,refetch:n,children:r}){let{searchParams:i}=ni(),a={locationItems:[],selectedLocationId:i.get(Q.location),hasOtherLocations:!1,hasMultipleLocations:!1,isLoading:e,hasError:t,refetch:n,selectLocation:()=>{}};return f($.Provider,{value:a,children:r})}function Bi({refetch:e,children:t}){return f(zi,{isLoading:!0,hasError:!1,refetch:e,children:t})}function Vi({refetch:e,children:t}){return f(zi,{isLoading:!1,hasError:!0,refetch:e,children:t})}var Hi=ci(`@wix/site-service-business-logger`);function Ui(e){return{evid:32,src:16,endpoint:``,params:e}}var Wi={SERVICES:`services_context`,SERVICE:`service_context`,TIME_SLOTS:`time_slots_context`,BOOKING_CHECKOUT:`booking_checkout_context`,CATEGORIES:`categories_context`,LOCATIONS:`locations_context`,SERVICE_ADD_ONS:`service_addons_context`,PREFERENCES:`preferences_context`};Fi.BOOK_ONLINE;var Gi=`new_bookings_server`,Ki=e=>{let{reportBi:t}=d(Hi);return r(n=>{t({widget_name:e,bookingsPlatform:Gi,is_over_editor:!1,...n.params,src:n.src,evid:n.evid},{endpoint:n.endpoint})},[t,e])},qi=(e,t=!0)=>{let n=Ki(e),{getParsedUrl:r}=ni(),i=s(!1);a(()=>{t&&!i.current&&(i.current=!0,n(Ui({referralInfo:r().searchParams.get(Q.referral)??void 0})))},[t,n,r])},$=n(null),Ji=`useLocationsContext must be used within LocationsContextProvider`;function Yi(){let e=i($);if(!e)throw Error(Ji);return e}function Xi(e,t){let n=Ii(e);return{locationId:n,locationName:Li(e),isSelected:n!=null&&n===t}}var Zi=e=>({...e,hasError:!1}),Qi=()=>({locations:[],hasOtherLocations:!1,hasError:!0});function $i({locationsPromise:e,refetch:t,children:n}){let{locations:i,hasOtherLocations:s,hasError:c}=Hr(e),{pathname:l,searchParams:u,pushUrl:d,getExternalBaseUrl:p}=ni(),m=u.get(Q.location),h=r((e,t)=>{let n=new URLSearchParams(u);e?n.set(Q.location,e):n.delete(Q.location),n.delete(Q.page);let r=n.toString(),i=r?`${l}?${r}`:l;d(new URL(i,`${p()}/`),{disableScrollToTop:!0,skipHistory:t})},[l,u,d,p]),g=r(e=>h(e,!1),[h]),_=m!=null&&!c&&!(m===`OTHER_LOCATIONS`&&s)&&!i.some(e=>Ii(e)===m);a(()=>{_&&h(null,!0)},[_,h]);let v=i.filter(e=>Ii(e)).length+ +!!s,y=o(()=>({locationItems:i.map(e=>Xi(e,m)),selectedLocationId:m,hasOtherLocations:s,hasMultipleLocations:v>1,isLoading:!1,hasError:c,refetch:t,selectLocation:g}),[i,m,s,c,v,t,g]);return f($.Provider,{value:y,children:n})}function ea({children:e}){qi(Wi.LOCATIONS);let n=oi(),i=fi(),[a,s]=c(0),l=o(()=>Gr(Ti({key:mi(i),refresh:a!==0,warmupData:n,fetchData:()=>Br(`locations-context-load`,{feature:Lr.locations},Ri())}),Zi,Qi),[a,i]),u=r(()=>s(e=>e+1),[]);return f(Vr,{fallback:f(Vi,{refetch:u,children:e}),feature:Lr.locations,children:f(t,{fallback:f(Bi,{refetch:u,children:e}),children:f($i,{locationsPromise:l,refetch:u,children:e})})})}var ta=wn(`c151d9f7-1582-407c-bb59-59030f244b47`);export{Ji as LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,ea as default,ta as injectAccessTokenGetter,$ as locationsContext,Yi as useLocationsContext};
|
|
2
|
+
//# sourceMappingURL=context-provider-c151d9f7-1582-407c-bb59-59030f244b47-DoPBtCgV.js.map
|