@omnic/widget-locations 1.1.69 → 1.1.76

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.
@@ -1,4 +1,4 @@
1
- "use strict";var zs=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var k=(t,e,n)=>(zs(t,e,"read from private field"),n?n.call(t):e.get(t)),J=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},$=(t,e,n,r)=>(zs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var ho=(t,e,n,r)=>({set _(i){$(t,e,i,n)},get _(){return k(t,e,r)}}),ye=(t,e,n)=>(zs(t,e,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),c=require("react"),ei=require("react-dom"),Hp=require("react-dom/server");function Bf(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const U=Bf(c),Ff=Bf(ei),Uf=c.createContext({}),Vf=!0;function $p({baseColor:t,highlightColor:e,width:n,height:r,borderRadius:i,circle:o,direction:s,duration:a,enableAnimation:l=Vf,customHighlightBackground:u}){const f={};return s==="rtl"&&(f["--animation-direction"]="reverse"),typeof a=="number"&&(f["--animation-duration"]=`${a}s`),l||(f["--pseudo-element-display"]="none"),(typeof n=="string"||typeof n=="number")&&(f.width=n),(typeof r=="string"||typeof r=="number")&&(f.height=r),(typeof i=="string"||typeof i=="number")&&(f.borderRadius=i),o&&(f.borderRadius="50%"),typeof t<"u"&&(f["--base-color"]=t),typeof e<"u"&&(f["--highlight-color"]=e),typeof u=="string"&&(f["--custom-highlight-background"]=u),f}function kt({count:t=1,wrapper:e,className:n,containerClassName:r,containerTestId:i,circle:o=!1,style:s,...a}){var l,u,f;const d=c.useContext(Uf),h={...a};for(const[m,_]of Object.entries(a))typeof _>"u"&&delete h[m];const v={...d,...h,circle:o},y={...s,...$p(v)};let g="react-loading-skeleton";n&&(g+=` ${n}`);const S=(l=v.inline)!==null&&l!==void 0?l:!1,w=[],L=Math.ceil(t);for(let m=0;m<L;m++){let _=y;if(L>t&&m===L-1){const p=(u=_.width)!==null&&u!==void 0?u:"100%",b=t%1,x=typeof p=="number"?p*b:`calc(${p} * ${b})`;_={..._,width:x}}const E=c.createElement("span",{className:g,style:_,key:m},"‌");S?w.push(E):w.push(c.createElement(c.Fragment,{key:m},E,c.createElement("br",null)))}return c.createElement("span",{className:r,"data-testid":i,"aria-live":"polite","aria-busy":(f=v.enableAnimation)!==null&&f!==void 0?f:Vf},e?w.map((m,_)=>c.createElement(e,{key:_},m)):w)}function Wp({children:t,...e}){return c.createElement(Uf.Provider,{value:e},t)}var po=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gp=function(t,e,n,r,i,o,s,a){if(!t){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],f=0;l=new Error(e.replace(/%s/g,function(){return u[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},Zp=Gp;const sn=Sl(Zp);let go;const qp=new Uint8Array(16);function Kp(){if(!go&&(go=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!go))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return go(qp)}const st=[];for(let t=0;t<256;++t)st.push((t+256).toString(16).slice(1));function Qp(t,e=0){return st[t[e+0]]+st[t[e+1]]+st[t[e+2]]+st[t[e+3]]+"-"+st[t[e+4]]+st[t[e+5]]+"-"+st[t[e+6]]+st[t[e+7]]+"-"+st[t[e+8]]+st[t[e+9]]+"-"+st[t[e+10]]+st[t[e+11]]+st[t[e+12]]+st[t[e+13]]+st[t[e+14]]+st[t[e+15]]}const Jp=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eu={randomUUID:Jp};function zf(t,e,n){if(eu.randomUUID&&!e&&!t)return eu.randomUUID();t=t||{};const r=t.random||(t.rng||Kp)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return Qp(r)}const Yp=zf(),Hf=zf(),Xp=[48,66],eg=6,wa=[49.3478969,14.0983344],$f="en",tg=["places","geocoding"],Jn={logo:"default",locale:$f,map:{provider:"google",center:wa,initialZoom:eg}},Wf=c.createContext(Jn),Ze=()=>c.useContext(Wf);var vn=(t=>(t[t.All=0]="All",t[t.PickPoint=20]="PickPoint",t[t.PostOffice=30]="PostOffice",t))(vn||{}),Zt=(t=>(t[t.PayByCash=0]="PayByCash",t[t.DressingRoom=1]="DressingRoom",t[t.CheckOrder=2]="CheckOrder",t))(Zt||{}),qt=(t=>(t[t.Return=0]="Return",t[t.Payment=1]="Payment",t[t.Shipping=2]="Shipping",t))(qt||{}),ng={VITE_API_BASE_URL:"https://ecomgate.omnic.solutions/api/1.0.0/type-1/public/",VITE_GEO_API_BASE_URL:"https://api.geo-data.omnic.solutions/api/1.0/",VITE_YMAPS_KEY:"5298a725-4baa-457a-a2a7-c3abac81db20",VITE_GMAP_KEY:"AIzaSyDsI0AO8VsUrTPoyR9fF7T31FKx1a9TLO0",VITE_TOKEN:"fa812020-3197-401a-9b39-345999046111",VITE_TOLGEE_API_URL:"https://tms.omnic.solutions",VITE_TOLGEE_API_KEY:"tgpak_gfpwentkga2g4zdngbzwozdinvztezlknu4xmnlpnbrgc",VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const tu=t=>{let e;const n=new Set,r=(f,d)=>{const h=typeof f=="function"?f(e):f;if(!Object.is(h,e)){const v=e;e=d??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(y=>y(e,v))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(ng?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=e=t(r,i,l);return l},rg=t=>t?tu(t):tu;var Gf={exports:{}},Zf={},qf={exports:{}},Kf={};/**
1
+ "use strict";var ks=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var P=(t,e,n)=>(ks(t,e,"read from private field"),n?n.call(t):e.get(t)),H=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},F=(t,e,n,r)=>(ks(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var Qi=(t,e,n,r)=>({set _(i){F(t,e,i,n)},get _(){return P(t,e,r)}}),Q=(t,e,n)=>(ks(t,e,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),p=require("react"),qo=require("react-dom"),cp=require("react-dom/server");function lp(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const N=lp(p),rf=p.createContext({}),of=!0;function up({baseColor:t,highlightColor:e,width:n,height:r,borderRadius:i,circle:o,direction:s,duration:a,enableAnimation:c=of,customHighlightBackground:l}){const u={};return s==="rtl"&&(u["--animation-direction"]="reverse"),typeof a=="number"&&(u["--animation-duration"]=`${a}s`),c||(u["--pseudo-element-display"]="none"),(typeof n=="string"||typeof n=="number")&&(u.width=n),(typeof r=="string"||typeof r=="number")&&(u.height=r),(typeof i=="string"||typeof i=="number")&&(u.borderRadius=i),o&&(u.borderRadius="50%"),typeof t<"u"&&(u["--base-color"]=t),typeof e<"u"&&(u["--highlight-color"]=e),typeof l=="string"&&(u["--custom-highlight-background"]=l),u}function Qe({count:t=1,wrapper:e,className:n,containerClassName:r,containerTestId:i,circle:o=!1,style:s,...a}){var c,l,u;const f=p.useContext(rf),d={...a};for(const[v,E]of Object.entries(a))typeof E>"u"&&delete d[v];const y={...f,...d,circle:o},m={...s,...up(y)};let h="react-loading-skeleton";n&&(h+=` ${n}`);const _=(c=y.inline)!==null&&c!==void 0?c:!1,b=[],C=Math.ceil(t);for(let v=0;v<C;v++){let E=m;if(C>t&&v===C-1){const g=(l=E.width)!==null&&l!==void 0?l:"100%",S=t%1,O=typeof g=="number"?g*S:`calc(${g} * ${S})`;E={...E,width:O}}const x=p.createElement("span",{className:h,style:E,key:v},"‌");_?b.push(x):b.push(p.createElement(p.Fragment,{key:v},x,p.createElement("br",null)))}return p.createElement("span",{className:r,"data-testid":i,"aria-live":"polite","aria-busy":(u=y.enableAnimation)!==null&&u!==void 0?u:of},e?b.map((v,E)=>p.createElement(e,{key:E},v)):b)}function fp({children:t,...e}){return p.createElement(rf.Provider,{value:e},t)}var Ji=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ds(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var dp=function(t,e,n,r,i,o,s,a){if(!t){var c;if(e===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,s,a],u=0;c=new Error(e.replace(/%s/g,function(){return l[u++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},hp=dp;const Tt=ds(hp);let Xi;const pp=new Uint8Array(16);function mp(){if(!Xi&&(Xi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xi(pp)}const Te=[];for(let t=0;t<256;++t)Te.push((t+256).toString(16).slice(1));function gp(t,e=0){return Te[t[e+0]]+Te[t[e+1]]+Te[t[e+2]]+Te[t[e+3]]+"-"+Te[t[e+4]]+Te[t[e+5]]+"-"+Te[t[e+6]]+Te[t[e+7]]+"-"+Te[t[e+8]]+Te[t[e+9]]+"-"+Te[t[e+10]]+Te[t[e+11]]+Te[t[e+12]]+Te[t[e+13]]+Te[t[e+14]]+Te[t[e+15]]}const vp=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Qc={randomUUID:vp};function sf(t,e,n){if(Qc.randomUUID&&!e&&!t)return Qc.randomUUID();t=t||{};const r=t.random||(t.rng||mp)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return gp(r)}const yp=sf(),af=sf(),bp=6,ua=[49.3478969,14.0983344],cf="en",wp=["places","geocoding"],yn={logo:"default",locale:cf,map:{provider:"google",center:ua,initialZoom:bp}},lf=p.createContext(yn),be=()=>p.useContext(lf);var Ft=(t=>(t[t.All=0]="All",t[t.PickPoint=20]="PickPoint",t[t.PostOffice=30]="PostOffice",t))(Ft||{}),mt=(t=>(t[t.PayByCash=0]="PayByCash",t[t.DressingRoom=1]="DressingRoom",t[t.CheckOrder=2]="CheckOrder",t))(mt||{}),gt=(t=>(t[t.Return=0]="Return",t[t.Payment=1]="Payment",t[t.Shipping=2]="Shipping",t))(gt||{}),_p={VITE_API_BASE_URL:"https://ecomgate.omnic.solutions/api/1.0.0/type-1/public/",VITE_GEO_API_BASE_URL:"https://api.geo-data.omnic.solutions/api/1.0/",VITE_YMAPS_KEY:"5298a725-4baa-457a-a2a7-c3abac81db20",VITE_GMAP_KEY:"AIzaSyDsI0AO8VsUrTPoyR9fF7T31FKx1a9TLO0",VITE_GMAP_ID:"e130cd87a3f1b9cbe3cb5de4",VITE_TOKEN:"fa812020-3197-401a-9b39-345999046111",VITE_TOLGEE_API_URL:"https://tms.omnic.solutions",VITE_TOLGEE_API_KEY:"tgpak_gfpwentkga2g4zdngbzwozdinvztezlknu4xmnlpnbrgc",VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Jc=t=>{let e;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(e):u;if(!Object.is(d,e)){const y=e;e=f??(typeof d!="object"||d===null)?d:Object.assign({},e,d),n.forEach(m=>m(e,y))}},i=()=>e,c={setState:r,getState:i,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(_p?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=e=t(r,i,c);return c},Sp=t=>t?Jc(t):Jc;var uf={exports:{}},ff={},df={exports:{}},hf={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Zr=c;function ig(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var og=typeof Object.is=="function"?Object.is:ig,sg=Zr.useState,ag=Zr.useEffect,lg=Zr.useLayoutEffect,ug=Zr.useDebugValue;function cg(t,e){var n=e(),r=sg({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return lg(function(){i.value=n,i.getSnapshot=e,Hs(i)&&o({inst:i})},[t,n,e]),ag(function(){return Hs(i)&&o({inst:i}),t(function(){Hs(i)&&o({inst:i})})},[t]),ug(n),n}function Hs(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!og(t,n)}catch{return!0}}function fg(t,e){return e()}var dg=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?fg:cg;Kf.useSyncExternalStore=Zr.useSyncExternalStore!==void 0?Zr.useSyncExternalStore:dg;qf.exports=Kf;var hg=qf.exports;/**
9
+ */var Sr=p;function Cp(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ep=typeof Object.is=="function"?Object.is:Cp,xp=Sr.useState,Op=Sr.useEffect,Pp=Sr.useLayoutEffect,Tp=Sr.useDebugValue;function Ap(t,e){var n=e(),r=xp({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return Pp(function(){i.value=n,i.getSnapshot=e,Ds(i)&&o({inst:i})},[t,n,e]),Op(function(){return Ds(i)&&o({inst:i}),t(function(){Ds(i)&&o({inst:i})})},[t]),Tp(n),n}function Ds(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Ep(t,n)}catch{return!0}}function Rp(t,e){return e()}var Lp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Rp:Ap;hf.useSyncExternalStore=Sr.useSyncExternalStore!==void 0?Sr.useSyncExternalStore:Lp;df.exports=hf;var Mp=df.exports;/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim/with-selector.production.min.js
12
12
  *
@@ -14,17 +14,17 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var _s=c,pg=hg;function gg(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var vg=typeof Object.is=="function"?Object.is:gg,mg=pg.useSyncExternalStore,yg=_s.useRef,bg=_s.useEffect,wg=_s.useMemo,Cg=_s.useDebugValue;Zf.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=yg(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=wg(function(){function l(v){if(!u){if(u=!0,f=v,v=r(v),i!==void 0&&s.hasValue){var y=s.value;if(i(y,v))return d=y}return d=v}if(y=d,vg(f,v))return y;var g=r(v);return i!==void 0&&i(y,g)?y:(f=v,d=g)}var u=!1,f,d,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,r,i]);var a=mg(t,o[0],o[1]);return bg(function(){s.hasValue=!0,s.value=a},[a]),Cg(a),a};Gf.exports=Zf;var Sg=Gf.exports;const Lg=Sl(Sg);var Qf={VITE_API_BASE_URL:"https://ecomgate.omnic.solutions/api/1.0.0/type-1/public/",VITE_GEO_API_BASE_URL:"https://api.geo-data.omnic.solutions/api/1.0/",VITE_YMAPS_KEY:"5298a725-4baa-457a-a2a7-c3abac81db20",VITE_GMAP_KEY:"AIzaSyDsI0AO8VsUrTPoyR9fF7T31FKx1a9TLO0",VITE_TOKEN:"fa812020-3197-401a-9b39-345999046111",VITE_TOLGEE_API_URL:"https://tms.omnic.solutions",VITE_TOLGEE_API_KEY:"tgpak_gfpwentkga2g4zdngbzwozdinvztezlknu4xmnlpnbrgc",VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:xg}=c,{useSyncExternalStoreWithSelector:Eg}=Lg;let nu=!1;const _g=t=>t;function Mg(t,e=_g,n){(Qf?"production":void 0)!=="production"&&n&&!nu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),nu=!0);const r=Eg(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return xg(r),r}const ru=t=>{(Qf?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?rg(t):t,n=(r,i)=>Mg(e,r,i);return Object.assign(n,e),n},wn=t=>t?ru(t):ru,Og={location:null,warehousePoint:null},Ll=t=>t.location,ut=wn()(t=>({...Og,setDeliverPoint(e){t({location:e})},setWarehousePoint(e){t({warehousePoint:e})}})),Pg={map:null,mode:"self_pickup",bounds:null,blurred:!1,loaded:!1,loading:!0,detailsOpen:!1,isIdle:!1},kg=t=>t.map,Tg=t=>t.mode,Rg=t=>t.bounds,Dg=t=>t.blurred,Ag=t=>t.loaded,Ig=t=>t.loading,xl=t=>t.detailsOpen,pe=wn()(t=>({...Pg,setLoaded(){t({loaded:!0,loading:!1})},setMode(e){t({mode:e})},setBounds(e){t({bounds:e})},setDetailsOpen(e){t({detailsOpen:e})},setBlurred(e){t({blurred:e})},setMap(e){t({map:e})},setIdle(e){t({isIdle:e})}})),jg={isTrackingEnabled:!1,location:null},Ng=t=>t.location,Rt=wn()(t=>({...jg,setSelectedLocation(e){t({location:e})},setIsTrackingEnabled(e){t({isTrackingEnabled:e})}})),Bg={query:"",type:vn.All,hours:["08:00","22:00"],send:{[qt.Return]:!1,[qt.Payment]:!1,[qt.Shipping]:!1},receive:{[Zt.PayByCash]:!1,[Zt.CheckOrder]:!1,[Zt.DressingRoom]:!1}},Fg=t=>t.type,Ug=t=>t.send,Vg=t=>t.receive,Vn=wn(t=>({...Bg,setFilter(e){pe.getState().setDetailsOpen(!1),ut.getState().setDeliverPoint(null),Rt.getState().setSelectedLocation(null),t(e)}})),zg=t=>{const[e,n]=t.split(":");return Number(e)*60+Number(n)},Hg=t=>{const e=Math.floor(t/60),n=t%60;return`${e<10?`0${e}`:e}:${n<10?`0${n}`:n}`},$g=(t,e)=>[[t[0]-e,t[0]+e],[t[1]-e,t[1]+e]];function Jf(t,e){return function(){return t.apply(e,arguments)}}const{toString:Wg}=Object.prototype,{getPrototypeOf:El}=Object,Ms=(t=>e=>{const n=Wg.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ln=t=>(t=t.toLowerCase(),e=>Ms(e)===t),Os=t=>e=>typeof e===t,{isArray:ti}=Array,Fi=Os("undefined");function Gg(t){return t!==null&&!Fi(t)&&t.constructor!==null&&!Fi(t.constructor)&&Bt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Yf=ln("ArrayBuffer");function Zg(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Yf(t.buffer),e}const qg=Os("string"),Bt=Os("function"),Xf=Os("number"),Ps=t=>t!==null&&typeof t=="object",Kg=t=>t===!0||t===!1,$o=t=>{if(Ms(t)!=="object")return!1;const e=El(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Qg=ln("Date"),Jg=ln("File"),Yg=ln("Blob"),Xg=ln("FileList"),ev=t=>Ps(t)&&Bt(t.pipe),tv=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Bt(t.append)&&((e=Ms(t))==="formdata"||e==="object"&&Bt(t.toString)&&t.toString()==="[object FormData]"))},nv=ln("URLSearchParams"),rv=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ro(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ti(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(r=0;r<s;r++)a=o[r],e.call(null,t[a],a,t)}}function ed(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const td=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nd=t=>!Fi(t)&&t!==td;function Ca(){const{caseless:t}=nd(this)&&this||{},e={},n=(r,i)=>{const o=t&&ed(e,i)||i;$o(e[o])&&$o(r)?e[o]=Ca(e[o],r):$o(r)?e[o]=Ca({},r):ti(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ro(arguments[r],n);return e}const iv=(t,e,n,{allOwnKeys:r}={})=>(ro(e,(i,o)=>{n&&Bt(i)?t[o]=Jf(i,n):t[o]=i},{allOwnKeys:r}),t),ov=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),sv=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},av=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&El(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},lv=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},uv=t=>{if(!t)return null;if(ti(t))return t;let e=t.length;if(!Xf(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},cv=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&El(Uint8Array)),fv=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},dv=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},hv=ln("HTMLFormElement"),pv=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),iu=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),gv=ln("RegExp"),rd=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ro(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},vv=t=>{rd(t,(e,n)=>{if(Bt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Bt(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mv=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return ti(t)?r(t):r(String(t).split(e)),n},yv=()=>{},bv=(t,e)=>(t=+t,Number.isFinite(t)?t:e),$s="abcdefghijklmnopqrstuvwxyz",ou="0123456789",id={DIGIT:ou,ALPHA:$s,ALPHA_DIGIT:$s+$s.toUpperCase()+ou},wv=(t=16,e=id.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function Cv(t){return!!(t&&Bt(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Sv=t=>{const e=new Array(10),n=(r,i)=>{if(Ps(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=ti(r)?[]:{};return ro(r,(s,a)=>{const l=n(s,i+1);!Fi(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},Lv=ln("AsyncFunction"),xv=t=>t&&(Ps(t)||Bt(t))&&Bt(t.then)&&Bt(t.catch),I={isArray:ti,isArrayBuffer:Yf,isBuffer:Gg,isFormData:tv,isArrayBufferView:Zg,isString:qg,isNumber:Xf,isBoolean:Kg,isObject:Ps,isPlainObject:$o,isUndefined:Fi,isDate:Qg,isFile:Jg,isBlob:Yg,isRegExp:gv,isFunction:Bt,isStream:ev,isURLSearchParams:nv,isTypedArray:cv,isFileList:Xg,forEach:ro,merge:Ca,extend:iv,trim:rv,stripBOM:ov,inherits:sv,toFlatObject:av,kindOf:Ms,kindOfTest:ln,endsWith:lv,toArray:uv,forEachEntry:fv,matchAll:dv,isHTMLForm:hv,hasOwnProperty:iu,hasOwnProp:iu,reduceDescriptors:rd,freezeMethods:vv,toObjectSet:mv,toCamelCase:pv,noop:yv,toFiniteNumber:bv,findKey:ed,global:td,isContextDefined:nd,ALPHABET:id,generateString:wv,isSpecCompliantForm:Cv,toJSONObject:Sv,isAsyncFn:Lv,isThenable:xv};function Se(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}I.inherits(Se,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const od=Se.prototype,sd={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{sd[t]={value:t}});Object.defineProperties(Se,sd);Object.defineProperty(od,"isAxiosError",{value:!0});Se.from=(t,e,n,r,i,o)=>{const s=Object.create(od);return I.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Se.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const Ev=null;function Sa(t){return I.isPlainObject(t)||I.isArray(t)}function ad(t){return I.endsWith(t,"[]")?t.slice(0,-2):t}function su(t,e,n){return t?t.concat(e).map(function(i,o){return i=ad(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function _v(t){return I.isArray(t)&&!t.some(Sa)}const Mv=I.toFlatObject(I,{},null,function(e){return/^is[A-Z]/.test(e)});function ks(t,e,n){if(!I.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,S){return!I.isUndefined(S[g])});const r=n.metaTokens,i=n.visitor||f,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(e);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(I.isDate(y))return y.toISOString();if(!l&&I.isBlob(y))throw new Se("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(y)||I.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function f(y,g,S){let w=y;if(y&&!S&&typeof y=="object"){if(I.endsWith(g,"{}"))g=r?g:g.slice(0,-2),y=JSON.stringify(y);else if(I.isArray(y)&&_v(y)||(I.isFileList(y)||I.endsWith(g,"[]"))&&(w=I.toArray(y)))return g=ad(g),w.forEach(function(m,_){!(I.isUndefined(m)||m===null)&&e.append(s===!0?su([g],_,o):s===null?g:g+"[]",u(m))}),!1}return Sa(y)?!0:(e.append(su(S,g,o),u(y)),!1)}const d=[],h=Object.assign(Mv,{defaultVisitor:f,convertValue:u,isVisitable:Sa});function v(y,g){if(!I.isUndefined(y)){if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(y),I.forEach(y,function(w,L){(!(I.isUndefined(w)||w===null)&&i.call(e,w,I.isString(L)?L.trim():L,g,h))===!0&&v(w,g?g.concat(L):[L])}),d.pop()}}if(!I.isObject(t))throw new TypeError("data must be an object");return v(t),e}function au(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function _l(t,e){this._pairs=[],t&&ks(t,this,e)}const ld=_l.prototype;ld.append=function(e,n){this._pairs.push([e,n])};ld.toString=function(e){const n=e?function(r){return e.call(this,r,au)}:au;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Ov(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ud(t,e,n){if(!e)return t;const r=n&&n.encode||Ov,i=n&&n.serialize;let o;if(i?o=i(e,n):o=I.isURLSearchParams(e)?e.toString():new _l(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class lu{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){I.forEach(this.handlers,function(r){r!==null&&e(r)})}}const cd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pv=typeof URLSearchParams<"u"?URLSearchParams:_l,kv=typeof FormData<"u"?FormData:null,Tv=typeof Blob<"u"?Blob:null,Rv={isBrowser:!0,classes:{URLSearchParams:Pv,FormData:kv,Blob:Tv},protocols:["http","https","file","blob","url","data"]},fd=typeof window<"u"&&typeof document<"u",Dv=(t=>fd&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Av=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Iv=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fd,hasStandardBrowserEnv:Dv,hasStandardBrowserWebWorkerEnv:Av},Symbol.toStringTag,{value:"Module"})),rn={...Iv,...Rv};function jv(t,e){return ks(t,new rn.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return rn.isNode&&I.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Nv(t){return I.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Bv(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function dd(t){function e(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&I.isArray(i)?i.length:s,l?(I.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!I.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&I.isArray(i[s])&&(i[s]=Bv(i[s])),!a)}if(I.isFormData(t)&&I.isFunction(t.entries)){const n={};return I.forEachEntry(t,(r,i)=>{e(Nv(r),i,n,0)}),n}return null}function Fv(t,e,n){if(I.isString(t))try{return(e||JSON.parse)(t),I.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Ml={transitional:cd,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=I.isObject(e);if(o&&I.isHTMLForm(e)&&(e=new FormData(e)),I.isFormData(e))return i?JSON.stringify(dd(e)):e;if(I.isArrayBuffer(e)||I.isBuffer(e)||I.isStream(e)||I.isFile(e)||I.isBlob(e))return e;if(I.isArrayBufferView(e))return e.buffer;if(I.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return jv(e,this.formSerializer).toString();if((a=I.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ks(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Fv(e)):e}],transformResponse:[function(e){const n=this.transitional||Ml.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&I.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?Se.from(a,Se.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rn.classes.FormData,Blob:rn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],t=>{Ml.headers[t]={}});const Ol=Ml,Uv=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vv=t=>{const e={};let n,r,i;return t&&t.split(`
18
- `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&Uv[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},uu=Symbol("internals");function ci(t){return t&&String(t).trim().toLowerCase()}function Wo(t){return t===!1||t==null?t:I.isArray(t)?t.map(Wo):String(t)}function zv(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const Hv=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ws(t,e,n,r,i){if(I.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!I.isString(e)){if(I.isString(r))return e.indexOf(r)!==-1;if(I.isRegExp(r))return r.test(e)}}function $v(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function Wv(t,e){const n=I.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}class Ts{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,u){const f=ci(l);if(!f)throw new Error("header name must be a non-empty string");const d=I.findKey(i,f);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=Wo(a))}const s=(a,l)=>I.forEach(a,(u,f)=>o(u,f,l));return I.isPlainObject(e)||e instanceof this.constructor?s(e,n):I.isString(e)&&(e=e.trim())&&!Hv(e)?s(Vv(e),n):e!=null&&o(n,e,r),this}get(e,n){if(e=ci(e),e){const r=I.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return zv(i);if(I.isFunction(n))return n.call(this,i,r);if(I.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=ci(e),e){const r=I.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Ws(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=ci(s),s){const a=I.findKey(r,s);a&&(!n||Ws(r,r[a],a,n))&&(delete r[a],i=!0)}}return I.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||Ws(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return I.forEach(this,(i,o)=>{const s=I.findKey(r,o);if(s){n[s]=Wo(i),delete n[o];return}const a=e?$v(o):String(o).trim();a!==o&&delete n[o],n[a]=Wo(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return I.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&I.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
19
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[uu]=this[uu]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=ci(s);r[a]||(Wv(i,s),r[a]=!0)}return I.isArray(e)?e.forEach(o):o(e),this}}Ts.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(Ts.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});I.freezeMethods(Ts);const bn=Ts;function Gs(t,e){const n=this||Ol,r=e||n,i=bn.from(r.headers);let o=r.data;return I.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function hd(t){return!!(t&&t.__CANCEL__)}function io(t,e,n){Se.call(this,t??"canceled",Se.ERR_CANCELED,e,n),this.name="CanceledError"}I.inherits(io,Se,{__CANCEL__:!0});function Gv(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Se("Request failed with status code "+n.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Zv=rn.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];I.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),I.isString(r)&&s.push("path="+r),I.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function qv(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Kv(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function pd(t,e){return t&&!qv(e)?Kv(t,e):e}const Qv=rn.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=I.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function Jv(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Yv(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),f=r[o];s||(s=u),n[i]=l,r[i]=u;let d=o,h=0;for(;d!==i;)h+=n[d++],d=d%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),u-s<e)return;const v=f&&u-f;return v?Math.round(h*1e3/v):void 0}}function cu(t,e){let n=0;const r=Yv(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,l=r(a),u=o<=s;n=o;const f={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&u?(s-o)/l:void 0,event:i};f[e?"download":"upload"]=!0,t(f)}}const Xv=typeof XMLHttpRequest<"u",em=Xv&&function(t){return new Promise(function(n,r){let i=t.data;const o=bn.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,l;function u(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}let f;if(I.isFormData(i)){if(rn.hasStandardBrowserEnv||rn.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((f=o.getContentType())!==!1){const[g,...S]=f?f.split(";").map(w=>w.trim()).filter(Boolean):[];o.setContentType([g||"multipart/form-data",...S].join("; "))}}let d=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"",S=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(g+":"+S))}const h=pd(t.baseURL,t.url);d.open(t.method.toUpperCase(),ud(h,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function v(){if(!d)return;const g=bn.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:t,request:d};Gv(function(m){n(m),u()},function(m){r(m),u()},w),d=null}if("onloadend"in d?d.onloadend=v:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(v)},d.onabort=function(){d&&(r(new Se("Request aborted",Se.ECONNABORTED,t,d)),d=null)},d.onerror=function(){r(new Se("Network Error",Se.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let S=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const w=t.transitional||cd;t.timeoutErrorMessage&&(S=t.timeoutErrorMessage),r(new Se(S,w.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,t,d)),d=null},rn.hasStandardBrowserEnv&&(a&&I.isFunction(a)&&(a=a(t)),a||a!==!1&&Qv(h))){const g=t.xsrfHeaderName&&t.xsrfCookieName&&Zv.read(t.xsrfCookieName);g&&o.set(t.xsrfHeaderName,g)}i===void 0&&o.setContentType(null),"setRequestHeader"in d&&I.forEach(o.toJSON(),function(S,w){d.setRequestHeader(w,S)}),I.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),s&&s!=="json"&&(d.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&d.addEventListener("progress",cu(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",cu(t.onUploadProgress)),(t.cancelToken||t.signal)&&(l=g=>{d&&(r(!g||g.type?new io(null,t,d):g),d.abort(),d=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l)));const y=Jv(h);if(y&&rn.protocols.indexOf(y)===-1){r(new Se("Unsupported protocol "+y+":",Se.ERR_BAD_REQUEST,t));return}d.send(i||null)})},La={http:Ev,xhr:em};I.forEach(La,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const fu=t=>`- ${t}`,tm=t=>I.isFunction(t)||t===null||t===!1,gd={getAdapter:t=>{t=I.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o<e;o++){n=t[o];let s;if(r=n,!tm(n)&&(r=La[(s=String(n)).toLowerCase()],r===void 0))throw new Se(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since :
20
- `+o.map(fu).join(`
21
- `):" "+fu(o[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:La};function Zs(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new io(null,t)}function du(t){return Zs(t),t.headers=bn.from(t.headers),t.data=Gs.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),gd.getAdapter(t.adapter||Ol.adapter)(t).then(function(r){return Zs(t),r.data=Gs.call(t,t.transformResponse,r),r.headers=bn.from(r.headers),r},function(r){return hd(r)||(Zs(t),r&&r.response&&(r.response.data=Gs.call(t,t.transformResponse,r.response),r.response.headers=bn.from(r.response.headers))),Promise.reject(r)})}const hu=t=>t instanceof bn?{...t}:t;function qr(t,e){e=e||{};const n={};function r(u,f,d){return I.isPlainObject(u)&&I.isPlainObject(f)?I.merge.call({caseless:d},u,f):I.isPlainObject(f)?I.merge({},f):I.isArray(f)?f.slice():f}function i(u,f,d){if(I.isUndefined(f)){if(!I.isUndefined(u))return r(void 0,u,d)}else return r(u,f,d)}function o(u,f){if(!I.isUndefined(f))return r(void 0,f)}function s(u,f){if(I.isUndefined(f)){if(!I.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function a(u,f,d){if(d in e)return r(u,f);if(d in t)return r(void 0,u)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,f)=>i(hu(u),hu(f),!0)};return I.forEach(Object.keys(Object.assign({},t,e)),function(f){const d=l[f]||i,h=d(t[f],e[f],f);I.isUndefined(h)&&d!==a||(n[f]=h)}),n}const vd="1.6.8",Pl={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Pl[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const pu={};Pl.transitional=function(e,n,r){function i(o,s){return"[Axios v"+vd+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new Se(i(s," has been removed"+(n?" in "+n:"")),Se.ERR_DEPRECATED);return n&&!pu[s]&&(pu[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function nm(t,e,n){if(typeof t!="object")throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new Se("option "+o+" must be "+l,Se.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Se("Unknown option "+o,Se.ERR_BAD_OPTION)}}const xa={assertOptions:nm,validators:Pl},xn=xa.validators;class os{constructor(e){this.defaults=e,this.interceptors={request:new lu,response:new lu}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
22
- `+o):r.stack=o}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=qr(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&xa.assertOptions(r,{silentJSONParsing:xn.transitional(xn.boolean),forcedJSONParsing:xn.transitional(xn.boolean),clarifyTimeoutError:xn.transitional(xn.boolean)},!1),i!=null&&(I.isFunction(i)?n.paramsSerializer={serialize:i}:xa.assertOptions(i,{encode:xn.function,serialize:xn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&I.merge(o.common,o[n.method]);o&&I.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=bn.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let f,d=0,h;if(!l){const y=[du.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,u),h=y.length,f=Promise.resolve(n);d<h;)f=f.then(y[d++],y[d++]);return f}h=a.length;let v=n;for(d=0;d<h;){const y=a[d++],g=a[d++];try{v=y(v)}catch(S){g.call(this,S);break}}try{f=du.call(this,v)}catch(y){return Promise.reject(y)}for(d=0,h=u.length;d<h;)f=f.then(u[d++],u[d++]);return f}getUri(e){e=qr(this.defaults,e);const n=pd(e.baseURL,e.url);return ud(n,e.params,e.paramsSerializer)}}I.forEach(["delete","get","head","options"],function(e){os.prototype[e]=function(n,r){return this.request(qr(r||{},{method:e,url:n,data:(r||{}).data}))}});I.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(qr(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}os.prototype[e]=n(),os.prototype[e+"Form"]=n(!0)});const Go=os;class kl{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new io(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new kl(function(i){e=i}),cancel:e}}}const rm=kl;function im(t){return function(n){return t.apply(null,n)}}function om(t){return I.isObject(t)&&t.isAxiosError===!0}const Ea={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ea).forEach(([t,e])=>{Ea[e]=t});const sm=Ea;function md(t){const e=new Go(t),n=Jf(Go.prototype.request,e);return I.extend(n,Go.prototype,e,{allOwnKeys:!0}),I.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return md(qr(t,i))},n}const Ye=md(Ol);Ye.Axios=Go;Ye.CanceledError=io;Ye.CancelToken=rm;Ye.isCancel=hd;Ye.VERSION=vd;Ye.toFormData=ks;Ye.AxiosError=Se;Ye.Cancel=Ye.CanceledError;Ye.all=function(e){return Promise.all(e)};Ye.spread=im;Ye.isAxiosError=om;Ye.mergeConfig=qr;Ye.AxiosHeaders=bn;Ye.formToJSON=t=>dd(I.isHTMLForm(t)?new FormData(t):t);Ye.getAdapter=gd.getAdapter;Ye.HttpStatusCode=sm;Ye.default=Ye;const Ui=Ye.create({baseURL:"https://ecomgate.omnic.solutions/api/1.0.0/type-1/public/"}),am=512,lm={[Zt.CheckOrder]:["is_check_order","is_delivery"],[Zt.DressingRoom]:["is_dressing_room","is_delivery"],[Zt.PayByCash]:["pay_by_cash","pay_by_card","is_delivery"]},um={[qt.Return]:["is_pickup"],[qt.Shipping]:["is_pickup"],[qt.Payment]:["pay_by_cash","pay_by_card","is_pickup"]};async function*_a({bounds:t,loadPointsParams:{city_name:e,country_abbreviation:n,filter:r,region_name:i}={},options:{controller:o}={},q:s}){const a={status:30,page_size:am,country_abbreviation:n,region_name:i,city_name:e};if(s&&(a.q=s),r!=null&&r.type&&(a.type=r.type),r!=null&&r.receive)for(const[d,h]of Object.entries(r==null?void 0:r.receive)){if(!h)continue;const v=lm[d];for(const y of v)a[y]=!0}if(r!=null&&r.send)for(const[d,h]of Object.entries(r==null?void 0:r.send)){if(!h)continue;const v=um[d];for(const y of v)a[y]=!0}t&&(a.start_latitude=t[0][0],a.end_latitude=t[0][1],a.start_longitude=t[1][0],a.end_longitude=t[1][1]);let l=await Ui.get("/locations/points",{params:a,signal:o==null?void 0:o.signal}),u=l.data.data.num_pages,f=l.data.data.current_page;for(;f<u;){yield l,a.page=f+1;const d=await Ui.get("/locations/points",{params:a,signal:o==null?void 0:o.signal});l.data.data.results=[...l.data.data.results,...d.data.data.results],l=d,f=d.data.data.current_page,u=d.data.data.num_pages}return yield l,l}const gu=[],Ma=({bounds:t,loadPointsParams:e,loading:n})=>{var i;const r=new AbortController;return n&&((i=gu.pop())==null||i.abort()),gu.push(r),async o=>{const s={controller:r};if(!t){const l=await _a({loadPointsParams:e,options:s}).next();o(l.value.data);return}for await(const a of _a({loadPointsParams:e,options:s,bounds:t}))o(a.data)}},yd=":root",oo=(t,e)=>{var n;(n=document.querySelector(yd))==null||n.style.setProperty(t,e)},Oa=t=>{t.stopImmediatePropagation()};var ss={};(function(t){var e,n,r=po&&po.__awaiter||function(p,b,x,P){return new(x=x||Promise)(function(O,T){function M(B){try{A(P.next(B))}catch(V){T(V)}}function R(B){try{A(P.throw(B))}catch(V){T(V)}}function A(B){var V;B.done?O(B.value):((V=B.value)instanceof x?V:new x(function(N){N(V)})).then(M,R)}A((P=P.apply(p,b||[])).next())})},i=po&&po.__rest||function(p,b){var x={};for(O in p)Object.prototype.hasOwnProperty.call(p,O)&&b.indexOf(O)<0&&(x[O]=p[O]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var P=0,O=Object.getOwnPropertySymbols(p);P<O.length;P++)b.indexOf(O[P])<0&&Object.prototype.propertyIsEnumerable.call(p,O[P])&&(x[O[P]]=p[O[P]]);return x};Object.defineProperty(t,"__esModule",{value:!0}),t.fromLatLng=t.fromPlaceId=t.fromAddress=t.geocode=t.enableAddressDescriptor=t.setOutputFormat=t.setLocationType=t.setResultType=t.setBounds=t.setComponents=t.setRegion=t.setLanguage=t.setKey=t.setDefaults=t.OutputFormat=t.RequestType=void 0,function(p){p.ADDRESS="address",p.LATLNG="latlng",p.PLACE_ID="place_id"}(e=t.RequestType||(t.RequestType={})),function(p){p.XML="xml",p.JSON="json"}(n=t.OutputFormat||(t.OutputFormat={}));const o="https://maps.googleapis.com/maps/api/geocode";let s={outputFormat:n.JSON};function a(p){return r(this,void 0,void 0,function*(){var x=p.outputFormat,b=i(p,["outputFormat"]),b=new URLSearchParams(b).toString(),x=o+`/${x}?`+b;try{var P=yield(yield fetch(x)).json(),{status:O,error_message:T}=P;if(O==="OK")return P;throw new Error(`Geocoding failed: ${T}. Server returned status code ${O}.`)}catch(M){throw M instanceof Error?new Error("Geocoding request failed: "+M.message):new Error("Geocoding request failed with unknown error: "+M)}})}function l(p){s=Object.assign(Object.assign({},s),p)}function u(p){s.key=p}function f(p){s.language=p}function d(p){s.region=p}function h(p){s.components=p}function v(p){s.bounds=p}function y(p){s.result_type=p}function g(p){s.location_type=p}function S(p){s.outputFormat=p}function w(p){s.enable_address_descriptor=p}function L(p,b,x){if(typeof p!="string"||typeof b!="string")throw new Error(`Both requestType and value are required and must be of type string.
23
- requestType: ${typeof p}, value: `+typeof b);return a(Object.assign(Object.assign(Object.assign({},s),x),{[p]:b}))}function m(p,b,x,P){var O={outputFormat:n.JSON};return b&&(O.key=b),x&&(O.language=x),P&&(O.region=P),L(e.ADDRESS,p,O)}function _(p,b,x,P){var O={outputFormat:n.JSON};return b&&(O.key=b),x&&(O.language=x),P&&(O.region=P),L(e.PLACE_ID,p,O)}function E(p,b,x,P,O,T){var M={outputFormat:n.JSON};return x&&(M.key=x),P&&(M.language=P),O&&(M.region=O),T&&(M.location_type=T),L(e.LATLNG,p+","+b,M)}t.setDefaults=l,t.setKey=u,t.setLanguage=f,t.setRegion=d,t.setComponents=h,t.setBounds=v,t.setResultType=y,t.setLocationType=g,t.setOutputFormat=S,t.enableAddressDescriptor=w,t.geocode=L,t.fromAddress=m,t.fromPlaceId=_,t.fromLatLng=E})(ss);const bd=t=>typeof t=="string",Pa=t=>Array.isArray(t)&&t.length===2;async function ka(t,e,n){var o;let r;if(bd(t))r=await ss.fromPlaceId(t,e);else{const[s,a]=t;r=await ss.fromLatLng(s,a,e,void 0,void 0,n==null?void 0:n.join("|"))}const i=(o=r.results)==null?void 0:o.map(s=>{var u,f;const a=(u=s.geometry)==null?void 0:u.viewport,l=(f=s.geometry)==null?void 0:f.location;return{...s,geometry:{...s.geometry,viewport:new google.maps.LatLngBounds(a.southwest,a.northeast),location:new google.maps.LatLng(l)}}});return{...r,results:i}}const Tl=t=>{var n;const e=pe.getState().map;if(!e){console.error("Map is not initialized");return}if(!navigator.geolocation){(n=t==null?void 0:t.error)==null||n.call(t,new GeolocationPositionError),console.error("Geolocation is not supported by your browser");return}navigator.geolocation.getCurrentPosition(r=>{var a;const{latitude:i,longitude:o}=r.coords,s=new google.maps.LatLngBounds;s.extend(new google.maps.LatLng(i,o)),e.fitBounds(s),e.setZoom(16),(a=t==null?void 0:t.success)==null||a.call(t,r)},r=>{var i;console.error("Geolocation error:",r),(i=t==null?void 0:t.error)==null||i.call(t,r)},{maximumAge:6e4,timeout:5e3,enableHighAccuracy:!0})},wd=t=>t.status===200,Cd=t=>{const e=document.querySelector(yd);return e?getComputedStyle(e).getPropertyValue(t):null},Rl=t=>{const e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)},Or=(t,e)=>{let n=t;const r=(e.includes("--owl")?Cd(e):e)||"";return n=n.replaceAll("currentColor",r),n},cm=t=>"comment"in t&&"address"in t&&"apartment_number"in t&&"delivery_time"in t,fm={points:[],samePoints:[],error:!1,loaded:!1,loading:!1,reloading:!1},dm=t=>t.points,hm=t=>t.loaded,Sd=t=>t.loading,an=wn()((t,e)=>({...fm,setSamePoints(n){t({samePoints:n})},closeSamePoints(){t({samePoints:[]})},async loadNext({bounds:n,...r}){const{reloading:i}=e();t({error:!1,reloading:!0}),pe.getState().setBounds(n);let o=0;try{await Ma({loading:i,bounds:n,loadPointsParams:r})(a=>{t(o===0?{points:a.data.results}:{points:[...e().points,...a.data.results]}),o++})}catch{t({error:!0})}finally{t({reloading:!1})}},async loadFirst(n){const{loading:r}=e(),i=Rg(pe.getState());t({error:!1,loading:!0});let o=0;try{await Ma({loading:r,bounds:i,loadPointsParams:n})(a=>{o>=1&&t({loading:!1,loaded:!0}),t(o===0?{points:a.data.results}:{points:[...e().points,...a.data.results]}),o++}),t({loading:!1,loaded:!0})}catch{t({error:!0,loading:!1})}finally{t({loading:!1})}}})),pm=({cityName:t,countryAbbreviation:e,regionName:n})=>{c.useEffect(()=>{an.getState().loadFirst({city_name:t,country_abbreviation:e,region_name:n}),console.debug("[OmnicWidgetLocations::pointsLoader]");const r=Vn.subscribe(i=>{an.getState().loadFirst({filter:i,city_name:t,country_abbreviation:e,region_name:n}),console.debug("[OmnicWidgetLocations::filters]",i)});return()=>{r()}},[t,e,n])},On=".",Dl=Symbol("target"),Ld=Symbol("unsubscribe");function Ta(t){return t instanceof Date||t instanceof Set||t instanceof Map||t instanceof WeakSet||t instanceof WeakMap||ArrayBuffer.isView(t)}function gm(t){return(typeof t=="object"?t===null:typeof t!="function")||t instanceof RegExp}const yt=Array.isArray;function as(t){return typeof t=="symbol"}const Mt={after(t,e){return yt(t)?t.slice(e.length):e===""?t:t.slice(e.length+1)},concat(t,e){return yt(t)?(t=[...t],e&&t.push(e),t):e&&e.toString!==void 0?(t!==""&&(t+=On),as(e)?t+e.toString():t+e):t},initial(t){if(yt(t))return t.slice(0,-1);if(t==="")return t;const e=t.lastIndexOf(On);return e===-1?"":t.slice(0,e)},last(t){if(yt(t))return t.at(-1)??"";if(t==="")return t;const e=t.lastIndexOf(On);return e===-1?t:t.slice(e+1)},walk(t,e){if(yt(t))for(const n of t)e(n);else if(t!==""){let n=0,r=t.indexOf(On);if(r===-1)e(t);else for(;n<t.length;)r===-1&&(r=t.length),e(t.slice(n,r)),n=r+1,r=t.indexOf(On,n)}},get(t,e){return this.walk(e,n=>{t&&(t=t[n])}),t},isSubPath(t,e){if(yt(t)){if(t.length<e.length)return!1;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}return t.length<e.length?!1:t===e?!0:t.startsWith(e)?t[e.length]===On:!1},isRootPath(t){return yt(t)?t.length===0:t===""}};function vm(t){return typeof t=="object"&&typeof t.next=="function"}function mm(t,e,n,r,i){const o=t.next;if(e.name==="entries")t.next=function(){const s=o.call(this);return s.done===!1&&(s.value[0]=i(s.value[0],e,s.value[0],r),s.value[1]=i(s.value[1],e,s.value[0],r)),s};else if(e.name==="values"){const s=n[Dl].keys();t.next=function(){const a=o.call(this);return a.done===!1&&(a.value=i(a.value,e,s.next().value,r)),a}}else t.next=function(){const s=o.call(this);return s.done===!1&&(s.value=i(s.value,e,s.value,r)),s};return t}function vu(t,e,n){return t.isUnsubscribed||e.ignoreSymbols&&as(n)||e.ignoreUnderscores&&n.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(n)}let ym=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){const n=this._getDescriptorCache();let r=n.get(e);return r===void 0&&(r={},n.set(e,r)),r}_getOwnPropertyDescriptor(e,n){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,n);const r=this._getProperties(e);let i=r[n];return i===void 0&&(i=Reflect.getOwnPropertyDescriptor(e,n),r[n]=i),i}getProxy(e,n,r,i){if(this.isUnsubscribed)return e;const o=e[i],s=o??e;this._pathCache.set(s,n);let a=this._proxyCache.get(s);return a===void 0&&(a=o===void 0?new Proxy(e,r):e,this._proxyCache.set(s,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,n){return!Object.is(e,Mt.get(n,this.getPath(e)))}defineProperty(e,n,r){return Reflect.defineProperty(e,n,r)?(this.isUnsubscribed||(this._getProperties(e)[n]=r),!0):!1}setProperty(e,n,r,i,o){if(!this._equals(o,r)||!(n in e)){const s=this._getOwnPropertyDescriptor(e,n);return s!==void 0&&"set"in s?Reflect.set(e,n,r,i):Reflect.set(e,n,r)}return!0}deleteProperty(e,n,r){if(Reflect.deleteProperty(e,n)){if(!this.isUnsubscribed){const i=this._getDescriptorCache().get(e);i&&(delete i[n],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(e,n,r){const i=this._getOwnPropertyDescriptor(n,r);return e!==void 0&&i!==void 0&&Object.is(e.value,i.value)&&(e.writable||!1)===(i.writable||!1)&&(e.enumerable||!1)===(i.enumerable||!1)&&(e.configurable||!1)===(i.configurable||!1)&&e.get===i.get&&e.set===i.set}isGetInvariant(e,n){const r=this._getOwnPropertyDescriptor(e,n);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function Ra(t){return toString.call(t)==="[object Object]"}function vo(){return!0}function yr(t,e){return t.length!==e.length||t.some((n,r)=>e[r]!==n)}const xd=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),bm=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),Ed={push:vo,pop:vo,shift:vo,unshift:vo,copyWithin:yr,reverse:yr,sort:yr,splice:yr,flat:yr,fill:yr},wm=new Set([...xd,...bm,...Object.keys(Ed)]);function mo(t,e){if(t.size!==e.size)return!0;for(const n of t)if(!e.has(n))return!0;return!1}const _d=["keys","values","entries"],Md=new Set(["has","toString"]),Od={add:mo,clear:mo,delete:mo,forEach:mo},Cm=new Set([...Md,...Object.keys(Od),..._d]);function yo(t,e){if(t.size!==e.size)return!0;let n;for(const[r,i]of t)if(n=e.get(r),n!==i||n===void 0&&!e.has(r))return!0;return!1}const Sm=new Set([...Md,"get"]),Pd={set:yo,clear:yo,delete:yo,forEach:yo},Lm=new Set([...Sm,...Object.keys(Pd),..._d]);class zn{constructor(e,n,r,i){this._path=n,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=i,this._changes=i?[]:null,this.clone=n===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return xd.has(e)}_shallowClone(e){let n=e;if(Ra(e))n={...e};else if(yt(e)||ArrayBuffer.isView(e))n=[...e];else if(e instanceof Date)n=new Date(e);else if(e instanceof Set)n=new Set([...e].map(r=>this._shallowClone(r)));else if(e instanceof Map){n=new Map;for(const[r,i]of e.entries())n.set(r,this._shallowClone(i))}return this._clonedCache.add(n),n}preferredThisArg(e,n,r,i){return e?(yt(i)?this._onIsChanged=Ed[n]:i instanceof Set?this._onIsChanged=Od[n]:i instanceof Map&&(this._onIsChanged=Pd[n]),i):r}update(e,n,r){const i=Mt.after(e,this._path);if(n!=="length"){let o=this.clone;Mt.walk(i,s=>{o!=null&&o[s]&&(this._clonedCache.has(o[s])||(o[s]=this._shallowClone(o[s])),o=o[s])}),this._hasOnValidate&&this._changes.push({path:i,property:n,previous:r}),o!=null&&o[n]&&(o[n]=r)}this._isChanged=!0}undo(e){let n;for(let r=this._changes.length-1;r!==-1;r--)n=this._changes[r],Mt.get(e,n.path)[n.property]=n.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}isPathApplicable(e){return Mt.isRootPath(this._path)||Mt.isSubPath(e,this._path)}}class mu extends zn{static isHandledMethod(e){return wm.has(e)}}class xm extends zn{undo(e){e.setTime(this.clone.getTime())}isChanged(e,n){return!n(this.clone.valueOf(),e.valueOf())}}class yu extends zn{static isHandledMethod(e){return Cm.has(e)}undo(e){for(const n of this.clone)e.add(n);for(const n of e)this.clone.has(n)||e.delete(n)}}class bu extends zn{static isHandledMethod(e){return Lm.has(e)}undo(e){for(const[n,r]of this.clone.entries())e.set(n,r);for(const n of e.keys())this.clone.has(n)||e.delete(n)}}class Em extends zn{constructor(e,n,r,i){super(void 0,n,r,i),this._argument1=r[0],this._weakValue=e.has(this._argument1)}isChanged(e){return this._weakValue!==e.has(this._argument1)}undo(e){this._weakValue&&!e.has(this._argument1)?e.add(this._argument1):e.delete(this._argument1)}}class _m extends zn{constructor(e,n,r,i){super(void 0,n,r,i),this._weakKey=r[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){const n=e.has(this._weakKey);this._weakHas&&!n?e.set(this._weakKey,this._weakValue):!this._weakHas&&n?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}}class Xn{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return Ra(e)||yt(e)||Ta(e)}static isHandledMethod(e,n){return Ra(e)?zn.isHandledMethod(n):yt(e)?mu.isHandledMethod(n):e instanceof Set?yu.isHandledMethod(n):e instanceof Map?bu.isHandledMethod(n):Ta(e)}get isCloning(){return this._stack.length>0}start(e,n,r){let i=zn;yt(e)?i=mu:e instanceof Date?i=xm:e instanceof Set?i=yu:e instanceof Map?i=bu:e instanceof WeakSet?i=Em:e instanceof WeakMap&&(i=_m),this._stack.push(new i(e,n,r,this._hasOnValidate))}update(e,n,r){this._stack.at(-1).update(e,n,r)}preferredThisArg(e,n,r){const{name:i}=e,o=Xn.isHandledMethod(r,i);return this._stack.at(-1).preferredThisArg(o,i,n,r)}isChanged(e,n,r){return this._stack.at(-1).isChanged(e,n,r)}isPartOfClone(e){return this._stack.at(-1).isPathApplicable(e)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}}const Mm={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},Mi=(t,e,n={})=>{n={...Mm,...n};const r=Symbol("ProxyTarget"),{equals:i,isShallow:o,ignoreDetached:s,details:a}=n,l=new ym(i),u=typeof n.onValidate=="function",f=new Xn(u),d=(m,_,E,p,b)=>!u||f.isCloning||n.onValidate(Mt.concat(l.getPath(m),_),E,p,b)===!0,h=(m,_,E,p)=>{!vu(l,n,_)&&!(s&&l.isDetached(m,t))&&v(l.getPath(m),_,E,p)},v=(m,_,E,p,b)=>{f.isCloning&&f.isPartOfClone(m)?f.update(m,_,p):e(Mt.concat(m,_),E,p,b)},y=m=>m&&(m[r]??m),g=(m,_,E,p)=>{if(gm(m)||E==="constructor"||o&&!Xn.isHandledMethod(_,E)||vu(l,n,E)||l.isGetInvariant(_,E)||s&&l.isDetached(_,t))return m;p===void 0&&(p=l.getPath(_));const b=Mt.concat(p,E),x=l.getPath(m);return x&&S(b,x)?l.getProxy(m,x,w,r):l.getProxy(m,b,w,r)},S=(m,_)=>{if(as(m)||m.length<=_.length||yt(_)&&_.length===0)return!1;const E=yt(m)?m:m.split(On),p=yt(_)?_:_.split(On);return E.length<=p.length?!1:!p.some((b,x)=>b!==E[x])},w={get(m,_,E){if(as(_)){if(_===r||_===Dl)return m;if(_===Ld&&!l.isUnsubscribed&&l.getPath(m).length===0)return l.unsubscribe(),m}const p=Ta(m)?Reflect.get(m,_):Reflect.get(m,_,E);return g(p,m,_)},set(m,_,E,p){E=y(E);const b=m[r]??m,x=b[_];if(i(x,E)&&_ in m)return!0;const P=d(m,_,E,x);return P&&l.setProperty(b,_,E,p,x)?(h(m,_,m[_],x),!0):!P},defineProperty(m,_,E){if(!l.isSameDescriptor(E,m,_)){const p=m[_];d(m,_,E.value,p)&&l.defineProperty(m,_,E,p)&&h(m,_,E.value,p)}return!0},deleteProperty(m,_){if(!Reflect.has(m,_))return!0;const E=Reflect.get(m,_),p=d(m,_,void 0,E);return p&&l.deleteProperty(m,_,E)?(h(m,_,void 0,E),!0):!p},apply(m,_,E){const p=_[r]??_;if(l.isUnsubscribed)return Reflect.apply(m,p,E);if((a===!1||a!==!0&&!a.includes(m.name))&&Xn.isHandledType(p)){let b=Mt.initial(l.getPath(m));const x=Xn.isHandledMethod(p,m.name);f.start(p,b,E);let P=Reflect.apply(m,f.preferredThisArg(m,_,p),x?E.map(M=>y(M)):E);const O=f.isChanged(p,i),T=f.stop();if(Xn.isHandledType(P)&&x&&(_ instanceof Map&&m.name==="get"&&(b=Mt.concat(b,E[0])),P=l.getProxy(P,b,w)),O){const M={name:m.name,args:E,result:P},R=f.isCloning?Mt.initial(b):b,A=f.isCloning?Mt.last(b):"";d(Mt.get(t,R),A,p,T,M)?v(R,A,p,T,M):f.undo(p)}return(_ instanceof Map||_ instanceof Set)&&vm(P)?mm(P,m,_,b,g):P}return Reflect.apply(m,_,E)}},L=l.getProxy(t,n.pathAsArray?[]:"",w);return e=e.bind(L),u&&(n.onValidate=n.onValidate.bind(L)),L};Mi.target=t=>(t==null?void 0:t[Dl])??t;Mi.unsubscribe=t=>(t==null?void 0:t[Ld])??t;const Om=t=>{const e=t??window.OMNIC_WIDGET_LOCATIONS_CONFIG,[n,r]=c.useState({...Jn,...e,map:{...Jn.map,...e==null?void 0:e.map},palette:{...Jn.palette,...e==null?void 0:e.palette}}),i=t&&!window.OMNIC_WIDGET_LOCATIONS_CONFIG,o=!t&&window.OMNIC_WIDGET_LOCATIONS_CONFIG;return c.useEffect(()=>{if(!i)return;const s={...Jn,...t,map:{...Jn.map,...t.map},palette:{...Jn.palette,...t.palette}};console.debug("[OmnicLocationsWidget::reactConfig]",s),r(s)},[t,i]),c.useEffect(()=>{if(o)return console.debug("[OmnicLocationsWidget::windowConfig]",n),window.OMNIC_WIDGET_LOCATIONS_CONFIG=Mi(window.OMNIC_WIDGET_LOCATIONS_CONFIG,function(){const s={...n,...Mi.target(this)};s.map&&(s.map={...s.map}),s.palette&&(s.palette={...s.palette}),console.debug("[OmnicLocationsWidget::changeWindowConfig]",s),r({...s})}),()=>{window.OMNIC_WIDGET_LOCATIONS_CONFIG&&Mi.unsubscribe(window.OMNIC_WIDGET_LOCATIONS_CONFIG)}},[n,o]),n},Pm=(t,e)=>{console.debug("[OmnicWidgetLocations::axios]",{INN:t,options:e}),Ui.defaults.headers.get.Authorization=`INN ${t}`,e!=null&&e.baseURL&&(Ui.defaults.baseURL=e.baseURL)};var kd={exports:{}};/*!
17
+ */var hs=p,kp=Mp;function Dp(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var jp=typeof Object.is=="function"?Object.is:Dp,Np=kp.useSyncExternalStore,Ip=hs.useRef,Fp=hs.useEffect,Bp=hs.useMemo,Vp=hs.useDebugValue;ff.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=Ip(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Bp(function(){function c(y){if(!l){if(l=!0,u=y,y=r(y),i!==void 0&&s.hasValue){var m=s.value;if(i(m,y))return f=m}return f=y}if(m=f,jp(u,y))return m;var h=r(y);return i!==void 0&&i(m,h)?m:(u=y,f=h)}var l=!1,u,f,d=n===void 0?null:n;return[function(){return c(e())},d===null?void 0:function(){return c(d())}]},[e,n,r,i]);var a=Np(t,o[0],o[1]);return Fp(function(){s.hasValue=!0,s.value=a},[a]),Vp(a),a};uf.exports=ff;var Hp=uf.exports;const $p=ds(Hp);var pf={VITE_API_BASE_URL:"https://ecomgate.omnic.solutions/api/1.0.0/type-1/public/",VITE_GEO_API_BASE_URL:"https://api.geo-data.omnic.solutions/api/1.0/",VITE_YMAPS_KEY:"5298a725-4baa-457a-a2a7-c3abac81db20",VITE_GMAP_KEY:"AIzaSyDsI0AO8VsUrTPoyR9fF7T31FKx1a9TLO0",VITE_GMAP_ID:"e130cd87a3f1b9cbe3cb5de4",VITE_TOKEN:"fa812020-3197-401a-9b39-345999046111",VITE_TOLGEE_API_URL:"https://tms.omnic.solutions",VITE_TOLGEE_API_KEY:"tgpak_gfpwentkga2g4zdngbzwozdinvztezlknu4xmnlpnbrgc",VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:Up}=p,{useSyncExternalStoreWithSelector:zp}=$p;let Xc=!1;const qp=t=>t;function Gp(t,e=qp,n){(pf?"production":void 0)!=="production"&&n&&!Xc&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Xc=!0);const r=zp(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Up(r),r}const Yc=t=>{(pf?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?Sp(t):t,n=(r,i)=>Gp(e,r,i);return Object.assign(n,e),n},Ut=t=>t?Yc(t):Yc,Wp={location:null,warehousePoint:null},fc=t=>t.location,Le=Ut()(t=>({...Wp,setDeliverPoint(e){t({location:e})},setWarehousePoint(e){t({warehousePoint:e})}})),Zp={map:null,mode:"self_pickup",bounds:null,blurred:!1,loaded:!1,loading:!0,detailsOpen:!1,isIdle:!1},Kp=t=>t.map,Qp=t=>t.mode,Jp=t=>t.bounds,Xp=t=>t.blurred,Yp=t=>t.loaded,e0=t=>t.loading,dc=t=>t.detailsOpen,Z=Ut()(t=>({...Zp,setLoaded(){t({loaded:!0,loading:!1})},setMode(e){t({mode:e})},setBounds(e){t({bounds:e})},setDetailsOpen(e){t({detailsOpen:e})},setBlurred(e){t({blurred:e})},setMap(e){t({map:e})},setIdle(e){t({isIdle:e})}})),t0={isTrackingEnabled:!1,location:null},n0=t=>t.location,st=Ut()(t=>({...t0,setSelectedLocation(e){t({location:e})},setIsTrackingEnabled(e){t({isTrackingEnabled:e})}})),r0={query:"",type:Ft.All,hours:["08:00","22:00"],send:{[gt.Return]:!1,[gt.Payment]:!1,[gt.Shipping]:!1},receive:{[mt.PayByCash]:!1,[mt.CheckOrder]:!1,[mt.DressingRoom]:!1}},i0=t=>t.type,o0=t=>t.send,s0=t=>t.receive,dn=Ut(t=>({...r0,setFilter(e){Z.getState().setDetailsOpen(!1),Le.getState().setDeliverPoint(null),st.getState().setSelectedLocation(null),t(e)}})),a0=t=>{const[e,n]=t.split(":");return Number(e)*60+Number(n)},c0=t=>{const e=Math.floor(t/60),n=t%60;return`${e<10?`0${e}`:e}:${n<10?`0${n}`:n}`},l0=(t,e)=>[[t[0]-e,t[0]+e],[t[1]-e,t[1]+e]];function mf(t,e){return function(){return t.apply(e,arguments)}}const{toString:u0}=Object.prototype,{getPrototypeOf:hc}=Object,ps=(t=>e=>{const n=u0.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Lt=t=>(t=t.toLowerCase(),e=>ps(e)===t),ms=t=>e=>typeof e===t,{isArray:Ar}=Array,hi=ms("undefined");function f0(t){return t!==null&&!hi(t)&&t.constructor!==null&&!hi(t.constructor)&&it(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const gf=Lt("ArrayBuffer");function d0(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&gf(t.buffer),e}const h0=ms("string"),it=ms("function"),vf=ms("number"),gs=t=>t!==null&&typeof t=="object",p0=t=>t===!0||t===!1,Ro=t=>{if(ps(t)!=="object")return!1;const e=hc(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},m0=Lt("Date"),g0=Lt("File"),v0=Lt("Blob"),y0=Lt("FileList"),b0=t=>gs(t)&&it(t.pipe),w0=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||it(t.append)&&((e=ps(t))==="formdata"||e==="object"&&it(t.toString)&&t.toString()==="[object FormData]"))},_0=Lt("URLSearchParams"),S0=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Mi(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),Ar(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(r=0;r<s;r++)a=o[r],e.call(null,t[a],a,t)}}function yf(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const bf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wf=t=>!hi(t)&&t!==bf;function fa(){const{caseless:t}=wf(this)&&this||{},e={},n=(r,i)=>{const o=t&&yf(e,i)||i;Ro(e[o])&&Ro(r)?e[o]=fa(e[o],r):Ro(r)?e[o]=fa({},r):Ar(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Mi(arguments[r],n);return e}const C0=(t,e,n,{allOwnKeys:r}={})=>(Mi(e,(i,o)=>{n&&it(i)?t[o]=mf(i,n):t[o]=i},{allOwnKeys:r}),t),E0=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),x0=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},O0=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&hc(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},P0=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},T0=t=>{if(!t)return null;if(Ar(t))return t;let e=t.length;if(!vf(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},A0=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&hc(Uint8Array)),R0=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},L0=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},M0=Lt("HTMLFormElement"),k0=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),el=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),D0=Lt("RegExp"),_f=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Mi(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},j0=t=>{_f(t,(e,n)=>{if(it(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(it(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},N0=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Ar(t)?r(t):r(String(t).split(e)),n},I0=()=>{},F0=(t,e)=>(t=+t,Number.isFinite(t)?t:e),js="abcdefghijklmnopqrstuvwxyz",tl="0123456789",Sf={DIGIT:tl,ALPHA:js,ALPHA_DIGIT:js+js.toUpperCase()+tl},B0=(t=16,e=Sf.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function V0(t){return!!(t&&it(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const H0=t=>{const e=new Array(10),n=(r,i)=>{if(gs(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=Ar(r)?[]:{};return Mi(r,(s,a)=>{const c=n(s,i+1);!hi(c)&&(o[a]=c)}),e[i]=void 0,o}}return r};return n(t,0)},$0=Lt("AsyncFunction"),U0=t=>t&&(gs(t)||it(t))&&it(t.then)&&it(t.catch),M={isArray:Ar,isArrayBuffer:gf,isBuffer:f0,isFormData:w0,isArrayBufferView:d0,isString:h0,isNumber:vf,isBoolean:p0,isObject:gs,isPlainObject:Ro,isUndefined:hi,isDate:m0,isFile:g0,isBlob:v0,isRegExp:D0,isFunction:it,isStream:b0,isURLSearchParams:_0,isTypedArray:A0,isFileList:y0,forEach:Mi,merge:fa,extend:C0,trim:S0,stripBOM:E0,inherits:x0,toFlatObject:O0,kindOf:ps,kindOfTest:Lt,endsWith:P0,toArray:T0,forEachEntry:R0,matchAll:L0,isHTMLForm:M0,hasOwnProperty:el,hasOwnProp:el,reduceDescriptors:_f,freezeMethods:j0,toObjectSet:N0,toCamelCase:k0,noop:I0,toFiniteNumber:F0,findKey:yf,global:bf,isContextDefined:wf,ALPHABET:Sf,generateString:B0,isSpecCompliantForm:V0,toJSONObject:H0,isAsyncFn:$0,isThenable:U0};function ee(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}M.inherits(ee,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:M.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Cf=ee.prototype,Ef={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ef[t]={value:t}});Object.defineProperties(ee,Ef);Object.defineProperty(Cf,"isAxiosError",{value:!0});ee.from=(t,e,n,r,i,o)=>{const s=Object.create(Cf);return M.toFlatObject(t,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ee.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const z0=null;function da(t){return M.isPlainObject(t)||M.isArray(t)}function xf(t){return M.endsWith(t,"[]")?t.slice(0,-2):t}function nl(t,e,n){return t?t.concat(e).map(function(i,o){return i=xf(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function q0(t){return M.isArray(t)&&!t.some(da)}const G0=M.toFlatObject(M,{},null,function(e){return/^is[A-Z]/.test(e)});function vs(t,e,n){if(!M.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=M.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,_){return!M.isUndefined(_[h])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&M.isSpecCompliantForm(e);if(!M.isFunction(i))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(M.isDate(m))return m.toISOString();if(!c&&M.isBlob(m))throw new ee("Blob is not supported. Use a Buffer instead.");return M.isArrayBuffer(m)||M.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,h,_){let b=m;if(m&&!_&&typeof m=="object"){if(M.endsWith(h,"{}"))h=r?h:h.slice(0,-2),m=JSON.stringify(m);else if(M.isArray(m)&&q0(m)||(M.isFileList(m)||M.endsWith(h,"[]"))&&(b=M.toArray(m)))return h=xf(h),b.forEach(function(v,E){!(M.isUndefined(v)||v===null)&&e.append(s===!0?nl([h],E,o):s===null?h:h+"[]",l(v))}),!1}return da(m)?!0:(e.append(nl(_,h,o),l(m)),!1)}const f=[],d=Object.assign(G0,{defaultVisitor:u,convertValue:l,isVisitable:da});function y(m,h){if(!M.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+h.join("."));f.push(m),M.forEach(m,function(b,C){(!(M.isUndefined(b)||b===null)&&i.call(e,b,M.isString(C)?C.trim():C,h,d))===!0&&y(b,h?h.concat(C):[C])}),f.pop()}}if(!M.isObject(t))throw new TypeError("data must be an object");return y(t),e}function rl(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function pc(t,e){this._pairs=[],t&&vs(t,this,e)}const Of=pc.prototype;Of.append=function(e,n){this._pairs.push([e,n])};Of.toString=function(e){const n=e?function(r){return e.call(this,r,rl)}:rl;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function W0(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pf(t,e,n){if(!e)return t;const r=n&&n.encode||W0,i=n&&n.serialize;let o;if(i?o=i(e,n):o=M.isURLSearchParams(e)?e.toString():new pc(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class il{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){M.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Tf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Z0=typeof URLSearchParams<"u"?URLSearchParams:pc,K0=typeof FormData<"u"?FormData:null,Q0=typeof Blob<"u"?Blob:null,J0={isBrowser:!0,classes:{URLSearchParams:Z0,FormData:K0,Blob:Q0},protocols:["http","https","file","blob","url","data"]},Af=typeof window<"u"&&typeof document<"u",X0=(t=>Af&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Y0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",em=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Af,hasStandardBrowserEnv:X0,hasStandardBrowserWebWorkerEnv:Y0},Symbol.toStringTag,{value:"Module"})),Ot={...em,...J0};function tm(t,e){return vs(t,new Ot.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Ot.isNode&&M.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function nm(t){return M.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function rm(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function Rf(t){function e(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=o>=n.length;return s=!s&&M.isArray(i)?i.length:s,c?(M.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!M.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&M.isArray(i[s])&&(i[s]=rm(i[s])),!a)}if(M.isFormData(t)&&M.isFunction(t.entries)){const n={};return M.forEachEntry(t,(r,i)=>{e(nm(r),i,n,0)}),n}return null}function im(t,e,n){if(M.isString(t))try{return(e||JSON.parse)(t),M.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const mc={transitional:Tf,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=M.isObject(e);if(o&&M.isHTMLForm(e)&&(e=new FormData(e)),M.isFormData(e))return i?JSON.stringify(Rf(e)):e;if(M.isArrayBuffer(e)||M.isBuffer(e)||M.isStream(e)||M.isFile(e)||M.isBlob(e))return e;if(M.isArrayBufferView(e))return e.buffer;if(M.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return tm(e,this.formSerializer).toString();if((a=M.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return vs(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),im(e)):e}],transformResponse:[function(e){const n=this.transitional||mc.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&M.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?ee.from(a,ee.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ot.classes.FormData,Blob:Ot.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};M.forEach(["delete","get","head","post","put","patch"],t=>{mc.headers[t]={}});const gc=mc,om=M.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sm=t=>{const e={};let n,r,i;return t&&t.split(`
18
+ `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&om[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},ol=Symbol("internals");function Fr(t){return t&&String(t).trim().toLowerCase()}function Lo(t){return t===!1||t==null?t:M.isArray(t)?t.map(Lo):String(t)}function am(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const cm=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ns(t,e,n,r,i){if(M.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!M.isString(e)){if(M.isString(r))return e.indexOf(r)!==-1;if(M.isRegExp(r))return r.test(e)}}function lm(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function um(t,e){const n=M.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}class ys{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,c,l){const u=Fr(c);if(!u)throw new Error("header name must be a non-empty string");const f=M.findKey(i,u);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||c]=Lo(a))}const s=(a,c)=>M.forEach(a,(l,u)=>o(l,u,c));return M.isPlainObject(e)||e instanceof this.constructor?s(e,n):M.isString(e)&&(e=e.trim())&&!cm(e)?s(sm(e),n):e!=null&&o(n,e,r),this}get(e,n){if(e=Fr(e),e){const r=M.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return am(i);if(M.isFunction(n))return n.call(this,i,r);if(M.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Fr(e),e){const r=M.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Ns(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=Fr(s),s){const a=M.findKey(r,s);a&&(!n||Ns(r,r[a],a,n))&&(delete r[a],i=!0)}}return M.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||Ns(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return M.forEach(this,(i,o)=>{const s=M.findKey(r,o);if(s){n[s]=Lo(i),delete n[o];return}const a=e?lm(o):String(o).trim();a!==o&&delete n[o],n[a]=Lo(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return M.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&M.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
19
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[ol]=this[ol]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Fr(s);r[a]||(um(i,s),r[a]=!0)}return M.isArray(e)?e.forEach(o):o(e),this}}ys.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);M.reduceDescriptors(ys.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});M.freezeMethods(ys);const $t=ys;function Is(t,e){const n=this||gc,r=e||n,i=$t.from(r.headers);let o=r.data;return M.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function Lf(t){return!!(t&&t.__CANCEL__)}function ki(t,e,n){ee.call(this,t??"canceled",ee.ERR_CANCELED,e,n),this.name="CanceledError"}M.inherits(ki,ee,{__CANCEL__:!0});function fm(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new ee("Request failed with status code "+n.status,[ee.ERR_BAD_REQUEST,ee.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const dm=Ot.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];M.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),M.isString(r)&&s.push("path="+r),M.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hm(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function pm(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Mf(t,e){return t&&!hm(e)?pm(t,e):e}const mm=Ot.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=M.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function gm(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function vm(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(c){const l=Date.now(),u=r[o];s||(s=l),n[i]=c,r[i]=l;let f=o,d=0;for(;f!==i;)d+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),l-s<e)return;const y=u&&l-u;return y?Math.round(d*1e3/y):void 0}}function sl(t,e){let n=0;const r=vm(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a),l=o<=s;n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-o)/c:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const ym=typeof XMLHttpRequest<"u",bm=ym&&function(t){return new Promise(function(n,r){let i=t.data;const o=$t.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,c;function l(){t.cancelToken&&t.cancelToken.unsubscribe(c),t.signal&&t.signal.removeEventListener("abort",c)}let u;if(M.isFormData(i)){if(Ot.hasStandardBrowserEnv||Ot.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((u=o.getContentType())!==!1){const[h,..._]=u?u.split(";").map(b=>b.trim()).filter(Boolean):[];o.setContentType([h||"multipart/form-data",..._].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const h=t.auth.username||"",_=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(h+":"+_))}const d=Mf(t.baseURL,t.url);f.open(t.method.toUpperCase(),Pf(d,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function y(){if(!f)return;const h=$t.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),b={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:h,config:t,request:f};fm(function(v){n(v),l()},function(v){r(v),l()},b),f=null}if("onloadend"in f?f.onloadend=y:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(y)},f.onabort=function(){f&&(r(new ee("Request aborted",ee.ECONNABORTED,t,f)),f=null)},f.onerror=function(){r(new ee("Network Error",ee.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let _=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const b=t.transitional||Tf;t.timeoutErrorMessage&&(_=t.timeoutErrorMessage),r(new ee(_,b.clarifyTimeoutError?ee.ETIMEDOUT:ee.ECONNABORTED,t,f)),f=null},Ot.hasStandardBrowserEnv&&(a&&M.isFunction(a)&&(a=a(t)),a||a!==!1&&mm(d))){const h=t.xsrfHeaderName&&t.xsrfCookieName&&dm.read(t.xsrfCookieName);h&&o.set(t.xsrfHeaderName,h)}i===void 0&&o.setContentType(null),"setRequestHeader"in f&&M.forEach(o.toJSON(),function(_,b){f.setRequestHeader(b,_)}),M.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),s&&s!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",sl(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",sl(t.onUploadProgress)),(t.cancelToken||t.signal)&&(c=h=>{f&&(r(!h||h.type?new ki(null,t,f):h),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(c),t.signal&&(t.signal.aborted?c():t.signal.addEventListener("abort",c)));const m=gm(d);if(m&&Ot.protocols.indexOf(m)===-1){r(new ee("Unsupported protocol "+m+":",ee.ERR_BAD_REQUEST,t));return}f.send(i||null)})},ha={http:z0,xhr:bm};M.forEach(ha,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const al=t=>`- ${t}`,wm=t=>M.isFunction(t)||t===null||t===!1,kf={getAdapter:t=>{t=M.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o<e;o++){n=t[o];let s;if(r=n,!wm(n)&&(r=ha[(s=String(n)).toLowerCase()],r===void 0))throw new ee(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since :
20
+ `+o.map(al).join(`
21
+ `):" "+al(o[0]):"as no adapter specified";throw new ee("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ha};function Fs(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ki(null,t)}function cl(t){return Fs(t),t.headers=$t.from(t.headers),t.data=Is.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),kf.getAdapter(t.adapter||gc.adapter)(t).then(function(r){return Fs(t),r.data=Is.call(t,t.transformResponse,r),r.headers=$t.from(r.headers),r},function(r){return Lf(r)||(Fs(t),r&&r.response&&(r.response.data=Is.call(t,t.transformResponse,r.response),r.response.headers=$t.from(r.response.headers))),Promise.reject(r)})}const ll=t=>t instanceof $t?{...t}:t;function Cr(t,e){e=e||{};const n={};function r(l,u,f){return M.isPlainObject(l)&&M.isPlainObject(u)?M.merge.call({caseless:f},l,u):M.isPlainObject(u)?M.merge({},u):M.isArray(u)?u.slice():u}function i(l,u,f){if(M.isUndefined(u)){if(!M.isUndefined(l))return r(void 0,l,f)}else return r(l,u,f)}function o(l,u){if(!M.isUndefined(u))return r(void 0,u)}function s(l,u){if(M.isUndefined(u)){if(!M.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,f){if(f in e)return r(l,u);if(f in t)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u)=>i(ll(l),ll(u),!0)};return M.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=c[u]||i,d=f(t[u],e[u],u);M.isUndefined(d)&&f!==a||(n[u]=d)}),n}const Df="1.6.8",vc={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{vc[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const ul={};vc.transitional=function(e,n,r){function i(o,s){return"[Axios v"+Df+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new ee(i(s," has been removed"+(n?" in "+n:"")),ee.ERR_DEPRECATED);return n&&!ul[s]&&(ul[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function _m(t,e,n){if(typeof t!="object")throw new ee("options must be an object",ee.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],c=a===void 0||s(a,o,t);if(c!==!0)throw new ee("option "+o+" must be "+c,ee.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ee("Unknown option "+o,ee.ERR_BAD_OPTION)}}const pa={assertOptions:_m,validators:vc},Zt=pa.validators;class Go{constructor(e){this.defaults=e,this.interceptors={request:new il,response:new il}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
22
+ `+o):r.stack=o}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Cr(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&pa.assertOptions(r,{silentJSONParsing:Zt.transitional(Zt.boolean),forcedJSONParsing:Zt.transitional(Zt.boolean),clarifyTimeoutError:Zt.transitional(Zt.boolean)},!1),i!=null&&(M.isFunction(i)?n.paramsSerializer={serialize:i}:pa.assertOptions(i,{encode:Zt.function,serialize:Zt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&M.merge(o.common,o[n.method]);o&&M.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),n.headers=$t.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(c=c&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let u,f=0,d;if(!c){const m=[cl.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,l),d=m.length,u=Promise.resolve(n);f<d;)u=u.then(m[f++],m[f++]);return u}d=a.length;let y=n;for(f=0;f<d;){const m=a[f++],h=a[f++];try{y=m(y)}catch(_){h.call(this,_);break}}try{u=cl.call(this,y)}catch(m){return Promise.reject(m)}for(f=0,d=l.length;f<d;)u=u.then(l[f++],l[f++]);return u}getUri(e){e=Cr(this.defaults,e);const n=Mf(e.baseURL,e.url);return Pf(n,e.params,e.paramsSerializer)}}M.forEach(["delete","get","head","options"],function(e){Go.prototype[e]=function(n,r){return this.request(Cr(r||{},{method:e,url:n,data:(r||{}).data}))}});M.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(Cr(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Go.prototype[e]=n(),Go.prototype[e+"Form"]=n(!0)});const Mo=Go;class yc{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new ki(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new yc(function(i){e=i}),cancel:e}}}const Sm=yc;function Cm(t){return function(n){return t.apply(null,n)}}function Em(t){return M.isObject(t)&&t.isAxiosError===!0}const ma={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ma).forEach(([t,e])=>{ma[e]=t});const xm=ma;function jf(t){const e=new Mo(t),n=mf(Mo.prototype.request,e);return M.extend(n,Mo.prototype,e,{allOwnKeys:!0}),M.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return jf(Cr(t,i))},n}const Se=jf(gc);Se.Axios=Mo;Se.CanceledError=ki;Se.CancelToken=Sm;Se.isCancel=Lf;Se.VERSION=Df;Se.toFormData=vs;Se.AxiosError=ee;Se.Cancel=Se.CanceledError;Se.all=function(e){return Promise.all(e)};Se.spread=Cm;Se.isAxiosError=Em;Se.mergeConfig=Cr;Se.AxiosHeaders=$t;Se.formToJSON=t=>Rf(M.isHTMLForm(t)?new FormData(t):t);Se.getAdapter=kf.getAdapter;Se.HttpStatusCode=xm;Se.default=Se;const pi=Se.create({baseURL:"https://ecomgate.omnic.solutions/api/1.0.0/type-1/public/"}),Om=512,Pm={[mt.CheckOrder]:["is_check_order","is_delivery"],[mt.DressingRoom]:["is_dressing_room","is_delivery"],[mt.PayByCash]:["pay_by_cash","pay_by_card","is_delivery"]},Tm={[gt.Return]:["is_pickup"],[gt.Shipping]:["is_pickup"],[gt.Payment]:["pay_by_cash","pay_by_card","is_pickup"]};async function*ga({bounds:t,loadPointsParams:{city_name:e,country_abbreviation:n,filter:r,region_name:i}={},options:{controller:o}={},q:s}){const a={status:30,page_size:Om,country_abbreviation:n,region_name:i,city_name:e};if(s&&(a.q=s),r!=null&&r.type&&(a.type=r.type),r!=null&&r.receive)for(const[f,d]of Object.entries(r==null?void 0:r.receive)){if(!d)continue;const y=Pm[f];for(const m of y)a[m]=!0}if(r!=null&&r.send)for(const[f,d]of Object.entries(r==null?void 0:r.send)){if(!d)continue;const y=Tm[f];for(const m of y)a[m]=!0}t&&(a.start_latitude=t[0][0],a.end_latitude=t[0][1],a.start_longitude=t[1][0],a.end_longitude=t[1][1]);let c=await pi.get("/locations/points",{params:a,signal:o==null?void 0:o.signal}),l=c.data.data.num_pages,u=c.data.data.current_page;for(;u<l;){yield c,a.page=u+1;const f=await pi.get("/locations/points",{params:a,signal:o==null?void 0:o.signal});c.data.data.results=[...c.data.data.results,...f.data.data.results],c=f,u=f.data.data.current_page,l=f.data.data.num_pages}return yield c,c}const Br=[],va=({bounds:t,loadPointsParams:e})=>{var r;const n=new AbortController;for(;Br.length;)(r=Br.pop())==null||r.abort();return Br.push(n),async i=>{const o={controller:n};try{if(!t){const a=await ga({loadPointsParams:e,options:o}).next();i(a.value.data);return}for await(const s of ga({loadPointsParams:e,options:o,bounds:t}))i(s.data)}catch(s){if(n.signal.aborted)return;throw s}finally{const s=Br.indexOf(n);s>=0&&Br.splice(s,1)}}},Nf=":root",Di=(t,e)=>{var n;(n=document.querySelector(Nf))==null||n.style.setProperty(t,e)};var Wo={};(function(t){var e,n,r=Ji&&Ji.__awaiter||function(g,S,O,T){return new(O=O||Promise)(function(R,L){function A($){try{I(T.next($))}catch(V){L(V)}}function D($){try{I(T.throw($))}catch(V){L(V)}}function I($){var V;$.done?R($.value):((V=$.value)instanceof O?V:new O(function(z){z(V)})).then(A,D)}I((T=T.apply(g,S||[])).next())})},i=Ji&&Ji.__rest||function(g,S){var O={};for(R in g)Object.prototype.hasOwnProperty.call(g,R)&&S.indexOf(R)<0&&(O[R]=g[R]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var T=0,R=Object.getOwnPropertySymbols(g);T<R.length;T++)S.indexOf(R[T])<0&&Object.prototype.propertyIsEnumerable.call(g,R[T])&&(O[R[T]]=g[R[T]]);return O};Object.defineProperty(t,"__esModule",{value:!0}),t.fromLatLng=t.fromPlaceId=t.fromAddress=t.geocode=t.enableAddressDescriptor=t.setOutputFormat=t.setLocationType=t.setResultType=t.setBounds=t.setComponents=t.setRegion=t.setLanguage=t.setKey=t.setDefaults=t.OutputFormat=t.RequestType=void 0,function(g){g.ADDRESS="address",g.LATLNG="latlng",g.PLACE_ID="place_id"}(e=t.RequestType||(t.RequestType={})),function(g){g.XML="xml",g.JSON="json"}(n=t.OutputFormat||(t.OutputFormat={}));const o="https://maps.googleapis.com/maps/api/geocode";let s={outputFormat:n.JSON};function a(g){return r(this,void 0,void 0,function*(){var O=g.outputFormat,S=i(g,["outputFormat"]),S=new URLSearchParams(S).toString(),O=o+`/${O}?`+S;try{var T=yield(yield fetch(O)).json(),{status:R,error_message:L}=T;if(R==="OK")return T;throw new Error(`Geocoding failed: ${L}. Server returned status code ${R}.`)}catch(A){throw A instanceof Error?new Error("Geocoding request failed: "+A.message):new Error("Geocoding request failed with unknown error: "+A)}})}function c(g){s=Object.assign(Object.assign({},s),g)}function l(g){s.key=g}function u(g){s.language=g}function f(g){s.region=g}function d(g){s.components=g}function y(g){s.bounds=g}function m(g){s.result_type=g}function h(g){s.location_type=g}function _(g){s.outputFormat=g}function b(g){s.enable_address_descriptor=g}function C(g,S,O){if(typeof g!="string"||typeof S!="string")throw new Error(`Both requestType and value are required and must be of type string.
23
+ requestType: ${typeof g}, value: `+typeof S);return a(Object.assign(Object.assign(Object.assign({},s),O),{[g]:S}))}function v(g,S,O,T){var R={outputFormat:n.JSON};return S&&(R.key=S),O&&(R.language=O),T&&(R.region=T),C(e.ADDRESS,g,R)}function E(g,S,O,T){var R={outputFormat:n.JSON};return S&&(R.key=S),O&&(R.language=O),T&&(R.region=T),C(e.PLACE_ID,g,R)}function x(g,S,O,T,R,L){var A={outputFormat:n.JSON};return O&&(A.key=O),T&&(A.language=T),R&&(A.region=R),L&&(A.location_type=L),C(e.LATLNG,g+","+S,A)}t.setDefaults=c,t.setKey=l,t.setLanguage=u,t.setRegion=f,t.setComponents=d,t.setBounds=y,t.setResultType=m,t.setLocationType=h,t.setOutputFormat=_,t.enableAddressDescriptor=b,t.geocode=C,t.fromAddress=v,t.fromPlaceId=E,t.fromLatLng=x})(Wo);const If=t=>typeof t=="string",ya=t=>Array.isArray(t)&&t.length===2;async function ba(t,e,n){var o;let r;if(If(t))r=await Wo.fromPlaceId(t,e);else{const[s,a]=t;r=await Wo.fromLatLng(s,a,e,void 0,void 0,n==null?void 0:n.join("|"))}const i=(o=r.results)==null?void 0:o.map(s=>{var l,u;const a=(l=s.geometry)==null?void 0:l.viewport,c=(u=s.geometry)==null?void 0:u.location;return{...s,geometry:{...s.geometry,viewport:new google.maps.LatLngBounds(a.southwest,a.northeast),location:new google.maps.LatLng(c)}}});return{...r,results:i}}const bc=t=>{var n;const e=Z.getState().map;if(!e){console.error("Map is not initialized");return}if(!navigator.geolocation){(n=t==null?void 0:t.error)==null||n.call(t,new GeolocationPositionError),console.error("Geolocation is not supported by your browser");return}navigator.geolocation.getCurrentPosition(r=>{var a;const{latitude:i,longitude:o}=r.coords,s=new google.maps.LatLngBounds;s.extend(new google.maps.LatLng(i,o)),e.fitBounds(s),e.setZoom(16),(a=t==null?void 0:t.success)==null||a.call(t,r)},r=>{var i;console.error("Geolocation error:",r),(i=t==null?void 0:t.error)==null||i.call(t,r)},{maximumAge:6e4,timeout:5e3,enableHighAccuracy:!0})},Ff=t=>t.status===200,Bf=t=>{const e=document.querySelector(Nf);return e?getComputedStyle(e).getPropertyValue(t):null},rr=(t,e)=>{let n=t;const r=(e.includes("--owl")?Bf(e):e)||"";return n=n.replaceAll("currentColor",r),n},Am=t=>"comment"in t&&"address"in t&&"apartment_number"in t&&"delivery_time"in t,Rm={points:[],samePoints:[],error:!1,loaded:!1,loading:!1,reloading:!1,requestId:0},Lm=t=>t.points,Mm=t=>t.loaded,Vf=t=>t.loading,Rt=Ut()((t,e)=>({...Rm,setSamePoints(n){t({samePoints:n})},closeSamePoints(){t({samePoints:[]})},async loadNext({bounds:n,...r}){const{requestId:i}=e(),o=i+1;t({error:!1,reloading:!0,requestId:o}),Z.getState().setBounds(n);let s=0;try{await va({bounds:n,loadPointsParams:r})(c=>{e().requestId===o&&(t(s===0?{points:c.data.results}:{points:[...e().points,...c.data.results]}),s++)})}catch{e().requestId===o&&t({error:!0})}finally{e().requestId===o&&t({reloading:!1})}},async loadFirst(n){const{requestId:r}=e(),i=Jp(Z.getState()),o=r+1;t({error:!1,loading:!0,reloading:!1,requestId:o});let s=0;try{await va({bounds:i,loadPointsParams:n})(c=>{e().requestId===o&&(s>=1&&t({loading:!1,loaded:!0}),t(s===0?{points:c.data.results}:{points:[...e().points,...c.data.results]}),s++)}),e().requestId===o&&t({loading:!1,loaded:!0})}catch{e().requestId===o&&t({error:!0,loading:!1})}finally{e().requestId===o&&t({loading:!1})}}})),km=({cityName:t,countryAbbreviation:e,regionName:n})=>{p.useEffect(()=>{Rt.getState().loadFirst({city_name:t,country_abbreviation:e,region_name:n}),console.debug("[OmnicWidgetLocations::pointsLoader]");const r=dn.subscribe(i=>{Rt.getState().loadFirst({filter:i,city_name:t,country_abbreviation:e,region_name:n}),console.debug("[OmnicWidgetLocations::filters]",i)});return()=>{r()}},[t,e,n])},Xt=".",wc=Symbol("target"),Hf=Symbol("unsubscribe");function wa(t){return t instanceof Date||t instanceof Set||t instanceof Map||t instanceof WeakSet||t instanceof WeakMap||ArrayBuffer.isView(t)}function Dm(t){return(typeof t=="object"?t===null:typeof t!="function")||t instanceof RegExp}const Ve=Array.isArray;function Zo(t){return typeof t=="symbol"}const qe={after(t,e){return Ve(t)?t.slice(e.length):e===""?t:t.slice(e.length+1)},concat(t,e){return Ve(t)?(t=[...t],e&&t.push(e),t):e&&e.toString!==void 0?(t!==""&&(t+=Xt),Zo(e)?t+e.toString():t+e):t},initial(t){if(Ve(t))return t.slice(0,-1);if(t==="")return t;const e=t.lastIndexOf(Xt);return e===-1?"":t.slice(0,e)},last(t){if(Ve(t))return t.at(-1)??"";if(t==="")return t;const e=t.lastIndexOf(Xt);return e===-1?t:t.slice(e+1)},walk(t,e){if(Ve(t))for(const n of t)e(n);else if(t!==""){let n=0,r=t.indexOf(Xt);if(r===-1)e(t);else for(;n<t.length;)r===-1&&(r=t.length),e(t.slice(n,r)),n=r+1,r=t.indexOf(Xt,n)}},get(t,e){return this.walk(e,n=>{t&&(t=t[n])}),t},isSubPath(t,e){if(Ve(t)){if(t.length<e.length)return!1;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}return t.length<e.length?!1:t===e?!0:t.startsWith(e)?t[e.length]===Xt:!1},isRootPath(t){return Ve(t)?t.length===0:t===""}};function jm(t){return typeof t=="object"&&typeof t.next=="function"}function Nm(t,e,n,r,i){const o=t.next;if(e.name==="entries")t.next=function(){const s=o.call(this);return s.done===!1&&(s.value[0]=i(s.value[0],e,s.value[0],r),s.value[1]=i(s.value[1],e,s.value[0],r)),s};else if(e.name==="values"){const s=n[wc].keys();t.next=function(){const a=o.call(this);return a.done===!1&&(a.value=i(a.value,e,s.next().value,r)),a}}else t.next=function(){const s=o.call(this);return s.done===!1&&(s.value=i(s.value,e,s.value,r)),s};return t}function fl(t,e,n){return t.isUnsubscribed||e.ignoreSymbols&&Zo(n)||e.ignoreUnderscores&&n.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(n)}let Im=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){const n=this._getDescriptorCache();let r=n.get(e);return r===void 0&&(r={},n.set(e,r)),r}_getOwnPropertyDescriptor(e,n){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,n);const r=this._getProperties(e);let i=r[n];return i===void 0&&(i=Reflect.getOwnPropertyDescriptor(e,n),r[n]=i),i}getProxy(e,n,r,i){if(this.isUnsubscribed)return e;const o=e[i],s=o??e;this._pathCache.set(s,n);let a=this._proxyCache.get(s);return a===void 0&&(a=o===void 0?new Proxy(e,r):e,this._proxyCache.set(s,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,n){return!Object.is(e,qe.get(n,this.getPath(e)))}defineProperty(e,n,r){return Reflect.defineProperty(e,n,r)?(this.isUnsubscribed||(this._getProperties(e)[n]=r),!0):!1}setProperty(e,n,r,i,o){if(!this._equals(o,r)||!(n in e)){const s=this._getOwnPropertyDescriptor(e,n);return s!==void 0&&"set"in s?Reflect.set(e,n,r,i):Reflect.set(e,n,r)}return!0}deleteProperty(e,n,r){if(Reflect.deleteProperty(e,n)){if(!this.isUnsubscribed){const i=this._getDescriptorCache().get(e);i&&(delete i[n],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(e,n,r){const i=this._getOwnPropertyDescriptor(n,r);return e!==void 0&&i!==void 0&&Object.is(e.value,i.value)&&(e.writable||!1)===(i.writable||!1)&&(e.enumerable||!1)===(i.enumerable||!1)&&(e.configurable||!1)===(i.configurable||!1)&&e.get===i.get&&e.set===i.set}isGetInvariant(e,n){const r=this._getOwnPropertyDescriptor(e,n);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function _a(t){return toString.call(t)==="[object Object]"}function Yi(){return!0}function Gn(t,e){return t.length!==e.length||t.some((n,r)=>e[r]!==n)}const $f=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Fm=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),Uf={push:Yi,pop:Yi,shift:Yi,unshift:Yi,copyWithin:Gn,reverse:Gn,sort:Gn,splice:Gn,flat:Gn,fill:Gn},Bm=new Set([...$f,...Fm,...Object.keys(Uf)]);function eo(t,e){if(t.size!==e.size)return!0;for(const n of t)if(!e.has(n))return!0;return!1}const zf=["keys","values","entries"],qf=new Set(["has","toString"]),Gf={add:eo,clear:eo,delete:eo,forEach:eo},Vm=new Set([...qf,...Object.keys(Gf),...zf]);function to(t,e){if(t.size!==e.size)return!0;let n;for(const[r,i]of t)if(n=e.get(r),n!==i||n===void 0&&!e.has(r))return!0;return!1}const Hm=new Set([...qf,"get"]),Wf={set:to,clear:to,delete:to,forEach:to},$m=new Set([...Hm,...Object.keys(Wf),...zf]);class hn{constructor(e,n,r,i){this._path=n,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=i,this._changes=i?[]:null,this.clone=n===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return $f.has(e)}_shallowClone(e){let n=e;if(_a(e))n={...e};else if(Ve(e)||ArrayBuffer.isView(e))n=[...e];else if(e instanceof Date)n=new Date(e);else if(e instanceof Set)n=new Set([...e].map(r=>this._shallowClone(r)));else if(e instanceof Map){n=new Map;for(const[r,i]of e.entries())n.set(r,this._shallowClone(i))}return this._clonedCache.add(n),n}preferredThisArg(e,n,r,i){return e?(Ve(i)?this._onIsChanged=Uf[n]:i instanceof Set?this._onIsChanged=Gf[n]:i instanceof Map&&(this._onIsChanged=Wf[n]),i):r}update(e,n,r){const i=qe.after(e,this._path);if(n!=="length"){let o=this.clone;qe.walk(i,s=>{o!=null&&o[s]&&(this._clonedCache.has(o[s])||(o[s]=this._shallowClone(o[s])),o=o[s])}),this._hasOnValidate&&this._changes.push({path:i,property:n,previous:r}),o!=null&&o[n]&&(o[n]=r)}this._isChanged=!0}undo(e){let n;for(let r=this._changes.length-1;r!==-1;r--)n=this._changes[r],qe.get(e,n.path)[n.property]=n.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}isPathApplicable(e){return qe.isRootPath(this._path)||qe.isSubPath(e,this._path)}}class dl extends hn{static isHandledMethod(e){return Bm.has(e)}}class Um extends hn{undo(e){e.setTime(this.clone.getTime())}isChanged(e,n){return!n(this.clone.valueOf(),e.valueOf())}}class hl extends hn{static isHandledMethod(e){return Vm.has(e)}undo(e){for(const n of this.clone)e.add(n);for(const n of e)this.clone.has(n)||e.delete(n)}}class pl extends hn{static isHandledMethod(e){return $m.has(e)}undo(e){for(const[n,r]of this.clone.entries())e.set(n,r);for(const n of e.keys())this.clone.has(n)||e.delete(n)}}class zm extends hn{constructor(e,n,r,i){super(void 0,n,r,i),this._argument1=r[0],this._weakValue=e.has(this._argument1)}isChanged(e){return this._weakValue!==e.has(this._argument1)}undo(e){this._weakValue&&!e.has(this._argument1)?e.add(this._argument1):e.delete(this._argument1)}}class qm extends hn{constructor(e,n,r,i){super(void 0,n,r,i),this._weakKey=r[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){const n=e.has(this._weakKey);this._weakHas&&!n?e.set(this._weakKey,this._weakValue):!this._weakHas&&n?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}}class wn{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return _a(e)||Ve(e)||wa(e)}static isHandledMethod(e,n){return _a(e)?hn.isHandledMethod(n):Ve(e)?dl.isHandledMethod(n):e instanceof Set?hl.isHandledMethod(n):e instanceof Map?pl.isHandledMethod(n):wa(e)}get isCloning(){return this._stack.length>0}start(e,n,r){let i=hn;Ve(e)?i=dl:e instanceof Date?i=Um:e instanceof Set?i=hl:e instanceof Map?i=pl:e instanceof WeakSet?i=zm:e instanceof WeakMap&&(i=qm),this._stack.push(new i(e,n,r,this._hasOnValidate))}update(e,n,r){this._stack.at(-1).update(e,n,r)}preferredThisArg(e,n,r){const{name:i}=e,o=wn.isHandledMethod(r,i);return this._stack.at(-1).preferredThisArg(o,i,n,r)}isChanged(e,n,r){return this._stack.at(-1).isChanged(e,n,r)}isPartOfClone(e){return this._stack.at(-1).isPathApplicable(e)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}}const Gm={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},ni=(t,e,n={})=>{n={...Gm,...n};const r=Symbol("ProxyTarget"),{equals:i,isShallow:o,ignoreDetached:s,details:a}=n,c=new Im(i),l=typeof n.onValidate=="function",u=new wn(l),f=(v,E,x,g,S)=>!l||u.isCloning||n.onValidate(qe.concat(c.getPath(v),E),x,g,S)===!0,d=(v,E,x,g)=>{!fl(c,n,E)&&!(s&&c.isDetached(v,t))&&y(c.getPath(v),E,x,g)},y=(v,E,x,g,S)=>{u.isCloning&&u.isPartOfClone(v)?u.update(v,E,g):e(qe.concat(v,E),x,g,S)},m=v=>v&&(v[r]??v),h=(v,E,x,g)=>{if(Dm(v)||x==="constructor"||o&&!wn.isHandledMethod(E,x)||fl(c,n,x)||c.isGetInvariant(E,x)||s&&c.isDetached(E,t))return v;g===void 0&&(g=c.getPath(E));const S=qe.concat(g,x),O=c.getPath(v);return O&&_(S,O)?c.getProxy(v,O,b,r):c.getProxy(v,S,b,r)},_=(v,E)=>{if(Zo(v)||v.length<=E.length||Ve(E)&&E.length===0)return!1;const x=Ve(v)?v:v.split(Xt),g=Ve(E)?E:E.split(Xt);return x.length<=g.length?!1:!g.some((S,O)=>S!==x[O])},b={get(v,E,x){if(Zo(E)){if(E===r||E===wc)return v;if(E===Hf&&!c.isUnsubscribed&&c.getPath(v).length===0)return c.unsubscribe(),v}const g=wa(v)?Reflect.get(v,E):Reflect.get(v,E,x);return h(g,v,E)},set(v,E,x,g){x=m(x);const S=v[r]??v,O=S[E];if(i(O,x)&&E in v)return!0;const T=f(v,E,x,O);return T&&c.setProperty(S,E,x,g,O)?(d(v,E,v[E],O),!0):!T},defineProperty(v,E,x){if(!c.isSameDescriptor(x,v,E)){const g=v[E];f(v,E,x.value,g)&&c.defineProperty(v,E,x,g)&&d(v,E,x.value,g)}return!0},deleteProperty(v,E){if(!Reflect.has(v,E))return!0;const x=Reflect.get(v,E),g=f(v,E,void 0,x);return g&&c.deleteProperty(v,E,x)?(d(v,E,void 0,x),!0):!g},apply(v,E,x){const g=E[r]??E;if(c.isUnsubscribed)return Reflect.apply(v,g,x);if((a===!1||a!==!0&&!a.includes(v.name))&&wn.isHandledType(g)){let S=qe.initial(c.getPath(v));const O=wn.isHandledMethod(g,v.name);u.start(g,S,x);let T=Reflect.apply(v,u.preferredThisArg(v,E,g),O?x.map(A=>m(A)):x);const R=u.isChanged(g,i),L=u.stop();if(wn.isHandledType(T)&&O&&(E instanceof Map&&v.name==="get"&&(S=qe.concat(S,x[0])),T=c.getProxy(T,S,b)),R){const A={name:v.name,args:x,result:T},D=u.isCloning?qe.initial(S):S,I=u.isCloning?qe.last(S):"";f(qe.get(t,D),I,g,L,A)?y(D,I,g,L,A):u.undo(g)}return(E instanceof Map||E instanceof Set)&&jm(T)?Nm(T,v,E,S,h):T}return Reflect.apply(v,E,x)}},C=c.getProxy(t,n.pathAsArray?[]:"",b);return e=e.bind(C),l&&(n.onValidate=n.onValidate.bind(C)),C};ni.target=t=>(t==null?void 0:t[wc])??t;ni.unsubscribe=t=>(t==null?void 0:t[Hf])??t;const Wm=t=>{const e=t??window.OMNIC_WIDGET_LOCATIONS_CONFIG,[n,r]=p.useState({...yn,...e,map:{...yn.map,...e==null?void 0:e.map},palette:{...yn.palette,...e==null?void 0:e.palette}}),i=t&&!window.OMNIC_WIDGET_LOCATIONS_CONFIG,o=!t&&window.OMNIC_WIDGET_LOCATIONS_CONFIG;return p.useEffect(()=>{if(!i)return;const s={...yn,...t,map:{...yn.map,...t.map},palette:{...yn.palette,...t.palette}};console.debug("[OmnicLocationsWidget::reactConfig]",s),r(s)},[t,i]),p.useEffect(()=>{if(o)return console.debug("[OmnicLocationsWidget::windowConfig]",n),window.OMNIC_WIDGET_LOCATIONS_CONFIG=ni(window.OMNIC_WIDGET_LOCATIONS_CONFIG,function(){const s={...n,...ni.target(this)};s.map&&(s.map={...s.map}),s.palette&&(s.palette={...s.palette}),console.debug("[OmnicLocationsWidget::changeWindowConfig]",s),r({...s})}),()=>{window.OMNIC_WIDGET_LOCATIONS_CONFIG&&ni.unsubscribe(window.OMNIC_WIDGET_LOCATIONS_CONFIG)}},[n,o]),n},Zm=(t,e)=>{console.debug("[OmnicWidgetLocations::axios]",{INN:t,options:e}),pi.defaults.headers.get.Authorization=`INN ${t}`,e!=null&&e.baseURL&&(pi.defaults.baseURL=e.baseURL)};var Zf={exports:{}};/*!
24
24
  Copyright (c) 2018 Jed Watson.
25
25
  Licensed under the MIT License (MIT), see
26
26
  http://jedwatson.github.io/classnames
27
- */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)e.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(kd);var km=kd.exports;const ge=Sl(km),Tm={lmsData:null,isLoading:!1},Rs=wn()(t=>({...Tm,setLMSData:e=>t({lmsData:e}),setLoading:e=>t({isLoading:e})})),Rm=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 12 12",...t},U.createElement("path",{fill:"currentcolor",d:"M6 9.42a.838.838 0 0 1-.594-.246l-5.16-5.16a.84.84 0 1 1 1.189-1.188L6 7.392l4.565-4.566a.84.84 0 0 1 1.189 1.189l-5.16 5.16A.838.838 0 0 1 6 9.42Z"})),Td=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:26,height:8,fill:"none",viewBox:"0 0 26 8",...t},U.createElement("g",{fill:"#000"},U.createElement("path",{d:"M1.416 7.5c-.255 0-.491-.065-.708-.194A1.445 1.445 0 0 1 0 6.06V1.94A1.445 1.445 0 0 1 .708.695C.925.564 1.16.5 1.416.5h4.056c.255 0 .488.065.698.194.217.13.39.305.517.525.134.214.2.454.2.72V6.06c0 .26-.066.5-.2.72-.128.22-.3.395-.517.525-.21.13-.443.194-.698.194H1.416Zm.067-1.517h3.903V2.017H1.483v3.966ZM7.941 7.5v-7h1.53l2.335 2.83L14.13.5h1.54v7h-1.493V2.804l-2.372 2.878-2.382-2.868V7.5H7.94ZM16.816 7.5v-7h1.53l3.856 4.667V.5h1.502v7h-1.53l-3.875-4.686V7.5h-1.483ZM24.536 7.5v-7H26v7h-1.464Z"}))),Rd=t=>U.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},U.createElement("rect",{width:48,height:48,fill:"#6A4A9D"}),U.createElement("path",{d:"M16.3444 36.5C15.3815 36.5 14.4907 36.2685 13.6722 35.8056C12.8537 35.3426 12.2037 34.7176 11.7222 33.9306C11.2407 33.1435 11 32.287 11 31.3611V16.6389C11 15.6898 11.2407 14.8333 11.7222 14.0694C12.2037 13.2824 12.8537 12.6574 13.6722 12.1944C14.4907 11.7315 15.3815 11.5 16.3444 11.5H31.6556C32.6185 11.5 33.4972 11.7315 34.2917 12.1944C35.1102 12.6574 35.7602 13.2824 36.2417 14.0694C36.7472 14.8333 37 15.6898 37 16.6389V31.3611C37 32.287 36.7472 33.1435 36.2417 33.9306C35.7602 34.7176 35.1102 35.3426 34.2917 35.8056C33.4972 36.2685 32.6185 36.5 31.6556 36.5H16.3444ZM16.5972 31.0833H31.3306V16.9167H16.5972V31.0833Z",fill:"white"}));function Dm(t,e){return e.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in t)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(t)}function Ds(t){return!!(t&&typeof t.then=="function")}function Zo(t,e){return Ds(t)?Promise.resolve(t).then(e):e(t)}function qs(t,e,n){function r(i){const o=e(i);throw t.emit(o),console.error(o),o}try{const i=n();return Ds(i)?i.catch(r):i}catch(i){r(i)}}function wu(t){const e=(Array.isArray(t)?t:[t]).map(o=>`'${o}'`),n=e.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...e.slice(0,-2),n].join(", ")} option`}function Am(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}function Dd(t){if(typeof t=="string")return[t];if(Array.isArray(t))return t}function Nt(t){return Dd(t)||[]}function Im(t,e){return Am(e)?Nt(e==null?void 0:e[t]):Nt(e)}function Da(t){return Array.from(new Set(t))}function Ad(t){return t&&t.replace(/\/+$/,"")}function jm(t){if(typeof t=="string")return t;if(typeof(t==null?void 0:t.message)=="string")return t.message}const Nm=(t,e)=>fetch(t,e),Id=(t=Nm)=>(e,n)=>t(e,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.22.0"},n==null?void 0:n.headers)}));function dn(t){let e=[];return Object.freeze({listen(n){const r=i=>{n(i)};return e.push(r),{unsubscribe(){e=e.filter(i=>r!==i)}}},emit(n){t()&&e.forEach(r=>r({value:n}))}})}function Bm(t,e,n){const r=new Set,i=new Set;function o(l){const u=new Set(e());i.forEach(f=>{(l===void 0||(l==null?void 0:l.findIndex(h=>u.has(h)||f.namespaces.has(h)))!==-1)&&f.fn({value:void 0})})}let s=[];function a(){if(s.length===0)return;const l=s;s=[],r.forEach(d=>{d({value:void 0})});let u=new Set;l.forEach(d=>{d===void 0?u=void 0:u!==void 0&&d.forEach(h=>u.add(h))});const f=u?Array.from(u.keys()):void 0;o(f)}return Object.freeze({emit(l,u){t()&&(s.push(l),u?setTimeout(a,0):a())},listen(l){return r.add(l),{unsubscribe:()=>{r.delete(l)}}},listenSome(l){const u={fn:d=>{l(d)},namespaces:new Set};i.add(u);const f={unsubscribe:()=>{i.delete(u)},subscribeNs:d=>(Nt(d).forEach(h=>u.namespaces.add(h)),d===void 0&&u.namespaces.add(n()),f)};return f}})}function Fm(t,e){let n=!0;function r(){return n}const i=Object.freeze({onPendingLanguageChange:dn(r),onLanguageChange:dn(r),onLoadingChange:dn(r),onFetchingChange:dn(r),onInitialLoaded:dn(r),onRunningChange:dn(r),onCacheChange:dn(r),onUpdate:Bm(r,t,e),onPermanentChange:dn(r),onError:dn(r),setEmitterActive(o){n=o},on:(o,s)=>{switch(o){case"pendingLanguage":return i.onPendingLanguageChange.listen(s);case"language":return i.onLanguageChange.listen(s);case"loading":return i.onLoadingChange.listen(s);case"fetching":return i.onFetchingChange.listen(s);case"initialLoad":return i.onInitialLoaded.listen(s);case"running":return i.onRunningChange.listen(s);case"cache":return i.onCacheChange.listen(s);case"update":return i.onUpdate.listen(s);case"permanentChange":return i.onPermanentChange.listen(s);case"error":return i.onError.listen(s)}}});return i.onInitialLoaded.listen(()=>i.onUpdate.emit()),i.onLanguageChange.listen(()=>i.onUpdate.emit()),i.onCacheChange.listen(({value:o})=>i.onUpdate.emit([o.namespace],!0)),i}class Cu extends Error{constructor(e,n,r=!1){const{language:i,namespace:o}=e;super(`Tolgee: Failed to fetch record for "${i}"${o&&` and "${o}"`}`),this.cause=n,this.isDev=r,this.name="RecordFetchError",this.language=i,this.namespace=o}}class Um extends Error{constructor(e,n){super(e),this.cause=n,this.name="LanguageDetectorError"}}class Su extends Error{constructor(e,n){super(e),this.cause=n,this.name="LanguageStorageError"}}const jd=t=>{const e=new Map;return Object.entries(t).forEach(([n,r])=>{if(r!=null){if(typeof r=="object"){jd(r).forEach((i,o)=>{e.set(n+"."+o,i)});return}e.set(n,r)}}),e},wi=t=>{const[e,...n]=t.split(":"),r=n.join(":");return{language:e,namespace:r||""}},hn=({language:t,namespace:e})=>e?`${t}:${e}`:t;function Vm(t,e,n,r,i,o,s){const a=new Map,l=new Map;let u={},f=0;function d(g,S,w){const L=hn(g);l.set(L,{data:jd(S),version:w}),t.onCacheChange.emit(g)}function h(g){let S;if(!S){const w=u[hn(g)];typeof w=="function"&&(S=w())}return S||(S=e(g)),Ds(S)?S==null?void 0:S.catch(w=>{const L=new Cu(g,w);throw t.onError.emit(L),console.error(L),L}):S}function v(g,S){var w;let L;return S&&(L=(w=n(g))===null||w===void 0?void 0:w.catch(m=>{const _=new Cu(g,m,!0);return t.onError.emit(_),console.warn(_),h(g)})),L||(L=h(g)),L}const y=Object.freeze({addStaticData(g){g&&(u=Object.assign(Object.assign({},u),g),Object.entries(g).forEach(([S,w])=>{if(typeof w!="function"){const L=wi(S),m=l.get(S);(!m||m.version===0)&&d(L,w,0)}}))},invalidate(){a.clear(),f+=1},addRecord(g,S){d(g,S,f)},exists(g,S=!1){const w=l.get(hn(g));return w&&S?w.version===f:!!w},getRecord(g){var S;return(S=l.get(hn(r(g))))===null||S===void 0?void 0:S.data},getTranslation(g,S){var w;return(w=l.get(hn(g)))===null||w===void 0?void 0:w.data.get(S)},getTranslationNs(g,S,w){var L;for(const m of g)for(const _ of S){const E=(L=l.get(hn({language:_,namespace:m})))===null||L===void 0?void 0:L.data.get(w);if(E!=null)return[m]}return Da(g)},getTranslationFallback(g,S,w){var L;for(const m of g)for(const _ of S){const E=(L=l.get(hn({language:_,namespace:m})))===null||L===void 0?void 0:L.data.get(w);if(E!=null)return E}},changeTranslation(g,S,w){var L;const m=(L=l.get(hn(g)))===null||L===void 0?void 0:L.data;m==null||m.set(S,w),t.onCacheChange.emit(Object.assign(Object.assign({},g),{key:S}))},isFetching(g){if(i())return!0;if(g===void 0)return a.size>0;const S=Nt(g);return!!Array.from(a.keys()).find(w=>S.includes(wi(w).namespace))},isLoading(g,S){const w=Nt(S);return!!(i()||Array.from(a.keys()).find(L=>{const m=wi(L);return(!w.length||w.includes(m.namespace))&&!y.exists({namespace:m.namespace,language:g})}))},async loadRecords(g,S){const w=g.map(m=>{const _=r(m),E=hn(_),p=a.get(E);if(p)return{new:!1,promise:p,keyObject:_,cacheKey:E};const b=v(_,S)||Promise.resolve(void 0);return a.set(E,b),{new:!0,promise:b,keyObject:_,cacheKey:E}});o.notify(),s.notify();const L=await Promise.all(w.map(m=>m.promise));return w.forEach((m,_)=>{const E=a.get(m.cacheKey)!==m.promise;if(m.new&&!E){a.delete(m.cacheKey);const p=L[_];p?y.addRecord(m.keyObject,p):y.getRecord(m.keyObject)||y.addRecord(m.keyObject,{})}}),o.notify(),s.notify(),w.map(m=>y.getRecord(m.keyObject))},getAllRecords(){return Array.from(l.entries()).map(([S,w])=>Object.assign(Object.assign({},wi(S)),{data:w.data}))}});return y}function Nd(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}const zm={tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},Aa="invalid",Hm="https://app.tolgee.io",$m=({key:t})=>t,Wm={defaultNs:"",observerOptions:zm,observerType:"invisible",onFormatError:Aa,apiUrl:Hm,fetch:Id(),onTranslationMissing:$m},Ia=(...t)=>{let e={};return t.forEach(n=>{e=Object.assign(Object.assign(Object.assign({},e),n),{observerOptions:Object.assign(Object.assign({},e.observerOptions),n==null?void 0:n.observerOptions)})}),e};function Lu(t,e){const n=Ia(Wm,e==null?void 0:e.initialOptions,t);return n.apiUrl=Ad(n.apiUrl),t!=null&&t.fetch&&(n.fetch=Id(t.fetch)),{initialOptions:n,activeNamespaces:(e==null?void 0:e.activeNamespaces)||new Map,language:e==null?void 0:e.language,pendingLanguage:e==null?void 0:e.language,isInitialLoading:!1,isRunning:!1}}function Gm(t,e,n,r,i,o,s,a){const l={ui:void 0},u={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},f=async({keysAndDefaults:M,event:R})=>{var A;const B=M.map(({key:V,ns:N,defaultValue:z})=>({key:V,defaultValue:z,fallbackNamespaces:r(N),namespace:i({key:V,ns:N})[0],translation:o({key:V,ns:N})}));(A=u.ui)===null||A===void 0||A.handleElementClick(B,R)},d=(M,R)=>{var A;return((A=u.observer)===null||A===void 0?void 0:A.findPositions(M,R))||[]};function h(M){const R=o({key:M.key,ns:M.ns});return T.formatTranslation(Object.assign(Object.assign({},M),{translation:R,formatEnabled:!0}))}function v(){return{fetch:e().fetch}}function y(M){u.observer=M==null?void 0:M()}function g(){return!!u.observer}function S(M){M&&u.formatters.push(M)}function w(M){u.finalFormatter=M}function L(M){l.ui=M}function m(){return!!l.ui}function _(M){u.languageStorage=M}function E(M){u.languageDetector=M}function p(){return qs(a.onError,M=>new Su("Tolgee: Failed to load language",M),()=>{var M;return(M=u.languageStorage)===null||M===void 0?void 0:M.getLanguage(v())})}function b(){if(!u.languageDetector)return;const M=n();return qs(a.onError,R=>new Um("Tolgee: Failed to detect language",R),()=>{var R;return(R=u.languageDetector)===null||R===void 0?void 0:R.getLanguage(Object.assign({availableLanguages:M},v()))})}function x(M){M&&u.backends.push(M)}function P(M){u.devBackend=M}function O(M,R){const A=Object.freeze({setFinalFormatter:w,addFormatter:S,setObserver:y,hasObserver:g,setUi:L,hasUi:m,setDevBackend:P,addBackend:x,setLanguageDetector:E,setLanguageStorage:_});R(M,A)}const T=Object.freeze({addPlugin:O,run(){var M,R;const{apiKey:A,apiUrl:B,projectId:V,observerOptions:N}=e();u.ui=(M=l.ui)===null||M===void 0?void 0:M.call(l,{apiKey:A,apiUrl:B,projectId:V,highlight:T.highlight,changeTranslation:s,findPositions:d,onPermanentChange:z=>a.onPermanentChange.emit(z)}),(R=u.observer)===null||R===void 0||R.run({mouseHighlight:!0,options:N,translate:h,onClick:f})},stop(){var M;u.ui=void 0,(M=u.observer)===null||M===void 0||M.stop()},getLanguageStorage(){return u.languageStorage},getInitialLanguage(){const M=n(),R=p();return Zo(R,A=>(!M||M.includes(A))&&A?A:b())},setStoredLanguage(M){return qs(a.onError,R=>new Su("Tolgee: Failed to store language",R),()=>{var R;return(R=u.languageStorage)===null||R===void 0?void 0:R.setLanguage(M,v())})},getDevBackend(){return u.devBackend},getBackendRecord:({language:M,namespace:R})=>{for(const A of u.backends){const B=A.getRecord(Object.assign({language:M,namespace:R},v()));if(B!==void 0)return B}},getBackendDevRecord:({language:M,namespace:R})=>{var A;const{apiKey:B,apiUrl:V,projectId:N}=e();return(A=u.devBackend)===null||A===void 0?void 0:A.getRecord(Object.assign({apiKey:B,apiUrl:V,projectId:N,language:M,namespace:R},v()))},getLanguageDetector(){return u.languageDetector},retranslate(){var M;(M=u.observer)===null||M===void 0||M.retranslate()},highlight:(M,R)=>{var A,B;return((B=(A=u.observer)===null||A===void 0?void 0:A.highlight)===null||B===void 0?void 0:B.call(A,M,R))||{unhighlight(){}}},unwrap(M){var R;return u.observer?(R=u.observer)===null||R===void 0?void 0:R.unwrap(M):{text:M,keys:[]}},wrap(M){var R;return u.observer?(R=u.observer)===null||R===void 0?void 0:R.wrap(M):M.translation},hasDevBackend(){return!!T.getDevBackend()},formatTranslation(M){var R,{formatEnabled:A}=M,B=Nd(M,["formatEnabled"]);const{key:V,translation:N,defaultValue:z,noWrap:Y,params:G,ns:H,orEmpty:Q}=B,oe=N??z;let te="";N==null&&(te=e().onTranslationMissing(B));let ee=oe??(Q?"":te);const D=t(),ve=A||!(!((R=u.observer)===null||R===void 0)&&R.outputNotFormattable),Pe=Z=>u.observer&&!Y?u.observer.wrap({key:V,translation:Z,defaultValue:z,params:G,ns:H}):Z;ee=Pe(ee);try{if(oe&&D&&ve)for(const Z of u.formatters)ee=Z.format({translation:ee,language:D,params:G});u.finalFormatter&&oe&&D&&ve&&(ee=u.finalFormatter.format({translation:ee,language:D,params:G}))}catch(Z){console.error(Z);const De=jm(Z)||Aa,Ae=e().onFormatError,ue=typeof Ae;ue==="string"?ee=Ae:ue==="function"?ee=Ae(De,B):ee=Aa,ee=Pe(ee)}return ee}});return T}const xu=(t,e,n)=>{let r=t;return Object.freeze({init(i){r=i},notify(){const i=e();r!==i&&n(i),r=i}})};function Zm(t,e,n){let r=Lu(),i;const o=Object.freeze({init(s){r=Lu(s,r)},isRunning(){return r.isRunning},setRunning(s){r.isRunning!==s&&(r.isRunning=s,n.emit(s))},isInitialLoading(){return r.isInitialLoading},setInitialLoading(s){r.isInitialLoading=s},getLanguage(){return r.language||r.initialOptions.language},setLanguage(s){r.language!==s&&(r.language=s,t.emit(s))},getPendingLanguage(){return r.pendingLanguage||o.getLanguage()},setPendingLanguage(s){r.pendingLanguage!==s&&(r.pendingLanguage=s,e.emit(s))},getInitialOptions(){return Object.assign(Object.assign({},r.initialOptions),i)},addActiveNs(s){Nt(s).forEach(l=>{const u=r.activeNamespaces.get(l);u!==void 0?r.activeNamespaces.set(l,u+1):r.activeNamespaces.set(l,1)})},removeActiveNs(s){Nt(s).forEach(l=>{const u=r.activeNamespaces.get(l);u!==void 0&&u>1?r.activeNamespaces.set(l,u-1):r.activeNamespaces.delete(l)})},getRequiredNamespaces(){return Da([...r.initialOptions.ns||[r.initialOptions.defaultNs],...Nt(r.initialOptions.fallbackNs),...r.activeNamespaces.keys()])},getFallbackLangs(s){const a=s||o.getLanguage();return a?Da([a,...Im(a,r.initialOptions.fallbackLanguage)]):[]},getFallbackNs(){return Nt(r.initialOptions.fallbackNs)},getDefaultNs(s){return s===void 0?r.initialOptions.defaultNs:s},getAvailableLanguages(){if(r.initialOptions.availableLanguages)return r.initialOptions.availableLanguages;if(r.initialOptions.staticData){const s=Object.keys(r.initialOptions.staticData).map(a=>wi(a).language);return Array.from(new Set(s))}},withDefaultNs(s){return{namespace:s.namespace===void 0?o.getInitialOptions().defaultNs:s.namespace,language:s.language}},overrideCredentials(s){s?i=Object.assign(Object.assign({},s),{apiUrl:Ad(s.apiUrl)}):i=void 0}});return o}function qm(t){var{ns:e,noWrap:n,orEmpty:r,params:i,language:o}=t,s=Nd(t,["ns","noWrap","orEmpty","params","language"]);return Object.assign(Object.assign({},{ns:e,noWrap:n,orEmpty:r,language:o}),{params:Object.assign({},s)})}const Bd=(t,...e)=>{let n={},r;return typeof t=="object"?n=t:(n.key=t,typeof e[0]=="string"?(n.defaultValue=e[0],r=e[1]):typeof e[0]=="object"&&(r=e[0])),r&&(n=Object.assign(Object.assign({},qm(r)),n)),n};function Km({options:t}){const e=Fm(l,u),n=xu(!1,()=>s.isFetching(),e.onFetchingChange.emit),r=xu(!1,()=>E.isLoading(),e.onLoadingChange.emit),i=Zm(e.onLanguageChange,e.onPendingLanguageChange,e.onRunningChange),o=Gm(i.getLanguage,i.getInitialOptions,i.getAvailableLanguages,f,S,w,h,e),s=Vm(e,o.getBackendRecord,o.getBackendDevRecord,i.withDefaultNs,i.isInitialLoading,n,r);t&&v(t);let a;e.onUpdate.listen(()=>{i.isRunning()&&o.retranslate()});function l(){return i.getFallbackNs()}function u(p){return i.getDefaultNs(p)}function f(p){return[...Nt(u(p)),...l()]}function d(p){return[...Nt(p??u()),...i.getRequiredNamespaces()]}function h(p,b,x){const P=i.withDefaultNs(p),O=s.getTranslation(P,b);return s.changeTranslation(P,b,x),{revert(){s.changeTranslation(P,b,O)}}}function v(p){i.init(p),s.addStaticData(i.getInitialOptions().staticData)}function y(p,b){const x=i.getFallbackLangs(p),P=d(b),O=[];return x.forEach(T=>{P.forEach(M=>{s.exists({language:T,namespace:M},!0)||O.push({language:T,namespace:M})})}),O}function g(p,b){const x=y(p,b);if(x.length)return Zo(E.loadRecords(x),()=>{})}function S({key:p,ns:b}){const x=i.getFallbackLangs(),P=f(b??void 0);return s.getTranslationNs(P,x,p)}function w({key:p,ns:b,language:x}){const P=f(b??void 0),O=i.getFallbackLangs(x);return s.getTranslationFallback(P,O,p)}function L(){const p=Zo(m(),()=>g());if(Ds(p))return i.setInitialLoading(!0),n.notify(),r.notify(),Promise.resolve(p).then(()=>{i.setInitialLoading(!1),n.notify(),r.notify(),e.onInitialLoaded.emit()});e.onInitialLoaded.emit()}function m(){if(i.getLanguage())return;const b=o.getInitialLanguage();return Zo(b,x=>{const P=x||i.getInitialOptions().defaultLanguage;P&&i.setLanguage(P)})}function _(){if((o.getLanguageDetector()||o.getLanguageStorage())&&!i.getAvailableLanguages())throw new Error(wu("availableLanguages"));if(!i.getLanguage()&&!i.getInitialOptions().defaultLanguage)throw new Error(wu(["defaultLanguage","language"]))}const E=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),i),o),s),{init:v,getTranslation:w,changeTranslation:h,getTranslationNs:S,getDefaultAndFallbackNs:f,async changeLanguage(p){i.getPendingLanguage()===p&&i.getLanguage()===p||(i.setPendingLanguage(p),i.isRunning()&&await g(p),p===i.getPendingLanguage()&&(i.setLanguage(p),await o.setStoredLanguage(p)))},async addActiveNs(p,b){b||i.addActiveNs(p),i.isRunning()&&await g(void 0,p)},loadRecords(p){return s.loadRecords(p,E.isDev())},async loadRecord(p){return(await E.loadRecords([p]))[0]},isLoading(p){return s.isLoading(i.getLanguage(),p)},isLoaded(p){const b=i.getLanguage();if(!b)return!1;const x=i.getFallbackLangs(b),P=d(p),O=[];return x.forEach(T=>{P.forEach(M=>{s.exists({language:T,namespace:M})||O.push({language:T,namespace:M})})}),O.length===0},t:(...p)=>{const b=Bd(...p),x=w(b);return o.formatTranslation(Object.assign(Object.assign({},b),{translation:x}))},isDev(){return!!(i.getInitialOptions().apiKey&&i.getInitialOptions().apiUrl)},run(){return _(),i.isRunning()||(i.setRunning(!0),o.run(),a=L()),Promise.resolve(a)},stop(){i.isRunning()&&(o.stop(),i.setRunning(!1))}}));return E}function Qm(t){const e=Km({options:t});e.isDev()&&e.invalidate();function n(i){const o=e.isRunning();o&&e.stop(),i(),e.isDev()&&e.invalidate(),o&&e.run()}const r=Object.freeze({on:e.on,onNsUpdate:e.onUpdate.listenSome,setEmitterActive:e.setEmitterActive,getLanguage:e.getLanguage,getPendingLanguage:e.getPendingLanguage,changeLanguage:e.changeLanguage,changeTranslation:e.changeTranslation,addActiveNs:e.addActiveNs,removeActiveNs:e.removeActiveNs,loadRecords:e.loadRecords,loadRecord:e.loadRecord,addStaticData:e.addStaticData,getRecord:e.getRecord,getAllRecords:e.getAllRecords,isLoaded:e.isLoaded,isInitialLoading:e.isInitialLoading,isLoading:e.isLoading,isFetching:e.isFetching,isRunning:e.isRunning,run:e.run,stop:e.stop,t:e.t,highlight:e.highlight,getInitialOptions:e.getInitialOptions,isDev:e.isDev,wrap:e.wrap,unwrap:e.unwrap,overrideCredentials(i){n(()=>e.overrideCredentials(i))},addPlugin(i){i&&n(()=>e.addPlugin(r,i))},updateOptions(i){i&&n(()=>e.init(i))}});return r}const Jm=()=>{const t={plugins:[],options:{}},e=Object.freeze({use(n){return t.plugins.push(n),e},updateDefaults(n){return t.options=Ia(t.options,n),e},init(n){const r=Qm(Ia(t.options,n));return t.plugins.forEach(r.addPlugin),r}});return e},Fd=0,ja=1,Ym=2;class Xm extends Error{constructor(e,n,r){let i;e===Fd?i="Empty parameter":e===ja?i="Unexpected character":i="Unexpected end",super(`Tolgee parser: ${i} at ${n} in "${r}"`),this.code=e,this.index=n}}function Eu(t){return/\s/.test(t)}const En=0,Na=1,qo=2,Ks=3,Qs=4,e0=new Set([qo,Na,En]),Ba="'",t0=new Set(["{","}",Ba]),n0=t=>/[0-9a-zA-Z_]/.test(t);function r0(t){let e=En,n="",r="",i="";const o=[],s=[];let a=0;function l(h){throw new Xm(h,a,t)}const u=()=>{o.push(n),n=""},f=()=>{n0(i)||l(ja),r+=i},d=()=>{r===""&&l(Fd),s.push(r),r=""};for(a=0;a<t.length;a++)switch(i=t[a],e){case En:i===Ba?(n+=i,e=Na):i==="{"?(u(),e=Ks):(n+=i,e=En);break;case Na:t0.has(i)?(n=n.slice(0,-1)+i,e=qo):(n+=i,e=En);break;case qo:i===Ba?e=En:(n+=i,e=qo);break;case Ks:i==="}"?(d(),e=En):Eu(i)?r!==""&&(d(),e=Qs):(f(),e=Ks);break;case Qs:i=="}"?e=En:Eu(i)?e=Qs:l(ja)}return e0.has(e)||l(Ym),u(),[o,s]}function i0(t,e){const[n,r]=r0(t),i=[n[0]];for(let o=1;o<n.length;o++){const s=e==null?void 0:e[r[o-1]];if(s===void 0)throw new Error(`Missing parameter "${r[o-1]}" in "${t}"`);i.push(String(s)),i.push(n[o])}return i.join("")}function o0(){return{format:({translation:t,params:e})=>i0(t,e)}}const s0=()=>(t,e)=>(e.setFinalFormatter(o0()),t);var Js=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_u={};(function(t){function e(w,L){var m;return w instanceof Buffer?m=w:m=Buffer.from(w.buffer,w.byteOffset,w.byteLength),m.toString(L)}var n=function(w){return Buffer.from(w)};function r(w){for(var L=0,m=Math.min(256*256,w.length+1),_=new Uint16Array(m),E=[],p=0;;){var b=L<w.length;if(!b||p>=m-1){var x=_.subarray(0,p),P=x;if(E.push(String.fromCharCode.apply(null,P)),!b)return E.join("");w=w.subarray(L),L=0,p=0}var O=w[L++];if(!(O&128))_[p++]=O;else if((O&224)===192){var T=w[L++]&63;_[p++]=(O&31)<<6|T}else if((O&240)===224){var T=w[L++]&63,M=w[L++]&63;_[p++]=(O&31)<<12|T<<6|M}else if((O&248)===240){var T=w[L++]&63,M=w[L++]&63,R=w[L++]&63,A=(O&7)<<18|T<<12|M<<6|R;A>65535&&(A-=65536,_[p++]=A>>>10&1023|55296,A=56320|A&1023),_[p++]=A}}}function i(w){for(var L=0,m=w.length,_=0,E=Math.max(32,m+(m>>>1)+7),p=new Uint8Array(E>>>3<<3);L<m;){var b=w.charCodeAt(L++);if(b>=55296&&b<=56319){if(L<m){var x=w.charCodeAt(L);(x&64512)===56320&&(++L,b=((b&1023)<<10)+(x&1023)+65536)}if(b>=55296&&b<=56319)continue}if(_+4>p.length){E+=8,E*=1+L/w.length*2,E=E>>>3<<3;var P=new Uint8Array(E);P.set(p),p=P}if(b&4294967168)if(!(b&4294965248))p[_++]=b>>>6&31|192;else if(!(b&4294901760))p[_++]=b>>>12&15|224,p[_++]=b>>>6&63|128;else if(!(b&4292870144))p[_++]=b>>>18&7|240,p[_++]=b>>>12&63|128,p[_++]=b>>>6&63|128;else continue;else{p[_++]=b;continue}p[_++]=b&63|128}return p.slice?p.slice(0,_):p.subarray(0,_)}var o="Failed to ",s=function(w,L,m){if(w)throw new Error("".concat(o).concat(L,": the '").concat(m,"' option is unsupported."))},a=typeof Buffer=="function"&&Buffer.from,l=a?n:i;function u(){this.encoding="utf-8"}u.prototype.encode=function(w,L){return s(L&&L.stream,"encode","stream"),l(w)};function f(w){var L;try{var m=new Blob([w],{type:"text/plain;charset=UTF-8"});L=URL.createObjectURL(m);var _=new XMLHttpRequest;return _.open("GET",L,!1),_.send(),_.responseText}finally{L&&URL.revokeObjectURL(L)}}var d=!a&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",h=["utf-8","utf8","unicode-1-1-utf-8"],v=r;a?v=e:d&&(v=function(w){try{return f(w)}catch{return r(w)}});var y="construct 'TextDecoder'",g="".concat(o," ").concat(y,": the ");function S(w,L){s(L&&L.fatal,y,"fatal"),w=w||"utf-8";var m;if(a?m=Buffer.isEncoding(w):m=h.indexOf(w.toLowerCase())!==-1,!m)throw new RangeError("".concat(g," encoding label provided ('").concat(w,"') is invalid."));this.encoding=w,this.fatal=!1,this.ignoreBOM=!1}S.prototype.decode=function(w,L){s(L&&L.stream,"decode","stream");var m;return w instanceof Uint8Array?m=w:w.buffer instanceof ArrayBuffer?m=new Uint8Array(w.buffer):m=new Uint8Array(w),v(m,this.encoding)},t.TextEncoder=t.TextEncoder||u,t.TextDecoder=t.TextDecoder||S})(typeof window<"u"?window:Js);var a0=Dm({__proto__:null,default:_u},[_u]),Ys;(Ys=console.assert)===null||Ys===void 0||Ys.call(console,a0);const l0="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function u0(t){const e=l0.indexOf(t);if(e===-1)throw new Error("Invalid character found: "+t);return e}function c0(t){const e=new Uint8Array(t),n=e.length;let r="",i=Math.pow(2,16)-1;for(let o=0;o<n;o+=i)o+i>n&&(i=n-o),r+=String.fromCharCode.apply(null,e.subarray(o,o+i));return r}function f0(t){t=t.toUpperCase();const e=t.length;let n=0,r=0,i=0;const o=new Uint8Array(e*5/8|0);for(let s=0;s<e;s++)r=r<<5|u0(t[s]),n+=5,n>=8&&(o[i++]=r>>>n-8&255,n-=8);return c0(o.buffer)}function d0(t){if(t)try{const[e,n]=t.split("_");if(e==="tgpak"){const[r]=f0(n).split("_");return Number(r)}}catch{console.warn("Tolgee: Api key can't be parsed")}}function h0(t){if(!t)return;const[e]=t.split("_");return e==="tgpak"?"tgpak":e==="tgpat"?"tgpat":"legacy"}function p0(){return{getRecord({apiUrl:t,apiKey:e,language:n,namespace:r,projectId:i,fetch:o}){var s;const a=(s=d0(e))!==null&&s!==void 0?s:i;let l=a!==void 0?`${t}/v2/projects/${a}/translations/${n}`:`${t}/v2/projects/translations/${n}`;if(r&&(l+=`?ns=${r}`),h0(e)==="tgpat"&&i===void 0)throw new Error("You need to specify 'projectId' when using PAT key");return o(l,{headers:{"X-API-Key":e||"","Content-Type":"application/json"}}).then(u=>{if(u.ok)return u.json().then(f=>f[n]);throw new Error(u.statusText)})}}}const g0=()=>(t,e)=>(e.setDevBackend(p0()),t);function v0(t,e){const n=r=>{var i,o;t.includes((i=r.data)===null||i===void 0?void 0:i.type)&&e((o=r.data)===null||o===void 0?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}function m0({message:t,recievingMessage:e,data:n,attempts:r=1,timeout:i=300}){let o=!1;const s=()=>new Promise((l,u)=>{const f=v0(e,h);window.postMessage({type:t,data:n},window.origin);const d=setTimeout(y,i);function h(g){clearTimeout(d),v(),l(g)}function v(){f.unsubscribe()}function y(){v(),u()}});return{cancel(){o=!0},promise:(async()=>{for(let l=0;l<r;l++){if(o)return new Promise(()=>{});try{return await s()}catch{continue}}if(!o)throw`Didn't recieve ${e.join(" or ")} in time.`;return new Promise(()=>{})})()}}function y0(){let t;async function e(n){t==null||t();const{cancel:r,promise:i}=m0({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:n,attempts:4});return t=r,i}return{update:e}}const b0="tolgee-in-context-tools.umd.min.js",w0="@tolgee/in-context-tools",C0="InContextTools",S0="https://cdn.jsdelivr.net/npm";function L0(t){return new Promise((e,n)=>{const r=document.createElement("script");r.src=t,r.addEventListener("load",()=>e()),r.addEventListener("error",i=>n(i.error)),document.head.appendChild(r)})}let Xs=null;function x0(t){return Xs||(Xs=L0(`${S0}/@tolgee/web@${t}/dist/${b0}`).then(()=>window[w0][C0])),Xs}const Ud="__tolgee_apiKey",Vd="__tolgee_apiUrl";function Mu(){const t=sessionStorage.getItem(Ud)||void 0,e=sessionStorage.getItem(Vd)||void 0;if(!(!t||!e))return{apiKey:t,apiUrl:e}}function E0(){sessionStorage.removeItem(Ud),sessionStorage.removeItem(Vd)}function _0(t){document.readyState!=="loading"?Promise.resolve().then(()=>{t()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",t)}let zd=()=>t=>t;const M0=()=>{if(typeof window>"u")return!1;try{return typeof sessionStorage<"u"&&sessionStorage}catch(t){return console.error("sessionStorage not available",t),!1}};M0()&&(zd=()=>t=>{const e=y0(),n=()=>({uiPresent:!0,uiVersion:void 0,mode:t.isDev()?"development":"production",config:{apiUrl:t.getInitialOptions().apiUrl||"",apiKey:t.getInitialOptions().apiKey||""}}),r=async()=>{const o=await x0("5.22.0");return s=>{const a=Mu();return s.addPlugin(o({credentials:a})),s}};return t.on("running",({value:o})=>{o&&_0(()=>{e.update(n()).catch(E0)})}),Mu()&&r().then(o=>{t.addPlugin(o)}).catch(o=>{console.error("Tolgee: Failed to load in-context tools"),console.error(o)}),t});function O0(){return Jm().use(zd())}const P0={useSuspense:!0};let ea;const Hd=()=>(ea||(ea=c.createContext(void 0)),ea),k0=({tolgee:t,options:e,children:n,fallback:r})=>{const[i,o]=c.useState(!t.isLoaded());c.useEffect(()=>{t.run().catch(l=>{console.error(l)}).finally(()=>{o(!1)})},[t]);const s=Object.assign(Object.assign({},P0),e),a=Hd();return s.useSuspense?c.createElement(a.Provider,{value:{tolgee:t,options:s}},i?r:c.createElement(c.Suspense,{fallback:r||null},n)):c.createElement(a.Provider,{value:{tolgee:t,options:s}},i?r:n)};let T0;function R0(){return T0}const D0=()=>{const t=Hd(),e=c.useContext(t)||R0();if(!e)throw new Error("Couldn't find tolgee instance, did you forgot to use `TolgeeProvider`?");return e},A0=()=>{const[t,e]=c.useState(0),n=c.useCallback(()=>{e(r=>r+1)},[e]);return{instance:t,rerender:n}},$d=(t,e)=>{const{tolgee:n,options:r}=D0(),i=Dd(t),o=Nt(i).join(":"),s=Object.assign(Object.assign({},r),e),{rerender:a,instance:l}=A0(),u=c.useRef(),f=c.useRef([]);f.current=[];const d=y=>{var g;f.current.push(y),(g=u.current)===null||g===void 0||g.subscribeNs(y)},h=n.isLoaded(i);c.useEffect(()=>{const y=n.onNsUpdate(a);return u.current=y,y.subscribeNs(i),f.current.forEach(g=>{y.subscribeNs(g)}),()=>{y.unsubscribe()}},[o,n]),c.useEffect(()=>(n.addActiveNs(i),()=>n.removeActiveNs(i)),[o,n]);const v=c.useCallback(y=>{var g;const S=(g=y.ns)!==null&&g!==void 0?g:i==null?void 0:i[0];return d(S),n.t(Object.assign(Object.assign({},y),{ns:S}))},[n,l]);if(s.useSuspense&&!h)throw n.addActiveNs(i,!0);return{t:v,isLoading:!h}},Kt=(t,e)=>{const{t:n,isLoading:r}=$d(t,e);return{t:c.useCallback((...o)=>{const s=Bd(...o);return n(s)},[n]),isLoading:r}},I0=t=>{if(!t)return;const e={};return Object.entries(t||{}).forEach(([n,r])=>{if(typeof r=="function")e[n]=i=>r(Fa(i));else if(c.isValidElement(r)){const i=r;e[n]=o=>i.props.children===void 0&&(o!=null&&o.length)?c.cloneElement(i,{},Fa(o)):c.cloneElement(i)}else e[n]=r}),e},Fa=t=>Array.isArray(t)?c.Children.toArray(t):t,j0=t=>{const e=t.keyName||t.children;e===void 0&&console.error("T component: keyName not defined");const n=t.defaultValue||(t.keyName?t.children:void 0),r=Fa(t.t({key:e,params:I0(t.params),defaultValue:n,noWrap:t.noWrap,ns:t.ns,language:t.language}));return c.createElement(c.Fragment,null,r)},mn=t=>{const{t:e}=$d();return c.createElement(j0,Object.assign({t:e},t))},N0="Spinner-module__loader__U4GVhD",B0={loader:N0},ls=({className:t})=>C.jsx("div",{className:ge(B0.loader,t),children:"Loading..."}),F0="Button-module__root__8RX49h",U0="Button-module__primary__st6yY9",V0="Button-module__secondary__j-3rjz",z0="Button-module__loading__QfItr2",H0="Button-module__spinner__kVZYqS",fi={root:F0,primary:U0,secondary:V0,loading:z0,spinner:H0},Ft=({children:t,className:e,loading:n,variant:r="primary",...i})=>{const o=[fi.root,e,fi[r],{[fi.loading]:n}];if(i.as==="link"){const{as:s,disabled:a,...l}=i;return C.jsxs("a",{className:ge(o),...l,"data-disabled":a,children:[!n&&t,n&&C.jsx(ls,{className:fi.spinner})]})}if(i.as==="button"){const{as:s,...a}=i;return C.jsxs("button",{type:"button",className:ge(o),...a,children:[!n&&t,n&&C.jsx(ls,{className:fi.spinner})]})}sn(!1,"Invalid button type")};Ft.defaultProps={as:"button"};const $0=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},U.createElement("g",{clipPath:"url(#a)"},U.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M17.071 3.071a1.25 1.25 0 0 0-1.768 0L10 8.375 4.697 3.07a1.25 1.25 0 1 0-1.768 1.77l5.303 5.303-5.303 5.303a1.25 1.25 0 0 0 1.768 1.768L10 11.91l5.303 5.303a1.25 1.25 0 1 0 1.768-1.768l-5.303-5.303L17.07 4.84a1.25 1.25 0 0 0 0-1.768Z",clipRule:"evenodd"})),U.createElement("defs",null,U.createElement("clipPath",{id:"a"},U.createElement("path",{fill:"#fff",d:"M0 0h20v20H0z"})))),W0="CloseButton-module__root__2m1asd",G0="CloseButton-module__absolutePositionVariant__lGX4cQ",Z0="CloseButton-module__relativePositionVariant__LqTTWf",Ou={root:W0,absolutePositionVariant:G0,relativePositionVariant:Z0},ni=({className:t,position:e="absolute",...n})=>C.jsx("div",{...n,className:ge(Ou.root,t,Ou[`${e}PositionVariant`]),children:C.jsx($0,{})}),q0=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:13,height:12,viewBox:"0 0 13 12",fill:"none",...t},U.createElement("path",{d:"M6.04102 1.125C5.07683 1.125 4.1343 1.41091 3.33261 1.94659C2.53092 2.48226 1.90608 3.24363 1.53711 4.13442C1.16813 5.02521 1.07159 6.00541 1.25969 6.95107C1.44779 7.89672 1.91209 8.76536 2.59387 9.44715C3.27565 10.1289 4.1443 10.5932 5.08995 10.7813C6.03561 10.9694 7.01581 10.8729 7.9066 10.5039C8.79739 10.1349 9.55876 9.51009 10.0944 8.7084C10.6301 7.90671 10.916 6.96418 10.916 6C10.9147 4.70749 10.4006 3.46831 9.48666 2.55436C8.57271 1.64042 7.33353 1.12636 6.04102 1.125ZM6.04102 10.125C5.22517 10.125 4.42764 9.88307 3.74929 9.42981C3.07094 8.97655 2.54223 8.33231 2.23001 7.57857C1.9178 6.82482 1.83611 5.99542 1.99528 5.19525C2.15444 4.39508 2.54731 3.66008 3.1242 3.08318C3.70109 2.50629 4.4361 2.11342 5.23627 1.95426C6.03644 1.7951 6.86584 1.87679 7.61959 2.189C8.37333 2.50121 9.01757 3.02992 9.47083 3.70827C9.92409 4.38663 10.166 5.18415 10.166 6C10.1648 7.09364 9.72978 8.14213 8.95646 8.91545C8.18314 9.68876 7.13465 10.1238 6.04102 10.125ZM6.79102 8.25C6.79102 8.34946 6.75151 8.44484 6.68118 8.51517C6.61086 8.58549 6.51547 8.625 6.41602 8.625C6.21711 8.625 6.02634 8.54598 5.88569 8.40533C5.74504 8.26468 5.66602 8.07391 5.66602 7.875V6C5.56656 6 5.47118 5.96049 5.40085 5.89016C5.33053 5.81984 5.29102 5.72446 5.29102 5.625C5.29102 5.52554 5.33053 5.43016 5.40085 5.35984C5.47118 5.28951 5.56656 5.25 5.66602 5.25C5.86493 5.25 6.0557 5.32902 6.19635 5.46967C6.337 5.61032 6.41602 5.80109 6.41602 6V7.875C6.51547 7.875 6.61086 7.91451 6.68118 7.98483C6.75151 8.05516 6.79102 8.15054 6.79102 8.25ZM5.29102 3.9375C5.29102 3.82625 5.32401 3.71749 5.38582 3.62499C5.44762 3.53249 5.53547 3.46039 5.63826 3.41782C5.74104 3.37524 5.85414 3.3641 5.96326 3.38581C6.07237 3.40751 6.1726 3.46109 6.25127 3.53975C6.32993 3.61842 6.38351 3.71865 6.40521 3.82776C6.42691 3.93688 6.41577 4.04998 6.3732 4.15276C6.33063 4.25554 6.25853 4.34339 6.16603 4.4052C6.07352 4.46701 5.96477 4.5 5.85352 4.5C5.70433 4.5 5.56126 4.44074 5.45577 4.33525C5.35028 4.22976 5.29102 4.08668 5.29102 3.9375Z",fill:"black"})),K0="W3WLink-module__likeButton__RhAlpN",Q0="W3WLink-module__title__eo6M7L",Pu={likeButton:K0,title:Q0},J0=()=>C.jsxs("a",{className:Pu.likeButton,title:"about what3words",href:"https://what3words.com/about",target:"_blank",rel:"noreferrer",children:[C.jsx("span",{className:Pu.title,children:"what3words"}),C.jsx(q0,{})]}),Y0=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...t},U.createElement("path",{d:"M10 1.25C8.17727 1.25207 6.42979 1.97706 5.14092 3.26592C3.85206 4.55479 3.12707 6.30227 3.125 8.125C3.125 14.0078 9.375 18.4508 9.64141 18.6367C9.74649 18.7103 9.87169 18.7498 10 18.7498C10.1283 18.7498 10.2535 18.7103 10.3586 18.6367C10.625 18.4508 16.875 14.0078 16.875 8.125C16.8729 6.30227 16.1479 4.55479 14.8591 3.26592C13.5702 1.97706 11.8227 1.25207 10 1.25ZM10 5.625C10.4945 5.625 10.9778 5.77162 11.3889 6.04633C11.8 6.32103 12.1205 6.71148 12.3097 7.16829C12.4989 7.62511 12.5484 8.12777 12.452 8.61273C12.3555 9.09768 12.1174 9.54314 11.7678 9.89277C11.4181 10.2424 10.9727 10.4805 10.4877 10.577C10.0028 10.6734 9.50011 10.6239 9.04329 10.4347C8.58648 10.2455 8.19603 9.92505 7.92133 9.51393C7.64662 9.1028 7.5 8.61945 7.5 8.125C7.5 7.46196 7.76339 6.82607 8.23223 6.35723C8.70107 5.88839 9.33696 5.625 10 5.625Z",fill:"black"})),X0=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...t},U.createElement("path",{d:"M20 0H0V20H20V0Z",fill:"black"}),U.createElement("path",{d:"M8.79664 14.3751C8.69766 14.3749 8.60012 14.3513 8.51204 14.3061C8.42396 14.261 8.34785 14.1956 8.28997 14.1153C8.2321 14.0349 8.1941 13.9421 8.1791 13.8442C8.1641 13.7464 8.17253 13.6464 8.2037 13.5524L10.7037 6.05231C10.7561 5.89505 10.8689 5.76506 11.0172 5.69095C11.1655 5.61683 11.3371 5.60466 11.4944 5.65711C11.6517 5.70956 11.7817 5.82233 11.8558 5.97061C11.9299 6.1189 11.9421 6.29055 11.8896 6.44782L9.38961 13.9479C9.34809 14.0723 9.26848 14.1805 9.16206 14.2572C9.05564 14.3338 8.9278 14.3751 8.79664 14.3751Z",fill:"white"}),U.createElement("path",{d:"M5.04666 14.3751C4.94767 14.3749 4.85013 14.3513 4.76205 14.3061C4.67397 14.261 4.59787 14.1955 4.53999 14.1152C4.48211 14.0349 4.4441 13.942 4.4291 13.8442C4.4141 13.7464 4.42253 13.6464 4.45369 13.5524L6.95369 6.05229C7.00645 5.89542 7.11927 5.76587 7.26741 5.69206C7.41554 5.61825 7.58691 5.60621 7.74391 5.65857C7.90092 5.71093 8.03075 5.82343 8.10493 5.97138C8.17911 6.11933 8.19159 6.29066 8.13962 6.4478L5.6396 13.9479C5.59808 14.0723 5.51848 14.1805 5.41206 14.2571C5.30565 14.3338 5.17781 14.3751 5.04666 14.3751Z",fill:"white"}),U.createElement("path",{d:"M12.5467 14.3751C12.4477 14.3749 12.3501 14.3513 12.2621 14.3061C12.174 14.261 12.0979 14.1955 12.04 14.1152C11.9821 14.0349 11.9441 13.942 11.9291 13.8442C11.9141 13.7464 11.9225 13.6464 11.9537 13.5524L14.4537 6.05229C14.5064 5.89542 14.6193 5.76587 14.7674 5.69206C14.9155 5.61825 15.0869 5.60621 15.2439 5.65857C15.4009 5.71093 15.5308 5.82343 15.6049 5.97138C15.6791 6.11933 15.6916 6.29066 15.6396 6.4478L13.1396 13.9479C13.0981 14.0723 13.0185 14.1805 12.9121 14.2571C12.8057 14.3338 12.6778 14.3751 12.5467 14.3751Z",fill:"white"})),ey="W3WLink-module__mainWrapper__BeGCpA",ty="W3WLink-module__link__yq50q-",ku={mainWrapper:ey,link:ty},Wd=({what3words:t})=>{const{id:e,link:n}=t;return C.jsxs("div",{className:ku.mainWrapper,children:[C.jsx(X0,{}),C.jsx("a",{className:ku.link,href:n,title:"w3w link",target:"_blank",rel:"noreferrer",children:e}),C.jsx(Y0,{})]})},Tu={day:"",statusValue:"No data",isAvailable:!1,closes:""};function ny(t){const[e,n]=c.useState({...Tu,workSchedule:[]}),{t:r}=Kt(["details_modal","common"]),i={1:r("monday"),2:r("tuesday"),3:r("wednesday"),4:r("thursday"),5:r("friday"),6:r("saturday"),7:r("sunday")};return c.useEffect(()=>{function o(a){var h;const l=new Date(Date.now()),u=l.getDay()||7,f=l.toLocaleTimeString("en-GB"),d=(h=a.find(({dayNumber:v})=>v===u))==null?void 0:h.time;if(d){const v=d.split("-"),y=v[v.length-1],S=d.split(", ").some(w=>{const[L,m]=w.split("-");return m.trim()<L.trim()?f>=L||f<m:f>=L&&f<m});return{day:i[u],statusValue:r(S?"open":"close"),isAvailable:S,closes:y}}return{...Tu,statusValue:r("close")}}const s=function(){if(t)return Object.entries(t).reduce((l,[u,f])=>{if(f==null?void 0:f.length){const h=+u,v=f.join(", "),y={dayNumber:h,dayName:i[h],time:v};l.push(y)}return l},[])}();s!=null&&s.length&&n({...o(s),workSchedule:s})},[t]),e}const ry="LocationView-module__title__-wT0bl",iy="LocationView-module__logo__jDjNMt",oy="LocationView-module__header__K0gBYX",sy="LocationView-module__content__wtOPjm",ay="LocationView-module__sectionTitle__cNIgnC",ly="LocationView-module__scheduleContainer__Qbb9sE",uy="LocationView-module__workStatus__9yJNqr",cy="LocationView-module__scheduleButton__RQPquM",fy="LocationView-module__scheduleList__lPVLXP",dy="LocationView-module__scheduleListItem__gcCPSg",hy="LocationView-module__svgWrapper__zKM438",py="LocationView-module__section__2J1zAJ",gy="LocationView-module__w3wSection__PdU7j4",vy="LocationView-module__chips__ALwJDx",my="LocationView-module__services__IgJ4ba",yy="LocationView-module__images__-wKmRM",by="LocationView-module__image__T1E-gt",wy="LocationView-module__actions__NuafMj",Cy="LocationView-module__actionsHidden__-vX5kK",Sy="LocationView-module__submit__c-Hc8u",Ly="LocationView-module__scheduleItem__RhAgat",qe={title:ry,logo:iy,header:oy,content:sy,sectionTitle:ay,scheduleContainer:ly,workStatus:uy,scheduleButton:cy,scheduleList:fy,scheduleListItem:dy,svgWrapper:hy,section:py,w3wSection:gy,chips:vy,services:my,images:yy,image:by,actions:wy,actionsHidden:Cy,submit:Sy,scheduleItem:Ly},xy={default:Td,llama:Rd},Ey=({classes:t,hideActions:e,location:n,onClose:r,onSubmit:i})=>{var m,_,E;const[o,s]=c.useState(!1),{t:a}=Kt(["details_modal","common"]),{isLoading:l,lmsData:u}=Rs(),{closes:f,isAvailable:d,statusValue:h,workSchedule:v}=ny(n.timetable),y=(m=u==null?void 0:u.location)==null?void 0:m.what3words,g=!!(y!=null&&y.id),{logo:S="default"}=Ze(),w=xy[S];function L(){s(p=>!p)}return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:ge(qe.header,t==null?void 0:t.header),children:[C.jsx(ni,{onClick:r}),C.jsxs("div",{className:qe.title,children:[C.jsx("div",{className:qe.logo,children:C.jsx(w,{})}),C.jsx("span",{children:n.name})]})]}),C.jsxs("div",{className:ge(qe.content,t==null?void 0:t.content),children:[C.jsxs("section",{className:qe.section,children:[C.jsxs("span",{children:[a("address"),":"]}),l?C.jsx(kt,{width:200}):C.jsx("p",{children:(_=n.location)==null?void 0:_.full_address})]}),l?C.jsx(kt,{}):g&&C.jsxs("section",{className:qe.w3wSection,children:[C.jsx(Wd,{what3words:y}),C.jsx(J0,{})]}),C.jsxs("div",{className:qe.scheduleContainer,children:[C.jsxs("span",{className:qe.sectionTitle,children:[a("schedule"),":"]}),C.jsxs("button",{type:"button","aria-label":"open schedule",className:qe.scheduleButton,onClick:L,children:[C.jsx("span",{className:qe.workStatus,"data-available":d,children:h}),f&&C.jsxs("span",{children:[a("closes")," ",f]}),C.jsx("span",{className:qe.svgWrapper,"data-open":o,children:C.jsx(Rm,{})})]}),C.jsx("ul",{className:qe.scheduleList,"data-open":o,children:v.map(({dayName:p,time:b})=>{const P=!b?a("weekend"):b;return C.jsxs("li",{className:qe.scheduleListItem,children:[C.jsxs("span",{children:[p,":"]}),C.jsx("span",{children:P})]},p)})})]}),(n.pay_by_card||n.pay_by_card)&&C.jsxs("section",{className:qe.section,children:[C.jsxs("span",{children:[a("payment_method"),":"]}),l?C.jsx(kt,{width:300}):C.jsxs("div",{className:qe.chips,children:[n.pay_by_cash&&a("pay_by_cash"),n.pay_by_card&&n.pay_by_cash&&", ",n.pay_by_card&&a("pay_by_card")]})]}),C.jsxs("section",{className:qe.section,children:[C.jsxs("span",{children:[a("services"),":"]}),C.jsxs("div",{className:qe.services,children:[n.is_pickup&&(l?C.jsx(kt,{width:150}):C.jsx("p",{children:a("is_pickup")})),n.is_delivery&&(l?C.jsx(kt,{width:150}):C.jsx("p",{children:a("is_delivery")})),n.is_dressing_room&&(l?C.jsx(kt,{width:150}):C.jsx("p",{children:a("is_dressing_room")})),n.is_check_order&&(l?C.jsx(kt,{width:150}):C.jsx("p",{children:a("is_check_order")}))]})]}),C.jsxs("section",{className:qe.section,children:[C.jsxs("span",{children:[a("location"),":"]}),l?C.jsx(kt,{width:100}):C.jsx("p",{children:n.location_name})]}),((E=n.images)==null?void 0:E.length)>0&&C.jsx("section",{className:qe.images,children:n.images.map(p=>C.jsx("img",{src:p,alt:n.name,className:qe.image},p))})]}),C.jsx("div",{className:ge(qe.actions,{[qe.actionsHidden]:e}),children:C.jsx(Ft,{variant:"primary",className:qe.submit,disabled:l,onClick:i,children:a("choose",{ns:"common"})})})]})},Gd=c.memo(Ey),Al=({isSelectedPoint:t})=>{const e=pe(xl),[n,r]=c.useState(!0);return c.useEffect(()=>{r(t?!e:!0)},[e,t]),n};var _y=My()?c.useLayoutEffect:c.useEffect;function My(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Oy(){var t=c.useState(Object.create(null)),e=t[1];return c.useCallback(function(){e(Object.create(null))},[])}var Py=function(e){var n=e.children,r=e.type,i=r===void 0?"reach-portal":r,o=c.useRef(null),s=c.useRef(null),a=Oy();return _y(function(){if(o.current){var l=o.current.ownerDocument;return s.current=l==null?void 0:l.createElement(i),l.body.appendChild(s.current),a(),function(){s.current&&s.current.ownerDocument&&s.current.ownerDocument.body.removeChild(s.current)}}},[i,a]),s.current?ei.createPortal(n,s.current):c.createElement("span",{ref:o})};/*! *****************************************************************************
27
+ */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)e.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(Zf);var Km=Zf.exports;const K=ds(Km),Qm={lmsData:null,isLoading:!1},bs=Ut()(t=>({...Qm,setLMSData:e=>t({lmsData:e}),setLoading:e=>t({isLoading:e})}));var Jm=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const Kf=ds(Jm);function At(){return At=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},At.apply(null,arguments)}function Dn(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Xm(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ym(t){var e=Xm(t,"string");return typeof e=="symbol"?e:e+""}const Ht={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED",FAILED:"FAILED",AUTH_FAILURE:"AUTH_FAILURE"},eg="https://maps.googleapis.com/maps/api/js";class mi{static async load(e,n){var r;const i=e.libraries?e.libraries.split(","):[],o=this.serializeParams(e);this.listeners.push(n),(r=window.google)!=null&&(r=r.maps)!=null&&r.importLibrary?(this.serializedApiParams||(this.loadingStatus=Ht.LOADED),this.notifyLoadingStatusListeners()):(this.serializedApiParams=o,this.initImportLibrary(e)),this.serializedApiParams&&this.serializedApiParams!==o&&console.warn("[google-maps-api-loader] The maps API has already been loaded with different parameters and will not be loaded again. Refresh the page for new values to have effect.");const s=["maps",...i];await Promise.all(s.map(a=>google.maps.importLibrary(a)))}static serializeParams(e){return[e.v,e.key,e.language,e.region,e.authReferrerPolicy,e.solutionChannel].join("/")}static initImportLibrary(e){if(window.google||(window.google={}),window.google.maps||(window.google.maps={}),window.google.maps.importLibrary){console.error("[google-maps-api-loader-internal]: initImportLibrary must only be called once");return}let n=null;const r=()=>n||(n=new Promise((i,o)=>{var s;const a=document.createElement("script"),c=new URLSearchParams;for(const[l,u]of Object.entries(e)){const f=l.replace(/[A-Z]/g,d=>"_"+d[0].toLowerCase());c.set(f,String(u))}c.set("loading","async"),c.set("callback","__googleMapsCallback__"),a.async=!0,a.src=eg+"?"+c.toString(),a.nonce=((s=document.querySelector("script[nonce]"))==null?void 0:s.nonce)||"",a.onerror=()=>{this.loadingStatus=Ht.FAILED,this.notifyLoadingStatusListeners(),o(new Error("The Google Maps JavaScript API could not load."))},window.__googleMapsCallback__=()=>{this.loadingStatus=Ht.LOADED,this.notifyLoadingStatusListeners(),i()},window.gm_authFailure=()=>{this.loadingStatus=Ht.AUTH_FAILURE,this.notifyLoadingStatusListeners()},this.loadingStatus=Ht.LOADING,this.notifyLoadingStatusListeners(),document.head.append(a)}),n);google.maps.importLibrary=i=>r().then(()=>google.maps.importLibrary(i))}static notifyLoadingStatusListeners(){for(const e of this.listeners)e(this.loadingStatus)}}mi.loadingStatus=Ht.NOT_LOADED;mi.serializedApiParams=void 0;mi.listeners=[];const tg=["onLoad","onError","apiKey","version","libraries"],ng=["children"],rg="GMP_visgl_rgmlibrary_v1_default",ji=p.createContext(null);function ig(){const[t,e]=p.useState({});return{mapInstances:t,addMapInstance:(o,s="default")=>{e(a=>At({},a,{[s]:o}))},removeMapInstance:(o="default")=>{e(s=>Dn(s,[o].map(Ym)))},clearMapInstances:()=>{e({})}}}function og(t){const{onLoad:e,onError:n,apiKey:r,version:i,libraries:o=[]}=t,s=Dn(t,tg),[a,c]=p.useState(mi.loadingStatus),[l,u]=p.useReducer((m,h)=>m[h.name]?m:At({},m,{[h.name]:h.value}),{}),f=p.useMemo(()=>o==null?void 0:o.join(","),[o]),d=p.useMemo(()=>JSON.stringify(At({apiKey:r,version:i},s)),[r,i,s]),y=p.useCallback(async m=>{var h;if(l[m])return l[m];if(!((h=google)!=null&&(h=h.maps)!=null&&h.importLibrary))throw new Error("[api-provider-internal] importLibrary was called before google.maps.importLibrary was defined.");const _=await window.google.maps.importLibrary(m);return u({name:m,value:_}),_},[l]);return p.useEffect(()=>{(async()=>{try{const m=At({key:r},s);i&&(m.v=i),(f==null?void 0:f.length)>0&&(m.libraries=f),(m.channel===void 0||m.channel<0||m.channel>999)&&delete m.channel,m.solutionChannel===void 0?m.solutionChannel=rg:m.solutionChannel===""&&delete m.solutionChannel,await mi.load(m,h=>c(h));for(const h of["core","maps",...o])await y(h);e&&e()}catch(m){n?n(m):console.error("<ApiProvider> failed to load the Google Maps JavaScript API",m)}})()},[r,f,d]),{status:a,loadedLibraries:l,importLibrary:y}}const sg=t=>{const{children:e}=t,n=Dn(t,ng),{mapInstances:r,addMapInstance:i,removeMapInstance:o,clearMapInstances:s}=ig(),{status:a,loadedLibraries:c,importLibrary:l}=og(n),u=p.useMemo(()=>({mapInstances:r,addMapInstance:i,removeMapInstance:o,clearMapInstances:s,status:a,loadedLibraries:c,importLibrary:l}),[r,i,o,s,a,c,l]);return p.createElement(ji.Provider,{value:u},e)};function ag(t,e){for(const n of fg){const r=e[n],i=Qf[n];p.useEffect(()=>{if(!t||!r)return;const o=google.maps.event.addListener(t,i,s=>{r(cg(i,t,s))});return()=>o.remove()},[t,i,r])}}function cg(t,e,n){const r={type:t,map:e,detail:{},stoppable:!1,stop:()=>{}};if(lg.includes(t)){const o=r,s=e.getCenter(),a=e.getZoom(),c=e.getHeading()||0,l=e.getTilt()||0,u=e.getBounds();return(!s||!u||!Number.isFinite(a))&&console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),o.detail={center:(s==null?void 0:s.toJSON())||{lat:0,lng:0},zoom:a||0,heading:c,tilt:l,bounds:(u==null?void 0:u.toJSON())||{north:90,east:180,south:-90,west:-180}},o}else if(ug.includes(t)){var i;if(!n)throw new Error("[createEvent] mouse events must provide a srcEvent");const o=r;return o.domEvent=n.domEvent,o.stoppable=!0,o.stop=()=>n.stop(),o.detail={latLng:((i=n.latLng)==null?void 0:i.toJSON())||null,placeId:n.placeId},o}return r}const Qf={onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onContextmenu:"contextmenu",onDblclick:"dblclick",onDrag:"drag",onDragend:"dragend",onDragstart:"dragstart",onHeadingChanged:"heading_changed",onIdle:"idle",onIsFractionalZoomEnabledChanged:"isfractionalzoomenabled_changed",onMapCapabilitiesChanged:"mapcapabilities_changed",onMapTypeIdChanged:"maptypeid_changed",onMousemove:"mousemove",onMouseout:"mouseout",onMouseover:"mouseover",onProjectionChanged:"projection_changed",onRenderingTypeChanged:"renderingtype_changed",onTilesLoaded:"tilesloaded",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed",onCameraChanged:"bounds_changed"},lg=["bounds_changed","center_changed","heading_changed","tilt_changed","zoom_changed"],ug=["click","contextmenu","dblclick","mousemove","mouseout","mouseover"],fg=Object.keys(Qf);function Jf(t,e){const n=p.useRef(t);return e(t,n.current)||(n.current=t),n.current}function dg(t,e,n){p.useEffect(t,[Jf(e,n)])}function hg(t,e){dg(t,e,Kf)}const pg=new Set(["backgroundColor","clickableIcons","controlSize","disableDefaultUI","disableDoubleClickZoom","draggable","draggableCursor","draggingCursor","fullscreenControl","fullscreenControlOptions","gestureHandling","headingInteractionEnabled","isFractionalZoomEnabled","keyboardShortcuts","mapTypeControl","mapTypeControlOptions","mapTypeId","maxZoom","minZoom","noClear","panControl","panControlOptions","restriction","rotateControl","rotateControlOptions","scaleControl","scaleControlOptions","scrollwheel","streetView","streetViewControl","streetViewControlOptions","styles","tiltInteractionEnabled","zoomControl","zoomControlOptions"]);function mg(t,e){const n={},r=Object.keys(e);for(const i of r)pg.has(i)&&(n[i]=e[i]);hg(()=>{t&&t.setOptions(n)},[n])}function Xf(){var t;return((t=p.useContext(ji))==null?void 0:t.status)||Ht.NOT_LOADED}function gg(t,e){const{viewport:n,viewState:r}=e,i=!!n;return p.useLayoutEffect(()=>{if(!t||!r)return;const{latitude:o,longitude:s,bearing:a,pitch:c,zoom:l}=r;t.moveCamera({center:{lat:o,lng:s},heading:a,tilt:c,zoom:l+1})},[t,r]),i}function vg(t){return!t||typeof t!="object"||!("lat"in t&&"lng"in t)?!1:Number.isFinite(t.lat)&&Number.isFinite(t.lng)}function Yf(t){return vg(t)?t:t.toJSON()}function yg(t,e,n){const r=n.center?Yf(n.center):null;let i=null,o=null;r&&Number.isFinite(r.lat)&&Number.isFinite(r.lng)&&(i=r.lat,o=r.lng);const s=Number.isFinite(n.zoom)?n.zoom:null,a=Number.isFinite(n.heading)?n.heading:null,c=Number.isFinite(n.tilt)?n.tilt:null;p.useLayoutEffect(()=>{if(!t)return;const l={};let u=!1;i!==null&&o!==null&&(e.current.center.lat!==i||e.current.center.lng!==o)&&(l.center={lat:i,lng:o},u=!0),s!==null&&e.current.zoom!==s&&(l.zoom=s,u=!0),a!==null&&e.current.heading!==a&&(l.heading=a,u=!0),c!==null&&e.current.tilt!==c&&(l.tilt=c,u=!0),u&&t.moveCamera(l)})}const bg=()=>{const t={position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:999,display:"flex",flexFlow:"column nowrap",textAlign:"center",justifyContent:"center",fontSize:".8rem",color:"rgba(0,0,0,0.6)",background:"#dddddd",padding:"1rem 1.5rem"};return p.createElement("div",{style:t},p.createElement("h2",null,"Error: AuthFailure"),p.createElement("p",null,"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ",p.createElement("code",null,"APIProvider.apiKey")," prop is correct. Check the error-message in the console for further details."))};function wg(){const[t,e]=p.useState(null),n=p.useCallback(r=>e(r),[e]);return[t,n]}function ed(){return Xf()===Ht.LOADED}function _g(){const[,t]=p.useReducer(e=>e+1,0);return t}function Sg(t,e){const n=t.getCenter(),r=t.getZoom(),i=t.getHeading()||0,o=t.getTilt()||0,s=t.getBounds();(!n||!s||!Number.isFinite(r))&&console.warn("[useTrackedCameraState] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),Object.assign(e.current,{center:(n==null?void 0:n.toJSON())||{lat:0,lng:0},zoom:r||0,heading:i,tilt:o})}function Cg(t){const e=_g(),n=p.useRef({center:{lat:0,lng:0},heading:0,tilt:0,zoom:0});return p.useEffect(()=>{if(!t)return;const r=google.maps.event.addListener(t,"bounds_changed",()=>{Sg(t,n),e()});return()=>r.remove()},[t,e]),n}const Eg=["id","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme"],xg=["padding"];class ko{static has(e){return this.entries[e]&&this.entries[e].length>0}static pop(e){return this.entries[e]&&this.entries[e].pop()||null}static push(e,n){this.entries[e]||(this.entries[e]=[]),this.entries[e].push(n)}}ko.entries={};function Og(t,e){const n=ed(),[r,i]=p.useState(null),[o,s]=wg(),a=Cg(r),{id:c,defaultBounds:l,defaultCenter:u,defaultZoom:f,defaultHeading:d,defaultTilt:y,reuseMaps:m,renderingType:h,colorScheme:_}=t,b=Dn(t,Eg),C=t.zoom!==void 0||t.defaultZoom!==void 0,v=t.center!==void 0||t.defaultCenter!==void 0;!l&&(!C||!v)&&console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"),!b.center&&u&&(b.center=u),!b.zoom&&Number.isFinite(f)&&(b.zoom=f),!b.heading&&Number.isFinite(d)&&(b.heading=d),!b.tilt&&Number.isFinite(y)&&(b.tilt=y);for(const x of Object.keys(b))b[x]===void 0&&delete b[x];const E=p.useRef(void 0);return p.useEffect(()=>{if(!o||!n)return;const{addMapInstance:x,removeMapInstance:g}=e,{mapId:S}=t,O=`${S||"default"}:${h||"default"}:${_||"LIGHT"}`;let T,R;if(m&&ko.has(O)?(R=ko.pop(O),T=R.getDiv(),o.appendChild(T),R.setOptions(b),setTimeout(()=>R.setCenter(R.getCenter()),0)):(T=document.createElement("div"),T.style.height="100%",o.appendChild(T),R=new google.maps.Map(T,At({},b,h?{renderingType:h}:{},_?{colorScheme:_}:{}))),i(R),x(R,c),l){const{padding:L}=l,A=Dn(l,xg);R.fitBounds(A,L)}else(!C||!v)&&R.fitBounds({east:180,west:-180,south:-90,north:90});if(E.current){const{mapId:L,cameraState:A}=E.current;L!==S&&R.setOptions(A)}return()=>{E.current={mapId:S,cameraState:a.current},T.remove(),m?ko.push(O,R):google.maps.event.clearInstanceListeners(R),i(null),g(c)}},[o,n,c,t.mapId,t.renderingType,t.colorScheme]),[r,s,a]}const td=p.createContext(null),nd=t=>{const{children:e,id:n,className:r,style:i}=t,o=p.useContext(ji),s=Xf();if(!o)throw new Error("<Map> can only be used inside an <ApiProvider> component.");const[a,c,l]=Og(t,o);yg(a,l,t),ag(a,t),mg(a,t);const u=gg(a,t),f=!!t.controlled;p.useEffect(()=>{if(a)return u&&a.setOptions({disableDefaultUI:!0}),(u||f)&&a.setOptions({gestureHandling:"none",keyboardShortcuts:!1}),()=>{a.setOptions({gestureHandling:t.gestureHandling,keyboardShortcuts:t.keyboardShortcuts})}},[a,u,f,t.gestureHandling,t.keyboardShortcuts]);const d=t.center?Yf(t.center):null;let y=null,m=null;d&&Number.isFinite(d.lat)&&Number.isFinite(d.lng)&&(y=d.lat,m=d.lng);const h=p.useMemo(()=>{var C,v,E,x,g;return{center:{lat:(C=y)!=null?C:0,lng:(v=m)!=null?v:0},zoom:(E=t.zoom)!=null?E:0,heading:(x=t.heading)!=null?x:0,tilt:(g=t.tilt)!=null?g:0}},[y,m,t.zoom,t.heading,t.tilt]);p.useLayoutEffect(()=>{if(!a||!f)return;a.moveCamera(h);const C=a.addListener("bounds_changed",()=>{a.moveCamera(h)});return()=>C.remove()},[a,f,h]);const _=p.useMemo(()=>At({width:"100%",height:"100%",position:"relative",zIndex:u?-1:0},i),[i,u]),b=p.useMemo(()=>({map:a}),[a]);return s===Ht.AUTH_FAILURE?p.createElement("div",{style:At({position:"relative"},r?{}:_),className:r},p.createElement(bg,null)):p.createElement("div",At({ref:c,"data-testid":"map",style:r?void 0:_,className:r},n?{id:n}:{}),a?p.createElement(td.Provider,{value:b},e):null)};nd.deckGLViewProps=!0;const ml=new Set;function Pg(...t){const e=JSON.stringify(t);ml.has(e)||(ml.add(e),console.error(...t))}const Ni=(t=null)=>{const e=p.useContext(ji),{map:n}=p.useContext(td)||{};if(e===null)return Pg("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."),null;const{mapInstances:r}=e;return t!==null?r[t]||null:n||r.default||null};function rd(t){const e=ed(),n=p.useContext(ji);return p.useEffect(()=>{!e||!n||n.importLibrary(t)},[e,n,t]),(n==null?void 0:n.loadedLibraries[t])||null}function tr(t,e,n){p.useEffect(()=>{if(!t||!e||!n)return;const r=google.maps.event.addListener(t,e,n);return()=>r.remove()},[t,e,n])}function no(t,e,n){p.useEffect(()=>{t&&(t[e]=n)},[t,e,n])}function gl(t,e,n){p.useEffect(()=>{if(!(!t||!e||!n))return t.addEventListener(e,n),()=>t.removeEventListener(e,n)},[t,e,n])}function Tg(t){return t.content!==void 0}function vl(t){return t.nodeType===Node.ELEMENT_NODE}const Ag=p.createContext(null),Rg={TOP_LEFT:["0%","0%"],TOP_CENTER:["50%","0%"],TOP:["50%","0%"],TOP_RIGHT:["100%","0%"],LEFT_CENTER:["0%","50%"],LEFT_TOP:["0%","0%"],LEFT:["0%","50%"],LEFT_BOTTOM:["0%","100%"],RIGHT_TOP:["100%","0%"],RIGHT:["100%","50%"],RIGHT_CENTER:["100%","50%"],RIGHT_BOTTOM:["100%","100%"],BOTTOM_LEFT:["0%","100%"],BOTTOM_CENTER:["50%","100%"],BOTTOM:["50%","100%"],BOTTOM_RIGHT:["100%","100%"],CENTER:["50%","50%"]},Lg=({children:t,styles:e,className:n,anchorPoint:r})=>{const[i,o]=r??Rg.BOTTOM;let s=`-${i}`,a=`-${o}`;i.trimStart().startsWith("-")&&(s=i.substring(1)),o.trimStart().startsWith("-")&&(a=o.substring(1));const c=`translate(50%, 100%) translate(${s}, ${a})`;return p.createElement("div",{style:{transform:c}},p.createElement("div",{className:n,style:e},t))};function Mg(t){const[e,n]=p.useState(null),[r,i]=p.useState(null),o=Ni(),s=rd("marker"),{children:a,onClick:c,className:l,onMouseEnter:u,onMouseLeave:f,onDrag:d,onDragStart:y,onDragEnd:m,collisionBehavior:h,clickable:_,draggable:b,position:C,title:v,zIndex:E}=t,x=p.Children.count(a);return p.useEffect(()=>{if(!o||!s)return;const g=new s.AdvancedMarkerElement;g.map=o,n(g);let S=null;return x>0&&(S=document.createElement("div"),S.isCustomMarker=!0,g.content=S,i(S)),()=>{var O;g.map=null,(O=S)==null||O.remove(),n(null),i(null)}},[o,s,x]),p.useEffect(()=>{!(e!=null&&e.content)||!vl(e.content)||x>0||(e.content.className=l??"")},[e,l,x]),no(e,"position",C),no(e,"title",v??""),no(e,"zIndex",E),no(e,"collisionBehavior",h),p.useEffect(()=>{e&&(b!==void 0?e.gmpDraggable=b:d||y||m?e.gmpDraggable=!0:e.gmpDraggable=!1)},[e,b,d,m,y]),p.useEffect(()=>{if(!e)return;const g=_!==void 0||!!c||!!u||!!f;e.gmpClickable=g,g&&e!=null&&e.content&&vl(e.content)&&(e.content.style.pointerEvents="none",e.content.firstElementChild&&(e.content.firstElementChild.style.pointerEvents="all"))},[e,_,c,u,f]),tr(e,"click",c),tr(e,"drag",d),tr(e,"dragstart",y),tr(e,"dragend",m),gl(e==null?void 0:e.element,"mouseenter",u),gl(e==null?void 0:e.element,"mouseleave",f),[e,r]}const id=p.forwardRef((t,e)=>{const{children:n,style:r,className:i,anchorPoint:o}=t,[s,a]=Mg(t),c=p.useMemo(()=>s?{marker:s}:null,[s]);return p.useImperativeHandle(e,()=>s,[s]),a?p.createElement(Ag.Provider,{value:c},qo.createPortal(p.createElement(Lg,{anchorPoint:o,styles:r,className:i},n),a)):null});function kg(t,e,n){if(e!=null&&typeof e!="object")throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");const r=t.style;if(n==null){if(e==null)return;for(const i in e)e.hasOwnProperty(i)&&yl(r,i,e[i]);return}for(const i in n)n.hasOwnProperty(i)&&(e==null||!e.hasOwnProperty(i))&&(i.indexOf("--")===0?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="");if(e!=null)for(const i in e){const o=e[i];e.hasOwnProperty(i)&&n[i]!==o&&yl(r,i,o)}}function yl(t,e,n){const r=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":r?t.setProperty(e,n):typeof n=="number"&&n!==0&&!jg(e)?t[e]=n+"px":e==="float"?t.cssFloat=n:t[e]=(""+n).trim()}const Dg=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function jg(t){return Dg.has(t)}const Ng=["children","headerContent","style","className","pixelOffset","anchor","shouldFocus","onClose","onCloseClick"],od=t=>{const{children:e,headerContent:n,style:r,className:i,pixelOffset:o,anchor:s,shouldFocus:a,onClose:c,onCloseClick:l}=t,u=Dn(t,Ng),f=rd("maps"),[d,y]=p.useState(null),m=p.useRef(null),h=p.useRef(null),_=Jf(u,Kf);p.useEffect(()=>{if(!f)return;m.current=document.createElement("div"),h.current=document.createElement("div");const v=_;o&&(v.pixelOffset=new google.maps.Size(o[0],o[1])),n&&(v.headerContent=typeof n=="string"?n:h.current);const E=new google.maps.InfoWindow(_);return E.setContent(m.current),y(E),()=>{var x,g;E.setContent(null),(x=m.current)==null||x.remove(),(g=h.current)==null||g.remove(),m.current=null,h.current=null,y(null)}},[f]);const b=p.useRef(null);p.useEffect(()=>{!d||!m.current||(kg(m.current,r||null,b.current),b.current=r||null,i!==m.current.className&&(m.current.className=i||""))},[d,i,r]),p.useEffect(()=>{if(!d)return;const v=_;o?v.pixelOffset=new google.maps.Size(o[0],o[1]):v.pixelOffset=null,n?v.headerContent=typeof n=="string"?n:h.current:v.headerContent=null,d.setOptions(_)},[_,o,n]),tr(d,"close",c),tr(d,"closeclick",l);const C=Ni();return p.useEffect(()=>{if(!C||!d||s===null)return;const v=!!s,E={map:C};if(s&&(E.anchor=s,Tg(s)&&s.content instanceof Element)){const g=s.content,S=g==null?void 0:g.getBoundingClientRect();if(S&&g!=null&&g.isCustomMarker){var x;const O=(x=s.content.firstElementChild)==null?void 0:x.firstElementChild,T=O==null?void 0:O.getBoundingClientRect(),R=T.x-S.x+(T.width-S.width)/2,L=T.y-S.y,A=_;A.pixelOffset=new google.maps.Size(o?o[0]+R:R,o?o[1]+L:L),d.setOptions(A)}}return a!==void 0&&(E.shouldFocus=a),d.open(E),()=>{v&&d.set("anchor",null),d.close()}},[d,s,C,a,_,o]),p.createElement(p.Fragment,null,m.current&&qo.createPortal(e,m.current),h.current!==null&&qo.createPortal(n,h.current))},Ig=["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut"];function Fg(t){const[e,n]=p.useState(null),r=Ni(),{onClick:i,onDrag:o,onDragStart:s,onDragEnd:a,onMouseOver:c,onMouseOut:l}=t,u=Dn(t,Ig),{position:f,draggable:d}=u;return p.useEffect(()=>{if(!r){r===void 0&&console.error("<Marker> has to be inside a Map component.");return}const y=new google.maps.Marker(u);return y.setMap(r),n(y),()=>{y.setMap(null),n(null)}},[r]),p.useEffect(()=>{if(!e)return;const y=e,m=google.maps.event;return i&&m.addListener(y,"click",i),o&&m.addListener(y,"drag",o),s&&m.addListener(y,"dragstart",s),a&&m.addListener(y,"dragend",a),c&&m.addListener(y,"mouseover",c),l&&m.addListener(y,"mouseout",l),e.setDraggable(!!d),()=>{m.clearInstanceListeners(y)}},[e,d,i,o,s,a,c,l]),p.useEffect(()=>{e&&u&&e.setOptions(u)},[e,u]),p.useEffect(()=>{d||!f||!e||e.setPosition(f)},[d,f,e]),e}p.forwardRef((t,e)=>{const n=Fg(t);return p.useImperativeHandle(e,()=>n,[n]),p.createElement(p.Fragment,null)});const Bg=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 12 12",...t},N.createElement("path",{fill:"currentcolor",d:"M6 9.42a.838.838 0 0 1-.594-.246l-5.16-5.16a.84.84 0 1 1 1.189-1.188L6 7.392l4.565-4.566a.84.84 0 0 1 1.189 1.189l-5.16 5.16A.838.838 0 0 1 6 9.42Z"})),sd=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:26,height:8,fill:"none",viewBox:"0 0 26 8",...t},N.createElement("g",{fill:"#000"},N.createElement("path",{d:"M1.416 7.5c-.255 0-.491-.065-.708-.194A1.445 1.445 0 0 1 0 6.06V1.94A1.445 1.445 0 0 1 .708.695C.925.564 1.16.5 1.416.5h4.056c.255 0 .488.065.698.194.217.13.39.305.517.525.134.214.2.454.2.72V6.06c0 .26-.066.5-.2.72-.128.22-.3.395-.517.525-.21.13-.443.194-.698.194H1.416Zm.067-1.517h3.903V2.017H1.483v3.966ZM7.941 7.5v-7h1.53l2.335 2.83L14.13.5h1.54v7h-1.493V2.804l-2.372 2.878-2.382-2.868V7.5H7.94ZM16.816 7.5v-7h1.53l3.856 4.667V.5h1.502v7h-1.53l-3.875-4.686V7.5h-1.483ZM24.536 7.5v-7H26v7h-1.464Z"}))),ad=t=>N.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},N.createElement("rect",{width:48,height:48,fill:"#6A4A9D"}),N.createElement("path",{d:"M16.3444 36.5C15.3815 36.5 14.4907 36.2685 13.6722 35.8056C12.8537 35.3426 12.2037 34.7176 11.7222 33.9306C11.2407 33.1435 11 32.287 11 31.3611V16.6389C11 15.6898 11.2407 14.8333 11.7222 14.0694C12.2037 13.2824 12.8537 12.6574 13.6722 12.1944C14.4907 11.7315 15.3815 11.5 16.3444 11.5H31.6556C32.6185 11.5 33.4972 11.7315 34.2917 12.1944C35.1102 12.6574 35.7602 13.2824 36.2417 14.0694C36.7472 14.8333 37 15.6898 37 16.6389V31.3611C37 32.287 36.7472 33.1435 36.2417 33.9306C35.7602 34.7176 35.1102 35.3426 34.2917 35.8056C33.4972 36.2685 32.6185 36.5 31.6556 36.5H16.3444ZM16.5972 31.0833H31.3306V16.9167H16.5972V31.0833Z",fill:"white"}));function Vg(t,e){return e.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in t)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(t)}function ws(t){return!!(t&&typeof t.then=="function")}function Do(t,e){return ws(t)?Promise.resolve(t).then(e):e(t)}function Bs(t,e,n){function r(i){const o=e(i);throw t.emit(o),console.error(o),o}try{const i=n();return ws(i)?i.catch(r):i}catch(i){r(i)}}function bl(t){const e=(Array.isArray(t)?t:[t]).map(o=>`'${o}'`),n=e.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...e.slice(0,-2),n].join(", ")} option`}function Hg(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}function cd(t){if(typeof t=="string")return[t];if(Array.isArray(t))return t}function rt(t){return cd(t)||[]}function $g(t,e){return Hg(e)?rt(e==null?void 0:e[t]):rt(e)}function Sa(t){return Array.from(new Set(t))}function ld(t){return t&&t.replace(/\/+$/,"")}function Ug(t){if(typeof t=="string")return t;if(typeof(t==null?void 0:t.message)=="string")return t.message}const zg=(t,e)=>fetch(t,e),ud=(t=zg)=>(e,n)=>t(e,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.22.0"},n==null?void 0:n.headers)}));function Dt(t){let e=[];return Object.freeze({listen(n){const r=i=>{n(i)};return e.push(r),{unsubscribe(){e=e.filter(i=>r!==i)}}},emit(n){t()&&e.forEach(r=>r({value:n}))}})}function qg(t,e,n){const r=new Set,i=new Set;function o(c){const l=new Set(e());i.forEach(u=>{(c===void 0||(c==null?void 0:c.findIndex(d=>l.has(d)||u.namespaces.has(d)))!==-1)&&u.fn({value:void 0})})}let s=[];function a(){if(s.length===0)return;const c=s;s=[],r.forEach(f=>{f({value:void 0})});let l=new Set;c.forEach(f=>{f===void 0?l=void 0:l!==void 0&&f.forEach(d=>l.add(d))});const u=l?Array.from(l.keys()):void 0;o(u)}return Object.freeze({emit(c,l){t()&&(s.push(c),l?setTimeout(a,0):a())},listen(c){return r.add(c),{unsubscribe:()=>{r.delete(c)}}},listenSome(c){const l={fn:f=>{c(f)},namespaces:new Set};i.add(l);const u={unsubscribe:()=>{i.delete(l)},subscribeNs:f=>(rt(f).forEach(d=>l.namespaces.add(d)),f===void 0&&l.namespaces.add(n()),u)};return u}})}function Gg(t,e){let n=!0;function r(){return n}const i=Object.freeze({onPendingLanguageChange:Dt(r),onLanguageChange:Dt(r),onLoadingChange:Dt(r),onFetchingChange:Dt(r),onInitialLoaded:Dt(r),onRunningChange:Dt(r),onCacheChange:Dt(r),onUpdate:qg(r,t,e),onPermanentChange:Dt(r),onError:Dt(r),setEmitterActive(o){n=o},on:(o,s)=>{switch(o){case"pendingLanguage":return i.onPendingLanguageChange.listen(s);case"language":return i.onLanguageChange.listen(s);case"loading":return i.onLoadingChange.listen(s);case"fetching":return i.onFetchingChange.listen(s);case"initialLoad":return i.onInitialLoaded.listen(s);case"running":return i.onRunningChange.listen(s);case"cache":return i.onCacheChange.listen(s);case"update":return i.onUpdate.listen(s);case"permanentChange":return i.onPermanentChange.listen(s);case"error":return i.onError.listen(s)}}});return i.onInitialLoaded.listen(()=>i.onUpdate.emit()),i.onLanguageChange.listen(()=>i.onUpdate.emit()),i.onCacheChange.listen(({value:o})=>i.onUpdate.emit([o.namespace],!0)),i}class wl extends Error{constructor(e,n,r=!1){const{language:i,namespace:o}=e;super(`Tolgee: Failed to fetch record for "${i}"${o&&` and "${o}"`}`),this.cause=n,this.isDev=r,this.name="RecordFetchError",this.language=i,this.namespace=o}}class Wg extends Error{constructor(e,n){super(e),this.cause=n,this.name="LanguageDetectorError"}}class _l extends Error{constructor(e,n){super(e),this.cause=n,this.name="LanguageStorageError"}}const fd=t=>{const e=new Map;return Object.entries(t).forEach(([n,r])=>{if(r!=null){if(typeof r=="object"){fd(r).forEach((i,o)=>{e.set(n+"."+o,i)});return}e.set(n,r)}}),e},Kr=t=>{const[e,...n]=t.split(":"),r=n.join(":");return{language:e,namespace:r||""}},jt=({language:t,namespace:e})=>e?`${t}:${e}`:t;function Zg(t,e,n,r,i,o,s){const a=new Map,c=new Map;let l={},u=0;function f(h,_,b){const C=jt(h);c.set(C,{data:fd(_),version:b}),t.onCacheChange.emit(h)}function d(h){let _;if(!_){const b=l[jt(h)];typeof b=="function"&&(_=b())}return _||(_=e(h)),ws(_)?_==null?void 0:_.catch(b=>{const C=new wl(h,b);throw t.onError.emit(C),console.error(C),C}):_}function y(h,_){var b;let C;return _&&(C=(b=n(h))===null||b===void 0?void 0:b.catch(v=>{const E=new wl(h,v,!0);return t.onError.emit(E),console.warn(E),d(h)})),C||(C=d(h)),C}const m=Object.freeze({addStaticData(h){h&&(l=Object.assign(Object.assign({},l),h),Object.entries(h).forEach(([_,b])=>{if(typeof b!="function"){const C=Kr(_),v=c.get(_);(!v||v.version===0)&&f(C,b,0)}}))},invalidate(){a.clear(),u+=1},addRecord(h,_){f(h,_,u)},exists(h,_=!1){const b=c.get(jt(h));return b&&_?b.version===u:!!b},getRecord(h){var _;return(_=c.get(jt(r(h))))===null||_===void 0?void 0:_.data},getTranslation(h,_){var b;return(b=c.get(jt(h)))===null||b===void 0?void 0:b.data.get(_)},getTranslationNs(h,_,b){var C;for(const v of h)for(const E of _){const x=(C=c.get(jt({language:E,namespace:v})))===null||C===void 0?void 0:C.data.get(b);if(x!=null)return[v]}return Sa(h)},getTranslationFallback(h,_,b){var C;for(const v of h)for(const E of _){const x=(C=c.get(jt({language:E,namespace:v})))===null||C===void 0?void 0:C.data.get(b);if(x!=null)return x}},changeTranslation(h,_,b){var C;const v=(C=c.get(jt(h)))===null||C===void 0?void 0:C.data;v==null||v.set(_,b),t.onCacheChange.emit(Object.assign(Object.assign({},h),{key:_}))},isFetching(h){if(i())return!0;if(h===void 0)return a.size>0;const _=rt(h);return!!Array.from(a.keys()).find(b=>_.includes(Kr(b).namespace))},isLoading(h,_){const b=rt(_);return!!(i()||Array.from(a.keys()).find(C=>{const v=Kr(C);return(!b.length||b.includes(v.namespace))&&!m.exists({namespace:v.namespace,language:h})}))},async loadRecords(h,_){const b=h.map(v=>{const E=r(v),x=jt(E),g=a.get(x);if(g)return{new:!1,promise:g,keyObject:E,cacheKey:x};const S=y(E,_)||Promise.resolve(void 0);return a.set(x,S),{new:!0,promise:S,keyObject:E,cacheKey:x}});o.notify(),s.notify();const C=await Promise.all(b.map(v=>v.promise));return b.forEach((v,E)=>{const x=a.get(v.cacheKey)!==v.promise;if(v.new&&!x){a.delete(v.cacheKey);const g=C[E];g?m.addRecord(v.keyObject,g):m.getRecord(v.keyObject)||m.addRecord(v.keyObject,{})}}),o.notify(),s.notify(),b.map(v=>m.getRecord(v.keyObject))},getAllRecords(){return Array.from(c.entries()).map(([_,b])=>Object.assign(Object.assign({},Kr(_)),{data:b.data}))}});return m}function dd(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}const Kg={tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},Ca="invalid",Qg="https://app.tolgee.io",Jg=({key:t})=>t,Xg={defaultNs:"",observerOptions:Kg,observerType:"invisible",onFormatError:Ca,apiUrl:Qg,fetch:ud(),onTranslationMissing:Jg},Ea=(...t)=>{let e={};return t.forEach(n=>{e=Object.assign(Object.assign(Object.assign({},e),n),{observerOptions:Object.assign(Object.assign({},e.observerOptions),n==null?void 0:n.observerOptions)})}),e};function Sl(t,e){const n=Ea(Xg,e==null?void 0:e.initialOptions,t);return n.apiUrl=ld(n.apiUrl),t!=null&&t.fetch&&(n.fetch=ud(t.fetch)),{initialOptions:n,activeNamespaces:(e==null?void 0:e.activeNamespaces)||new Map,language:e==null?void 0:e.language,pendingLanguage:e==null?void 0:e.language,isInitialLoading:!1,isRunning:!1}}function Yg(t,e,n,r,i,o,s,a){const c={ui:void 0},l={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},u=async({keysAndDefaults:A,event:D})=>{var I;const $=A.map(({key:V,ns:z,defaultValue:W})=>({key:V,defaultValue:W,fallbackNamespaces:r(z),namespace:i({key:V,ns:z})[0],translation:o({key:V,ns:z})}));(I=l.ui)===null||I===void 0||I.handleElementClick($,D)},f=(A,D)=>{var I;return((I=l.observer)===null||I===void 0?void 0:I.findPositions(A,D))||[]};function d(A){const D=o({key:A.key,ns:A.ns});return L.formatTranslation(Object.assign(Object.assign({},A),{translation:D,formatEnabled:!0}))}function y(){return{fetch:e().fetch}}function m(A){l.observer=A==null?void 0:A()}function h(){return!!l.observer}function _(A){A&&l.formatters.push(A)}function b(A){l.finalFormatter=A}function C(A){c.ui=A}function v(){return!!c.ui}function E(A){l.languageStorage=A}function x(A){l.languageDetector=A}function g(){return Bs(a.onError,A=>new _l("Tolgee: Failed to load language",A),()=>{var A;return(A=l.languageStorage)===null||A===void 0?void 0:A.getLanguage(y())})}function S(){if(!l.languageDetector)return;const A=n();return Bs(a.onError,D=>new Wg("Tolgee: Failed to detect language",D),()=>{var D;return(D=l.languageDetector)===null||D===void 0?void 0:D.getLanguage(Object.assign({availableLanguages:A},y()))})}function O(A){A&&l.backends.push(A)}function T(A){l.devBackend=A}function R(A,D){const I=Object.freeze({setFinalFormatter:b,addFormatter:_,setObserver:m,hasObserver:h,setUi:C,hasUi:v,setDevBackend:T,addBackend:O,setLanguageDetector:x,setLanguageStorage:E});D(A,I)}const L=Object.freeze({addPlugin:R,run(){var A,D;const{apiKey:I,apiUrl:$,projectId:V,observerOptions:z}=e();l.ui=(A=c.ui)===null||A===void 0?void 0:A.call(c,{apiKey:I,apiUrl:$,projectId:V,highlight:L.highlight,changeTranslation:s,findPositions:f,onPermanentChange:W=>a.onPermanentChange.emit(W)}),(D=l.observer)===null||D===void 0||D.run({mouseHighlight:!0,options:z,translate:d,onClick:u})},stop(){var A;l.ui=void 0,(A=l.observer)===null||A===void 0||A.stop()},getLanguageStorage(){return l.languageStorage},getInitialLanguage(){const A=n(),D=g();return Do(D,I=>(!A||A.includes(I))&&I?I:S())},setStoredLanguage(A){return Bs(a.onError,D=>new _l("Tolgee: Failed to store language",D),()=>{var D;return(D=l.languageStorage)===null||D===void 0?void 0:D.setLanguage(A,y())})},getDevBackend(){return l.devBackend},getBackendRecord:({language:A,namespace:D})=>{for(const I of l.backends){const $=I.getRecord(Object.assign({language:A,namespace:D},y()));if($!==void 0)return $}},getBackendDevRecord:({language:A,namespace:D})=>{var I;const{apiKey:$,apiUrl:V,projectId:z}=e();return(I=l.devBackend)===null||I===void 0?void 0:I.getRecord(Object.assign({apiKey:$,apiUrl:V,projectId:z,language:A,namespace:D},y()))},getLanguageDetector(){return l.languageDetector},retranslate(){var A;(A=l.observer)===null||A===void 0||A.retranslate()},highlight:(A,D)=>{var I,$;return(($=(I=l.observer)===null||I===void 0?void 0:I.highlight)===null||$===void 0?void 0:$.call(I,A,D))||{unhighlight(){}}},unwrap(A){var D;return l.observer?(D=l.observer)===null||D===void 0?void 0:D.unwrap(A):{text:A,keys:[]}},wrap(A){var D;return l.observer?(D=l.observer)===null||D===void 0?void 0:D.wrap(A):A.translation},hasDevBackend(){return!!L.getDevBackend()},formatTranslation(A){var D,{formatEnabled:I}=A,$=dd(A,["formatEnabled"]);const{key:V,translation:z,defaultValue:W,noWrap:ce,params:le,ns:ue,orEmpty:ne}=$,We=z??W;let xe="";z==null&&(xe=e().onTranslationMissing($));let me=We??(ne?"":xe);const zt=t(),qt=I||!(!((D=l.observer)===null||D===void 0)&&D.outputNotFormattable),Mr=yt=>l.observer&&!ce?l.observer.wrap({key:V,translation:yt,defaultValue:W,params:le,ns:ue}):yt;me=Mr(me);try{if(We&&zt&&qt)for(const yt of l.formatters)me=yt.format({translation:me,language:zt,params:le});l.finalFormatter&&We&&zt&&qt&&(me=l.finalFormatter.format({translation:me,language:zt,params:le}))}catch(yt){console.error(yt);const Hi=Ug(yt)||Ca,Bn=e().onFormatError,Je=typeof Bn;Je==="string"?me=Bn:Je==="function"?me=Bn(Hi,$):me=Ca,me=Mr(me)}return me}});return L}const Cl=(t,e,n)=>{let r=t;return Object.freeze({init(i){r=i},notify(){const i=e();r!==i&&n(i),r=i}})};function ev(t,e,n){let r=Sl(),i;const o=Object.freeze({init(s){r=Sl(s,r)},isRunning(){return r.isRunning},setRunning(s){r.isRunning!==s&&(r.isRunning=s,n.emit(s))},isInitialLoading(){return r.isInitialLoading},setInitialLoading(s){r.isInitialLoading=s},getLanguage(){return r.language||r.initialOptions.language},setLanguage(s){r.language!==s&&(r.language=s,t.emit(s))},getPendingLanguage(){return r.pendingLanguage||o.getLanguage()},setPendingLanguage(s){r.pendingLanguage!==s&&(r.pendingLanguage=s,e.emit(s))},getInitialOptions(){return Object.assign(Object.assign({},r.initialOptions),i)},addActiveNs(s){rt(s).forEach(c=>{const l=r.activeNamespaces.get(c);l!==void 0?r.activeNamespaces.set(c,l+1):r.activeNamespaces.set(c,1)})},removeActiveNs(s){rt(s).forEach(c=>{const l=r.activeNamespaces.get(c);l!==void 0&&l>1?r.activeNamespaces.set(c,l-1):r.activeNamespaces.delete(c)})},getRequiredNamespaces(){return Sa([...r.initialOptions.ns||[r.initialOptions.defaultNs],...rt(r.initialOptions.fallbackNs),...r.activeNamespaces.keys()])},getFallbackLangs(s){const a=s||o.getLanguage();return a?Sa([a,...$g(a,r.initialOptions.fallbackLanguage)]):[]},getFallbackNs(){return rt(r.initialOptions.fallbackNs)},getDefaultNs(s){return s===void 0?r.initialOptions.defaultNs:s},getAvailableLanguages(){if(r.initialOptions.availableLanguages)return r.initialOptions.availableLanguages;if(r.initialOptions.staticData){const s=Object.keys(r.initialOptions.staticData).map(a=>Kr(a).language);return Array.from(new Set(s))}},withDefaultNs(s){return{namespace:s.namespace===void 0?o.getInitialOptions().defaultNs:s.namespace,language:s.language}},overrideCredentials(s){s?i=Object.assign(Object.assign({},s),{apiUrl:ld(s.apiUrl)}):i=void 0}});return o}function tv(t){var{ns:e,noWrap:n,orEmpty:r,params:i,language:o}=t,s=dd(t,["ns","noWrap","orEmpty","params","language"]);return Object.assign(Object.assign({},{ns:e,noWrap:n,orEmpty:r,language:o}),{params:Object.assign({},s)})}const hd=(t,...e)=>{let n={},r;return typeof t=="object"?n=t:(n.key=t,typeof e[0]=="string"?(n.defaultValue=e[0],r=e[1]):typeof e[0]=="object"&&(r=e[0])),r&&(n=Object.assign(Object.assign({},tv(r)),n)),n};function nv({options:t}){const e=Gg(c,l),n=Cl(!1,()=>s.isFetching(),e.onFetchingChange.emit),r=Cl(!1,()=>x.isLoading(),e.onLoadingChange.emit),i=ev(e.onLanguageChange,e.onPendingLanguageChange,e.onRunningChange),o=Yg(i.getLanguage,i.getInitialOptions,i.getAvailableLanguages,u,_,b,d,e),s=Zg(e,o.getBackendRecord,o.getBackendDevRecord,i.withDefaultNs,i.isInitialLoading,n,r);t&&y(t);let a;e.onUpdate.listen(()=>{i.isRunning()&&o.retranslate()});function c(){return i.getFallbackNs()}function l(g){return i.getDefaultNs(g)}function u(g){return[...rt(l(g)),...c()]}function f(g){return[...rt(g??l()),...i.getRequiredNamespaces()]}function d(g,S,O){const T=i.withDefaultNs(g),R=s.getTranslation(T,S);return s.changeTranslation(T,S,O),{revert(){s.changeTranslation(T,S,R)}}}function y(g){i.init(g),s.addStaticData(i.getInitialOptions().staticData)}function m(g,S){const O=i.getFallbackLangs(g),T=f(S),R=[];return O.forEach(L=>{T.forEach(A=>{s.exists({language:L,namespace:A},!0)||R.push({language:L,namespace:A})})}),R}function h(g,S){const O=m(g,S);if(O.length)return Do(x.loadRecords(O),()=>{})}function _({key:g,ns:S}){const O=i.getFallbackLangs(),T=u(S??void 0);return s.getTranslationNs(T,O,g)}function b({key:g,ns:S,language:O}){const T=u(S??void 0),R=i.getFallbackLangs(O);return s.getTranslationFallback(T,R,g)}function C(){const g=Do(v(),()=>h());if(ws(g))return i.setInitialLoading(!0),n.notify(),r.notify(),Promise.resolve(g).then(()=>{i.setInitialLoading(!1),n.notify(),r.notify(),e.onInitialLoaded.emit()});e.onInitialLoaded.emit()}function v(){if(i.getLanguage())return;const S=o.getInitialLanguage();return Do(S,O=>{const T=O||i.getInitialOptions().defaultLanguage;T&&i.setLanguage(T)})}function E(){if((o.getLanguageDetector()||o.getLanguageStorage())&&!i.getAvailableLanguages())throw new Error(bl("availableLanguages"));if(!i.getLanguage()&&!i.getInitialOptions().defaultLanguage)throw new Error(bl(["defaultLanguage","language"]))}const x=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),i),o),s),{init:y,getTranslation:b,changeTranslation:d,getTranslationNs:_,getDefaultAndFallbackNs:u,async changeLanguage(g){i.getPendingLanguage()===g&&i.getLanguage()===g||(i.setPendingLanguage(g),i.isRunning()&&await h(g),g===i.getPendingLanguage()&&(i.setLanguage(g),await o.setStoredLanguage(g)))},async addActiveNs(g,S){S||i.addActiveNs(g),i.isRunning()&&await h(void 0,g)},loadRecords(g){return s.loadRecords(g,x.isDev())},async loadRecord(g){return(await x.loadRecords([g]))[0]},isLoading(g){return s.isLoading(i.getLanguage(),g)},isLoaded(g){const S=i.getLanguage();if(!S)return!1;const O=i.getFallbackLangs(S),T=f(g),R=[];return O.forEach(L=>{T.forEach(A=>{s.exists({language:L,namespace:A})||R.push({language:L,namespace:A})})}),R.length===0},t:(...g)=>{const S=hd(...g),O=b(S);return o.formatTranslation(Object.assign(Object.assign({},S),{translation:O}))},isDev(){return!!(i.getInitialOptions().apiKey&&i.getInitialOptions().apiUrl)},run(){return E(),i.isRunning()||(i.setRunning(!0),o.run(),a=C()),Promise.resolve(a)},stop(){i.isRunning()&&(o.stop(),i.setRunning(!1))}}));return x}function rv(t){const e=nv({options:t});e.isDev()&&e.invalidate();function n(i){const o=e.isRunning();o&&e.stop(),i(),e.isDev()&&e.invalidate(),o&&e.run()}const r=Object.freeze({on:e.on,onNsUpdate:e.onUpdate.listenSome,setEmitterActive:e.setEmitterActive,getLanguage:e.getLanguage,getPendingLanguage:e.getPendingLanguage,changeLanguage:e.changeLanguage,changeTranslation:e.changeTranslation,addActiveNs:e.addActiveNs,removeActiveNs:e.removeActiveNs,loadRecords:e.loadRecords,loadRecord:e.loadRecord,addStaticData:e.addStaticData,getRecord:e.getRecord,getAllRecords:e.getAllRecords,isLoaded:e.isLoaded,isInitialLoading:e.isInitialLoading,isLoading:e.isLoading,isFetching:e.isFetching,isRunning:e.isRunning,run:e.run,stop:e.stop,t:e.t,highlight:e.highlight,getInitialOptions:e.getInitialOptions,isDev:e.isDev,wrap:e.wrap,unwrap:e.unwrap,overrideCredentials(i){n(()=>e.overrideCredentials(i))},addPlugin(i){i&&n(()=>e.addPlugin(r,i))},updateOptions(i){i&&n(()=>e.init(i))}});return r}const iv=()=>{const t={plugins:[],options:{}},e=Object.freeze({use(n){return t.plugins.push(n),e},updateDefaults(n){return t.options=Ea(t.options,n),e},init(n){const r=rv(Ea(t.options,n));return t.plugins.forEach(r.addPlugin),r}});return e},pd=0,xa=1,ov=2;class sv extends Error{constructor(e,n,r){let i;e===pd?i="Empty parameter":e===xa?i="Unexpected character":i="Unexpected end",super(`Tolgee parser: ${i} at ${n} in "${r}"`),this.code=e,this.index=n}}function El(t){return/\s/.test(t)}const Kt=0,Oa=1,jo=2,Vs=3,Hs=4,av=new Set([jo,Oa,Kt]),Pa="'",cv=new Set(["{","}",Pa]),lv=t=>/[0-9a-zA-Z_]/.test(t);function uv(t){let e=Kt,n="",r="",i="";const o=[],s=[];let a=0;function c(d){throw new sv(d,a,t)}const l=()=>{o.push(n),n=""},u=()=>{lv(i)||c(xa),r+=i},f=()=>{r===""&&c(pd),s.push(r),r=""};for(a=0;a<t.length;a++)switch(i=t[a],e){case Kt:i===Pa?(n+=i,e=Oa):i==="{"?(l(),e=Vs):(n+=i,e=Kt);break;case Oa:cv.has(i)?(n=n.slice(0,-1)+i,e=jo):(n+=i,e=Kt);break;case jo:i===Pa?e=Kt:(n+=i,e=jo);break;case Vs:i==="}"?(f(),e=Kt):El(i)?r!==""&&(f(),e=Hs):(u(),e=Vs);break;case Hs:i=="}"?e=Kt:El(i)?e=Hs:c(xa)}return av.has(e)||c(ov),l(),[o,s]}function fv(t,e){const[n,r]=uv(t),i=[n[0]];for(let o=1;o<n.length;o++){const s=e==null?void 0:e[r[o-1]];if(s===void 0)throw new Error(`Missing parameter "${r[o-1]}" in "${t}"`);i.push(String(s)),i.push(n[o])}return i.join("")}function dv(){return{format:({translation:t,params:e})=>fv(t,e)}}const hv=()=>(t,e)=>(e.setFinalFormatter(dv()),t);var $s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xl={};(function(t){function e(b,C){var v;return b instanceof Buffer?v=b:v=Buffer.from(b.buffer,b.byteOffset,b.byteLength),v.toString(C)}var n=function(b){return Buffer.from(b)};function r(b){for(var C=0,v=Math.min(256*256,b.length+1),E=new Uint16Array(v),x=[],g=0;;){var S=C<b.length;if(!S||g>=v-1){var O=E.subarray(0,g),T=O;if(x.push(String.fromCharCode.apply(null,T)),!S)return x.join("");b=b.subarray(C),C=0,g=0}var R=b[C++];if(!(R&128))E[g++]=R;else if((R&224)===192){var L=b[C++]&63;E[g++]=(R&31)<<6|L}else if((R&240)===224){var L=b[C++]&63,A=b[C++]&63;E[g++]=(R&31)<<12|L<<6|A}else if((R&248)===240){var L=b[C++]&63,A=b[C++]&63,D=b[C++]&63,I=(R&7)<<18|L<<12|A<<6|D;I>65535&&(I-=65536,E[g++]=I>>>10&1023|55296,I=56320|I&1023),E[g++]=I}}}function i(b){for(var C=0,v=b.length,E=0,x=Math.max(32,v+(v>>>1)+7),g=new Uint8Array(x>>>3<<3);C<v;){var S=b.charCodeAt(C++);if(S>=55296&&S<=56319){if(C<v){var O=b.charCodeAt(C);(O&64512)===56320&&(++C,S=((S&1023)<<10)+(O&1023)+65536)}if(S>=55296&&S<=56319)continue}if(E+4>g.length){x+=8,x*=1+C/b.length*2,x=x>>>3<<3;var T=new Uint8Array(x);T.set(g),g=T}if(S&4294967168)if(!(S&4294965248))g[E++]=S>>>6&31|192;else if(!(S&4294901760))g[E++]=S>>>12&15|224,g[E++]=S>>>6&63|128;else if(!(S&4292870144))g[E++]=S>>>18&7|240,g[E++]=S>>>12&63|128,g[E++]=S>>>6&63|128;else continue;else{g[E++]=S;continue}g[E++]=S&63|128}return g.slice?g.slice(0,E):g.subarray(0,E)}var o="Failed to ",s=function(b,C,v){if(b)throw new Error("".concat(o).concat(C,": the '").concat(v,"' option is unsupported."))},a=typeof Buffer=="function"&&Buffer.from,c=a?n:i;function l(){this.encoding="utf-8"}l.prototype.encode=function(b,C){return s(C&&C.stream,"encode","stream"),c(b)};function u(b){var C;try{var v=new Blob([b],{type:"text/plain;charset=UTF-8"});C=URL.createObjectURL(v);var E=new XMLHttpRequest;return E.open("GET",C,!1),E.send(),E.responseText}finally{C&&URL.revokeObjectURL(C)}}var f=!a&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",d=["utf-8","utf8","unicode-1-1-utf-8"],y=r;a?y=e:f&&(y=function(b){try{return u(b)}catch{return r(b)}});var m="construct 'TextDecoder'",h="".concat(o," ").concat(m,": the ");function _(b,C){s(C&&C.fatal,m,"fatal"),b=b||"utf-8";var v;if(a?v=Buffer.isEncoding(b):v=d.indexOf(b.toLowerCase())!==-1,!v)throw new RangeError("".concat(h," encoding label provided ('").concat(b,"') is invalid."));this.encoding=b,this.fatal=!1,this.ignoreBOM=!1}_.prototype.decode=function(b,C){s(C&&C.stream,"decode","stream");var v;return b instanceof Uint8Array?v=b:b.buffer instanceof ArrayBuffer?v=new Uint8Array(b.buffer):v=new Uint8Array(b),y(v,this.encoding)},t.TextEncoder=t.TextEncoder||l,t.TextDecoder=t.TextDecoder||_})(typeof window<"u"?window:$s);var pv=Vg({__proto__:null,default:xl},[xl]),Us;(Us=console.assert)===null||Us===void 0||Us.call(console,pv);const mv="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function gv(t){const e=mv.indexOf(t);if(e===-1)throw new Error("Invalid character found: "+t);return e}function vv(t){const e=new Uint8Array(t),n=e.length;let r="",i=Math.pow(2,16)-1;for(let o=0;o<n;o+=i)o+i>n&&(i=n-o),r+=String.fromCharCode.apply(null,e.subarray(o,o+i));return r}function yv(t){t=t.toUpperCase();const e=t.length;let n=0,r=0,i=0;const o=new Uint8Array(e*5/8|0);for(let s=0;s<e;s++)r=r<<5|gv(t[s]),n+=5,n>=8&&(o[i++]=r>>>n-8&255,n-=8);return vv(o.buffer)}function bv(t){if(t)try{const[e,n]=t.split("_");if(e==="tgpak"){const[r]=yv(n).split("_");return Number(r)}}catch{console.warn("Tolgee: Api key can't be parsed")}}function wv(t){if(!t)return;const[e]=t.split("_");return e==="tgpak"?"tgpak":e==="tgpat"?"tgpat":"legacy"}function _v(){return{getRecord({apiUrl:t,apiKey:e,language:n,namespace:r,projectId:i,fetch:o}){var s;const a=(s=bv(e))!==null&&s!==void 0?s:i;let c=a!==void 0?`${t}/v2/projects/${a}/translations/${n}`:`${t}/v2/projects/translations/${n}`;if(r&&(c+=`?ns=${r}`),wv(e)==="tgpat"&&i===void 0)throw new Error("You need to specify 'projectId' when using PAT key");return o(c,{headers:{"X-API-Key":e||"","Content-Type":"application/json"}}).then(l=>{if(l.ok)return l.json().then(u=>u[n]);throw new Error(l.statusText)})}}}const Sv=()=>(t,e)=>(e.setDevBackend(_v()),t);function Cv(t,e){const n=r=>{var i,o;t.includes((i=r.data)===null||i===void 0?void 0:i.type)&&e((o=r.data)===null||o===void 0?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}function Ev({message:t,recievingMessage:e,data:n,attempts:r=1,timeout:i=300}){let o=!1;const s=()=>new Promise((c,l)=>{const u=Cv(e,d);window.postMessage({type:t,data:n},window.origin);const f=setTimeout(m,i);function d(h){clearTimeout(f),y(),c(h)}function y(){u.unsubscribe()}function m(){y(),l()}});return{cancel(){o=!0},promise:(async()=>{for(let c=0;c<r;c++){if(o)return new Promise(()=>{});try{return await s()}catch{continue}}if(!o)throw`Didn't recieve ${e.join(" or ")} in time.`;return new Promise(()=>{})})()}}function xv(){let t;async function e(n){t==null||t();const{cancel:r,promise:i}=Ev({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:n,attempts:4});return t=r,i}return{update:e}}const Ov="tolgee-in-context-tools.umd.min.js",Pv="@tolgee/in-context-tools",Tv="InContextTools",Av="https://cdn.jsdelivr.net/npm";function Rv(t){return new Promise((e,n)=>{const r=document.createElement("script");r.src=t,r.addEventListener("load",()=>e()),r.addEventListener("error",i=>n(i.error)),document.head.appendChild(r)})}let zs=null;function Lv(t){return zs||(zs=Rv(`${Av}/@tolgee/web@${t}/dist/${Ov}`).then(()=>window[Pv][Tv])),zs}const md="__tolgee_apiKey",gd="__tolgee_apiUrl";function Ol(){const t=sessionStorage.getItem(md)||void 0,e=sessionStorage.getItem(gd)||void 0;if(!(!t||!e))return{apiKey:t,apiUrl:e}}function Mv(){sessionStorage.removeItem(md),sessionStorage.removeItem(gd)}function kv(t){document.readyState!=="loading"?Promise.resolve().then(()=>{t()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",t)}let vd=()=>t=>t;const Dv=()=>{if(typeof window>"u")return!1;try{return typeof sessionStorage<"u"&&sessionStorage}catch(t){return console.error("sessionStorage not available",t),!1}};Dv()&&(vd=()=>t=>{const e=xv(),n=()=>({uiPresent:!0,uiVersion:void 0,mode:t.isDev()?"development":"production",config:{apiUrl:t.getInitialOptions().apiUrl||"",apiKey:t.getInitialOptions().apiKey||""}}),r=async()=>{const o=await Lv("5.22.0");return s=>{const a=Ol();return s.addPlugin(o({credentials:a})),s}};return t.on("running",({value:o})=>{o&&kv(()=>{e.update(n()).catch(Mv)})}),Ol()&&r().then(o=>{t.addPlugin(o)}).catch(o=>{console.error("Tolgee: Failed to load in-context tools"),console.error(o)}),t});function jv(){return iv().use(vd())}const Nv={useSuspense:!0};let qs;const yd=()=>(qs||(qs=p.createContext(void 0)),qs),Iv=({tolgee:t,options:e,children:n,fallback:r})=>{const[i,o]=p.useState(!t.isLoaded());p.useEffect(()=>{t.run().catch(c=>{console.error(c)}).finally(()=>{o(!1)})},[t]);const s=Object.assign(Object.assign({},Nv),e),a=yd();return s.useSuspense?p.createElement(a.Provider,{value:{tolgee:t,options:s}},i?r:p.createElement(p.Suspense,{fallback:r||null},n)):p.createElement(a.Provider,{value:{tolgee:t,options:s}},i?r:n)};let Fv;function Bv(){return Fv}const Vv=()=>{const t=yd(),e=p.useContext(t)||Bv();if(!e)throw new Error("Couldn't find tolgee instance, did you forgot to use `TolgeeProvider`?");return e},Hv=()=>{const[t,e]=p.useState(0),n=p.useCallback(()=>{e(r=>r+1)},[e]);return{instance:t,rerender:n}},bd=(t,e)=>{const{tolgee:n,options:r}=Vv(),i=cd(t),o=rt(i).join(":"),s=Object.assign(Object.assign({},r),e),{rerender:a,instance:c}=Hv(),l=p.useRef(),u=p.useRef([]);u.current=[];const f=m=>{var h;u.current.push(m),(h=l.current)===null||h===void 0||h.subscribeNs(m)},d=n.isLoaded(i);p.useEffect(()=>{const m=n.onNsUpdate(a);return l.current=m,m.subscribeNs(i),u.current.forEach(h=>{m.subscribeNs(h)}),()=>{m.unsubscribe()}},[o,n]),p.useEffect(()=>(n.addActiveNs(i),()=>n.removeActiveNs(i)),[o,n]);const y=p.useCallback(m=>{var h;const _=(h=m.ns)!==null&&h!==void 0?h:i==null?void 0:i[0];return f(_),n.t(Object.assign(Object.assign({},m),{ns:_}))},[n,c]);if(s.useSuspense&&!d)throw n.addActiveNs(i,!0);return{t:y,isLoading:!d}},vt=(t,e)=>{const{t:n,isLoading:r}=bd(t,e);return{t:p.useCallback((...o)=>{const s=hd(...o);return n(s)},[n]),isLoading:r}},$v=t=>{if(!t)return;const e={};return Object.entries(t||{}).forEach(([n,r])=>{if(typeof r=="function")e[n]=i=>r(Ta(i));else if(p.isValidElement(r)){const i=r;e[n]=o=>i.props.children===void 0&&(o!=null&&o.length)?p.cloneElement(i,{},Ta(o)):p.cloneElement(i)}else e[n]=r}),e},Ta=t=>Array.isArray(t)?p.Children.toArray(t):t,Uv=t=>{const e=t.keyName||t.children;e===void 0&&console.error("T component: keyName not defined");const n=t.defaultValue||(t.keyName?t.children:void 0),r=Ta(t.t({key:e,params:$v(t.params),defaultValue:n,noWrap:t.noWrap,ns:t.ns,language:t.language}));return p.createElement(p.Fragment,null,r)},Bt=t=>{const{t:e}=bd();return p.createElement(Uv,Object.assign({t:e},t))},zv="Spinner-module__loader__U4GVhD",qv={loader:zv},Ko=({className:t})=>w.jsx("div",{className:K(qv.loader,t),children:"Loading..."}),Gv="Button-module__root__8RX49h",Wv="Button-module__primary__st6yY9",Zv="Button-module__secondary__j-3rjz",Kv="Button-module__loading__QfItr2",Qv="Button-module__spinner__kVZYqS",Vr={root:Gv,primary:Wv,secondary:Zv,loading:Kv,spinner:Qv},ot=({children:t,className:e,loading:n,variant:r="primary",...i})=>{const o=[Vr.root,e,Vr[r],{[Vr.loading]:n}];if(i.as==="link"){const{as:s,disabled:a,...c}=i;return w.jsxs("a",{className:K(o),...c,"data-disabled":a,children:[!n&&t,n&&w.jsx(Ko,{className:Vr.spinner})]})}if(i.as==="button"){const{as:s,...a}=i;return w.jsxs("button",{type:"button",className:K(o),...a,children:[!n&&t,n&&w.jsx(Ko,{className:Vr.spinner})]})}Tt(!1,"Invalid button type")};ot.defaultProps={as:"button"};const Jv=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},N.createElement("g",{clipPath:"url(#a)"},N.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M17.071 3.071a1.25 1.25 0 0 0-1.768 0L10 8.375 4.697 3.07a1.25 1.25 0 1 0-1.768 1.77l5.303 5.303-5.303 5.303a1.25 1.25 0 0 0 1.768 1.768L10 11.91l5.303 5.303a1.25 1.25 0 1 0 1.768-1.768l-5.303-5.303L17.07 4.84a1.25 1.25 0 0 0 0-1.768Z",clipRule:"evenodd"})),N.createElement("defs",null,N.createElement("clipPath",{id:"a"},N.createElement("path",{fill:"#fff",d:"M0 0h20v20H0z"})))),Xv="CloseButton-module__root__2m1asd",Yv="CloseButton-module__absolutePositionVariant__lGX4cQ",e1="CloseButton-module__relativePositionVariant__LqTTWf",Pl={root:Xv,absolutePositionVariant:Yv,relativePositionVariant:e1},Rr=({className:t,position:e="absolute",...n})=>w.jsx("div",{...n,className:K(Pl.root,t,Pl[`${e}PositionVariant`]),children:w.jsx(Jv,{})}),t1=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:13,height:12,viewBox:"0 0 13 12",fill:"none",...t},N.createElement("path",{d:"M6.04102 1.125C5.07683 1.125 4.1343 1.41091 3.33261 1.94659C2.53092 2.48226 1.90608 3.24363 1.53711 4.13442C1.16813 5.02521 1.07159 6.00541 1.25969 6.95107C1.44779 7.89672 1.91209 8.76536 2.59387 9.44715C3.27565 10.1289 4.1443 10.5932 5.08995 10.7813C6.03561 10.9694 7.01581 10.8729 7.9066 10.5039C8.79739 10.1349 9.55876 9.51009 10.0944 8.7084C10.6301 7.90671 10.916 6.96418 10.916 6C10.9147 4.70749 10.4006 3.46831 9.48666 2.55436C8.57271 1.64042 7.33353 1.12636 6.04102 1.125ZM6.04102 10.125C5.22517 10.125 4.42764 9.88307 3.74929 9.42981C3.07094 8.97655 2.54223 8.33231 2.23001 7.57857C1.9178 6.82482 1.83611 5.99542 1.99528 5.19525C2.15444 4.39508 2.54731 3.66008 3.1242 3.08318C3.70109 2.50629 4.4361 2.11342 5.23627 1.95426C6.03644 1.7951 6.86584 1.87679 7.61959 2.189C8.37333 2.50121 9.01757 3.02992 9.47083 3.70827C9.92409 4.38663 10.166 5.18415 10.166 6C10.1648 7.09364 9.72978 8.14213 8.95646 8.91545C8.18314 9.68876 7.13465 10.1238 6.04102 10.125ZM6.79102 8.25C6.79102 8.34946 6.75151 8.44484 6.68118 8.51517C6.61086 8.58549 6.51547 8.625 6.41602 8.625C6.21711 8.625 6.02634 8.54598 5.88569 8.40533C5.74504 8.26468 5.66602 8.07391 5.66602 7.875V6C5.56656 6 5.47118 5.96049 5.40085 5.89016C5.33053 5.81984 5.29102 5.72446 5.29102 5.625C5.29102 5.52554 5.33053 5.43016 5.40085 5.35984C5.47118 5.28951 5.56656 5.25 5.66602 5.25C5.86493 5.25 6.0557 5.32902 6.19635 5.46967C6.337 5.61032 6.41602 5.80109 6.41602 6V7.875C6.51547 7.875 6.61086 7.91451 6.68118 7.98483C6.75151 8.05516 6.79102 8.15054 6.79102 8.25ZM5.29102 3.9375C5.29102 3.82625 5.32401 3.71749 5.38582 3.62499C5.44762 3.53249 5.53547 3.46039 5.63826 3.41782C5.74104 3.37524 5.85414 3.3641 5.96326 3.38581C6.07237 3.40751 6.1726 3.46109 6.25127 3.53975C6.32993 3.61842 6.38351 3.71865 6.40521 3.82776C6.42691 3.93688 6.41577 4.04998 6.3732 4.15276C6.33063 4.25554 6.25853 4.34339 6.16603 4.4052C6.07352 4.46701 5.96477 4.5 5.85352 4.5C5.70433 4.5 5.56126 4.44074 5.45577 4.33525C5.35028 4.22976 5.29102 4.08668 5.29102 3.9375Z",fill:"black"})),n1="W3WLink-module__likeButton__RhAlpN",r1="W3WLink-module__title__eo6M7L",Tl={likeButton:n1,title:r1},i1=()=>w.jsxs("a",{className:Tl.likeButton,title:"about what3words",href:"https://what3words.com/about",target:"_blank",rel:"noreferrer",children:[w.jsx("span",{className:Tl.title,children:"what3words"}),w.jsx(t1,{})]}),o1=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...t},N.createElement("path",{d:"M10 1.25C8.17727 1.25207 6.42979 1.97706 5.14092 3.26592C3.85206 4.55479 3.12707 6.30227 3.125 8.125C3.125 14.0078 9.375 18.4508 9.64141 18.6367C9.74649 18.7103 9.87169 18.7498 10 18.7498C10.1283 18.7498 10.2535 18.7103 10.3586 18.6367C10.625 18.4508 16.875 14.0078 16.875 8.125C16.8729 6.30227 16.1479 4.55479 14.8591 3.26592C13.5702 1.97706 11.8227 1.25207 10 1.25ZM10 5.625C10.4945 5.625 10.9778 5.77162 11.3889 6.04633C11.8 6.32103 12.1205 6.71148 12.3097 7.16829C12.4989 7.62511 12.5484 8.12777 12.452 8.61273C12.3555 9.09768 12.1174 9.54314 11.7678 9.89277C11.4181 10.2424 10.9727 10.4805 10.4877 10.577C10.0028 10.6734 9.50011 10.6239 9.04329 10.4347C8.58648 10.2455 8.19603 9.92505 7.92133 9.51393C7.64662 9.1028 7.5 8.61945 7.5 8.125C7.5 7.46196 7.76339 6.82607 8.23223 6.35723C8.70107 5.88839 9.33696 5.625 10 5.625Z",fill:"black"})),s1=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...t},N.createElement("path",{d:"M20 0H0V20H20V0Z",fill:"black"}),N.createElement("path",{d:"M8.79664 14.3751C8.69766 14.3749 8.60012 14.3513 8.51204 14.3061C8.42396 14.261 8.34785 14.1956 8.28997 14.1153C8.2321 14.0349 8.1941 13.9421 8.1791 13.8442C8.1641 13.7464 8.17253 13.6464 8.2037 13.5524L10.7037 6.05231C10.7561 5.89505 10.8689 5.76506 11.0172 5.69095C11.1655 5.61683 11.3371 5.60466 11.4944 5.65711C11.6517 5.70956 11.7817 5.82233 11.8558 5.97061C11.9299 6.1189 11.9421 6.29055 11.8896 6.44782L9.38961 13.9479C9.34809 14.0723 9.26848 14.1805 9.16206 14.2572C9.05564 14.3338 8.9278 14.3751 8.79664 14.3751Z",fill:"white"}),N.createElement("path",{d:"M5.04666 14.3751C4.94767 14.3749 4.85013 14.3513 4.76205 14.3061C4.67397 14.261 4.59787 14.1955 4.53999 14.1152C4.48211 14.0349 4.4441 13.942 4.4291 13.8442C4.4141 13.7464 4.42253 13.6464 4.45369 13.5524L6.95369 6.05229C7.00645 5.89542 7.11927 5.76587 7.26741 5.69206C7.41554 5.61825 7.58691 5.60621 7.74391 5.65857C7.90092 5.71093 8.03075 5.82343 8.10493 5.97138C8.17911 6.11933 8.19159 6.29066 8.13962 6.4478L5.6396 13.9479C5.59808 14.0723 5.51848 14.1805 5.41206 14.2571C5.30565 14.3338 5.17781 14.3751 5.04666 14.3751Z",fill:"white"}),N.createElement("path",{d:"M12.5467 14.3751C12.4477 14.3749 12.3501 14.3513 12.2621 14.3061C12.174 14.261 12.0979 14.1955 12.04 14.1152C11.9821 14.0349 11.9441 13.942 11.9291 13.8442C11.9141 13.7464 11.9225 13.6464 11.9537 13.5524L14.4537 6.05229C14.5064 5.89542 14.6193 5.76587 14.7674 5.69206C14.9155 5.61825 15.0869 5.60621 15.2439 5.65857C15.4009 5.71093 15.5308 5.82343 15.6049 5.97138C15.6791 6.11933 15.6916 6.29066 15.6396 6.4478L13.1396 13.9479C13.0981 14.0723 13.0185 14.1805 12.9121 14.2571C12.8057 14.3338 12.6778 14.3751 12.5467 14.3751Z",fill:"white"})),a1="W3WLink-module__mainWrapper__BeGCpA",c1="W3WLink-module__link__yq50q-",Al={mainWrapper:a1,link:c1},wd=({what3words:t})=>{const{id:e,link:n}=t;return w.jsxs("div",{className:Al.mainWrapper,children:[w.jsx(s1,{}),w.jsx("a",{className:Al.link,href:n,title:"w3w link",target:"_blank",rel:"noreferrer",children:e}),w.jsx(o1,{})]})},Rl={day:"",statusValue:"No data",isAvailable:!1,closes:""};function l1(t){const[e,n]=p.useState({...Rl,workSchedule:[]}),{t:r}=vt(["details_modal","common"]),i={1:r("monday"),2:r("tuesday"),3:r("wednesday"),4:r("thursday"),5:r("friday"),6:r("saturday"),7:r("sunday")};return p.useEffect(()=>{function o(a){var d;const c=new Date(Date.now()),l=c.getDay()||7,u=c.toLocaleTimeString("en-GB"),f=(d=a.find(({dayNumber:y})=>y===l))==null?void 0:d.time;if(f){const y=f.split("-"),m=y[y.length-1],_=f.split(", ").some(b=>{const[C,v]=b.split("-");return v.trim()<C.trim()?u>=C||u<v:u>=C&&u<v});return{day:i[l],statusValue:r(_?"open":"close"),isAvailable:_,closes:m}}return{...Rl,statusValue:r("close")}}const s=function(){if(t)return Object.entries(t).reduce((c,[l,u])=>{if(u==null?void 0:u.length){const d=+l,y=u.join(", "),m={dayNumber:d,dayName:i[d],time:y};c.push(m)}return c},[])}();s!=null&&s.length&&n({...o(s),workSchedule:s})},[t]),e}const u1="LocationView-module__title__-wT0bl",f1="LocationView-module__logo__jDjNMt",d1="LocationView-module__header__K0gBYX",h1="LocationView-module__content__wtOPjm",p1="LocationView-module__sectionTitle__cNIgnC",m1="LocationView-module__scheduleContainer__Qbb9sE",g1="LocationView-module__workStatus__9yJNqr",v1="LocationView-module__scheduleButton__RQPquM",y1="LocationView-module__scheduleList__lPVLXP",b1="LocationView-module__scheduleListItem__gcCPSg",w1="LocationView-module__svgWrapper__zKM438",_1="LocationView-module__section__2J1zAJ",S1="LocationView-module__w3wSection__PdU7j4",C1="LocationView-module__chips__ALwJDx",E1="LocationView-module__services__IgJ4ba",x1="LocationView-module__images__-wKmRM",O1="LocationView-module__image__T1E-gt",P1="LocationView-module__actions__NuafMj",T1="LocationView-module__actionsHidden__-vX5kK",A1="LocationView-module__submit__c-Hc8u",R1="LocationView-module__scheduleItem__RhAgat",ve={title:u1,logo:f1,header:d1,content:h1,sectionTitle:p1,scheduleContainer:m1,workStatus:g1,scheduleButton:v1,scheduleList:y1,scheduleListItem:b1,svgWrapper:w1,section:_1,w3wSection:S1,chips:C1,services:E1,images:x1,image:O1,actions:P1,actionsHidden:T1,submit:A1,scheduleItem:R1},L1={default:sd,llama:ad},M1=({classes:t,hideActions:e,location:n,onClose:r,onSubmit:i})=>{var v,E,x;const[o,s]=p.useState(!1),{t:a}=vt(["details_modal","common"]),{isLoading:c,lmsData:l}=bs(),{closes:u,isAvailable:f,statusValue:d,workSchedule:y}=l1(n.timetable),m=(v=l==null?void 0:l.location)==null?void 0:v.what3words,h=!!(m!=null&&m.id),{logo:_="default"}=be(),b=L1[_];function C(){s(g=>!g)}return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:K(ve.header,t==null?void 0:t.header),children:[w.jsx(Rr,{onClick:r}),w.jsxs("div",{className:ve.title,children:[w.jsx("div",{className:ve.logo,children:w.jsx(b,{})}),w.jsx("span",{children:n.name})]})]}),w.jsxs("div",{className:K(ve.content,t==null?void 0:t.content),children:[w.jsxs("section",{className:ve.section,children:[w.jsxs("span",{children:[a("address"),":"]}),c?w.jsx(Qe,{width:200}):w.jsx("p",{children:(E=n.location)==null?void 0:E.full_address})]}),c?w.jsx(Qe,{}):h&&w.jsxs("section",{className:ve.w3wSection,children:[w.jsx(wd,{what3words:m}),w.jsx(i1,{})]}),w.jsxs("div",{className:ve.scheduleContainer,children:[w.jsxs("span",{className:ve.sectionTitle,children:[a("schedule"),":"]}),w.jsxs("button",{type:"button","aria-label":"open schedule",className:ve.scheduleButton,onClick:C,children:[w.jsx("span",{className:ve.workStatus,"data-available":f,children:d}),u&&w.jsxs("span",{children:[a("closes")," ",u]}),w.jsx("span",{className:ve.svgWrapper,"data-open":o,children:w.jsx(Bg,{})})]}),w.jsx("ul",{className:ve.scheduleList,"data-open":o,children:y.map(({dayName:g,time:S})=>{const T=!S?a("weekend"):S;return w.jsxs("li",{className:ve.scheduleListItem,children:[w.jsxs("span",{children:[g,":"]}),w.jsx("span",{children:T})]},g)})})]}),(n.pay_by_card||n.pay_by_card)&&w.jsxs("section",{className:ve.section,children:[w.jsxs("span",{children:[a("payment_method"),":"]}),c?w.jsx(Qe,{width:300}):w.jsxs("div",{className:ve.chips,children:[n.pay_by_cash&&a("pay_by_cash"),n.pay_by_card&&n.pay_by_cash&&", ",n.pay_by_card&&a("pay_by_card")]})]}),w.jsxs("section",{className:ve.section,children:[w.jsxs("span",{children:[a("services"),":"]}),w.jsxs("div",{className:ve.services,children:[n.is_pickup&&(c?w.jsx(Qe,{width:150}):w.jsx("p",{children:a("is_pickup")})),n.is_delivery&&(c?w.jsx(Qe,{width:150}):w.jsx("p",{children:a("is_delivery")})),n.is_dressing_room&&(c?w.jsx(Qe,{width:150}):w.jsx("p",{children:a("is_dressing_room")})),n.is_check_order&&(c?w.jsx(Qe,{width:150}):w.jsx("p",{children:a("is_check_order")}))]})]}),w.jsxs("section",{className:ve.section,children:[w.jsxs("span",{children:[a("location"),":"]}),c?w.jsx(Qe,{width:100}):w.jsx("p",{children:n.location_name})]}),((x=n.images)==null?void 0:x.length)>0&&w.jsx("section",{className:ve.images,children:n.images.map(g=>w.jsx("img",{src:g,alt:n.name,className:ve.image},g))})]}),w.jsx("div",{className:K(ve.actions,{[ve.actionsHidden]:e}),children:w.jsx(ot,{variant:"primary",className:ve.submit,disabled:c,onClick:i,children:a("choose",{ns:"common"})})})]})},_d=p.memo(M1),_c=({isSelectedPoint:t})=>{const e=Z(dc),[n,r]=p.useState(!0);return p.useEffect(()=>{r(t?!e:!0)},[e,t]),n};var k1=D1()?p.useLayoutEffect:p.useEffect;function D1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function j1(){var t=p.useState(Object.create(null)),e=t[1];return p.useCallback(function(){e(Object.create(null))},[])}var N1=function(e){var n=e.children,r=e.type,i=r===void 0?"reach-portal":r,o=p.useRef(null),s=p.useRef(null),a=j1();return k1(function(){if(o.current){var c=o.current.ownerDocument;return s.current=c==null?void 0:c.createElement(i),c.body.appendChild(s.current),a(),function(){s.current&&s.current.ownerDocument&&s.current.ownerDocument.body.removeChild(s.current)}}},[i,a]),s.current?qo.createPortal(n,s.current):p.createElement("span",{ref:o})};/*! *****************************************************************************
28
28
  Copyright (c) Microsoft Corporation.
29
29
 
30
30
  Permission to use, copy, modify, and/or distribute this software for any
@@ -37,17 +37,17 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
37
37
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
38
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
39
  PERFORMANCE OF THIS SOFTWARE.
40
- ***************************************************************************** */var F=function(){return F=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},F.apply(this,arguments)};function Il(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function we(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ee(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function $e(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var Fe;(function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"})(Fe||(Fe={}));var Kr;(function(t){t.Parent="#_parent",t.Internal="#_internal"})(Kr||(Kr={}));var Ua=Fe.Start,jl=Fe.Stop,so=Fe.Raise,As=Fe.Send,Zd=Fe.Cancel,ky=Fe.NullEvent,Nl=Fe.Assign;Fe.After;Fe.DoneState;var qd=Fe.Log,Ty=Fe.Init,Va=Fe.Invoke;Fe.ErrorExecution;var Ru=Fe.ErrorPlatform,Ry=Fe.ErrorCustom,Kd=Fe.Update,Dy=Fe.Choose,Ay=Fe.Pure,Qd=".",Du={},za="xstate.guard",Iy="",bo;function Bl(t,e,n){n===void 0&&(n=Qd);var r=Oi(t,n),i=Oi(e,n);return Re(i)?Re(r)?i===r:!1:Re(r)?r in i:Object.keys(r).every(function(o){return o in i?Bl(r[o],i[o]):!1})}function Jd(t){try{return Re(t)||typeof t=="number"?"".concat(t):t.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function Ha(t,e){try{return ri(t)?t:t.toString().split(e)}catch{throw new Error("'".concat(t,"' is not a valid state path."))}}function jy(t){return typeof t=="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function Oi(t,e){if(jy(t))return t.value;if(ri(t))return us(t);if(typeof t!="string")return t;var n=Ha(t,e);return us(n)}function us(t){if(t.length===1)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function Ci(t,e){for(var n={},r=Object.keys(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function Au(t,e,n){var r,i,o={};try{for(var s=we(Object.keys(t)),a=s.next();!a.done;a=s.next()){var l=a.value,u=t[l];n(u)&&(o[l]=e(u,l,t))}}catch(f){r={error:f}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}var Ny=function(t){return function(e){var n,r,i=e;try{for(var o=we(t),s=o.next();!s.done;s=o.next()){var a=s.value;i=i[a]}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function By(t,e){return function(n){var r,i,o=n;try{for(var s=we(t),a=s.next();!a.done;a=s.next()){var l=a.value;o=o[e][l]}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}}function Ko(t){if(!t)return[[]];if(Re(t))return[[t]];var e=Ke(Object.keys(t).map(function(n){var r=t[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:Ko(t[n]).map(function(i){return[n].concat(i)})}));return e}function Ke(t){var e;return(e=[]).concat.apply(e,$e([],Ee(t),!1))}function Yd(t){return ri(t)?t:[t]}function zt(t){return t===void 0?[]:Yd(t)}function cs(t,e,n){var r,i;if(Oe(t))return t(e,n.data);var o={};try{for(var s=we(Object.keys(t)),a=s.next();!a.done;a=s.next()){var l=a.value,u=t[l];Oe(u)?o[l]=u(e,n.data):o[l]=u}}catch(f){r={error:f}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function Fy(t){return/^(done|error)\./.test(t)}function Iu(t){return!!(t instanceof Promise||t!==null&&(Oe(t)||typeof t=="object")&&Oe(t.then))}function Uy(t){return t!==null&&typeof t=="object"&&"transition"in t&&typeof t.transition=="function"}function Vy(t,e){var n,r,i=Ee([[],[]],2),o=i[0],s=i[1];try{for(var a=we(t),l=a.next();!l.done;l=a.next()){var u=l.value;e(u)?o.push(u):s.push(u)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}function Xd(t,e){return Ci(t.states,function(n,r){if(n){var i=(Re(e)?void 0:e[r])||(n?n.current:void 0);if(i)return{current:i,states:Xd(n,i)}}})}function zy(t,e){return{current:e,states:Xd(t,e)}}function ju(t,e,n,r){var i=t&&n.reduce(function(o,s){var a,l,u=s.assignment,f={state:r,action:s,_event:e},d={};if(Oe(u))d=u(o,e.data,f);else try{for(var h=we(Object.keys(u)),v=h.next();!v.done;v=h.next()){var y=v.value,g=u[y];d[y]=Oe(g)?g(o,e.data,f):g}}catch(S){a={error:S}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(a)throw a.error}}return Object.assign({},o,d)},t);return i}var Hy=function(){};function ri(t){return Array.isArray(t)}function Oe(t){return typeof t=="function"}function Re(t){return typeof t=="string"}function eh(t,e){if(t)return Re(t)?{type:za,name:t,predicate:e?e[t]:void 0}:Oe(t)?{type:za,name:t.name,predicate:t}:t}function $y(t){try{return"subscribe"in t&&Oe(t.subscribe)}catch{return!1}}var kn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();bo={},bo[kn]=function(){return this},bo[Symbol.observable]=function(){return this};function Qr(t){return!!t&&"__xstatenode"in t}function Wy(t){return!!t&&typeof t.send=="function"}function Is(t,e){return Re(t)||typeof t=="number"?F({type:t},e):t}function at(t,e){if(!Re(t)&&"$$type"in t&&t.$$type==="scxml")return t;var n=Is(t);return F({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function br(t,e){var n=Yd(e).map(function(r){return typeof r>"u"||typeof r=="string"||Qr(r)?{target:r,event:t}:F(F({},r),{event:t})});return n}function Gy(t){if(!(t===void 0||t===Iy))return zt(t)}function th(t,e,n,r,i){var o=t.options.guards,s={state:i,cond:e,_event:r};if(e.type===za)return((o==null?void 0:o[e.name])||e.predicate)(n,r.data,s);var a=o==null?void 0:o[e.type];if(!a)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return a(n,r.data,s)}function nh(t){return typeof t=="string"?{type:t}:t}function Qo(t,e,n){var r=function(){},i=typeof t=="object",o=i?t:null;return{next:((i?t.next:t)||r).bind(o),error:((i?t.error:e)||r).bind(o),complete:((i?t.complete:n)||r).bind(o)}}function wo(t,e){return"".concat(t,":invocation[").concat(e,"]")}function $a(t){return(t.type===so||t.type===As&&t.to===Kr.Internal)&&typeof t.delay!="number"}var Pr=at({type:Ty});function Wa(t,e){return e&&e[t]||void 0}function Vi(t,e){var n;if(Re(t)||typeof t=="number"){var r=Wa(t,e);Oe(r)?n={type:t,exec:r}:r?n=r:n={type:t,exec:void 0}}else if(Oe(t))n={type:t.name||t.toString(),exec:t};else{var r=Wa(t.type,e);if(Oe(r))n=F(F({},t),{exec:r});else if(r){var i=r.type||t.type;n=F(F(F({},r),t),{type:i})}else n=t}return n}var Tn=function(t,e){if(!t)return[];var n=ri(t)?t:[t];return n.map(function(r){return Vi(r,e)})};function Fl(t){var e=Vi(t);return F(F({id:Re(t)?t:e.id},e),{type:e.type})}function Zy(t,e){return{type:so,event:typeof t=="function"?t:Is(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function qy(t,e,n,r){var i={_event:n},o=at(Oe(t.event)?t.event(e,n.data,i):t.event),s;if(Re(t.delay)){var a=r&&r[t.delay];s=Oe(a)?a(e,n.data,i):a}else s=Oe(t.delay)?t.delay(e,n.data,i):t.delay;return F(F({},t),{type:so,_event:o,delay:s})}function Ky(t,e){return{to:e?e.to:void 0,type:As,event:Oe(t)?t:Is(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:Oe(t)?t.name:Jd(t)}}function Qy(t,e,n,r){var i={_event:n},o=at(Oe(t.event)?t.event(e,n.data,i):t.event),s;if(Re(t.delay)){var a=r&&r[t.delay];s=Oe(a)?a(e,n.data,i):a}else s=Oe(t.delay)?t.delay(e,n.data,i):t.delay;var l=Oe(t.to)?t.to(e,n.data,i):t.to;return F(F({},t),{to:l,_event:o,event:o.data,delay:s})}var Jy=function(t,e,n){return F(F({},t),{value:Re(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})},Yy=function(t){return{type:Zd,sendId:t}};function Xy(t){var e=Fl(t);return{type:Fe.Start,activity:e,exec:void 0}}function e1(t){var e=Oe(t)?t:Fl(t);return{type:Fe.Stop,activity:e,exec:void 0}}function t1(t,e,n){var r=Oe(t.activity)?t.activity(e,n.data):t.activity,i=typeof r=="string"?{id:r}:r,o={type:Fe.Stop,activity:i};return o}var n1=function(t){return{type:Nl,assignment:t}};function r1(t,e){var n=e?"#".concat(e):"";return"".concat(Fe.After,"(").concat(t,")").concat(n)}function Co(t,e){var n="".concat(Fe.DoneState,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function Jo(t,e){var n="".concat(Fe.DoneInvoke,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function Si(t,e){var n="".concat(Fe.ErrorPlatform,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}var i1=function(t){var e,n,r=[];try{for(var i=we(t),o=i.next();!o.done;o=i.next())for(var s=o.value,a=0;a<s.actions.length;){if(s.actions[a].type===Nl){r.push(s.actions[a]),s.actions.splice(a,1);continue}a++}}catch(l){e={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r};function fs(t,e,n,r,i,o,s){s===void 0&&(s=!1);var a=s?[]:i1(i),l=a.length?ju(n,r,a,e):n,u=s?[n]:void 0,f=[];function d(y,g){var S;switch(g.type){case so:{var w=qy(g,l,r,t.options.delays);return o&&typeof w.delay=="number"&&o(w,l,r),w}case As:var L=Qy(g,l,r,t.options.delays);return o&&L.to!==Kr.Internal&&(y==="entry"?f.push(L):o(L,l,r)),L;case qd:{var m=Jy(g,l,r);return o==null||o(m,l,r),m}case Dy:{var _=g,E=(S=_.conds.find(function(V){var N=eh(V.cond,t.options.guards);return!N||th(t,N,l,r,o?void 0:e)}))===null||S===void 0?void 0:S.actions;if(!E)return[];var p=Ee(fs(t,e,l,r,[{type:y,actions:Tn(zt(E),t.options.actions)}],o,s),2),b=p[0],x=p[1];return l=x,u==null||u.push(l),b}case Ay:{var E=g.get(l,r.data);if(!E)return[];var P=Ee(fs(t,e,l,r,[{type:y,actions:Tn(zt(E),t.options.actions)}],o,s),2),O=P[0],T=P[1];return l=T,u==null||u.push(l),O}case jl:{var m=t1(g,l,r);return o==null||o(m,n,r),m}case Nl:{l=ju(l,r,[g],o?void 0:e),u==null||u.push(l);break}default:var M=Vi(g,t.options.actions),R=M.exec;if(o)o(M,l,r);else if(R&&u){var A=u.length-1,B=F(F({},M),{exec:function(V){for(var N=[],z=1;z<arguments.length;z++)N[z-1]=arguments[z];R.apply(void 0,$e([u[A]],Ee(N),!1))}});M=B}return M}}function h(y){var g,S,w=[];try{for(var L=we(y.actions),m=L.next();!m.done;m=L.next()){var _=m.value,E=d(y.type,_);E&&(w=w.concat(E))}}catch(p){g={error:p}}finally{try{m&&!m.done&&(S=L.return)&&S.call(L)}finally{if(g)throw g.error}}return f.forEach(function(p){o(p,l,r)}),f.length=0,w}var v=Ke(i.map(h));return[v,l]}var _r=function(t,e){var n=e(t);return n};function rh(t){var e;return e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}},e[kn]=function(){return this},e}function o1(t,e,n,r){var i,o=nh(t.src),s=(i=e==null?void 0:e.options.services)===null||i===void 0?void 0:i[o.type],a=t.data?cs(t.data,n,r):void 0,l=s?ih(s,t.id,a):rh(t.id);return l.meta=t,l}function ih(t,e,n){var r=rh(e);if(r.deferred=!0,Qr(t)){var i=r.state=_r(void 0,function(){return(n?t.withContext(n):t).initialState});r.getSnapshot=function(){return i}}return r}function s1(t){try{return typeof t.send=="function"}catch{return!1}}function a1(t){return s1(t)&&"id"in t}function l1(t){var e;return F((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e[kn]=function(){return this},e),t)}var ds=function(t){return t.type==="atomic"||t.type==="final"};function oh(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function zi(t){return oh(t).filter(function(e){return e.type!=="history"})}function sh(t){var e=[t];return ds(t)?e:e.concat(Ke(zi(t).map(sh)))}function Li(t,e){var n,r,i,o,s,a,l,u,f=new Set(t),d=Ga(f),h=new Set(e);try{for(var v=we(h),y=v.next();!y.done;y=v.next())for(var g=y.value,S=g.parent;S&&!h.has(S);)h.add(S),S=S.parent}catch(P){n={error:P}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}var w=Ga(h);try{for(var L=we(h),m=L.next();!m.done;m=L.next()){var g=m.value;if(g.type==="compound"&&(!w.get(g)||!w.get(g).length))d.get(g)?d.get(g).forEach(function(O){return h.add(O)}):g.initialStateNodes.forEach(function(O){return h.add(O)});else if(g.type==="parallel")try{for(var _=(s=void 0,we(zi(g))),E=_.next();!E.done;E=_.next()){var p=E.value;h.has(p)||(h.add(p),d.get(p)?d.get(p).forEach(function(O){return h.add(O)}):p.initialStateNodes.forEach(function(O){return h.add(O)}))}}catch(O){s={error:O}}finally{try{E&&!E.done&&(a=_.return)&&a.call(_)}finally{if(s)throw s.error}}}}catch(P){i={error:P}}finally{try{m&&!m.done&&(o=L.return)&&o.call(L)}finally{if(i)throw i.error}}try{for(var b=we(h),x=b.next();!x.done;x=b.next())for(var g=x.value,S=g.parent;S&&!h.has(S);)h.add(S),S=S.parent}catch(P){l={error:P}}finally{try{x&&!x.done&&(u=b.return)&&u.call(b)}finally{if(l)throw l.error}}return h}function ah(t,e){var n=e.get(t);if(!n)return{};if(t.type==="compound"){var r=n[0];if(r){if(ds(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=ah(o,e)}),i}function Ga(t){var e,n,r=new Map;try{for(var i=we(t),o=i.next();!o.done;o=i.next()){var s=o.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function u1(t,e){var n=Li([t],e);return ah(t,Ga(n))}function xi(t,e){return Array.isArray(t)?t.some(function(n){return n===e}):t instanceof Set?t.has(e):!1}function c1(t){return $e([],Ee(new Set(Ke($e([],Ee(t.map(function(e){return e.ownEvents})),!1)))),!1)}function Yo(t,e){return e.type==="compound"?zi(e).some(function(n){return n.type==="final"&&xi(t,n)}):e.type==="parallel"?zi(e).every(function(n){return Yo(t,n)}):!1}function f1(t){return t===void 0&&(t=[]),t.reduce(function(e,n){return n.meta!==void 0&&(e[n.id]=n.meta),e},{})}function Nu(t){return new Set(Ke(t.map(function(e){return e.tags})))}function lh(t,e){if(t===e)return!0;if(t===void 0||e===void 0)return!1;if(Re(t)||Re(e))return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(i){return lh(t[i],e[i])})}function d1(t){return typeof t!="object"||t===null?!1:"value"in t&&"_event"in t}function h1(t,e){var n=t.exec,r=F(F({},t),{exec:n!==void 0?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0});return r}var It=function(){function t(e){var n=this,r;this.actions=[],this.activities=Du,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||Du,this.meta=f1(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=(r=Array.isArray(e.tags)?new Set(e.tags):e.tags)!==null&&r!==void 0?r:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return c1(n.configuration)}})}return t.from=function(e,n){if(e instanceof t)return e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e;var r=Pr;return new t({value:e,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var r=Pr;return new t({value:e.value,context:n,_event:r,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(e,n){var r=this;if(e===void 0&&(e=this.value),n===void 0&&(n="."),Re(e))return[e];var i=Object.keys(e);return i.concat.apply(i,$e([],Ee(i.map(function(o){return r.toStrings(e[o],n).map(function(s){return o+n+s})})),!1))},t.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var n=e.tags;e.machine;var r=Il(e,["configuration","transitions","tags","machine"]);return F(F({},r),{tags:Array.from(n)})},t.prototype.matches=function(e){return Bl(e,this.value)},t.prototype.hasTag=function(e){return this.tags.has(e)},t.prototype.can=function(e){var n;Hy(!!this.machine);var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,e);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},t}(),p1={deferEvents:!1},Bu=function(){function t(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=F(F({},p1),e)}return t.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents){this.schedule(e);return}this.process(e)}this.flushEvents()},t.prototype.schedule=function(e){if(!this.initialized||this.processingEvent){this.queue.push(e);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},t.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},t}(),ta=new Map,g1=0,di={bookId:function(){return"x:".concat(g1++)},register:function(t,e){return ta.set(t,e),t},get:function(t){return ta.get(t)},free:function(t){ta.delete(t)}};function Ul(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function v1(){var t=Ul();if(t&&"__xstate__"in t)return t.__xstate__}function m1(t){if(Ul()){var e=v1();e&&e.register(t)}}function y1(t,e){e===void 0&&(e={});var n=t.initialState,r=new Set,i=[],o=!1,s=function(){if(!o){for(o=!0;i.length>0;){var u=i.shift();n=t.transition(n,u,l),r.forEach(function(f){return f.next(n)})}o=!1}},a=l1({id:e.id,send:function(u){i.push(u),s()},getSnapshot:function(){return n},subscribe:function(u,f,d){var h=Qo(u,f,d);return r.add(h),h.next(n),{unsubscribe:function(){r.delete(h)}}}}),l={parent:e.parent,self:a,id:e.id||"anonymous",observers:r};return n=t.start?t.start(l):n,a}var b1={sync:!1,autoForward:!1},it;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(it||(it={}));var w1=function(){function t(e,n){n===void 0&&(n=t.defaultOptions);var r=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=it.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(f,d){if(ri(f))return r.batch(f),r.state;var h=at(Is(f,d));if(r.status===it.Stopped)return r.state;if(r.status!==it.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(h.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
41
- Event: `).concat(JSON.stringify(h.data)));return r.scheduler.schedule(function(){r.forward(h);var v=r._nextState(h);r.update(v,h)}),r._state},this.sendTo=function(f,d,h){var v=r.parent&&(d===Kr.Parent||r.parent.id===d),y=v?r.parent:Re(d)?d===Kr.Internal?r:r.children.get(d)||di.get(d):Wy(d)?d:void 0;if(!y){if(!v)throw new Error("Unable to send event to child '".concat(d,"' from service '").concat(r.id,"'."));return}if("machine"in y){if(r.status!==it.Stopped||r.parent!==y||r.state.done){var g=F(F({},f),{name:f.name===Ry?"".concat(Si(r.id)):f.name,origin:r.sessionId});!h&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([y,g]):y.send(g)}}else!h&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([y,f.data]):y.send(f.data)},this._exec=function(f,d,h,v){v===void 0&&(v=r.machine.options.actions);var y=f.exec||Wa(f.type,v),g=Oe(y)?y:y?y.exec:f.exec;if(g)try{return g(d,h.data,r.machine.config.predictableActionArguments?{action:f,_event:h}:{action:f,state:r.state,_event:h})}catch(A){throw r.parent&&r.parent.send({type:"xstate.error",data:A}),A}switch(f.type){case so:{var S=f;r.defer(S);break}case As:var w=f;if(typeof w.delay=="number"){r.defer(w);return}else w.to?r.sendTo(w._event,w.to,h===Pr):r.send(w._event);break;case Zd:r.cancel(f.sendId);break;case Ua:{if(r.status!==it.Running)return;var L=f.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[L.id||L.type])break;if(L.type===Fe.Invoke){var m=nh(L.src),_=r.machine.options.services?r.machine.options.services[m.type]:void 0,E=L.id,p=L.data,b="autoForward"in L?L.autoForward:!!L.forward;if(!_)return;var x=p?cs(p,d,h):void 0;if(typeof _=="string")return;var P=Oe(_)?_(d,h.data,{data:x,src:m,meta:L.meta}):_;if(!P)return;var O=void 0;Qr(P)&&(P=x?P.withContext(x):P,O={autoForward:b}),r.spawn(P,E,O)}else r.spawnActivity(L);break}case jl:{r.stopChild(f.activity.id);break}case qd:var T=f,M=T.label,R=T.value;M?r.logger(M,R):r.logger(R);break}};var i=F(F({},t.defaultOptions),n),o=i.clock,s=i.logger,a=i.parent,l=i.id,u=l!==void 0?l:e.id;this.id=u,this.logger=s,this.clock=o,this.parent=a,this.options=i,this.scheduler=new Bu({deferEvents:this.options.deferEvents}),this.sessionId=di.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:_r(this,function(){return e._initialState=e.machine.initialState,e._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(e,n){var r,i;try{for(var o=we(e.actions),s=o.next();!s.done;s=o.next()){var a=s.value;this.exec(a,e,n)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.update=function(e,n){var r,i,o,s,a,l,u,f,d=this;if(e._sessionid=this.sessionId,this._state=e,(!this.machine.config.predictableActionArguments||n===Pr)&&this.options.execute)this.execute(this.state);else for(var h=void 0;h=this._outgoingQueue.shift();)h[0].send(h[1]);if(this.children.forEach(function(P){d.state.children[P.id]=P}),this.devTools&&this.devTools.send(n.data,e),e.event)try{for(var v=we(this.eventListeners),y=v.next();!y.done;y=v.next()){var g=y.value;g(e.event)}}catch(P){r={error:P}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}try{for(var S=we(this.listeners),w=S.next();!w.done;w=S.next()){var g=w.value;g(e,e.event)}}catch(P){o={error:P}}finally{try{w&&!w.done&&(s=S.return)&&s.call(S)}finally{if(o)throw o.error}}try{for(var L=we(this.contextListeners),m=L.next();!m.done;m=L.next()){var _=m.value;_(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(P){a={error:P}}finally{try{m&&!m.done&&(l=L.return)&&l.call(L)}finally{if(a)throw a.error}}if(this.state.done){var E=e.configuration.find(function(P){return P.type==="final"&&P.parent===d.machine}),p=E&&E.doneData?cs(E.doneData,e.context,n):void 0;this._doneEvent=Jo(this.id,p);try{for(var b=we(this.doneListeners),x=b.next();!x.done;x=b.next()){var g=x.value;g(this._doneEvent)}}catch(P){u={error:P}}finally{try{x&&!x.done&&(f=b.return)&&f.call(b)}finally{if(u)throw u.error}}this._stop(),this._stopChildren(),di.free(this.sessionId)}},t.prototype.onTransition=function(e){return this.listeners.add(e),this.status===it.Running&&e(this.state,this.state.event),this},t.prototype.subscribe=function(e,n,r){var i=this,o=Qo(e,n,r);this.listeners.add(o.next),this.status!==it.NotStarted&&o.next(this.state);var s=function(){i.doneListeners.delete(s),i.stopListeners.delete(s),o.complete()};return this.status===it.Stopped?o.complete():(this.onDone(s),this.onStop(s)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(s),i.stopListeners.delete(s)}}},t.prototype.onEvent=function(e){return this.eventListeners.add(e),this},t.prototype.onSend=function(e){return this.sendListeners.add(e),this},t.prototype.onChange=function(e){return this.contextListeners.add(e),this},t.prototype.onStop=function(e){return this.stopListeners.add(e),this},t.prototype.onDone=function(e){return this.status===it.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},t.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},t.prototype.start=function(e){var n=this;if(this.status===it.Running)return this;this.machine._init(),di.register(this.sessionId,this),this.initialized=!0,this.status=it.Running;var r=e===void 0?this.initialState:_r(this,function(){return d1(e)?n.machine.resolveState(e):n.machine.resolveState(It.from(e,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,Pr)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(e){Oe(e.stop)&&e.stop()}),this.children.clear()},t.prototype._stop=function(){var e,n,r,i,o,s,a,l,u,f;try{for(var d=we(this.listeners),h=d.next();!h.done;h=d.next()){var v=h.value;this.listeners.delete(v)}}catch(b){e={error:b}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}try{for(var y=we(this.stopListeners),g=y.next();!g.done;g=y.next()){var v=g.value;v(),this.stopListeners.delete(v)}}catch(b){r={error:b}}finally{try{g&&!g.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}try{for(var S=we(this.contextListeners),w=S.next();!w.done;w=S.next()){var v=w.value;this.contextListeners.delete(v)}}catch(b){o={error:b}}finally{try{w&&!w.done&&(s=S.return)&&s.call(S)}finally{if(o)throw o.error}}try{for(var L=we(this.doneListeners),m=L.next();!m.done;m=L.next()){var v=m.value;this.doneListeners.delete(v)}}catch(b){a={error:b}}finally{try{m&&!m.done&&(l=L.return)&&l.call(L)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=it.Stopped,this._initialState=void 0;try{for(var _=we(Object.keys(this.delayedEventsMap)),E=_.next();!E.done;E=_.next()){var p=E.value;this.clock.clearTimeout(this.delayedEventsMap[p])}}catch(b){u={error:b}}finally{try{E&&!E.done&&(f=_.return)&&f.call(_)}finally{if(u)throw u.error}}this.scheduler.clear(),this.scheduler=new Bu({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var e=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r;if(!(!((r=e._state)===null||r===void 0)&&r.done)){var i=at({type:"xstate.stop"}),o=_r(e,function(){var s=Ke($e([],Ee(e.state.configuration),!1).sort(function(d,h){return h.order-d.order}).map(function(d){return Tn(d.onExit,e.machine.options.actions)})),a=Ee(fs(e.machine,e.state,e.state.context,i,[{type:"exit",actions:s}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),l=a[0],u=a[1],f=new It({value:e.state.value,context:u,_event:i,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:l.filter(function(d){return!$a(d)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return f.changed=!0,f});e.update(o,i),e._stopChildren(),di.free(e.sessionId)}}),this},t.prototype.batch=function(e){var n=this;if(!(this.status===it.NotStarted&&this.options.deferEvents)){if(this.status!==it.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(e.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,s=n.state,a=!1,l=[],u=function(v){var y=at(v);n.forward(y),s=_r(n,function(){return n.machine.transition(s,y,void 0,r||void 0)}),l.push.apply(l,$e([],Ee(n.machine.config.predictableActionArguments?s.actions:s.actions.map(function(g){return h1(g,s)})),!1)),a=a||!!s.changed};try{for(var f=we(e),d=f.next();!d.done;d=f.next()){var h=d.value;u(h)}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}s.changed=a,s.actions=l,n.update(s,at(e[e.length-1]))})}},t.prototype.sender=function(e){return this.send.bind(this,e)},t.prototype._nextState=function(e,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=at(e);if(i.name.indexOf(Ru)===0&&!this.state.nextEvents.some(function(s){return s.indexOf(Ru)===0}))throw i.data.data;var o=_r(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},t.prototype.nextState=function(e){return this._nextState(e,!1)},t.prototype.forward=function(e){var n,r;try{for(var i=we(this.forwardTo),o=i.next();!o.done;o=i.next()){var s=o.value,a=this.children.get(s);if(!a)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(s,"'."));a.send(e)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.defer=function(e){var n=this,r=this.clock.setTimeout(function(){"to"in e&&e.to?n.sendTo(e._event,e.to,!0):n.send(e._event)},e.delay);e.id&&(this.delayedEventsMap[e.id]=r)},t.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},t.prototype.exec=function(e,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(e,n.context,n._event,r)},t.prototype.removeChild=function(e){var n;this.children.delete(e),this.forwardTo.delete(e),(n=this.state)===null||n===void 0||delete n.children[e]},t.prototype.stopChild=function(e){var n=this.children.get(e);n&&(this.removeChild(e),Oe(n.stop)&&n.stop())},t.prototype.spawn=function(e,n,r){if(this.status!==it.Running)return ih(e,n);if(Iu(e))return this.spawnPromise(Promise.resolve(e),n);if(Oe(e))return this.spawnCallback(e,n);if(a1(e))return this.spawnActor(e,n);if($y(e))return this.spawnObservable(e,n);if(Qr(e))return this.spawnMachine(e,F(F({},r),{id:n}));if(Uy(e))return this.spawnBehavior(e,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof e,'".'))},t.prototype.spawnMachine=function(e,n){var r=this;n===void 0&&(n={});var i=new t(e,F(F({},this.options),{parent:this,id:n.id||e.id})),o=F(F({},b1),n);o.sync&&i.onTransition(function(a){r.send(Kd,{state:a,id:i.id})});var s=i;return this.children.set(i.id,s),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(a){r.removeChild(i.id),r.send(at(a,{origin:i.id}))}).start(),s},t.prototype.spawnBehavior=function(e,n){var r=y1(e,{id:n,parent:this});return this.children.set(n,r),r},t.prototype.spawnPromise=function(e,n){var r,i=this,o=!1,s;e.then(function(l){o||(s=l,i.removeChild(n),i.send(at(Jo(n,l),{origin:n})))},function(l){if(!o){i.removeChild(n);var u=Si(n,l);try{i.send(at(u,{origin:n}))}catch{i.devTools&&i.devTools.send(u,i.state),i.machine.strict&&i.stop()}}});var a=(r={id:n,send:function(){},subscribe:function(l,u,f){var d=Qo(l,u,f),h=!1;return e.then(function(v){h||(d.next(v),!h&&d.complete())},function(v){h||d.error(v)}),{unsubscribe:function(){return h=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return s}},r[kn]=function(){return this},r);return this.children.set(n,a),a},t.prototype.spawnCallback=function(e,n){var r,i=this,o=!1,s=new Set,a=new Set,l,u=function(h){l=h,a.forEach(function(v){return v(h)}),!o&&i.send(at(h,{origin:n}))},f;try{f=e(u,function(h){s.add(h)})}catch(h){this.send(Si(n,h))}if(Iu(f))return this.spawnPromise(f,n);var d=(r={id:n,send:function(h){return s.forEach(function(v){return v(h)})},subscribe:function(h){var v=Qo(h);return a.add(v.next),{unsubscribe:function(){a.delete(v.next)}}},stop:function(){o=!0,Oe(f)&&f()},toJSON:function(){return{id:n}},getSnapshot:function(){return l}},r[kn]=function(){return this},r);return this.children.set(n,d),d},t.prototype.spawnObservable=function(e,n){var r,i=this,o,s=e.subscribe(function(l){o=l,i.send(at(l,{origin:n}))},function(l){i.removeChild(n),i.send(at(Si(n,l),{origin:n}))},function(){i.removeChild(n),i.send(at(Jo(n),{origin:n}))}),a=(r={id:n,send:function(){},subscribe:function(l,u,f){return e.subscribe(l,u,f)},stop:function(){return s.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[kn]=function(){return this},r);return this.children.set(n,a),a},t.prototype.spawnActor=function(e,n){return this.children.set(n,e),e},t.prototype.spawnActivity=function(e){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(n){var r=n(this.state.context,e);this.spawnEffect(e.id,r)}},t.prototype.spawnEffect=function(e,n){var r;this.children.set(e,(r={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}},r[kn]=function(){return this},r))},t.prototype.attachDev=function(){var e=Ul();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(F(F({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:F({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}m1(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[kn]=function(){return this},t.prototype.getSnapshot=function(){return this.status===it.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,n){return setTimeout(e,n)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},t.interpret=uh,t}();function uh(t,e){var n=new w1(t,e);return n}function C1(t){if(typeof t=="string"){var e={type:t};return e.toString=function(){return t},e}return t}function So(t){return F(F({type:Va},t),{toJSON:function(){t.onDone,t.onError;var e=Il(t,["onDone","onError"]);return F(F({},e),{type:Va,src:C1(t.src)})}})}var Lo="",Za="#",na="*",wr={},Cr=function(t){return t[0]===Za},S1=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},L1=function(){function t(e,n,r,i){r===void 0&&(r="context"in e?e.context:void 0);var o=this,s;this.config=e,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(S1(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:Qd),this.id=this.config.id||$e([this.machine.key],Ee(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(s=this.config.schema)!==null&&s!==void 0?s:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?Ci(this.config.states,function(u,f){var d,h=new t(u,{},void 0,{parent:o,key:f});return Object.assign(o.idMap,F((d={},d[h.id]=h,d),h.idMap)),h}):wr;var a=0;function l(u){var f,d;u.order=a++;try{for(var h=we(oh(u)),v=h.next();!v.done;v=h.next()){var y=v.value;l(y)}}catch(g){f={error:g}}finally{try{v&&!v.done&&(d=h.return)&&d.call(h)}finally{if(f)throw f.error}}}l(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(u){var f=u.event;return f===Lo}):Lo in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=zt(this.config.entry||this.config.onEntry).map(function(u){return Vi(u)}),this.onExit=zt(this.config.exit||this.config.onExit).map(function(u){return Vi(u)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=zt(this.config.invoke).map(function(u,f){var d,h;if(Qr(u)){var v=wo(o.id,f);return o.machine.options.services=F((d={},d[v]=u,d),o.machine.options.services),So({src:v,id:v})}else if(Re(u.src)){var v=u.id||wo(o.id,f);return So(F(F({},u),{id:v,src:u.src}))}else if(Qr(u.src)||Oe(u.src)){var v=u.id||wo(o.id,f);return o.machine.options.services=F((h={},h[v]=u.src,h),o.machine.options.services),So(F(F({id:v},u),{src:v}))}else{var y=u.src;return So(F(F({id:wo(o.id,f)},u),{src:y}))}}),this.activities=zt(this.config.activities).concat(this.invoke).map(function(u){return Fl(u)}),this.transition=this.transition.bind(this),this.tags=zt(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||sh(this).forEach(function(e){return e.on})},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,s=r.guards,a=r.services,l=r.delays;return new t(this.config,{actions:F(F({},i),e.actions),activities:F(F({},o),e.activities),guards:F(F({},s),e.guards),services:F(F({},a),e.services),delays:F(F({},l),e.delays)},n??this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return Oe(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Ci(this.states,function(e){return e.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var n=e===Lo,r=this.transitions.filter(function(i){var o=i.eventType===e;return n?o:o||i.eventType===na});return this.__cache.candidates[e]=r,r},t.prototype.getDelayedTransitions=function(){var e=this,n=this.config.after;if(!n)return[];var r=function(o,s){var a=Oe(o)?"".concat(e.id,":delay[").concat(s,"]"):o,l=r1(a,e.id);return e.onEntry.push(Ky(l,{delay:o})),e.onExit.push(Yy(l)),l},i=ri(n)?n.map(function(o,s){var a=r(o.delay,s);return F(F({},o),{event:a})}):Ke(Object.keys(n).map(function(o,s){var a=n[o],l=Re(a)?{target:a}:a,u=isNaN(+o)?o:+o,f=r(u,s);return zt(l).map(function(d){return F(F({},d),{event:f,delay:u})})}));return i.map(function(o){var s=o.delay;return F(F({},e.formatTransition(o)),{delay:s})})},t.prototype.getStateNodes=function(e){var n,r=this;if(!e)return[];var i=e instanceof It?e.value:Oi(e,this.delimiter);if(Re(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var s=Object.keys(i),a=[this];return a.push.apply(a,$e([],Ee(Ke(s.map(function(l){return r.getStateNode(l).getStateNodes(i[l])}))),!1)),a},t.prototype.handles=function(e){var n=Jd(e);return this.events.includes(n)},t.prototype.resolveState=function(e){var n=e instanceof It?e:It.create(e),r=Array.from(Li([],this.getStateNodes(n.value)));return new It(F(F({},n),{value:this.resolve(n.value),configuration:r,done:Yo(r,this),tags:Nu(r),machine:this.machine}))},t.prototype.transitionLeafNode=function(e,n,r){var i=this.getStateNode(e),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},t.prototype.transitionCompoundNode=function(e,n,r){var i=Object.keys(e),o=this.getStateNode(i[0]),s=o._transition(e[i[0]],n,r);return!s||!s.transitions.length?this.next(n,r):s},t.prototype.transitionParallelNode=function(e,n,r){var i,o,s={};try{for(var a=we(Object.keys(e)),l=a.next();!l.done;l=a.next()){var u=l.value,f=e[u];if(f){var d=this.getStateNode(u),h=d._transition(f,n,r);h&&(s[u]=h)}}}catch(w){i={error:w}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}var v=Object.keys(s).map(function(w){return s[w]}),y=Ke(v.map(function(w){return w.transitions})),g=v.some(function(w){return w.transitions.length>0});if(!g)return this.next(n,r);var S=Ke(Object.keys(s).map(function(w){return s[w].configuration}));return{transitions:y,exitSet:Ke(v.map(function(w){return w.exitSet})),configuration:S,source:n,actions:Ke(Object.keys(s).map(function(w){return s[w].actions}))}},t.prototype._transition=function(e,n,r){return Re(e)?this.transitionLeafNode(e,n,r):Object.keys(e).length===1?this.transitionCompoundNode(e,n,r):this.transitionParallelNode(e,n,r)},t.prototype.getTransitionData=function(e,n){return this._transition(e.value,e,at(n))},t.prototype.next=function(e,n){var r,i,o=this,s=n.name,a=[],l=[],u;try{for(var f=we(this.getCandidates(s)),d=f.next();!d.done;d=f.next()){var h=d.value,v=h.cond,y=h.in,g=e.context,S=y?Re(y)&&Cr(y)?e.matches(Oi(this.getStateNodeById(y).path,this.delimiter)):Bl(Oi(y,this.delimiter),Ny(this.path.slice(0,-2))(e.value)):!0,w=!1;try{w=!v||th(this.machine,v,g,n,e)}catch(_){throw new Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,`':
42
- `).concat(_.message))}if(w&&S){h.target!==void 0&&(l=h.target),a.push.apply(a,$e([],Ee(h.actions),!1)),u=h;break}}}catch(_){r={error:_}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}if(u){if(!l.length)return{transitions:[u],exitSet:[],configuration:e.value?[this]:[],source:e,actions:a};var L=Ke(l.map(function(_){return o.getRelativeStateNodes(_,e.historyValue)})),m=!!u.internal;return{transitions:[u],exitSet:m?[]:Ke(l.map(function(_){return o.getPotentiallyReenteringNodes(_)})),configuration:L,source:e,actions:a}}},t.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var n=[],r=this,i=e;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},t.prototype.getActions=function(e,n,r,i,o,s,a){var l,u,f,d,h=this,v=s?Li([],this.getStateNodes(s.value)):[],y=new Set;try{for(var g=we(Array.from(e).sort(function(T,M){return T.order-M.order})),S=g.next();!S.done;S=g.next()){var w=S.value;(!xi(v,w)||xi(r.exitSet,w)||w.parent&&y.has(w.parent))&&y.add(w)}}catch(T){l={error:T}}finally{try{S&&!S.done&&(u=g.return)&&u.call(g)}finally{if(l)throw l.error}}try{for(var L=we(v),m=L.next();!m.done;m=L.next()){var w=m.value;(!xi(e,w)||xi(r.exitSet,w.parent))&&r.exitSet.push(w)}}catch(T){f={error:T}}finally{try{m&&!m.done&&(d=L.return)&&d.call(L)}finally{if(f)throw f.error}}r.exitSet.sort(function(T,M){return M.order-T.order});var _=Array.from(y).sort(function(T,M){return T.order-M.order}),E=new Set(r.exitSet),p=Ke(_.map(function(T){var M=[];if(T.type!=="final")return M;var R=T.parent;if(!R.parent)return M;M.push(Co(T.id,T.doneData),Co(R.id,T.doneData?cs(T.doneData,i,o):void 0));var A=R.parent;return A.type==="parallel"&&zi(A).every(function(B){return Yo(r.configuration,B)})&&M.push(Co(A.id)),M})),b=_.map(function(T){var M=T.onEntry,R=T.activities.map(function(A){return Xy(A)});return{type:"entry",actions:Tn(a?$e($e([],Ee(M),!1),Ee(R),!1):$e($e([],Ee(R),!1),Ee(M),!1),h.machine.options.actions)}}).concat({type:"state_done",actions:p.map(function(T){return Zy(T)})}),x=Array.from(E).map(function(T){return{type:"exit",actions:Tn($e($e([],Ee(T.onExit),!1),Ee(T.activities.map(function(M){return e1(M)})),!1),h.machine.options.actions)}}),P=x.concat({type:"transition",actions:Tn(r.actions,this.machine.options.actions)}).concat(b);if(n){var O=Tn(Ke($e([],Ee(e),!1).sort(function(T,M){return M.order-T.order}).map(function(T){return T.onExit})),this.machine.options.actions).filter(function(T){return!$a(T)});return P.concat({type:"stop",actions:O})}return P},t.prototype.transition=function(e,n,r,i){e===void 0&&(e=this.initialState);var o=at(n),s;if(e instanceof It)s=r===void 0?e:this.resolveState(It.from(e,r));else{var a=Re(e)?this.resolve(us(this.getResolvedPath(e))):this.resolve(e),l=r??this.machine.context;s=this.resolveState(It.from(a,l))}if(this.strict&&!this.events.includes(o.name)&&!Fy(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var u=this._transition(s.value,s,o)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]},f=Li([],this.getStateNodes(s.value)),d=u.configuration.length?Li(f,u.configuration):f;return u.configuration=$e([],Ee(d),!1),this.resolveTransition(u,s,s.context,i,o)},t.prototype.resolveRaisedTransition=function(e,n,r,i){var o,s=e.actions;return e=this.transition(e,n,void 0,i),e._event=r,e.event=r.data,(o=e.actions).unshift.apply(o,$e([],Ee(s),!1)),e},t.prototype.resolveTransition=function(e,n,r,i,o){var s,a,l,u,f=this;o===void 0&&(o=Pr);var d=e.configuration,h=!n||e.transitions.length>0,v=h?e.configuration:n?n.configuration:[],y=Yo(v,this),g=h?u1(this.machine,d):void 0,S=n?n.historyValue?n.historyValue:e.source?this.machine.historyValue(n.value):void 0:void 0,w=this.getActions(new Set(v),y,e,r,o,n,i),L=n?F({},n.activities):{};try{for(var m=we(w),_=m.next();!_.done;_=m.next()){var E=_.value;try{for(var p=(l=void 0,we(E.actions)),b=p.next();!b.done;b=p.next()){var x=b.value;x.type===Ua?L[x.activity.id||x.activity.type]=x:x.type===jl&&(L[x.activity.id||x.activity.type]=!1)}}catch(te){l={error:te}}finally{try{b&&!b.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}}}catch(te){s={error:te}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(s)throw s.error}}var P=Ee(fs(this,n,r,o,w,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),O=P[0],T=P[1],M=Ee(Vy(O,$a),2),R=M[0],A=M[1],B=O.filter(function(te){var ee;return te.type===Ua&&((ee=te.activity)===null||ee===void 0?void 0:ee.type)===Va}),V=B.reduce(function(te,ee){return te[ee.activity.id]=o1(ee.activity,f.machine,T,o),te},n?F({},n.children):{}),N=new It({value:g||n.value,context:T,_event:o,_sessionid:n?n._sessionid:null,historyValue:g?S?zy(S,g):void 0:n?n.historyValue:void 0,history:!g||e.source?n:void 0,actions:g?A:[],activities:g?L:n?n.activities:{},events:[],configuration:v,transitions:e.transitions,children:V,done:y,tags:Nu(v),machine:this}),z=r!==T;N.changed=o.name===Kd||z;var Y=N.history;Y&&delete Y.history;var G=!y&&(this._transient||d.some(function(te){return te._transient}));if(!h&&(!G||o.name===Lo))return N;var H=N;if(!y)for(G&&(H=this.resolveRaisedTransition(H,{type:ky},o,i));R.length;){var Q=R.shift();H=this.resolveRaisedTransition(H,Q._event,o,i)}var oe=H.changed||(Y?!!H.actions.length||z||typeof Y.value!=typeof H.value||!lh(H.value,Y.value):void 0);return H.changed=oe,H.history=Y,H},t.prototype.getStateNode=function(e){if(Cr(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[e];if(!n)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return n},t.prototype.getStateNodeById=function(e){var n=Cr(e)?e.slice(Za.length):e;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},t.prototype.getStateNodeByPath=function(e){if(typeof e=="string"&&Cr(e))try{return this.getStateNodeById(e.slice(1))}catch{}for(var n=Ha(e,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},t.prototype.resolve=function(e){var n,r=this;if(!e)return this.initialStateValue||wr;switch(this.type){case"parallel":return Ci(this.initialStateValue,function(o,s){return o?r.getStateNode(s).resolve(e[s]||o):wr});case"compound":if(Re(e)){var i=this.getStateNode(e);return i.type==="parallel"||i.type==="compound"?(n={},n[e]=i.initialStateValue,n):e}return Object.keys(e).length?Ci(e,function(o,s){return o?r.getStateNode(s).resolve(o):wr}):this.initialStateValue||{};default:return e||wr}},t.prototype.getResolvedPath=function(e){if(Cr(e)){var n=this.machine.idMap[e.slice(Za.length)];if(!n)throw new Error("Unable to find state node '".concat(e,"'"));return n.path}return Ha(e,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Au(this.states,function(r){return r.initialStateValue||wr},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=ds(this.states[this.initial])?this.initial:(e={},e[this.initial]=this.states[this.initial].initialStateValue,e)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(e,n){this._init();var r=this.getStateNodes(e);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var e;if(this.type==="history"){var n=this.config;Re(n.target)?e=Cr(n.target)?us(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:e=n.target}return e},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(e,n,r){return r===void 0&&(r=!0),r?e.type==="history"?e.resolveHistory(n):e.initialStateNodes:[e]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var e=this;if(ds(this))return[this];if(this.type==="compound"&&!this.initial)return[this];var n=Ko(this.initialStateValue);return Ke(n.map(function(r){return e.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var n=Ee(e),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},t.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:Au(this.states,function(n,r){if(!e)return n.historyValue();var i=Re(e)?void 0:e[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},t.prototype.resolveHistory=function(e){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!e){var i=this.target;return i?Ke(Ko(i).map(function(s){return r.getFromRelativePath(s)})):r.initialStateNodes}var o=By(r.path,"states")(e).current;return Re(o)?[r.getStateNode(o)]:Ke(Ko(o).map(function(s){return n.history==="deep"?r.getFromRelativePath(s):[r.states[s[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var e=this,n=Ke(Object.keys(this.states).map(function(r){return e.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var e,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,s=new Set(this.ownEvents);if(o)try{for(var a=we(Object.keys(o)),l=a.next();!l.done;l=a.next()){var u=l.value,f=o[u];if(f.states)try{for(var d=(r=void 0,we(f.events)),h=d.next();!h.done;h=d.next()){var v=h.value;s.add("".concat(v))}}catch(y){r={error:y}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}}catch(y){e={error:y}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(e)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(e){var n=this;if(e!==void 0)return e.map(function(r){if(!Re(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var s=n.parent.getStateNodeByPath(o);return s}catch(a){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
43
- `).concat(a.message))}else return n.getStateNodeByPath(o)})},t.prototype.formatTransition=function(e){var n=this,r=Gy(e.target),i="internal"in e?e.internal:r?r.some(function(l){return Re(l)&&l[0]===n.delimiter}):!0,o=this.machine.options.guards,s=this.resolveTarget(r),a=F(F({},e),{actions:Tn(zt(e.actions)),cond:eh(e.cond,o),target:s,source:this,internal:i,eventType:e.event,toJSON:function(){return F(F({},a),{target:a.target?a.target.map(function(l){return"#".concat(l.id)}):void 0,source:"#".concat(n.id)})}});return a},t.prototype.formatTransitions=function(){var e,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,s=na,a=o[s],l=a===void 0?[]:a,u=Il(o,[typeof s=="symbol"?s:s+""]);i=Ke(Object.keys(u).map(function(L){var m=br(L,u[L]);return m}).concat(br(na,l)))}var f=this.config.always?br("",this.config.always):[],d=this.config.onDone?br(String(Co(this.id)),this.config.onDone):[],h=Ke(this.invoke.map(function(L){var m=[];return L.onDone&&m.push.apply(m,$e([],Ee(br(String(Jo(L.id)),L.onDone)),!1)),L.onError&&m.push.apply(m,$e([],Ee(br(String(Si(L.id)),L.onError)),!1)),m})),v=this.after,y=Ke($e($e($e($e([],Ee(d),!1),Ee(h),!1),Ee(i),!1),Ee(f),!1).map(function(L){return zt(L).map(function(m){return r.formatTransition(m)})}));try{for(var g=we(v),S=g.next();!S.done;S=g.next()){var w=S.value;y.push(w)}}catch(L){e={error:L}}finally{try{S&&!S.done&&(n=g.return)&&n.call(g)}finally{if(e)throw e.error}}return y},t}();function x1(t,e,n){return n===void 0&&(n=t.context),new L1(t,e,n)}var E1=n1,qa;(function(t){t[t.Effect=1]="Effect",t[t.LayoutEffect=2]="LayoutEffect"})(qa||(qa={}));var Pi=c.useLayoutEffect;function Fu(t){var e=U.useRef();return e.current||(e.current={v:t()}),e.current.v}var _1=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},M1=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function O1(t,e){var n,r,i=_1([[],[]],2),o=i[0],s=i[1];try{for(var a=M1(t),l=a.next();!l.done;l=a.next()){var u=l.value;e(u)?o.push(u):s.push(u)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}var hi=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Uu=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function Vu(t,e){var n=t.exec,r=n(e.context,e._event.data,{action:t,state:e,_event:e._event});r()}function P1(t){var e=c.useRef([]),n=c.useRef([]);Pi(function(){var r=t.subscribe(function(i){var o,s;if(i.actions.length){var a=i.actions.filter(function(d){return typeof d.exec=="function"&&"__effect"in d.exec}),l=hi(O1(a,function(d){return d.exec.__effect===qa.Effect}),2),u=l[0],f=l[1];(o=e.current).push.apply(o,Uu([],hi(u.map(function(d){return[d,i]})),!1)),(s=n.current).push.apply(s,Uu([],hi(f.map(function(d){return[d,i]})),!1))}});return function(){r.unsubscribe()}},[]),Pi(function(){for(;n.current.length;){var r=hi(n.current.shift(),2),i=r[0],o=r[1];Vu(i,o)}}),c.useEffect(function(){for(;e.current.length;){var r=hi(e.current.shift(),2),i=r[0],o=r[1];Vu(i,o)}})}var ki=function(){return ki=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ki.apply(this,arguments)},k1=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function T1(t,e,n){if(typeof t=="object")return t;var r=function(){};return{next:t,error:e||r,complete:n||r}}function R1(t,e,n){e===void 0&&(e={});var r=Fu(function(){return typeof t=="function"?t():t}),i=e.context,o=e.guards,s=e.actions,a=e.activities,l=e.services,u=e.delays,f=e.state,d=k1(e,["context","guards","actions","activities","services","delays","state"]),h=Fu(function(){var v={context:i,guards:o,actions:s,activities:a,services:l,delays:u},y=r.withConfig(v,function(){return ki(ki({},r.context),i)});return uh(y,ki({deferEvents:!0},d))});return Pi(function(){var v;return n&&(v=h.subscribe(T1(n))),function(){v==null||v.unsubscribe()}},[n]),Pi(function(){return h.start(f?It.create(f):void 0),function(){h.stop()}},[]),Pi(function(){Object.assign(h.machine.options.actions,s),Object.assign(h.machine.options.guards,o),Object.assign(h.machine.options.activities,a),Object.assign(h.machine.options.services,l),Object.assign(h.machine.options.delays,u)},[s,o,a,l,u]),P1(h),h}var D1=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o};function A1(t,e){e===void 0&&(e={});var n=c.useCallback(function(a){var l=a.changed===void 0&&Object.keys(a.children).length;(a.changed||l)&&s(a)},[]),r=R1(t,e,n),i=D1(c.useState(function(){var a=r.machine.initialState;return e.state?It.create(e.state):a}),2),o=i[0],s=i[1];return[o,r.send,r]}function Je(){return Je=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Je.apply(this,arguments)}function kr(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}const de={arr:Array.isArray,obj:t=>Object.prototype.toString.call(t)==="[object Object]",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0,nul:t=>t===null,set:t=>t instanceof Set,map:t=>t instanceof Map,equ(t,e){if(typeof t!=typeof e)return!1;if(de.str(t)||de.num(t))return t===e;if(de.obj(t)&&de.obj(e)&&Object.keys(t).length+Object.keys(e).length===0)return!0;let n;for(n in t)if(!(n in e))return!1;for(n in e)if(t[n]!==e[n])return!1;return de.und(n)?t===e:!0}};function I1(t,e){return e===void 0&&(e=!0),n=>(de.arr(n)?n:Object.keys(n)).reduce((r,i)=>{const o=e?i[0].toLowerCase()+i.substring(1):i;return r[o]=t(o),r},t)}function j1(){const t=c.useState(!1),e=t[1];return c.useCallback(()=>e(r=>!r),[])}function Kn(t,e){return de.und(t)||de.nul(t)?e:t}function xo(t){return de.und(t)?[]:de.arr(t)?t:[t]}function Mr(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return de.fun(t)?t(...n):t}function N1(t){return t.to,t.from,t.config,t.onStart,t.onRest,t.onFrame,t.children,t.reset,t.reverse,t.force,t.immediate,t.delay,t.attach,t.destroyed,t.interpolateTo,t.ref,t.lazy,kr(t,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}function ra(t){const e=N1(t);if(de.und(e))return Je({to:e},t);const n=Object.keys(t).reduce((r,i)=>de.und(e[i])?Je({},r,{[i]:t[i]}):r,{});return Je({to:e},n)}function B1(t,e){return e&&(de.fun(e)?e(t):de.obj(e)&&(e.current=t)),t}class Wt{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){this.children.length===0&&this.attach(),this.children.push(e)}removeChild(e){const n=this.children.indexOf(e);this.children.splice(n,1),this.children.length===0&&this.detach()}}class Ka extends Wt{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach(e=>e instanceof Wt&&e.addChild(this)),this.detach=()=>this.payload.forEach(e=>e instanceof Wt&&e.removeChild(this))}}class ch extends Wt{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach(e=>e instanceof Wt&&e.addChild(this)),this.detach=()=>Object.values(this.payload).forEach(e=>e instanceof Wt&&e.removeChild(this))}getValue(e){e===void 0&&(e=!1);const n={};for(const r in this.payload){const i=this.payload[r];e&&!(i instanceof Wt)||(n[r]=i instanceof Wt?i[e?"getAnimatedValue":"getValue"]():i)}return n}getAnimatedValue(){return this.getValue(!0)}}let Vl;function F1(t,e){Vl={fn:t,transform:e}}let fh;function U1(t){fh=t}let dh=t=>typeof window<"u"?window.requestAnimationFrame(t):-1,hs;function V1(t){hs=t}let hh=()=>Date.now(),z1=t=>t.current,ph;function H1(t){ph=t}class $1 extends ch{constructor(e,n){super(),this.update=void 0,this.payload=e.style?Je({},e,{style:ph(e.style)}):e,this.update=n,this.attach()}}const W1=t=>de.fun(t)&&!(t.prototype instanceof c.Component),G1=t=>c.forwardRef((n,r)=>{const i=j1(),o=c.useRef(!0),s=c.useRef(null),a=c.useRef(null),l=c.useCallback(h=>{const v=s.current,y=()=>{let g=!1;a.current&&(g=Vl.fn(a.current,s.current.getAnimatedValue())),(!a.current||g===!1)&&i()};s.current=new $1(h,y),v&&v.detach()},[]);c.useEffect(()=>()=>{o.current=!1,s.current&&s.current.detach()},[]),c.useImperativeHandle(r,()=>z1(a)),l(n);const u=s.current.getValue();u.scrollTop,u.scrollLeft;const f=kr(u,["scrollTop","scrollLeft"]),d=W1(t)?void 0:h=>a.current=B1(h,r);return c.createElement(t,Je({},f,{ref:d}))});let Ti=!1;const cr=new Set,gh=()=>{if(!Ti)return!1;let t=hh();for(let e of cr){let n=!1;for(let r=0;r<e.configs.length;r++){let i=e.configs[r],o,s;for(let a=0;a<i.animatedValues.length;a++){let l=i.animatedValues[a];if(l.done)continue;let u=i.fromValues[a],f=i.toValues[a],d=l.lastPosition,h=f instanceof Wt,v=Array.isArray(i.initialVelocity)?i.initialVelocity[a]:i.initialVelocity;if(h&&(f=f.getValue()),i.immediate){l.setValue(f),l.done=!0;continue}if(typeof u=="string"||typeof f=="string"){l.setValue(f),l.done=!0;continue}if(i.duration!==void 0)d=u+i.easing((t-l.startTime)/i.duration)*(f-u),o=t>=l.startTime+i.duration;else if(i.decay)d=u+v/(1-.998)*(1-Math.exp(-(1-.998)*(t-l.startTime))),o=Math.abs(l.lastPosition-d)<.1,o&&(f=d);else{s=l.lastTime!==void 0?l.lastTime:t,v=l.lastVelocity!==void 0?l.lastVelocity:i.initialVelocity,t>s+64&&(s=t);let y=Math.floor(t-s);for(let L=0;L<y;++L){let m=-i.tension*(d-f),_=-i.friction*v,E=(m+_)/i.mass;v=v+E*1/1e3,d=d+v*1/1e3}let g=i.clamp&&i.tension!==0?u<f?d>f:d<f:!1,S=Math.abs(v)<=i.precision,w=i.tension!==0?Math.abs(f-d)<=i.precision:!0;o=g||S&&w,l.lastVelocity=v,l.lastTime=t}h&&!i.toValues[a].done&&(o=!1),o?(l.value!==f&&(d=f),l.done=!0):n=!0,l.setValue(d),l.lastPosition=d}e.props.onFrame&&(e.values[i.name]=i.interpolation.getValue())}e.props.onFrame&&e.props.onFrame(e.values),n||(cr.delete(e),e.stop(!0))}return cr.size?dh(gh):Ti=!1,Ti},Z1=t=>{cr.has(t)||cr.add(t),Ti||(Ti=!0,dh(gh))},q1=t=>{cr.has(t)&&cr.delete(t)};function ps(t,e,n){if(typeof t=="function")return t;if(Array.isArray(t))return ps({range:t,output:e,extrapolate:n});if(hs&&typeof t.output[0]=="string")return hs(t);const r=t,i=r.output,o=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(u=>u);return u=>{const f=Q1(u,o);return K1(u,o[f],o[f+1],i[f],i[f+1],l,s,a,r.map)}}function K1(t,e,n,r,i,o,s,a,l){let u=l?l(t):t;if(u<e){if(s==="identity")return u;s==="clamp"&&(u=e)}if(u>n){if(a==="identity")return u;a==="clamp"&&(u=n)}return r===i?r:e===n?t<=e?r:i:(e===-1/0?u=-u:n===1/0?u=u-e:u=(u-e)/(n-e),u=o(u),r===-1/0?u=-u:i===1/0?u=u+r:u=u*(i-r)+r,u)}function Q1(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}class Jr extends Ka{constructor(e,n,r,i){super(),this.calc=void 0,this.payload=e instanceof Ka&&!(e instanceof Jr)?e.getPayload():Array.isArray(e)?e:[e],this.calc=ps(n,r,i)}getValue(){return this.calc(...this.payload.map(e=>e.getValue()))}updateConfig(e,n,r){this.calc=ps(e,n,r)}interpolate(e,n,r){return new Jr(this,e,n,r)}}const Sr=(t,e,n)=>t&&new Jr(t,e,n),J1={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};function vh(t,e){"update"in t?e.add(t):t.getChildren().forEach(n=>vh(n,e))}class Qa extends Wt{constructor(e){var n;super(),n=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(r,i){i===void 0&&(i=!0),n.value=r,i&&n.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){this.animatedStyles.size===0&&vh(this,this.animatedStyles),this.animatedStyles.forEach(e=>e.update())}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,n,r){return new Jr(this,e,n,r)}}class Y1 extends Ka{constructor(e){super(),this.payload=e.map(n=>new Qa(n))}setValue(e,n){n===void 0&&(n=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((r,i)=>this.payload[i].setValue(r,n)):this.payload.forEach(r=>r.setValue(e,n))}getValue(){return this.payload.map(e=>e.getValue())}interpolate(e,n){return new Jr(this,e,n)}}let X1=0,eb=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=X1++}update(e){if(!e)return this;const n=ra(e),r=n.delay,i=r===void 0?0:r,o=n.to,s=kr(n,["delay","to"]);if(de.arr(o)||de.fun(o))this.queue.push(Je({},s,{delay:i,to:o}));else if(o){let a={};Object.entries(o).forEach(l=>{let u=l[0],f=l[1];const d=Je({to:{[u]:f},delay:Mr(i,u)},s),h=a[d.delay]&&a[d.delay].to;a[d.delay]=Je({},a[d.delay],d,{to:Je({},h,d.to)})}),this.queue=Object.values(a)}return this.queue=this.queue.sort((a,l)=>a.delay-l.delay),this.diff(s),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach(i=>{let o=i.from,s=o===void 0?{}:o,a=i.to,l=a===void 0?{}:a;de.obj(s)&&(this.merged=Je({},s,this.merged)),de.obj(l)&&(this.merged=Je({},this.merged,l))});const n=this.local=++this.guid,r=this.localQueue=this.queue;this.queue=[],r.forEach((i,o)=>{let s=i.delay,a=kr(i,["delay"]);const l=f=>{o===r.length-1&&n===this.guid&&f&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let u=de.arr(a.to)||de.fun(a.to);s?setTimeout(()=>{n===this.guid&&(u?this.runAsync(a,l):this.diff(a).start(l))},s):u?this.runAsync(a,l):this.diff(a).start(l)})}else de.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),Z1(this);return this}stop(e){return this.listeners.forEach(n=>n(e)),this.listeners=[],this}pause(e){return this.stop(!0),e&&q1(this),this}runAsync(e,n){var r=this;e.delay;let i=kr(e,["delay"]);const o=this.local;let s=Promise.resolve(void 0);if(de.arr(i.to))for(let a=0;a<i.to.length;a++){const l=a,u=Je({},i,ra(i.to[l]));de.arr(u.config)&&(u.config=u.config[l]),s=s.then(()=>{if(o===this.guid)return new Promise(f=>this.diff(u).start(f))})}else if(de.fun(i.to)){let a=0,l;s=s.then(()=>i.to(u=>{const f=Je({},i,ra(u));if(de.arr(f.config)&&(f.config=f.config[a]),a++,o===this.guid)return l=new Promise(d=>this.diff(f).start(d))},function(u){return u===void 0&&(u=!0),r.stop(u)}).then(()=>l))}s.then(n)}diff(e){this.props=Je({},this.props,e);let n=this.props,r=n.from,i=r===void 0?{}:r,o=n.to,s=o===void 0?{}:o,a=n.config,l=a===void 0?{}:a,u=n.reverse,f=n.attach,d=n.reset,h=n.immediate;if(u){var v=[s,i];i=v[0],s=v[1]}this.merged=Je({},i,this.merged,s),this.hasChanged=!1;let y=f&&f(this);if(this.animations=Object.entries(this.merged).reduce((g,S)=>{let w=S[0],L=S[1],m=g[w]||{};const _=de.num(L),E=de.str(L)&&!L.startsWith("#")&&!/\d/.test(L)&&!fh[L],p=de.arr(L),b=!_&&!p&&!E;let x=de.und(i[w])?L:i[w],P=_||p||E?L:1,O=Mr(l,w);y&&(P=y.animations[w].parent);let T=m.parent,M=m.interpolation,R=xo(y?P.getPayload():P),A,B=L;b&&(B=hs({range:[0,1],output:[L,L]})(1));let V=M&&M.getValue();const z=!de.und(T)&&m.animatedValues.some(Q=>!Q.done),Y=!de.equ(B,V),G=!de.equ(B,m.previous),H=!de.equ(O,m.config);if(d||G&&Y||H){if(_||E)T=M=m.parent||new Qa(x);else if(p)T=M=m.parent||new Y1(x);else if(b){let Q=m.interpolation&&m.interpolation.calc(m.parent.value);Q=Q!==void 0&&!d?Q:x,m.parent?(T=m.parent,T.setValue(0,!1)):T=new Qa(0);const oe={output:[Q,L]};m.interpolation?(M=m.interpolation,m.interpolation.updateConfig(oe)):M=T.interpolate(oe)}return R=xo(y?P.getPayload():P),A=xo(T.getPayload()),d&&!b&&T.setValue(x,!1),this.hasChanged=!0,A.forEach(Q=>{Q.startPosition=Q.value,Q.lastPosition=Q.value,Q.lastVelocity=z?Q.lastVelocity:void 0,Q.lastTime=z?Q.lastTime:void 0,Q.startTime=hh(),Q.done=!1,Q.animatedStyles.clear()}),Mr(h,w)&&T.setValue(b?P:L,!1),Je({},g,{[w]:Je({},m,{name:w,parent:T,interpolation:M,animatedValues:A,toValues:R,previous:B,config:O,fromValues:xo(T.getValue()),immediate:Mr(h,w),initialVelocity:Kn(O.velocity,0),clamp:Kn(O.clamp,!1),precision:Kn(O.precision,.01),tension:Kn(O.tension,170),friction:Kn(O.friction,26),mass:Kn(O.mass,1),duration:O.duration,easing:Kn(O.easing,Q=>Q),decay:O.decay})})}else return Y?g:(b&&(T.setValue(1,!1),M.updateConfig({output:[B,B]})),T.done=!0,this.hasChanged=!0,Je({},g,{[w]:Je({},g[w],{previous:B})}))},this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let g in this.animations)this.interpolations[g]=this.animations[g].interpolation,this.values[g]=this.animations[g].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const tb=(t,e)=>{const n=c.useRef(!1),r=c.useRef(),i=de.fun(e),o=c.useMemo(()=>{r.current&&(r.current.map(d=>d.destroy()),r.current=void 0);let f;return[new Array(t).fill().map((d,h)=>{const v=new eb,y=i?Mr(e,h,v):e[h];return h===0&&(f=y.ref),v.update(y),f||v.start(),v}),f]},[t]),s=o[0],a=o[1];r.current=s,c.useImperativeHandle(a,()=>({start:()=>Promise.all(r.current.map(f=>new Promise(d=>f.start(d)))),stop:f=>r.current.forEach(d=>d.stop(f)),get controllers(){return r.current}}));const l=c.useMemo(()=>f=>r.current.map((d,h)=>{d.update(i?Mr(f,h,d):f[h]),a||d.start()}),[t]);c.useEffect(()=>{n.current?i||l(e):a||r.current.forEach(f=>f.start())}),c.useEffect(()=>(n.current=!0,()=>r.current.forEach(f=>f.destroy())),[]);const u=r.current.map(f=>f.getValues());return i?[u,l,f=>r.current.forEach(d=>d.pause(f))]:u},nb=t=>{const e=de.fun(t),n=tb(1,e?t:[t]),r=n[0],i=n[1],o=n[2];return e?[r[0],i,o]:r};class rb extends ch{constructor(e){e===void 0&&(e={}),super(),e.transform&&!(e.transform instanceof Wt)&&(e=Vl.transform(e)),this.payload=e}}const gs={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Gt="[-+]?\\d*\\.?\\d+",vs=Gt+"%";function js(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const ib=new RegExp("rgb"+js(Gt,Gt,Gt)),ob=new RegExp("rgba"+js(Gt,Gt,Gt,Gt)),sb=new RegExp("hsl"+js(Gt,vs,vs)),ab=new RegExp("hsla"+js(Gt,vs,vs,Gt)),lb=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ub=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,cb=/^#([0-9a-fA-F]{6})$/,fb=/^#([0-9a-fA-F]{8})$/;function db(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=cb.exec(t))?parseInt(e[1]+"ff",16)>>>0:gs.hasOwnProperty(t)?gs[t]:(e=ib.exec(t))?(Lr(e[1])<<24|Lr(e[2])<<16|Lr(e[3])<<8|255)>>>0:(e=ob.exec(t))?(Lr(e[1])<<24|Lr(e[2])<<16|Lr(e[3])<<8|$u(e[4]))>>>0:(e=lb.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=fb.exec(t))?parseInt(e[1],16)>>>0:(e=ub.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=sb.exec(t))?(zu(Hu(e[1]),Eo(e[2]),Eo(e[3]))|255)>>>0:(e=ab.exec(t))?(zu(Hu(e[1]),Eo(e[2]),Eo(e[3]))|$u(e[4]))>>>0:null}function ia(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function zu(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=ia(i,r,t+1/3),s=ia(i,r,t),a=ia(i,r,t-1/3);return Math.round(o*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function Lr(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function Hu(t){return(parseFloat(t)%360+360)%360/360}function $u(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function Eo(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function Wu(t){let e=db(t);if(e===null)return t;e=e||0;let n=(e&4278190080)>>>24,r=(e&16711680)>>>16,i=(e&65280)>>>8,o=(e&255)/255;return`rgba(${n}, ${r}, ${i}, ${o})`}const _o=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hb=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,pb=new RegExp(`(${Object.keys(gs).join("|")})`,"g"),gb=t=>{const e=t.output.map(i=>i.replace(hb,Wu)).map(i=>i.replace(pb,Wu)),n=e[0].match(_o).map(()=>[]);e.forEach(i=>{i.match(_o).forEach((o,s)=>n[s].push(+o))});const r=e[0].match(_o).map((i,o)=>ps(Je({},t,{output:n[o]})));return i=>{let o=0;return e[0].replace(_o,()=>r[o++](i)).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(s,a,l,u,f)=>`rgba(${Math.round(a)}, ${Math.round(l)}, ${Math.round(u)}, ${f})`)}};let Ri={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const vb=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),mb=["Webkit","Ms","Moz","O"];Ri=Object.keys(Ri).reduce((t,e)=>(mb.forEach(n=>t[vb(n,e)]=t[e]),t),Ri);function yb(t,e,n){return e==null||typeof e=="boolean"||e===""?"":!n&&typeof e=="number"&&e!==0&&!(Ri.hasOwnProperty(t)&&Ri[t])?e+"px":(""+e).trim()}const Gu={};H1(t=>new rb(t));V1(gb);U1(gs);F1((t,e)=>{if(t.nodeType&&t.setAttribute!==void 0){const i=e.style,o=e.children,s=e.scrollTop,a=e.scrollLeft,l=kr(e,["style","children","scrollTop","scrollLeft"]),u=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter";s!==void 0&&(t.scrollTop=s),a!==void 0&&(t.scrollLeft=a),o!==void 0&&(t.textContent=o);for(let f in i)if(i.hasOwnProperty(f)){var n=f.indexOf("--")===0,r=yb(f,i[f],n);f==="float"&&(f="cssFloat"),n?t.style.setProperty(f,r):t.style[f]=r}for(let f in l){const d=u?f:Gu[f]||(Gu[f]=f.replace(/([A-Z])/g,h=>"-"+h.toLowerCase()));typeof t.getAttribute(d)<"u"&&t.setAttribute(d,l[f])}return}else return!1},t=>t);const bb=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],wb=I1(G1,!1),Cb=wb(bb);function Zu(t,e){return t.map(function(n,r){return n+e[r]})}function mh(t,e){return t.map(function(n,r){return n-e[r]})}function Ja(t){return Math.hypot.apply(Math,t)}function Sb(t,e,n){var r=Ja(e),i=r===0?0:1/r,o=n===0?0:1/n,s=o*r,a=e.map(function(f){return o*f}),l=e.map(function(f){return i*f}),u=Ja(t);return{velocities:a,velocity:s,distance:u,direction:l}}function Ya(t){return Math.sign?Math.sign(t):+(t>0)-+(t<0)||+t}function Lb(t,e,n){return Math.max(e,Math.min(t,n))}function xb(t,e){return Math.pow(t,e*5)}function qu(t,e,n){return e===0||Math.abs(e)===1/0?xb(t,n):t*e*n/(e+n*t)}function Di(t,e,n,r){return r===void 0&&(r=.15),r===0?Lb(t,e,n):t<e?-qu(e-t,n-e,r)+e:t>n?+qu(t-n,n-e,r)+n:t}function Ku(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Eb(t,e,n){return e&&Ku(t.prototype,e),n&&Ku(t,n),t}function bt(){return bt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bt.apply(this,arguments)}function yh(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function _b(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Mo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mb(t,e){if(t){if(typeof t=="string")return Qu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qu(t,e)}}function Qu(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ns(t,e){var n;if(typeof Symbol>"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(n=Mb(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
44
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return n=t[Symbol.iterator](),n.next.bind(n)}function bh(){}function wh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.length===0?bh:e.length===1?e[0]:function(){for(var r,i=Ns(e),o;!(o=i()).done;){var s=o.value;r=s.apply(this,arguments)||r}return r}}function Rn(t,e){if(t===void 0){if(e===void 0)throw new Error("Must define fallback value if undefined is expected");t=e}return Array.isArray(t)?t:[t,t]}function Oo(t){if(typeof t=="function"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.apply(void 0,n)}else return t}function zl(t,e){t===void 0&&(t={});for(var n={},r=0,i=Object.entries(e);r<i.length;r++){var o=i[r],s=o[0],a=o[1];switch(typeof a){case"function":n[s]=a.call(n,t[s],s,t);break;case"object":n[s]=zl(t[s],a);break;case"boolean":a&&(n[s]=t[s]);break}}return n}var Ob=180,Pb=.15,kb=.5,Tb=60,Rb={threshold:function(e){return e===void 0&&(e=0),Rn(e)},rubberband:function(e){switch(e===void 0&&(e=0),e){case!0:return Rn(Pb);case!1:return Rn(0);default:return Rn(e)}},enabled:function(e){return e===void 0&&(e=!0),e},triggerAllEvents:function(e){return e===void 0&&(e=!1),e},initial:function(e){return e===void 0&&(e=0),typeof e=="function"?e:Rn(e)}},Ch=bt({},Rb,{axis:!0,lockDirection:function(e){return e===void 0&&(e=!1),e},bounds:function(e){if(e===void 0&&(e={}),typeof e=="function")return function(d){return Ch.bounds(e(d))};var n=e,r=n.left,i=r===void 0?-1/0:r,o=n.right,s=o===void 0?1/0:o,a=n.top,l=a===void 0?-1/0:a,u=n.bottom,f=u===void 0?1/0:u;return[[i,s],[l,f]]}}),Db=typeof window<"u"&&window.document&&window.document.createElement,Ab={enabled:function(e){return e===void 0&&(e=!0),e},domTarget:!0,window:function(t){function e(n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return t===void 0&&(t=Db?window:void 0),t}),eventOptions:function(e){var n=e===void 0?{}:e,r=n.passive,i=r===void 0?!0:r,o=n.capture,s=o===void 0?!1:o;return{passive:i,capture:s}}},Ib=bt({},Ch,{threshold:function(e,n,r){var i=r.filterTaps,o=i===void 0?!1:i,s=r.lockDirection,a=s===void 0?!1:s,l=r.axis,u=l===void 0?void 0:l,f=Rn(e,o?3:a||u?1:0);return this.filterTaps=o||f[0]+f[1]>0,f},swipeVelocity:function(e){return e===void 0&&(e=kb),Rn(e)},swipeDistance:function(e){return e===void 0&&(e=Tb),Rn(e)},delay:function(e){switch(e===void 0&&(e=0),e){case!0:return Ob;case!1:return 0;default:return e}}});function jb(t){return t===void 0&&(t={}),zl(t,Ab)}function Nb(t){return t===void 0&&(t={}),zl(t,Ib)}function Bb(t){var e=t.domTarget,n=t.eventOptions,r=t.window,i=t.enabled,o=_b(t,["domTarget","eventOptions","window","enabled"]),s=jb({domTarget:e,eventOptions:n,window:r,enabled:i});return s.drag=Nb(o),s}function pi(t){return bt({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:bh,canceled:!1,memo:void 0,args:void 0},t)}function Sh(){var t={hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},e=pi({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),n=pi({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),r=pi({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),i=pi({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),o=pi({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0});return{shared:t,drag:e,pinch:n,wheel:r,move:i,scroll:o}}var Yn=new Map,Fb=function(){function t(n,r){var i=this;r===void 0&&(r=[]),this.controller=n,this.args=r,this.debounced=!0,this.setTimeout=function(o,s){var a;s===void 0&&(s=140),clearTimeout(i.controller.timeouts[i.stateKey]);for(var l=arguments.length,u=new Array(l>2?l-2:0),f=2;f<l;f++)u[f-2]=arguments[f];i.controller.timeouts[i.stateKey]=(a=window).setTimeout.apply(a,[o,s].concat(u))},this.clearTimeout=function(){clearTimeout(i.controller.timeouts[i.stateKey])},this.fireGestureHandler=function(o){if(o===void 0&&(o=!1),i.state._blocked)return i.debounced||(i.state._active=!1,i.clean()),null;if(!o&&!i.state.intentional&&!i.config.triggerAllEvents)return null;if(i.state.intentional){var s=i.state.active,a=i.state._active;i.state.active=a,i.state.first=a&&!s,i.state.last=s&&!a,i.controller.state.shared[i.ingKey]=a}var l=bt({},i.controller.state.shared,i.state,i.mapStateValues(i.state)),u=i.handler(l);return i.state.memo=u!==void 0?u:i.state.memo,i.state._active||i.clean(),l}}var e=t.prototype;return e.updateSharedState=function(r){Object.assign(this.controller.state.shared,r)},e.updateGestureState=function(r){Object.assign(this.state,r)},e.checkIntentionality=function(r,i){return{_intentional:r,_blocked:!1}},e.getMovement=function(r){var i=this.config,o=i.initial,s=i.bounds,a=i.rubberband,l=i.threshold,u=this.state,f=u._bounds,d=u._initial,h=u._active,v=u._intentional,y=u.lastOffset,g=u.movement,S=this.getInternalMovement(r,this.state),w=v[0]===!1?Ju(S[0],l[0]):v[0],L=v[1]===!1?Ju(S[1],l[1]):v[1],m=this.checkIntentionality([w,L],S);if(m._blocked)return bt({},m,{_movement:S,delta:[0,0]});var _=m._intentional,E=S,p,b;if(_[0]!==!1&&v[0]===!1&&(b=Oo(o,this.state),p=Oo(s,this.state),d[0]=b[0],f[0]=p[0]),_[1]!==!1&&v[1]===!1){var x,P;b=(x=b)!=null?x:Oo(o,this.state),p=(P=p)!=null?P:Oo(s,this.state),d[1]=b[1],f[1]=p[1]}var O=[_[0]!==!1?S[0]-_[0]:d[0],_[1]!==!1?S[1]-_[1]:d[1]],T=Zu(O,y),M=h?a:[0,0];return O=Yu(f,Zu(O,d),M),bt({},m,{intentional:_[0]!==!1||_[1]!==!1,_initial:d,_movement:E,movement:O,values:r,offset:Yu(f,T,M),delta:mh(O,g)})},e.clean=function(){this.clearTimeout()},Eb(t,[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}]),t}();function Ju(t,e){return Math.abs(t)>=e?Ya(t)*e:!1}function Yu(t,e,n){var r=e[0],i=e[1],o=n[0],s=n[1],a=t[0],l=a[0],u=a[1],f=t[1],d=f[0],h=f[1];return[Di(r,l,u,o),Di(i,d,h,s)]}function oa(t,e,n){var r=t.state,i=t.args,o=e.timeStamp,s=e.type,a=r.values,l=n?0:o-r.startTime;return{_lastEventType:s,event:e,timeStamp:o,elapsedTime:l,args:i,previous:a}}function Ub(t,e,n){var r=t.state.offset,i=n.timeStamp;return bt({},Sh()[t.stateKey],{_active:!0,values:e,initial:e,offset:r,lastOffset:r,startTime:i})}function Vb(t,e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.call.apply(t,[this,bt({},e,{event:n})].concat(i))}}var zb=function(e){var n=this;this.classes=e,this.bind=function(){for(var r={},i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];for(var a=Ns(n.classes),l;!(l=a()).done;){var u=l.value;new u(n,o).addBindings(r)}for(var f=0,d=Object.entries(n.nativeRefs);f<d.length;f++){var h=d[f],v=h[0],y=h[1];Xa(r,v,Vb(y,bt({},n.state.shared,{args:o})))}return n.config.domTarget?Gb(n,r):Zb(n,r)},this.effect=function(){return n.config.domTarget&&n.bind(),n.clean},this.clean=function(){var r=xh(n.config),i=n.config.eventOptions;r&&ao(r,Lh(n.domListeners),i),Object.values(n.timeouts).forEach(clearTimeout),Hb(n)},this.state=Sh(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function Hb(t){var e=t.config,n=e.window,r=e.eventOptions,i=t.windowListeners;if(n){for(var o in i){var s=i[o];ao(n,s,r)}t.windowListeners={}}}function $b(t,e){var n=t.config,r=t.windowListeners;n.window&&(ao(n.window,r[e],n.eventOptions),delete r[e])}function Wb(t,e,n){var r=t.config,i=t.windowListeners;n===void 0&&(n=[]),r.window&&(ao(r.window,i[e],r.eventOptions),Eh(r.window,i[e]=n,r.eventOptions))}function Gb(t,e){var n=t.config,r=t.domListeners,i=xh(n);if(!i)throw new Error("domTarget must be defined");var o=n.eventOptions;ao(i,Lh(r),o);for(var s=0,a=Object.entries(e);s<a.length;s++){var l=a[s],u=l[0],f=l[1],d=u.slice(2).toLowerCase();r.push([d,wh.apply(void 0,f)])}Eh(i,r,o)}function Zb(t,e){for(var n=t.config,r={},i=n.eventOptions.capture?"Capture":"",o=0,s=Object.entries(e);o<s.length;o++){var a=s[o],l=a[0],u=a[1],f=Array.isArray(u)?u:[u],d=l+i;r[d]=wh.apply(void 0,f)}return r}function Lh(t){return t===void 0&&(t=[]),t.splice(0,t.length)}function xh(t){var e=t.domTarget;return e&&"current"in e?e.current:e}function Xa(t,e,n){t[e]||(t[e]=[]),t[e].push(n)}function Eh(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={});for(var r=Ns(e),i;!(i=r()).done;){var o=i.value,s=o[0],a=o[1];t.addEventListener(s,a,n)}}function ao(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={});for(var r=Ns(e),i;!(i=r()).done;){var o=i.value,s=o[0],a=o[1];t.removeEventListener(s,a,n)}}function qb(t,e,n){n===void 0&&(n={});var r=Qb(t),i=c.useMemo(function(){return new zb(r)},[]);return i.config=e,i.handlers=t,i.nativeRefs=n,c.useEffect(i.effect,[]),i.config.domTarget?Kb:i.bind}function Kb(){}function Qb(t){var e=new Set;return t.drag&&e.add(Yn.get("drag")),t.wheel&&e.add(Yn.get("wheel")),t.scroll&&e.add(Yn.get("scroll")),t.move&&e.add(Yn.get("move")),t.pinch&&e.add(Yn.get("pinch")),t.hover&&e.add(Yn.get("hover")),e}var Jb=function(t){yh(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.getInternalMovement=function(i,o){return mh(i,o.initial)},n.checkIntentionality=function(i,o){if(i[0]===!1&&i[1]===!1)return{_intentional:i,axis:this.state.axis};var s=o.map(Math.abs),a=s[0],l=s[1],u=this.state.axis||(a>l?"x":a<l?"y":void 0);return!this.config.axis&&!this.config.lockDirection?{_intentional:i,_blocked:!1,axis:u}:u?this.config.axis&&u!==this.config.axis?{_intentional:i,_blocked:!0,axis:u}:(i[u==="x"?1:0]=!1,{_intentional:i,_blocked:!1,axis:u}):{_intentional:[!1,!1],_blocked:!1,axis:u}},n.getKinematics=function(i,o){var s=this.getMovement(i);if(!s._blocked){var a=o.timeStamp-this.state.timeStamp;Object.assign(s,Sb(s.movement,s.delta,a))}return s},n.mapStateValues=function(i){return{xy:i.values,vxvy:i.velocities}},e}(Fb);function _h(t){if("touches"in t){var e=t.targetTouches,n=t.changedTouches;return e.length>0?e:n}return null}function Xu(t){var e="buttons"in t?t.buttons:0,n=_h(t),r=n&&n.length||0,i=r>0||e>0,o=t.shiftKey,s=t.altKey,a=t.metaKey,l=t.ctrlKey;return{touches:r,down:i,buttons:e,shiftKey:o,altKey:s,metaKey:a,ctrlKey:l}}function ec(t){var e=_h(t),n=e?e[0]:t,r=n.clientX,i=n.clientY;return[r,i]}var Yb=3,Xb=220,e2=function(t){yh(e,t);function e(){var r;return r=t.apply(this,arguments)||this,r.ingKey="dragging",r.stateKey="drag",r.onDragStart=function(i){!r.enabled||r.state._active||(Wb(r.controller,r.stateKey,[["pointermove",r.onDragChange],["pointerup",r.onDragEnd],["pointercancel",r.onDragEnd]]),r.updateGestureState({_pointerId:i.pointerId}),r.config.delay>0?(r.state._delayedEvent=!0,"persist"in i&&typeof i.persist=="function"&&i.persist(),r.setTimeout(r.startDrag.bind(Mo(r)),r.config.delay,i)):r.startDrag(i))},r.onDragChange=function(i){if(!r.state.canceled&&i.pointerId===r.state._pointerId){if(!r.state._active){r.state._delayedEvent&&(r.clearTimeout(),r.startDrag(i));return}var o=Xu(i);if(!o.down){r.onDragEnd(i);return}r.updateSharedState(o);var s=ec(i),a=r.getKinematics(s,i),l=oa(Mo(r),i),u=r.state._isTap,f=Ja(a._movement);u&&f>=Yb&&(u=!1),r.updateGestureState(bt({},l,a,{_isTap:u})),r.fireGestureHandler()}},r.onDragEnd=function(i){if(i.pointerId===r.state._pointerId){r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0});var o=r.state._isTap,s=r.state.velocities,a=s[0],l=s[1],u=r.state.movement,f=u[0],d=u[1],h=r.state._intentional,v=h[0],y=h[1],g=r.config.swipeVelocity,S=g[0],w=g[1],L=r.config.swipeDistance,m=L[0],_=L[1],E=bt({},oa(Mo(r),i),r.getMovement(r.state.values)),p=[0,0];E.elapsedTime<Xb&&(v!==!1&&Math.abs(a)>S&&Math.abs(f)>m&&(p[0]=Ya(a)),y!==!1&&Math.abs(l)>w&&Math.abs(d)>_&&(p[1]=Ya(l))),r.updateGestureState(bt({},E,{tap:o,swipe:p})),r.fireGestureHandler(o===!0)}},r.clean=function(){t.prototype.clean.call(Mo(r)),r.state._delayedEvent=!1,$b(r.controller,r.stateKey)},r.onCancel=function(){r.state.canceled||(r.updateGestureState({canceled:!0}),r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame(function(){return r.fireGestureHandler()}))},r.onClick=function(i){r.state._isTap||i.stopPropagation()},r}var n=e.prototype;return n.startDrag=function(i){var o=ec(i);this.updateSharedState(Xu(i)),this.updateGestureState(bt({},Ub(this,o,i),oa(this,i,!0),{_pointerId:i.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(o)),this.fireGestureHandler()},n.addBindings=function(i){if(Xa(i,"onPointerDown",this.onDragStart),this.config.filterTaps){var o=this.controller.config.eventOptions.capture?"onClick":"onClickCapture";Xa(i,o,this.onClick)}},e}(Jb);function t2(t,e){var n,r=[],i,o=!1;function s(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return o&&n===this&&e(l,r)||(i=t.apply(this,l),o=!0,n=this,r=l),i}return s}function Xo(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Xo(t[r],e[r]))return!1;return!0}var o;if(typeof Map=="function"&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=t.entries();!(r=o.next()).done;)if(!Xo(r.value[1],e.get(r.value[0])))return!1;return!0}if(typeof Set=="function"&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(typeof Element<"u"&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!(i[r]==="_owner"&&t.$$typeof)&&!Xo(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}function n2(t,e){try{return Xo(t,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}function r2(t,e){e===void 0&&(e={}),Yn.set("drag",e2);var n=c.useRef();return n.current||(n.current=t2(Bb,n2)),qb({drag:t},n.current(e))}/*!
40
+ ***************************************************************************** */var j=function(){return j=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},j.apply(this,arguments)};function Sc(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function X(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function te(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function he(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var ae;(function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"})(ae||(ae={}));var Er;(function(t){t.Parent="#_parent",t.Internal="#_internal"})(Er||(Er={}));var Aa=ae.Start,Cc=ae.Stop,Ii=ae.Raise,_s=ae.Send,Sd=ae.Cancel,I1=ae.NullEvent,Ec=ae.Assign;ae.After;ae.DoneState;var Cd=ae.Log,F1=ae.Init,Ra=ae.Invoke;ae.ErrorExecution;var Ll=ae.ErrorPlatform,B1=ae.ErrorCustom,Ed=ae.Update,V1=ae.Choose,H1=ae.Pure,xd=".",Ml={},La="xstate.guard",$1="",ro;function xc(t,e,n){n===void 0&&(n=xd);var r=ri(t,n),i=ri(e,n);return se(i)?se(r)?i===r:!1:se(r)?r in i:Object.keys(r).every(function(o){return o in i?xc(r[o],i[o]):!1})}function Od(t){try{return se(t)||typeof t=="number"?"".concat(t):t.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function Ma(t,e){try{return Lr(t)?t:t.toString().split(e)}catch{throw new Error("'".concat(t,"' is not a valid state path."))}}function U1(t){return typeof t=="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function ri(t,e){if(U1(t))return t.value;if(Lr(t))return Qo(t);if(typeof t!="string")return t;var n=Ma(t,e);return Qo(n)}function Qo(t){if(t.length===1)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function Qr(t,e){for(var n={},r=Object.keys(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function kl(t,e,n){var r,i,o={};try{for(var s=X(Object.keys(t)),a=s.next();!a.done;a=s.next()){var c=a.value,l=t[c];n(l)&&(o[c]=e(l,c,t))}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}var z1=function(t){return function(e){var n,r,i=e;try{for(var o=X(t),s=o.next();!s.done;s=o.next()){var a=s.value;i=i[a]}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function q1(t,e){return function(n){var r,i,o=n;try{for(var s=X(t),a=s.next();!a.done;a=s.next()){var c=a.value;o=o[e][c]}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}}function No(t){if(!t)return[[]];if(se(t))return[[t]];var e=ye(Object.keys(t).map(function(n){var r=t[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:No(t[n]).map(function(i){return[n].concat(i)})}));return e}function ye(t){var e;return(e=[]).concat.apply(e,he([],te(t),!1))}function Pd(t){return Lr(t)?t:[t]}function ut(t){return t===void 0?[]:Pd(t)}function Jo(t,e,n){var r,i;if(re(t))return t(e,n.data);var o={};try{for(var s=X(Object.keys(t)),a=s.next();!a.done;a=s.next()){var c=a.value,l=t[c];re(l)?o[c]=l(e,n.data):o[c]=l}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function G1(t){return/^(done|error)\./.test(t)}function Dl(t){return!!(t instanceof Promise||t!==null&&(re(t)||typeof t=="object")&&re(t.then))}function W1(t){return t!==null&&typeof t=="object"&&"transition"in t&&typeof t.transition=="function"}function Z1(t,e){var n,r,i=te([[],[]],2),o=i[0],s=i[1];try{for(var a=X(t),c=a.next();!c.done;c=a.next()){var l=c.value;e(l)?o.push(l):s.push(l)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}function Td(t,e){return Qr(t.states,function(n,r){if(n){var i=(se(e)?void 0:e[r])||(n?n.current:void 0);if(i)return{current:i,states:Td(n,i)}}})}function K1(t,e){return{current:e,states:Td(t,e)}}function jl(t,e,n,r){var i=t&&n.reduce(function(o,s){var a,c,l=s.assignment,u={state:r,action:s,_event:e},f={};if(re(l))f=l(o,e.data,u);else try{for(var d=X(Object.keys(l)),y=d.next();!y.done;y=d.next()){var m=y.value,h=l[m];f[m]=re(h)?h(o,e.data,u):h}}catch(_){a={error:_}}finally{try{y&&!y.done&&(c=d.return)&&c.call(d)}finally{if(a)throw a.error}}return Object.assign({},o,f)},t);return i}var Q1=function(){};function Lr(t){return Array.isArray(t)}function re(t){return typeof t=="function"}function se(t){return typeof t=="string"}function Ad(t,e){if(t)return se(t)?{type:La,name:t,predicate:e?e[t]:void 0}:re(t)?{type:La,name:t.name,predicate:t}:t}function J1(t){try{return"subscribe"in t&&re(t.subscribe)}catch{return!1}}var en=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();ro={},ro[en]=function(){return this},ro[Symbol.observable]=function(){return this};function xr(t){return!!t&&"__xstatenode"in t}function X1(t){return!!t&&typeof t.send=="function"}function Ss(t,e){return se(t)||typeof t=="number"?j({type:t},e):t}function Ae(t,e){if(!se(t)&&"$$type"in t&&t.$$type==="scxml")return t;var n=Ss(t);return j({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function Wn(t,e){var n=Pd(e).map(function(r){return typeof r>"u"||typeof r=="string"||xr(r)?{target:r,event:t}:j(j({},r),{event:t})});return n}function Y1(t){if(!(t===void 0||t===$1))return ut(t)}function Rd(t,e,n,r,i){var o=t.options.guards,s={state:i,cond:e,_event:r};if(e.type===La)return((o==null?void 0:o[e.name])||e.predicate)(n,r.data,s);var a=o==null?void 0:o[e.type];if(!a)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return a(n,r.data,s)}function Ld(t){return typeof t=="string"?{type:t}:t}function Io(t,e,n){var r=function(){},i=typeof t=="object",o=i?t:null;return{next:((i?t.next:t)||r).bind(o),error:((i?t.error:e)||r).bind(o),complete:((i?t.complete:n)||r).bind(o)}}function io(t,e){return"".concat(t,":invocation[").concat(e,"]")}function ka(t){return(t.type===Ii||t.type===_s&&t.to===Er.Internal)&&typeof t.delay!="number"}var ir=Ae({type:F1});function Da(t,e){return e&&e[t]||void 0}function gi(t,e){var n;if(se(t)||typeof t=="number"){var r=Da(t,e);re(r)?n={type:t,exec:r}:r?n=r:n={type:t,exec:void 0}}else if(re(t))n={type:t.name||t.toString(),exec:t};else{var r=Da(t.type,e);if(re(r))n=j(j({},t),{exec:r});else if(r){var i=r.type||t.type;n=j(j(j({},r),t),{type:i})}else n=t}return n}var tn=function(t,e){if(!t)return[];var n=Lr(t)?t:[t];return n.map(function(r){return gi(r,e)})};function Oc(t){var e=gi(t);return j(j({id:se(t)?t:e.id},e),{type:e.type})}function ey(t,e){return{type:Ii,event:typeof t=="function"?t:Ss(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function ty(t,e,n,r){var i={_event:n},o=Ae(re(t.event)?t.event(e,n.data,i):t.event),s;if(se(t.delay)){var a=r&&r[t.delay];s=re(a)?a(e,n.data,i):a}else s=re(t.delay)?t.delay(e,n.data,i):t.delay;return j(j({},t),{type:Ii,_event:o,delay:s})}function ny(t,e){return{to:e?e.to:void 0,type:_s,event:re(t)?t:Ss(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:re(t)?t.name:Od(t)}}function ry(t,e,n,r){var i={_event:n},o=Ae(re(t.event)?t.event(e,n.data,i):t.event),s;if(se(t.delay)){var a=r&&r[t.delay];s=re(a)?a(e,n.data,i):a}else s=re(t.delay)?t.delay(e,n.data,i):t.delay;var c=re(t.to)?t.to(e,n.data,i):t.to;return j(j({},t),{to:c,_event:o,event:o.data,delay:s})}var iy=function(t,e,n){return j(j({},t),{value:se(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})},oy=function(t){return{type:Sd,sendId:t}};function sy(t){var e=Oc(t);return{type:ae.Start,activity:e,exec:void 0}}function ay(t){var e=re(t)?t:Oc(t);return{type:ae.Stop,activity:e,exec:void 0}}function cy(t,e,n){var r=re(t.activity)?t.activity(e,n.data):t.activity,i=typeof r=="string"?{id:r}:r,o={type:ae.Stop,activity:i};return o}var ly=function(t){return{type:Ec,assignment:t}};function uy(t,e){var n=e?"#".concat(e):"";return"".concat(ae.After,"(").concat(t,")").concat(n)}function oo(t,e){var n="".concat(ae.DoneState,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function Fo(t,e){var n="".concat(ae.DoneInvoke,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function Jr(t,e){var n="".concat(ae.ErrorPlatform,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}var fy=function(t){var e,n,r=[];try{for(var i=X(t),o=i.next();!o.done;o=i.next())for(var s=o.value,a=0;a<s.actions.length;){if(s.actions[a].type===Ec){r.push(s.actions[a]),s.actions.splice(a,1);continue}a++}}catch(c){e={error:c}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r};function Xo(t,e,n,r,i,o,s){s===void 0&&(s=!1);var a=s?[]:fy(i),c=a.length?jl(n,r,a,e):n,l=s?[n]:void 0,u=[];function f(m,h){var _;switch(h.type){case Ii:{var b=ty(h,c,r,t.options.delays);return o&&typeof b.delay=="number"&&o(b,c,r),b}case _s:var C=ry(h,c,r,t.options.delays);return o&&C.to!==Er.Internal&&(m==="entry"?u.push(C):o(C,c,r)),C;case Cd:{var v=iy(h,c,r);return o==null||o(v,c,r),v}case V1:{var E=h,x=(_=E.conds.find(function(V){var z=Ad(V.cond,t.options.guards);return!z||Rd(t,z,c,r,o?void 0:e)}))===null||_===void 0?void 0:_.actions;if(!x)return[];var g=te(Xo(t,e,c,r,[{type:m,actions:tn(ut(x),t.options.actions)}],o,s),2),S=g[0],O=g[1];return c=O,l==null||l.push(c),S}case H1:{var x=h.get(c,r.data);if(!x)return[];var T=te(Xo(t,e,c,r,[{type:m,actions:tn(ut(x),t.options.actions)}],o,s),2),R=T[0],L=T[1];return c=L,l==null||l.push(c),R}case Cc:{var v=cy(h,c,r);return o==null||o(v,n,r),v}case Ec:{c=jl(c,r,[h],o?void 0:e),l==null||l.push(c);break}default:var A=gi(h,t.options.actions),D=A.exec;if(o)o(A,c,r);else if(D&&l){var I=l.length-1,$=j(j({},A),{exec:function(V){for(var z=[],W=1;W<arguments.length;W++)z[W-1]=arguments[W];D.apply(void 0,he([l[I]],te(z),!1))}});A=$}return A}}function d(m){var h,_,b=[];try{for(var C=X(m.actions),v=C.next();!v.done;v=C.next()){var E=v.value,x=f(m.type,E);x&&(b=b.concat(x))}}catch(g){h={error:g}}finally{try{v&&!v.done&&(_=C.return)&&_.call(C)}finally{if(h)throw h.error}}return u.forEach(function(g){o(g,c,r)}),u.length=0,b}var y=ye(i.map(d));return[y,c]}var er=function(t,e){var n=e(t);return n};function Md(t){var e;return e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}},e[en]=function(){return this},e}function dy(t,e,n,r){var i,o=Ld(t.src),s=(i=e==null?void 0:e.options.services)===null||i===void 0?void 0:i[o.type],a=t.data?Jo(t.data,n,r):void 0,c=s?kd(s,t.id,a):Md(t.id);return c.meta=t,c}function kd(t,e,n){var r=Md(e);if(r.deferred=!0,xr(t)){var i=r.state=er(void 0,function(){return(n?t.withContext(n):t).initialState});r.getSnapshot=function(){return i}}return r}function hy(t){try{return typeof t.send=="function"}catch{return!1}}function py(t){return hy(t)&&"id"in t}function my(t){var e;return j((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e[en]=function(){return this},e),t)}var Yo=function(t){return t.type==="atomic"||t.type==="final"};function Dd(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function vi(t){return Dd(t).filter(function(e){return e.type!=="history"})}function jd(t){var e=[t];return Yo(t)?e:e.concat(ye(vi(t).map(jd)))}function Xr(t,e){var n,r,i,o,s,a,c,l,u=new Set(t),f=ja(u),d=new Set(e);try{for(var y=X(d),m=y.next();!m.done;m=y.next())for(var h=m.value,_=h.parent;_&&!d.has(_);)d.add(_),_=_.parent}catch(T){n={error:T}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}var b=ja(d);try{for(var C=X(d),v=C.next();!v.done;v=C.next()){var h=v.value;if(h.type==="compound"&&(!b.get(h)||!b.get(h).length))f.get(h)?f.get(h).forEach(function(R){return d.add(R)}):h.initialStateNodes.forEach(function(R){return d.add(R)});else if(h.type==="parallel")try{for(var E=(s=void 0,X(vi(h))),x=E.next();!x.done;x=E.next()){var g=x.value;d.has(g)||(d.add(g),f.get(g)?f.get(g).forEach(function(R){return d.add(R)}):g.initialStateNodes.forEach(function(R){return d.add(R)}))}}catch(R){s={error:R}}finally{try{x&&!x.done&&(a=E.return)&&a.call(E)}finally{if(s)throw s.error}}}}catch(T){i={error:T}}finally{try{v&&!v.done&&(o=C.return)&&o.call(C)}finally{if(i)throw i.error}}try{for(var S=X(d),O=S.next();!O.done;O=S.next())for(var h=O.value,_=h.parent;_&&!d.has(_);)d.add(_),_=_.parent}catch(T){c={error:T}}finally{try{O&&!O.done&&(l=S.return)&&l.call(S)}finally{if(c)throw c.error}}return d}function Nd(t,e){var n=e.get(t);if(!n)return{};if(t.type==="compound"){var r=n[0];if(r){if(Yo(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=Nd(o,e)}),i}function ja(t){var e,n,r=new Map;try{for(var i=X(t),o=i.next();!o.done;o=i.next()){var s=o.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function gy(t,e){var n=Xr([t],e);return Nd(t,ja(n))}function Yr(t,e){return Array.isArray(t)?t.some(function(n){return n===e}):t instanceof Set?t.has(e):!1}function vy(t){return he([],te(new Set(ye(he([],te(t.map(function(e){return e.ownEvents})),!1)))),!1)}function Bo(t,e){return e.type==="compound"?vi(e).some(function(n){return n.type==="final"&&Yr(t,n)}):e.type==="parallel"?vi(e).every(function(n){return Bo(t,n)}):!1}function yy(t){return t===void 0&&(t=[]),t.reduce(function(e,n){return n.meta!==void 0&&(e[n.id]=n.meta),e},{})}function Nl(t){return new Set(ye(t.map(function(e){return e.tags})))}function Id(t,e){if(t===e)return!0;if(t===void 0||e===void 0)return!1;if(se(t)||se(e))return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(i){return Id(t[i],e[i])})}function by(t){return typeof t!="object"||t===null?!1:"value"in t&&"_event"in t}function wy(t,e){var n=t.exec,r=j(j({},t),{exec:n!==void 0?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0});return r}var tt=function(){function t(e){var n=this,r;this.actions=[],this.activities=Ml,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||Ml,this.meta=yy(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=(r=Array.isArray(e.tags)?new Set(e.tags):e.tags)!==null&&r!==void 0?r:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return vy(n.configuration)}})}return t.from=function(e,n){if(e instanceof t)return e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e;var r=ir;return new t({value:e,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var r=ir;return new t({value:e.value,context:n,_event:r,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(e,n){var r=this;if(e===void 0&&(e=this.value),n===void 0&&(n="."),se(e))return[e];var i=Object.keys(e);return i.concat.apply(i,he([],te(i.map(function(o){return r.toStrings(e[o],n).map(function(s){return o+n+s})})),!1))},t.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var n=e.tags;e.machine;var r=Sc(e,["configuration","transitions","tags","machine"]);return j(j({},r),{tags:Array.from(n)})},t.prototype.matches=function(e){return xc(e,this.value)},t.prototype.hasTag=function(e){return this.tags.has(e)},t.prototype.can=function(e){var n;Q1(!!this.machine);var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,e);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},t}(),_y={deferEvents:!1},Il=function(){function t(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=j(j({},_y),e)}return t.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents){this.schedule(e);return}this.process(e)}this.flushEvents()},t.prototype.schedule=function(e){if(!this.initialized||this.processingEvent){this.queue.push(e);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},t.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},t}(),Gs=new Map,Sy=0,Hr={bookId:function(){return"x:".concat(Sy++)},register:function(t,e){return Gs.set(t,e),t},get:function(t){return Gs.get(t)},free:function(t){Gs.delete(t)}};function Pc(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Cy(){var t=Pc();if(t&&"__xstate__"in t)return t.__xstate__}function Ey(t){if(Pc()){var e=Cy();e&&e.register(t)}}function xy(t,e){e===void 0&&(e={});var n=t.initialState,r=new Set,i=[],o=!1,s=function(){if(!o){for(o=!0;i.length>0;){var l=i.shift();n=t.transition(n,l,c),r.forEach(function(u){return u.next(n)})}o=!1}},a=my({id:e.id,send:function(l){i.push(l),s()},getSnapshot:function(){return n},subscribe:function(l,u,f){var d=Io(l,u,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),c={parent:e.parent,self:a,id:e.id||"anonymous",observers:r};return n=t.start?t.start(c):n,a}var Oy={sync:!1,autoForward:!1},Oe;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(Oe||(Oe={}));var Py=function(){function t(e,n){n===void 0&&(n=t.defaultOptions);var r=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=Oe.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(u,f){if(Lr(u))return r.batch(u),r.state;var d=Ae(Ss(u,f));if(r.status===Oe.Stopped)return r.state;if(r.status!==Oe.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(d.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
41
+ Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var y=r._nextState(d);r.update(y,d)}),r._state},this.sendTo=function(u,f,d){var y=r.parent&&(f===Er.Parent||r.parent.id===f),m=y?r.parent:se(f)?f===Er.Internal?r:r.children.get(f)||Hr.get(f):X1(f)?f:void 0;if(!m){if(!y)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));return}if("machine"in m){if(r.status!==Oe.Stopped||r.parent!==m||r.state.done){var h=j(j({},u),{name:u.name===B1?"".concat(Jr(r.id)):u.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([m,h]):m.send(h)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([m,u.data]):m.send(u.data)},this._exec=function(u,f,d,y){y===void 0&&(y=r.machine.options.actions);var m=u.exec||Da(u.type,y),h=re(m)?m:m?m.exec:u.exec;if(h)try{return h(f,d.data,r.machine.config.predictableActionArguments?{action:u,_event:d}:{action:u,state:r.state,_event:d})}catch(I){throw r.parent&&r.parent.send({type:"xstate.error",data:I}),I}switch(u.type){case Ii:{var _=u;r.defer(_);break}case _s:var b=u;if(typeof b.delay=="number"){r.defer(b);return}else b.to?r.sendTo(b._event,b.to,d===ir):r.send(b._event);break;case Sd:r.cancel(u.sendId);break;case Aa:{if(r.status!==Oe.Running)return;var C=u.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[C.id||C.type])break;if(C.type===ae.Invoke){var v=Ld(C.src),E=r.machine.options.services?r.machine.options.services[v.type]:void 0,x=C.id,g=C.data,S="autoForward"in C?C.autoForward:!!C.forward;if(!E)return;var O=g?Jo(g,f,d):void 0;if(typeof E=="string")return;var T=re(E)?E(f,d.data,{data:O,src:v,meta:C.meta}):E;if(!T)return;var R=void 0;xr(T)&&(T=O?T.withContext(O):T,R={autoForward:S}),r.spawn(T,x,R)}else r.spawnActivity(C);break}case Cc:{r.stopChild(u.activity.id);break}case Cd:var L=u,A=L.label,D=L.value;A?r.logger(A,D):r.logger(D);break}};var i=j(j({},t.defaultOptions),n),o=i.clock,s=i.logger,a=i.parent,c=i.id,l=c!==void 0?c:e.id;this.id=l,this.logger=s,this.clock=o,this.parent=a,this.options=i,this.scheduler=new Il({deferEvents:this.options.deferEvents}),this.sessionId=Hr.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:er(this,function(){return e._initialState=e.machine.initialState,e._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(e,n){var r,i;try{for(var o=X(e.actions),s=o.next();!s.done;s=o.next()){var a=s.value;this.exec(a,e,n)}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.update=function(e,n){var r,i,o,s,a,c,l,u,f=this;if(e._sessionid=this.sessionId,this._state=e,(!this.machine.config.predictableActionArguments||n===ir)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(T){f.state.children[T.id]=T}),this.devTools&&this.devTools.send(n.data,e),e.event)try{for(var y=X(this.eventListeners),m=y.next();!m.done;m=y.next()){var h=m.value;h(e.event)}}catch(T){r={error:T}}finally{try{m&&!m.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}try{for(var _=X(this.listeners),b=_.next();!b.done;b=_.next()){var h=b.value;h(e,e.event)}}catch(T){o={error:T}}finally{try{b&&!b.done&&(s=_.return)&&s.call(_)}finally{if(o)throw o.error}}try{for(var C=X(this.contextListeners),v=C.next();!v.done;v=C.next()){var E=v.value;E(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(T){a={error:T}}finally{try{v&&!v.done&&(c=C.return)&&c.call(C)}finally{if(a)throw a.error}}if(this.state.done){var x=e.configuration.find(function(T){return T.type==="final"&&T.parent===f.machine}),g=x&&x.doneData?Jo(x.doneData,e.context,n):void 0;this._doneEvent=Fo(this.id,g);try{for(var S=X(this.doneListeners),O=S.next();!O.done;O=S.next()){var h=O.value;h(this._doneEvent)}}catch(T){l={error:T}}finally{try{O&&!O.done&&(u=S.return)&&u.call(S)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),Hr.free(this.sessionId)}},t.prototype.onTransition=function(e){return this.listeners.add(e),this.status===Oe.Running&&e(this.state,this.state.event),this},t.prototype.subscribe=function(e,n,r){var i=this,o=Io(e,n,r);this.listeners.add(o.next),this.status!==Oe.NotStarted&&o.next(this.state);var s=function(){i.doneListeners.delete(s),i.stopListeners.delete(s),o.complete()};return this.status===Oe.Stopped?o.complete():(this.onDone(s),this.onStop(s)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(s),i.stopListeners.delete(s)}}},t.prototype.onEvent=function(e){return this.eventListeners.add(e),this},t.prototype.onSend=function(e){return this.sendListeners.add(e),this},t.prototype.onChange=function(e){return this.contextListeners.add(e),this},t.prototype.onStop=function(e){return this.stopListeners.add(e),this},t.prototype.onDone=function(e){return this.status===Oe.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},t.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},t.prototype.start=function(e){var n=this;if(this.status===Oe.Running)return this;this.machine._init(),Hr.register(this.sessionId,this),this.initialized=!0,this.status=Oe.Running;var r=e===void 0?this.initialState:er(this,function(){return by(e)?n.machine.resolveState(e):n.machine.resolveState(tt.from(e,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,ir)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(e){re(e.stop)&&e.stop()}),this.children.clear()},t.prototype._stop=function(){var e,n,r,i,o,s,a,c,l,u;try{for(var f=X(this.listeners),d=f.next();!d.done;d=f.next()){var y=d.value;this.listeners.delete(y)}}catch(S){e={error:S}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}try{for(var m=X(this.stopListeners),h=m.next();!h.done;h=m.next()){var y=h.value;y(),this.stopListeners.delete(y)}}catch(S){r={error:S}}finally{try{h&&!h.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}try{for(var _=X(this.contextListeners),b=_.next();!b.done;b=_.next()){var y=b.value;this.contextListeners.delete(y)}}catch(S){o={error:S}}finally{try{b&&!b.done&&(s=_.return)&&s.call(_)}finally{if(o)throw o.error}}try{for(var C=X(this.doneListeners),v=C.next();!v.done;v=C.next()){var y=v.value;this.doneListeners.delete(y)}}catch(S){a={error:S}}finally{try{v&&!v.done&&(c=C.return)&&c.call(C)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Oe.Stopped,this._initialState=void 0;try{for(var E=X(Object.keys(this.delayedEventsMap)),x=E.next();!x.done;x=E.next()){var g=x.value;this.clock.clearTimeout(this.delayedEventsMap[g])}}catch(S){l={error:S}}finally{try{x&&!x.done&&(u=E.return)&&u.call(E)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new Il({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var e=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r;if(!(!((r=e._state)===null||r===void 0)&&r.done)){var i=Ae({type:"xstate.stop"}),o=er(e,function(){var s=ye(he([],te(e.state.configuration),!1).sort(function(f,d){return d.order-f.order}).map(function(f){return tn(f.onExit,e.machine.options.actions)})),a=te(Xo(e.machine,e.state,e.state.context,i,[{type:"exit",actions:s}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),c=a[0],l=a[1],u=new tt({value:e.state.value,context:l,_event:i,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:c.filter(function(f){return!ka(f)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return u.changed=!0,u});e.update(o,i),e._stopChildren(),Hr.free(e.sessionId)}}),this},t.prototype.batch=function(e){var n=this;if(!(this.status===Oe.NotStarted&&this.options.deferEvents)){if(this.status!==Oe.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(e.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,s=n.state,a=!1,c=[],l=function(y){var m=Ae(y);n.forward(m),s=er(n,function(){return n.machine.transition(s,m,void 0,r||void 0)}),c.push.apply(c,he([],te(n.machine.config.predictableActionArguments?s.actions:s.actions.map(function(h){return wy(h,s)})),!1)),a=a||!!s.changed};try{for(var u=X(e),f=u.next();!f.done;f=u.next()){var d=f.value;l(d)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}s.changed=a,s.actions=c,n.update(s,Ae(e[e.length-1]))})}},t.prototype.sender=function(e){return this.send.bind(this,e)},t.prototype._nextState=function(e,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=Ae(e);if(i.name.indexOf(Ll)===0&&!this.state.nextEvents.some(function(s){return s.indexOf(Ll)===0}))throw i.data.data;var o=er(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},t.prototype.nextState=function(e){return this._nextState(e,!1)},t.prototype.forward=function(e){var n,r;try{for(var i=X(this.forwardTo),o=i.next();!o.done;o=i.next()){var s=o.value,a=this.children.get(s);if(!a)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(s,"'."));a.send(e)}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.defer=function(e){var n=this,r=this.clock.setTimeout(function(){"to"in e&&e.to?n.sendTo(e._event,e.to,!0):n.send(e._event)},e.delay);e.id&&(this.delayedEventsMap[e.id]=r)},t.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},t.prototype.exec=function(e,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(e,n.context,n._event,r)},t.prototype.removeChild=function(e){var n;this.children.delete(e),this.forwardTo.delete(e),(n=this.state)===null||n===void 0||delete n.children[e]},t.prototype.stopChild=function(e){var n=this.children.get(e);n&&(this.removeChild(e),re(n.stop)&&n.stop())},t.prototype.spawn=function(e,n,r){if(this.status!==Oe.Running)return kd(e,n);if(Dl(e))return this.spawnPromise(Promise.resolve(e),n);if(re(e))return this.spawnCallback(e,n);if(py(e))return this.spawnActor(e,n);if(J1(e))return this.spawnObservable(e,n);if(xr(e))return this.spawnMachine(e,j(j({},r),{id:n}));if(W1(e))return this.spawnBehavior(e,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof e,'".'))},t.prototype.spawnMachine=function(e,n){var r=this;n===void 0&&(n={});var i=new t(e,j(j({},this.options),{parent:this,id:n.id||e.id})),o=j(j({},Oy),n);o.sync&&i.onTransition(function(a){r.send(Ed,{state:a,id:i.id})});var s=i;return this.children.set(i.id,s),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(a){r.removeChild(i.id),r.send(Ae(a,{origin:i.id}))}).start(),s},t.prototype.spawnBehavior=function(e,n){var r=xy(e,{id:n,parent:this});return this.children.set(n,r),r},t.prototype.spawnPromise=function(e,n){var r,i=this,o=!1,s;e.then(function(c){o||(s=c,i.removeChild(n),i.send(Ae(Fo(n,c),{origin:n})))},function(c){if(!o){i.removeChild(n);var l=Jr(n,c);try{i.send(Ae(l,{origin:n}))}catch{i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var a=(r={id:n,send:function(){},subscribe:function(c,l,u){var f=Io(c,l,u),d=!1;return e.then(function(y){d||(f.next(y),!d&&f.complete())},function(y){d||f.error(y)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return s}},r[en]=function(){return this},r);return this.children.set(n,a),a},t.prototype.spawnCallback=function(e,n){var r,i=this,o=!1,s=new Set,a=new Set,c,l=function(d){c=d,a.forEach(function(y){return y(d)}),!o&&i.send(Ae(d,{origin:n}))},u;try{u=e(l,function(d){s.add(d)})}catch(d){this.send(Jr(n,d))}if(Dl(u))return this.spawnPromise(u,n);var f=(r={id:n,send:function(d){return s.forEach(function(y){return y(d)})},subscribe:function(d){var y=Io(d);return a.add(y.next),{unsubscribe:function(){a.delete(y.next)}}},stop:function(){o=!0,re(u)&&u()},toJSON:function(){return{id:n}},getSnapshot:function(){return c}},r[en]=function(){return this},r);return this.children.set(n,f),f},t.prototype.spawnObservable=function(e,n){var r,i=this,o,s=e.subscribe(function(c){o=c,i.send(Ae(c,{origin:n}))},function(c){i.removeChild(n),i.send(Ae(Jr(n,c),{origin:n}))},function(){i.removeChild(n),i.send(Ae(Fo(n),{origin:n}))}),a=(r={id:n,send:function(){},subscribe:function(c,l,u){return e.subscribe(c,l,u)},stop:function(){return s.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[en]=function(){return this},r);return this.children.set(n,a),a},t.prototype.spawnActor=function(e,n){return this.children.set(n,e),e},t.prototype.spawnActivity=function(e){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(n){var r=n(this.state.context,e);this.spawnEffect(e.id,r)}},t.prototype.spawnEffect=function(e,n){var r;this.children.set(e,(r={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}},r[en]=function(){return this},r))},t.prototype.attachDev=function(){var e=Pc();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(j(j({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:j({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}Ey(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[en]=function(){return this},t.prototype.getSnapshot=function(){return this.status===Oe.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,n){return setTimeout(e,n)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},t.interpret=Fd,t}();function Fd(t,e){var n=new Py(t,e);return n}function Ty(t){if(typeof t=="string"){var e={type:t};return e.toString=function(){return t},e}return t}function so(t){return j(j({type:Ra},t),{toJSON:function(){t.onDone,t.onError;var e=Sc(t,["onDone","onError"]);return j(j({},e),{type:Ra,src:Ty(t.src)})}})}var ao="",Na="#",Ws="*",Zn={},Kn=function(t){return t[0]===Na},Ay=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},Ry=function(){function t(e,n,r,i){r===void 0&&(r="context"in e?e.context:void 0);var o=this,s;this.config=e,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(Ay(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:xd),this.id=this.config.id||he([this.machine.key],te(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(s=this.config.schema)!==null&&s!==void 0?s:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?Qr(this.config.states,function(l,u){var f,d=new t(l,{},void 0,{parent:o,key:u});return Object.assign(o.idMap,j((f={},f[d.id]=d,f),d.idMap)),d}):Zn;var a=0;function c(l){var u,f;l.order=a++;try{for(var d=X(Dd(l)),y=d.next();!y.done;y=d.next()){var m=y.value;c(m)}}catch(h){u={error:h}}finally{try{y&&!y.done&&(f=d.return)&&f.call(d)}finally{if(u)throw u.error}}}c(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(l){var u=l.event;return u===ao}):ao in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=ut(this.config.entry||this.config.onEntry).map(function(l){return gi(l)}),this.onExit=ut(this.config.exit||this.config.onExit).map(function(l){return gi(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=ut(this.config.invoke).map(function(l,u){var f,d;if(xr(l)){var y=io(o.id,u);return o.machine.options.services=j((f={},f[y]=l,f),o.machine.options.services),so({src:y,id:y})}else if(se(l.src)){var y=l.id||io(o.id,u);return so(j(j({},l),{id:y,src:l.src}))}else if(xr(l.src)||re(l.src)){var y=l.id||io(o.id,u);return o.machine.options.services=j((d={},d[y]=l.src,d),o.machine.options.services),so(j(j({id:y},l),{src:y}))}else{var m=l.src;return so(j(j({id:io(o.id,u)},l),{src:m}))}}),this.activities=ut(this.config.activities).concat(this.invoke).map(function(l){return Oc(l)}),this.transition=this.transition.bind(this),this.tags=ut(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||jd(this).forEach(function(e){return e.on})},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,s=r.guards,a=r.services,c=r.delays;return new t(this.config,{actions:j(j({},i),e.actions),activities:j(j({},o),e.activities),guards:j(j({},s),e.guards),services:j(j({},a),e.services),delays:j(j({},c),e.delays)},n??this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return re(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Qr(this.states,function(e){return e.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var n=e===ao,r=this.transitions.filter(function(i){var o=i.eventType===e;return n?o:o||i.eventType===Ws});return this.__cache.candidates[e]=r,r},t.prototype.getDelayedTransitions=function(){var e=this,n=this.config.after;if(!n)return[];var r=function(o,s){var a=re(o)?"".concat(e.id,":delay[").concat(s,"]"):o,c=uy(a,e.id);return e.onEntry.push(ny(c,{delay:o})),e.onExit.push(oy(c)),c},i=Lr(n)?n.map(function(o,s){var a=r(o.delay,s);return j(j({},o),{event:a})}):ye(Object.keys(n).map(function(o,s){var a=n[o],c=se(a)?{target:a}:a,l=isNaN(+o)?o:+o,u=r(l,s);return ut(c).map(function(f){return j(j({},f),{event:u,delay:l})})}));return i.map(function(o){var s=o.delay;return j(j({},e.formatTransition(o)),{delay:s})})},t.prototype.getStateNodes=function(e){var n,r=this;if(!e)return[];var i=e instanceof tt?e.value:ri(e,this.delimiter);if(se(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var s=Object.keys(i),a=[this];return a.push.apply(a,he([],te(ye(s.map(function(c){return r.getStateNode(c).getStateNodes(i[c])}))),!1)),a},t.prototype.handles=function(e){var n=Od(e);return this.events.includes(n)},t.prototype.resolveState=function(e){var n=e instanceof tt?e:tt.create(e),r=Array.from(Xr([],this.getStateNodes(n.value)));return new tt(j(j({},n),{value:this.resolve(n.value),configuration:r,done:Bo(r,this),tags:Nl(r),machine:this.machine}))},t.prototype.transitionLeafNode=function(e,n,r){var i=this.getStateNode(e),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},t.prototype.transitionCompoundNode=function(e,n,r){var i=Object.keys(e),o=this.getStateNode(i[0]),s=o._transition(e[i[0]],n,r);return!s||!s.transitions.length?this.next(n,r):s},t.prototype.transitionParallelNode=function(e,n,r){var i,o,s={};try{for(var a=X(Object.keys(e)),c=a.next();!c.done;c=a.next()){var l=c.value,u=e[l];if(u){var f=this.getStateNode(l),d=f._transition(u,n,r);d&&(s[l]=d)}}}catch(b){i={error:b}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}var y=Object.keys(s).map(function(b){return s[b]}),m=ye(y.map(function(b){return b.transitions})),h=y.some(function(b){return b.transitions.length>0});if(!h)return this.next(n,r);var _=ye(Object.keys(s).map(function(b){return s[b].configuration}));return{transitions:m,exitSet:ye(y.map(function(b){return b.exitSet})),configuration:_,source:n,actions:ye(Object.keys(s).map(function(b){return s[b].actions}))}},t.prototype._transition=function(e,n,r){return se(e)?this.transitionLeafNode(e,n,r):Object.keys(e).length===1?this.transitionCompoundNode(e,n,r):this.transitionParallelNode(e,n,r)},t.prototype.getTransitionData=function(e,n){return this._transition(e.value,e,Ae(n))},t.prototype.next=function(e,n){var r,i,o=this,s=n.name,a=[],c=[],l;try{for(var u=X(this.getCandidates(s)),f=u.next();!f.done;f=u.next()){var d=f.value,y=d.cond,m=d.in,h=e.context,_=m?se(m)&&Kn(m)?e.matches(ri(this.getStateNodeById(m).path,this.delimiter)):xc(ri(m,this.delimiter),z1(this.path.slice(0,-2))(e.value)):!0,b=!1;try{b=!y||Rd(this.machine,y,h,n,e)}catch(E){throw new Error("Unable to evaluate guard '".concat(y.name||y.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,`':
42
+ `).concat(E.message))}if(b&&_){d.target!==void 0&&(c=d.target),a.push.apply(a,he([],te(d.actions),!1)),l=d;break}}}catch(E){r={error:E}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}if(l){if(!c.length)return{transitions:[l],exitSet:[],configuration:e.value?[this]:[],source:e,actions:a};var C=ye(c.map(function(E){return o.getRelativeStateNodes(E,e.historyValue)})),v=!!l.internal;return{transitions:[l],exitSet:v?[]:ye(c.map(function(E){return o.getPotentiallyReenteringNodes(E)})),configuration:C,source:e,actions:a}}},t.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var n=[],r=this,i=e;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},t.prototype.getActions=function(e,n,r,i,o,s,a){var c,l,u,f,d=this,y=s?Xr([],this.getStateNodes(s.value)):[],m=new Set;try{for(var h=X(Array.from(e).sort(function(L,A){return L.order-A.order})),_=h.next();!_.done;_=h.next()){var b=_.value;(!Yr(y,b)||Yr(r.exitSet,b)||b.parent&&m.has(b.parent))&&m.add(b)}}catch(L){c={error:L}}finally{try{_&&!_.done&&(l=h.return)&&l.call(h)}finally{if(c)throw c.error}}try{for(var C=X(y),v=C.next();!v.done;v=C.next()){var b=v.value;(!Yr(e,b)||Yr(r.exitSet,b.parent))&&r.exitSet.push(b)}}catch(L){u={error:L}}finally{try{v&&!v.done&&(f=C.return)&&f.call(C)}finally{if(u)throw u.error}}r.exitSet.sort(function(L,A){return A.order-L.order});var E=Array.from(m).sort(function(L,A){return L.order-A.order}),x=new Set(r.exitSet),g=ye(E.map(function(L){var A=[];if(L.type!=="final")return A;var D=L.parent;if(!D.parent)return A;A.push(oo(L.id,L.doneData),oo(D.id,L.doneData?Jo(L.doneData,i,o):void 0));var I=D.parent;return I.type==="parallel"&&vi(I).every(function($){return Bo(r.configuration,$)})&&A.push(oo(I.id)),A})),S=E.map(function(L){var A=L.onEntry,D=L.activities.map(function(I){return sy(I)});return{type:"entry",actions:tn(a?he(he([],te(A),!1),te(D),!1):he(he([],te(D),!1),te(A),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:g.map(function(L){return ey(L)})}),O=Array.from(x).map(function(L){return{type:"exit",actions:tn(he(he([],te(L.onExit),!1),te(L.activities.map(function(A){return ay(A)})),!1),d.machine.options.actions)}}),T=O.concat({type:"transition",actions:tn(r.actions,this.machine.options.actions)}).concat(S);if(n){var R=tn(ye(he([],te(e),!1).sort(function(L,A){return A.order-L.order}).map(function(L){return L.onExit})),this.machine.options.actions).filter(function(L){return!ka(L)});return T.concat({type:"stop",actions:R})}return T},t.prototype.transition=function(e,n,r,i){e===void 0&&(e=this.initialState);var o=Ae(n),s;if(e instanceof tt)s=r===void 0?e:this.resolveState(tt.from(e,r));else{var a=se(e)?this.resolve(Qo(this.getResolvedPath(e))):this.resolve(e),c=r??this.machine.context;s=this.resolveState(tt.from(a,c))}if(this.strict&&!this.events.includes(o.name)&&!G1(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(s.value,s,o)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]},u=Xr([],this.getStateNodes(s.value)),f=l.configuration.length?Xr(u,l.configuration):u;return l.configuration=he([],te(f),!1),this.resolveTransition(l,s,s.context,i,o)},t.prototype.resolveRaisedTransition=function(e,n,r,i){var o,s=e.actions;return e=this.transition(e,n,void 0,i),e._event=r,e.event=r.data,(o=e.actions).unshift.apply(o,he([],te(s),!1)),e},t.prototype.resolveTransition=function(e,n,r,i,o){var s,a,c,l,u=this;o===void 0&&(o=ir);var f=e.configuration,d=!n||e.transitions.length>0,y=d?e.configuration:n?n.configuration:[],m=Bo(y,this),h=d?gy(this.machine,f):void 0,_=n?n.historyValue?n.historyValue:e.source?this.machine.historyValue(n.value):void 0:void 0,b=this.getActions(new Set(y),m,e,r,o,n,i),C=n?j({},n.activities):{};try{for(var v=X(b),E=v.next();!E.done;E=v.next()){var x=E.value;try{for(var g=(c=void 0,X(x.actions)),S=g.next();!S.done;S=g.next()){var O=S.value;O.type===Aa?C[O.activity.id||O.activity.type]=O:O.type===Cc&&(C[O.activity.id||O.activity.type]=!1)}}catch(xe){c={error:xe}}finally{try{S&&!S.done&&(l=g.return)&&l.call(g)}finally{if(c)throw c.error}}}}catch(xe){s={error:xe}}finally{try{E&&!E.done&&(a=v.return)&&a.call(v)}finally{if(s)throw s.error}}var T=te(Xo(this,n,r,o,b,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),R=T[0],L=T[1],A=te(Z1(R,ka),2),D=A[0],I=A[1],$=R.filter(function(xe){var me;return xe.type===Aa&&((me=xe.activity)===null||me===void 0?void 0:me.type)===Ra}),V=$.reduce(function(xe,me){return xe[me.activity.id]=dy(me.activity,u.machine,L,o),xe},n?j({},n.children):{}),z=new tt({value:h||n.value,context:L,_event:o,_sessionid:n?n._sessionid:null,historyValue:h?_?K1(_,h):void 0:n?n.historyValue:void 0,history:!h||e.source?n:void 0,actions:h?I:[],activities:h?C:n?n.activities:{},events:[],configuration:y,transitions:e.transitions,children:V,done:m,tags:Nl(y),machine:this}),W=r!==L;z.changed=o.name===Ed||W;var ce=z.history;ce&&delete ce.history;var le=!m&&(this._transient||f.some(function(xe){return xe._transient}));if(!d&&(!le||o.name===ao))return z;var ue=z;if(!m)for(le&&(ue=this.resolveRaisedTransition(ue,{type:I1},o,i));D.length;){var ne=D.shift();ue=this.resolveRaisedTransition(ue,ne._event,o,i)}var We=ue.changed||(ce?!!ue.actions.length||W||typeof ce.value!=typeof ue.value||!Id(ue.value,ce.value):void 0);return ue.changed=We,ue.history=ce,ue},t.prototype.getStateNode=function(e){if(Kn(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[e];if(!n)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return n},t.prototype.getStateNodeById=function(e){var n=Kn(e)?e.slice(Na.length):e;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},t.prototype.getStateNodeByPath=function(e){if(typeof e=="string"&&Kn(e))try{return this.getStateNodeById(e.slice(1))}catch{}for(var n=Ma(e,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},t.prototype.resolve=function(e){var n,r=this;if(!e)return this.initialStateValue||Zn;switch(this.type){case"parallel":return Qr(this.initialStateValue,function(o,s){return o?r.getStateNode(s).resolve(e[s]||o):Zn});case"compound":if(se(e)){var i=this.getStateNode(e);return i.type==="parallel"||i.type==="compound"?(n={},n[e]=i.initialStateValue,n):e}return Object.keys(e).length?Qr(e,function(o,s){return o?r.getStateNode(s).resolve(o):Zn}):this.initialStateValue||{};default:return e||Zn}},t.prototype.getResolvedPath=function(e){if(Kn(e)){var n=this.machine.idMap[e.slice(Na.length)];if(!n)throw new Error("Unable to find state node '".concat(e,"'"));return n.path}return Ma(e,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=kl(this.states,function(r){return r.initialStateValue||Zn},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=Yo(this.states[this.initial])?this.initial:(e={},e[this.initial]=this.states[this.initial].initialStateValue,e)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(e,n){this._init();var r=this.getStateNodes(e);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var e;if(this.type==="history"){var n=this.config;se(n.target)?e=Kn(n.target)?Qo(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:e=n.target}return e},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(e,n,r){return r===void 0&&(r=!0),r?e.type==="history"?e.resolveHistory(n):e.initialStateNodes:[e]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var e=this;if(Yo(this))return[this];if(this.type==="compound"&&!this.initial)return[this];var n=No(this.initialStateValue);return ye(n.map(function(r){return e.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var n=te(e),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},t.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:kl(this.states,function(n,r){if(!e)return n.historyValue();var i=se(e)?void 0:e[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},t.prototype.resolveHistory=function(e){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!e){var i=this.target;return i?ye(No(i).map(function(s){return r.getFromRelativePath(s)})):r.initialStateNodes}var o=q1(r.path,"states")(e).current;return se(o)?[r.getStateNode(o)]:ye(No(o).map(function(s){return n.history==="deep"?r.getFromRelativePath(s):[r.states[s[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var e=this,n=ye(Object.keys(this.states).map(function(r){return e.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var e,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,s=new Set(this.ownEvents);if(o)try{for(var a=X(Object.keys(o)),c=a.next();!c.done;c=a.next()){var l=c.value,u=o[l];if(u.states)try{for(var f=(r=void 0,X(u.events)),d=f.next();!d.done;d=f.next()){var y=d.value;s.add("".concat(y))}}catch(m){r={error:m}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(m){e={error:m}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(e)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(e){var n=this;if(e!==void 0)return e.map(function(r){if(!se(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var s=n.parent.getStateNodeByPath(o);return s}catch(a){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
43
+ `).concat(a.message))}else return n.getStateNodeByPath(o)})},t.prototype.formatTransition=function(e){var n=this,r=Y1(e.target),i="internal"in e?e.internal:r?r.some(function(c){return se(c)&&c[0]===n.delimiter}):!0,o=this.machine.options.guards,s=this.resolveTarget(r),a=j(j({},e),{actions:tn(ut(e.actions)),cond:Ad(e.cond,o),target:s,source:this,internal:i,eventType:e.event,toJSON:function(){return j(j({},a),{target:a.target?a.target.map(function(c){return"#".concat(c.id)}):void 0,source:"#".concat(n.id)})}});return a},t.prototype.formatTransitions=function(){var e,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,s=Ws,a=o[s],c=a===void 0?[]:a,l=Sc(o,[typeof s=="symbol"?s:s+""]);i=ye(Object.keys(l).map(function(C){var v=Wn(C,l[C]);return v}).concat(Wn(Ws,c)))}var u=this.config.always?Wn("",this.config.always):[],f=this.config.onDone?Wn(String(oo(this.id)),this.config.onDone):[],d=ye(this.invoke.map(function(C){var v=[];return C.onDone&&v.push.apply(v,he([],te(Wn(String(Fo(C.id)),C.onDone)),!1)),C.onError&&v.push.apply(v,he([],te(Wn(String(Jr(C.id)),C.onError)),!1)),v})),y=this.after,m=ye(he(he(he(he([],te(f),!1),te(d),!1),te(i),!1),te(u),!1).map(function(C){return ut(C).map(function(v){return r.formatTransition(v)})}));try{for(var h=X(y),_=h.next();!_.done;_=h.next()){var b=_.value;m.push(b)}}catch(C){e={error:C}}finally{try{_&&!_.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}return m},t}();function Ly(t,e,n){return n===void 0&&(n=t.context),new Ry(t,e,n)}var My=ly,Ia;(function(t){t[t.Effect=1]="Effect",t[t.LayoutEffect=2]="LayoutEffect"})(Ia||(Ia={}));var ii=p.useLayoutEffect;function Fl(t){var e=N.useRef();return e.current||(e.current={v:t()}),e.current.v}var ky=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Dy=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function jy(t,e){var n,r,i=ky([[],[]],2),o=i[0],s=i[1];try{for(var a=Dy(t),c=a.next();!c.done;c=a.next()){var l=c.value;e(l)?o.push(l):s.push(l)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}var $r=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Bl=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function Vl(t,e){var n=t.exec,r=n(e.context,e._event.data,{action:t,state:e,_event:e._event});r()}function Ny(t){var e=p.useRef([]),n=p.useRef([]);ii(function(){var r=t.subscribe(function(i){var o,s;if(i.actions.length){var a=i.actions.filter(function(f){return typeof f.exec=="function"&&"__effect"in f.exec}),c=$r(jy(a,function(f){return f.exec.__effect===Ia.Effect}),2),l=c[0],u=c[1];(o=e.current).push.apply(o,Bl([],$r(l.map(function(f){return[f,i]})),!1)),(s=n.current).push.apply(s,Bl([],$r(u.map(function(f){return[f,i]})),!1))}});return function(){r.unsubscribe()}},[]),ii(function(){for(;n.current.length;){var r=$r(n.current.shift(),2),i=r[0],o=r[1];Vl(i,o)}}),p.useEffect(function(){for(;e.current.length;){var r=$r(e.current.shift(),2),i=r[0],o=r[1];Vl(i,o)}})}var oi=function(){return oi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},oi.apply(this,arguments)},Iy=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function Fy(t,e,n){if(typeof t=="object")return t;var r=function(){};return{next:t,error:e||r,complete:n||r}}function By(t,e,n){e===void 0&&(e={});var r=Fl(function(){return typeof t=="function"?t():t}),i=e.context,o=e.guards,s=e.actions,a=e.activities,c=e.services,l=e.delays,u=e.state,f=Iy(e,["context","guards","actions","activities","services","delays","state"]),d=Fl(function(){var y={context:i,guards:o,actions:s,activities:a,services:c,delays:l},m=r.withConfig(y,function(){return oi(oi({},r.context),i)});return Fd(m,oi({deferEvents:!0},f))});return ii(function(){var y;return n&&(y=d.subscribe(Fy(n))),function(){y==null||y.unsubscribe()}},[n]),ii(function(){return d.start(u?tt.create(u):void 0),function(){d.stop()}},[]),ii(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,o),Object.assign(d.machine.options.activities,a),Object.assign(d.machine.options.services,c),Object.assign(d.machine.options.delays,l)},[s,o,a,c,l]),Ny(d),d}var Vy=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o};function Hy(t,e){e===void 0&&(e={});var n=p.useCallback(function(a){var c=a.changed===void 0&&Object.keys(a.children).length;(a.changed||c)&&s(a)},[]),r=By(t,e,n),i=Vy(p.useState(function(){var a=r.machine.initialState;return e.state?tt.create(e.state):a}),2),o=i[0],s=i[1];return[o,r.send,r]}function _e(){return _e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_e.apply(this,arguments)}function or(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}const G={arr:Array.isArray,obj:t=>Object.prototype.toString.call(t)==="[object Object]",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0,nul:t=>t===null,set:t=>t instanceof Set,map:t=>t instanceof Map,equ(t,e){if(typeof t!=typeof e)return!1;if(G.str(t)||G.num(t))return t===e;if(G.obj(t)&&G.obj(e)&&Object.keys(t).length+Object.keys(e).length===0)return!0;let n;for(n in t)if(!(n in e))return!1;for(n in e)if(t[n]!==e[n])return!1;return G.und(n)?t===e:!0}};function $y(t,e){return e===void 0&&(e=!0),n=>(G.arr(n)?n:Object.keys(n)).reduce((r,i)=>{const o=e?i[0].toLowerCase()+i.substring(1):i;return r[o]=t(o),r},t)}function Uy(){const t=p.useState(!1),e=t[1];return p.useCallback(()=>e(r=>!r),[])}function gn(t,e){return G.und(t)||G.nul(t)?e:t}function co(t){return G.und(t)?[]:G.arr(t)?t:[t]}function nr(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return G.fun(t)?t(...n):t}function zy(t){return t.to,t.from,t.config,t.onStart,t.onRest,t.onFrame,t.children,t.reset,t.reverse,t.force,t.immediate,t.delay,t.attach,t.destroyed,t.interpolateTo,t.ref,t.lazy,or(t,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}function Zs(t){const e=zy(t);if(G.und(e))return _e({to:e},t);const n=Object.keys(t).reduce((r,i)=>G.und(e[i])?_e({},r,{[i]:t[i]}):r,{});return _e({to:e},n)}function qy(t,e){return e&&(G.fun(e)?e(t):G.obj(e)&&(e.current=t)),t}class ht{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){this.children.length===0&&this.attach(),this.children.push(e)}removeChild(e){const n=this.children.indexOf(e);this.children.splice(n,1),this.children.length===0&&this.detach()}}class Fa extends ht{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach(e=>e instanceof ht&&e.addChild(this)),this.detach=()=>this.payload.forEach(e=>e instanceof ht&&e.removeChild(this))}}class Bd extends ht{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach(e=>e instanceof ht&&e.addChild(this)),this.detach=()=>Object.values(this.payload).forEach(e=>e instanceof ht&&e.removeChild(this))}getValue(e){e===void 0&&(e=!1);const n={};for(const r in this.payload){const i=this.payload[r];e&&!(i instanceof ht)||(n[r]=i instanceof ht?i[e?"getAnimatedValue":"getValue"]():i)}return n}getAnimatedValue(){return this.getValue(!0)}}let Tc;function Gy(t,e){Tc={fn:t,transform:e}}let Vd;function Wy(t){Vd=t}let Hd=t=>typeof window<"u"?window.requestAnimationFrame(t):-1,es;function Zy(t){es=t}let $d=()=>Date.now(),Ky=t=>t.current,Ud;function Qy(t){Ud=t}class Jy extends Bd{constructor(e,n){super(),this.update=void 0,this.payload=e.style?_e({},e,{style:Ud(e.style)}):e,this.update=n,this.attach()}}const Xy=t=>G.fun(t)&&!(t.prototype instanceof p.Component),Yy=t=>p.forwardRef((n,r)=>{const i=Uy(),o=p.useRef(!0),s=p.useRef(null),a=p.useRef(null),c=p.useCallback(d=>{const y=s.current,m=()=>{let h=!1;a.current&&(h=Tc.fn(a.current,s.current.getAnimatedValue())),(!a.current||h===!1)&&i()};s.current=new Jy(d,m),y&&y.detach()},[]);p.useEffect(()=>()=>{o.current=!1,s.current&&s.current.detach()},[]),p.useImperativeHandle(r,()=>Ky(a)),c(n);const l=s.current.getValue();l.scrollTop,l.scrollLeft;const u=or(l,["scrollTop","scrollLeft"]),f=Xy(t)?void 0:d=>a.current=qy(d,r);return p.createElement(t,_e({},u,{ref:f}))});let si=!1;const Ln=new Set,zd=()=>{if(!si)return!1;let t=$d();for(let e of Ln){let n=!1;for(let r=0;r<e.configs.length;r++){let i=e.configs[r],o,s;for(let a=0;a<i.animatedValues.length;a++){let c=i.animatedValues[a];if(c.done)continue;let l=i.fromValues[a],u=i.toValues[a],f=c.lastPosition,d=u instanceof ht,y=Array.isArray(i.initialVelocity)?i.initialVelocity[a]:i.initialVelocity;if(d&&(u=u.getValue()),i.immediate){c.setValue(u),c.done=!0;continue}if(typeof l=="string"||typeof u=="string"){c.setValue(u),c.done=!0;continue}if(i.duration!==void 0)f=l+i.easing((t-c.startTime)/i.duration)*(u-l),o=t>=c.startTime+i.duration;else if(i.decay)f=l+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-c.startTime))),o=Math.abs(c.lastPosition-f)<.1,o&&(u=f);else{s=c.lastTime!==void 0?c.lastTime:t,y=c.lastVelocity!==void 0?c.lastVelocity:i.initialVelocity,t>s+64&&(s=t);let m=Math.floor(t-s);for(let C=0;C<m;++C){let v=-i.tension*(f-u),E=-i.friction*y,x=(v+E)/i.mass;y=y+x*1/1e3,f=f+y*1/1e3}let h=i.clamp&&i.tension!==0?l<u?f>u:f<u:!1,_=Math.abs(y)<=i.precision,b=i.tension!==0?Math.abs(u-f)<=i.precision:!0;o=h||_&&b,c.lastVelocity=y,c.lastTime=t}d&&!i.toValues[a].done&&(o=!1),o?(c.value!==u&&(f=u),c.done=!0):n=!0,c.setValue(f),c.lastPosition=f}e.props.onFrame&&(e.values[i.name]=i.interpolation.getValue())}e.props.onFrame&&e.props.onFrame(e.values),n||(Ln.delete(e),e.stop(!0))}return Ln.size?Hd(zd):si=!1,si},e2=t=>{Ln.has(t)||Ln.add(t),si||(si=!0,Hd(zd))},t2=t=>{Ln.has(t)&&Ln.delete(t)};function ts(t,e,n){if(typeof t=="function")return t;if(Array.isArray(t))return ts({range:t,output:e,extrapolate:n});if(es&&typeof t.output[0]=="string")return es(t);const r=t,i=r.output,o=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(l=>l);return l=>{const u=r2(l,o);return n2(l,o[u],o[u+1],i[u],i[u+1],c,s,a,r.map)}}function n2(t,e,n,r,i,o,s,a,c){let l=c?c(t):t;if(l<e){if(s==="identity")return l;s==="clamp"&&(l=e)}if(l>n){if(a==="identity")return l;a==="clamp"&&(l=n)}return r===i?r:e===n?t<=e?r:i:(e===-1/0?l=-l:n===1/0?l=l-e:l=(l-e)/(n-e),l=o(l),r===-1/0?l=-l:i===1/0?l=l+r:l=l*(i-r)+r,l)}function r2(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}class Or extends Fa{constructor(e,n,r,i){super(),this.calc=void 0,this.payload=e instanceof Fa&&!(e instanceof Or)?e.getPayload():Array.isArray(e)?e:[e],this.calc=ts(n,r,i)}getValue(){return this.calc(...this.payload.map(e=>e.getValue()))}updateConfig(e,n,r){this.calc=ts(e,n,r)}interpolate(e,n,r){return new Or(this,e,n,r)}}const Qn=(t,e,n)=>t&&new Or(t,e,n),i2={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};function qd(t,e){"update"in t?e.add(t):t.getChildren().forEach(n=>qd(n,e))}class Ba extends ht{constructor(e){var n;super(),n=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(r,i){i===void 0&&(i=!0),n.value=r,i&&n.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){this.animatedStyles.size===0&&qd(this,this.animatedStyles),this.animatedStyles.forEach(e=>e.update())}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,n,r){return new Or(this,e,n,r)}}class o2 extends Fa{constructor(e){super(),this.payload=e.map(n=>new Ba(n))}setValue(e,n){n===void 0&&(n=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((r,i)=>this.payload[i].setValue(r,n)):this.payload.forEach(r=>r.setValue(e,n))}getValue(){return this.payload.map(e=>e.getValue())}interpolate(e,n){return new Or(this,e,n)}}let s2=0,a2=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=s2++}update(e){if(!e)return this;const n=Zs(e),r=n.delay,i=r===void 0?0:r,o=n.to,s=or(n,["delay","to"]);if(G.arr(o)||G.fun(o))this.queue.push(_e({},s,{delay:i,to:o}));else if(o){let a={};Object.entries(o).forEach(c=>{let l=c[0],u=c[1];const f=_e({to:{[l]:u},delay:nr(i,l)},s),d=a[f.delay]&&a[f.delay].to;a[f.delay]=_e({},a[f.delay],f,{to:_e({},d,f.to)})}),this.queue=Object.values(a)}return this.queue=this.queue.sort((a,c)=>a.delay-c.delay),this.diff(s),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach(i=>{let o=i.from,s=o===void 0?{}:o,a=i.to,c=a===void 0?{}:a;G.obj(s)&&(this.merged=_e({},s,this.merged)),G.obj(c)&&(this.merged=_e({},this.merged,c))});const n=this.local=++this.guid,r=this.localQueue=this.queue;this.queue=[],r.forEach((i,o)=>{let s=i.delay,a=or(i,["delay"]);const c=u=>{o===r.length-1&&n===this.guid&&u&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let l=G.arr(a.to)||G.fun(a.to);s?setTimeout(()=>{n===this.guid&&(l?this.runAsync(a,c):this.diff(a).start(c))},s):l?this.runAsync(a,c):this.diff(a).start(c)})}else G.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),e2(this);return this}stop(e){return this.listeners.forEach(n=>n(e)),this.listeners=[],this}pause(e){return this.stop(!0),e&&t2(this),this}runAsync(e,n){var r=this;e.delay;let i=or(e,["delay"]);const o=this.local;let s=Promise.resolve(void 0);if(G.arr(i.to))for(let a=0;a<i.to.length;a++){const c=a,l=_e({},i,Zs(i.to[c]));G.arr(l.config)&&(l.config=l.config[c]),s=s.then(()=>{if(o===this.guid)return new Promise(u=>this.diff(l).start(u))})}else if(G.fun(i.to)){let a=0,c;s=s.then(()=>i.to(l=>{const u=_e({},i,Zs(l));if(G.arr(u.config)&&(u.config=u.config[a]),a++,o===this.guid)return c=new Promise(f=>this.diff(u).start(f))},function(l){return l===void 0&&(l=!0),r.stop(l)}).then(()=>c))}s.then(n)}diff(e){this.props=_e({},this.props,e);let n=this.props,r=n.from,i=r===void 0?{}:r,o=n.to,s=o===void 0?{}:o,a=n.config,c=a===void 0?{}:a,l=n.reverse,u=n.attach,f=n.reset,d=n.immediate;if(l){var y=[s,i];i=y[0],s=y[1]}this.merged=_e({},i,this.merged,s),this.hasChanged=!1;let m=u&&u(this);if(this.animations=Object.entries(this.merged).reduce((h,_)=>{let b=_[0],C=_[1],v=h[b]||{};const E=G.num(C),x=G.str(C)&&!C.startsWith("#")&&!/\d/.test(C)&&!Vd[C],g=G.arr(C),S=!E&&!g&&!x;let O=G.und(i[b])?C:i[b],T=E||g||x?C:1,R=nr(c,b);m&&(T=m.animations[b].parent);let L=v.parent,A=v.interpolation,D=co(m?T.getPayload():T),I,$=C;S&&($=es({range:[0,1],output:[C,C]})(1));let V=A&&A.getValue();const W=!G.und(L)&&v.animatedValues.some(ne=>!ne.done),ce=!G.equ($,V),le=!G.equ($,v.previous),ue=!G.equ(R,v.config);if(f||le&&ce||ue){if(E||x)L=A=v.parent||new Ba(O);else if(g)L=A=v.parent||new o2(O);else if(S){let ne=v.interpolation&&v.interpolation.calc(v.parent.value);ne=ne!==void 0&&!f?ne:O,v.parent?(L=v.parent,L.setValue(0,!1)):L=new Ba(0);const We={output:[ne,C]};v.interpolation?(A=v.interpolation,v.interpolation.updateConfig(We)):A=L.interpolate(We)}return D=co(m?T.getPayload():T),I=co(L.getPayload()),f&&!S&&L.setValue(O,!1),this.hasChanged=!0,I.forEach(ne=>{ne.startPosition=ne.value,ne.lastPosition=ne.value,ne.lastVelocity=W?ne.lastVelocity:void 0,ne.lastTime=W?ne.lastTime:void 0,ne.startTime=$d(),ne.done=!1,ne.animatedStyles.clear()}),nr(d,b)&&L.setValue(S?T:C,!1),_e({},h,{[b]:_e({},v,{name:b,parent:L,interpolation:A,animatedValues:I,toValues:D,previous:$,config:R,fromValues:co(L.getValue()),immediate:nr(d,b),initialVelocity:gn(R.velocity,0),clamp:gn(R.clamp,!1),precision:gn(R.precision,.01),tension:gn(R.tension,170),friction:gn(R.friction,26),mass:gn(R.mass,1),duration:R.duration,easing:gn(R.easing,ne=>ne),decay:R.decay})})}else return ce?h:(S&&(L.setValue(1,!1),A.updateConfig({output:[$,$]})),L.done=!0,this.hasChanged=!0,_e({},h,{[b]:_e({},h[b],{previous:$})}))},this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let h in this.animations)this.interpolations[h]=this.animations[h].interpolation,this.values[h]=this.animations[h].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const c2=(t,e)=>{const n=p.useRef(!1),r=p.useRef(),i=G.fun(e),o=p.useMemo(()=>{r.current&&(r.current.map(f=>f.destroy()),r.current=void 0);let u;return[new Array(t).fill().map((f,d)=>{const y=new a2,m=i?nr(e,d,y):e[d];return d===0&&(u=m.ref),y.update(m),u||y.start(),y}),u]},[t]),s=o[0],a=o[1];r.current=s,p.useImperativeHandle(a,()=>({start:()=>Promise.all(r.current.map(u=>new Promise(f=>u.start(f)))),stop:u=>r.current.forEach(f=>f.stop(u)),get controllers(){return r.current}}));const c=p.useMemo(()=>u=>r.current.map((f,d)=>{f.update(i?nr(u,d,f):u[d]),a||f.start()}),[t]);p.useEffect(()=>{n.current?i||c(e):a||r.current.forEach(u=>u.start())}),p.useEffect(()=>(n.current=!0,()=>r.current.forEach(u=>u.destroy())),[]);const l=r.current.map(u=>u.getValues());return i?[l,c,u=>r.current.forEach(f=>f.pause(u))]:l},l2=t=>{const e=G.fun(t),n=c2(1,e?t:[t]),r=n[0],i=n[1],o=n[2];return e?[r[0],i,o]:r};class u2 extends Bd{constructor(e){e===void 0&&(e={}),super(),e.transform&&!(e.transform instanceof ht)&&(e=Tc.transform(e)),this.payload=e}}const ns={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},pt="[-+]?\\d*\\.?\\d+",rs=pt+"%";function Cs(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const f2=new RegExp("rgb"+Cs(pt,pt,pt)),d2=new RegExp("rgba"+Cs(pt,pt,pt,pt)),h2=new RegExp("hsl"+Cs(pt,rs,rs)),p2=new RegExp("hsla"+Cs(pt,rs,rs,pt)),m2=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,g2=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,v2=/^#([0-9a-fA-F]{6})$/,y2=/^#([0-9a-fA-F]{8})$/;function b2(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=v2.exec(t))?parseInt(e[1]+"ff",16)>>>0:ns.hasOwnProperty(t)?ns[t]:(e=f2.exec(t))?(Jn(e[1])<<24|Jn(e[2])<<16|Jn(e[3])<<8|255)>>>0:(e=d2.exec(t))?(Jn(e[1])<<24|Jn(e[2])<<16|Jn(e[3])<<8|Ul(e[4]))>>>0:(e=m2.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=y2.exec(t))?parseInt(e[1],16)>>>0:(e=g2.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=h2.exec(t))?(Hl($l(e[1]),lo(e[2]),lo(e[3]))|255)>>>0:(e=p2.exec(t))?(Hl($l(e[1]),lo(e[2]),lo(e[3]))|Ul(e[4]))>>>0:null}function Ks(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Hl(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=Ks(i,r,t+1/3),s=Ks(i,r,t),a=Ks(i,r,t-1/3);return Math.round(o*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function Jn(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function $l(t){return(parseFloat(t)%360+360)%360/360}function Ul(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function lo(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function zl(t){let e=b2(t);if(e===null)return t;e=e||0;let n=(e&4278190080)>>>24,r=(e&16711680)>>>16,i=(e&65280)>>>8,o=(e&255)/255;return`rgba(${n}, ${r}, ${i}, ${o})`}const uo=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,w2=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,_2=new RegExp(`(${Object.keys(ns).join("|")})`,"g"),S2=t=>{const e=t.output.map(i=>i.replace(w2,zl)).map(i=>i.replace(_2,zl)),n=e[0].match(uo).map(()=>[]);e.forEach(i=>{i.match(uo).forEach((o,s)=>n[s].push(+o))});const r=e[0].match(uo).map((i,o)=>ts(_e({},t,{output:n[o]})));return i=>{let o=0;return e[0].replace(uo,()=>r[o++](i)).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(s,a,c,l,u)=>`rgba(${Math.round(a)}, ${Math.round(c)}, ${Math.round(l)}, ${u})`)}};let ai={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const C2=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),E2=["Webkit","Ms","Moz","O"];ai=Object.keys(ai).reduce((t,e)=>(E2.forEach(n=>t[C2(n,e)]=t[e]),t),ai);function x2(t,e,n){return e==null||typeof e=="boolean"||e===""?"":!n&&typeof e=="number"&&e!==0&&!(ai.hasOwnProperty(t)&&ai[t])?e+"px":(""+e).trim()}const ql={};Qy(t=>new u2(t));Zy(S2);Wy(ns);Gy((t,e)=>{if(t.nodeType&&t.setAttribute!==void 0){const i=e.style,o=e.children,s=e.scrollTop,a=e.scrollLeft,c=or(e,["style","children","scrollTop","scrollLeft"]),l=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter";s!==void 0&&(t.scrollTop=s),a!==void 0&&(t.scrollLeft=a),o!==void 0&&(t.textContent=o);for(let u in i)if(i.hasOwnProperty(u)){var n=u.indexOf("--")===0,r=x2(u,i[u],n);u==="float"&&(u="cssFloat"),n?t.style.setProperty(u,r):t.style[u]=r}for(let u in c){const f=l?u:ql[u]||(ql[u]=u.replace(/([A-Z])/g,d=>"-"+d.toLowerCase()));typeof t.getAttribute(f)<"u"&&t.setAttribute(f,c[u])}return}else return!1},t=>t);const O2=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],P2=$y(Yy,!1),T2=P2(O2);function Gl(t,e){return t.map(function(n,r){return n+e[r]})}function Gd(t,e){return t.map(function(n,r){return n-e[r]})}function Va(t){return Math.hypot.apply(Math,t)}function A2(t,e,n){var r=Va(e),i=r===0?0:1/r,o=n===0?0:1/n,s=o*r,a=e.map(function(u){return o*u}),c=e.map(function(u){return i*u}),l=Va(t);return{velocities:a,velocity:s,distance:l,direction:c}}function Ha(t){return Math.sign?Math.sign(t):+(t>0)-+(t<0)||+t}function R2(t,e,n){return Math.max(e,Math.min(t,n))}function L2(t,e){return Math.pow(t,e*5)}function Wl(t,e,n){return e===0||Math.abs(e)===1/0?L2(t,n):t*e*n/(e+n*t)}function ci(t,e,n,r){return r===void 0&&(r=.15),r===0?R2(t,e,n):t<e?-Wl(e-t,n-e,r)+e:t>n?+Wl(t-n,n-e,r)+n:t}function Zl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function M2(t,e,n){return e&&Zl(t.prototype,e),n&&Zl(t,n),t}function He(){return He=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},He.apply(this,arguments)}function Wd(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function k2(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function fo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function D2(t,e){if(t){if(typeof t=="string")return Kl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kl(t,e)}}function Kl(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Es(t,e){var n;if(typeof Symbol>"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(n=D2(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
44
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return n=t[Symbol.iterator](),n.next.bind(n)}function Zd(){}function Kd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.length===0?Zd:e.length===1?e[0]:function(){for(var r,i=Es(e),o;!(o=i()).done;){var s=o.value;r=s.apply(this,arguments)||r}return r}}function nn(t,e){if(t===void 0){if(e===void 0)throw new Error("Must define fallback value if undefined is expected");t=e}return Array.isArray(t)?t:[t,t]}function ho(t){if(typeof t=="function"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.apply(void 0,n)}else return t}function Ac(t,e){t===void 0&&(t={});for(var n={},r=0,i=Object.entries(e);r<i.length;r++){var o=i[r],s=o[0],a=o[1];switch(typeof a){case"function":n[s]=a.call(n,t[s],s,t);break;case"object":n[s]=Ac(t[s],a);break;case"boolean":a&&(n[s]=t[s]);break}}return n}var j2=180,N2=.15,I2=.5,F2=60,B2={threshold:function(e){return e===void 0&&(e=0),nn(e)},rubberband:function(e){switch(e===void 0&&(e=0),e){case!0:return nn(N2);case!1:return nn(0);default:return nn(e)}},enabled:function(e){return e===void 0&&(e=!0),e},triggerAllEvents:function(e){return e===void 0&&(e=!1),e},initial:function(e){return e===void 0&&(e=0),typeof e=="function"?e:nn(e)}},Qd=He({},B2,{axis:!0,lockDirection:function(e){return e===void 0&&(e=!1),e},bounds:function(e){if(e===void 0&&(e={}),typeof e=="function")return function(f){return Qd.bounds(e(f))};var n=e,r=n.left,i=r===void 0?-1/0:r,o=n.right,s=o===void 0?1/0:o,a=n.top,c=a===void 0?-1/0:a,l=n.bottom,u=l===void 0?1/0:l;return[[i,s],[c,u]]}}),V2=typeof window<"u"&&window.document&&window.document.createElement,H2={enabled:function(e){return e===void 0&&(e=!0),e},domTarget:!0,window:function(t){function e(n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return t===void 0&&(t=V2?window:void 0),t}),eventOptions:function(e){var n=e===void 0?{}:e,r=n.passive,i=r===void 0?!0:r,o=n.capture,s=o===void 0?!1:o;return{passive:i,capture:s}}},$2=He({},Qd,{threshold:function(e,n,r){var i=r.filterTaps,o=i===void 0?!1:i,s=r.lockDirection,a=s===void 0?!1:s,c=r.axis,l=c===void 0?void 0:c,u=nn(e,o?3:a||l?1:0);return this.filterTaps=o||u[0]+u[1]>0,u},swipeVelocity:function(e){return e===void 0&&(e=I2),nn(e)},swipeDistance:function(e){return e===void 0&&(e=F2),nn(e)},delay:function(e){switch(e===void 0&&(e=0),e){case!0:return j2;case!1:return 0;default:return e}}});function U2(t){return t===void 0&&(t={}),Ac(t,H2)}function z2(t){return t===void 0&&(t={}),Ac(t,$2)}function q2(t){var e=t.domTarget,n=t.eventOptions,r=t.window,i=t.enabled,o=k2(t,["domTarget","eventOptions","window","enabled"]),s=U2({domTarget:e,eventOptions:n,window:r,enabled:i});return s.drag=z2(o),s}function Ur(t){return He({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:Zd,canceled:!1,memo:void 0,args:void 0},t)}function Jd(){var t={hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},e=Ur({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),n=Ur({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),r=Ur({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),i=Ur({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),o=Ur({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0});return{shared:t,drag:e,pinch:n,wheel:r,move:i,scroll:o}}var bn=new Map,G2=function(){function t(n,r){var i=this;r===void 0&&(r=[]),this.controller=n,this.args=r,this.debounced=!0,this.setTimeout=function(o,s){var a;s===void 0&&(s=140),clearTimeout(i.controller.timeouts[i.stateKey]);for(var c=arguments.length,l=new Array(c>2?c-2:0),u=2;u<c;u++)l[u-2]=arguments[u];i.controller.timeouts[i.stateKey]=(a=window).setTimeout.apply(a,[o,s].concat(l))},this.clearTimeout=function(){clearTimeout(i.controller.timeouts[i.stateKey])},this.fireGestureHandler=function(o){if(o===void 0&&(o=!1),i.state._blocked)return i.debounced||(i.state._active=!1,i.clean()),null;if(!o&&!i.state.intentional&&!i.config.triggerAllEvents)return null;if(i.state.intentional){var s=i.state.active,a=i.state._active;i.state.active=a,i.state.first=a&&!s,i.state.last=s&&!a,i.controller.state.shared[i.ingKey]=a}var c=He({},i.controller.state.shared,i.state,i.mapStateValues(i.state)),l=i.handler(c);return i.state.memo=l!==void 0?l:i.state.memo,i.state._active||i.clean(),c}}var e=t.prototype;return e.updateSharedState=function(r){Object.assign(this.controller.state.shared,r)},e.updateGestureState=function(r){Object.assign(this.state,r)},e.checkIntentionality=function(r,i){return{_intentional:r,_blocked:!1}},e.getMovement=function(r){var i=this.config,o=i.initial,s=i.bounds,a=i.rubberband,c=i.threshold,l=this.state,u=l._bounds,f=l._initial,d=l._active,y=l._intentional,m=l.lastOffset,h=l.movement,_=this.getInternalMovement(r,this.state),b=y[0]===!1?Ql(_[0],c[0]):y[0],C=y[1]===!1?Ql(_[1],c[1]):y[1],v=this.checkIntentionality([b,C],_);if(v._blocked)return He({},v,{_movement:_,delta:[0,0]});var E=v._intentional,x=_,g,S;if(E[0]!==!1&&y[0]===!1&&(S=ho(o,this.state),g=ho(s,this.state),f[0]=S[0],u[0]=g[0]),E[1]!==!1&&y[1]===!1){var O,T;S=(O=S)!=null?O:ho(o,this.state),g=(T=g)!=null?T:ho(s,this.state),f[1]=S[1],u[1]=g[1]}var R=[E[0]!==!1?_[0]-E[0]:f[0],E[1]!==!1?_[1]-E[1]:f[1]],L=Gl(R,m),A=d?a:[0,0];return R=Jl(u,Gl(R,f),A),He({},v,{intentional:E[0]!==!1||E[1]!==!1,_initial:f,_movement:x,movement:R,values:r,offset:Jl(u,L,A),delta:Gd(R,h)})},e.clean=function(){this.clearTimeout()},M2(t,[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}]),t}();function Ql(t,e){return Math.abs(t)>=e?Ha(t)*e:!1}function Jl(t,e,n){var r=e[0],i=e[1],o=n[0],s=n[1],a=t[0],c=a[0],l=a[1],u=t[1],f=u[0],d=u[1];return[ci(r,c,l,o),ci(i,f,d,s)]}function Qs(t,e,n){var r=t.state,i=t.args,o=e.timeStamp,s=e.type,a=r.values,c=n?0:o-r.startTime;return{_lastEventType:s,event:e,timeStamp:o,elapsedTime:c,args:i,previous:a}}function W2(t,e,n){var r=t.state.offset,i=n.timeStamp;return He({},Jd()[t.stateKey],{_active:!0,values:e,initial:e,offset:r,lastOffset:r,startTime:i})}function Z2(t,e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.call.apply(t,[this,He({},e,{event:n})].concat(i))}}var K2=function(e){var n=this;this.classes=e,this.bind=function(){for(var r={},i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];for(var a=Es(n.classes),c;!(c=a()).done;){var l=c.value;new l(n,o).addBindings(r)}for(var u=0,f=Object.entries(n.nativeRefs);u<f.length;u++){var d=f[u],y=d[0],m=d[1];$a(r,y,Z2(m,He({},n.state.shared,{args:o})))}return n.config.domTarget?Y2(n,r):e3(n,r)},this.effect=function(){return n.config.domTarget&&n.bind(),n.clean},this.clean=function(){var r=Yd(n.config),i=n.config.eventOptions;r&&Fi(r,Xd(n.domListeners),i),Object.values(n.timeouts).forEach(clearTimeout),Q2(n)},this.state=Jd(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function Q2(t){var e=t.config,n=e.window,r=e.eventOptions,i=t.windowListeners;if(n){for(var o in i){var s=i[o];Fi(n,s,r)}t.windowListeners={}}}function J2(t,e){var n=t.config,r=t.windowListeners;n.window&&(Fi(n.window,r[e],n.eventOptions),delete r[e])}function X2(t,e,n){var r=t.config,i=t.windowListeners;n===void 0&&(n=[]),r.window&&(Fi(r.window,i[e],r.eventOptions),eh(r.window,i[e]=n,r.eventOptions))}function Y2(t,e){var n=t.config,r=t.domListeners,i=Yd(n);if(!i)throw new Error("domTarget must be defined");var o=n.eventOptions;Fi(i,Xd(r),o);for(var s=0,a=Object.entries(e);s<a.length;s++){var c=a[s],l=c[0],u=c[1],f=l.slice(2).toLowerCase();r.push([f,Kd.apply(void 0,u)])}eh(i,r,o)}function e3(t,e){for(var n=t.config,r={},i=n.eventOptions.capture?"Capture":"",o=0,s=Object.entries(e);o<s.length;o++){var a=s[o],c=a[0],l=a[1],u=Array.isArray(l)?l:[l],f=c+i;r[f]=Kd.apply(void 0,u)}return r}function Xd(t){return t===void 0&&(t=[]),t.splice(0,t.length)}function Yd(t){var e=t.domTarget;return e&&"current"in e?e.current:e}function $a(t,e,n){t[e]||(t[e]=[]),t[e].push(n)}function eh(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={});for(var r=Es(e),i;!(i=r()).done;){var o=i.value,s=o[0],a=o[1];t.addEventListener(s,a,n)}}function Fi(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={});for(var r=Es(e),i;!(i=r()).done;){var o=i.value,s=o[0],a=o[1];t.removeEventListener(s,a,n)}}function t3(t,e,n){n===void 0&&(n={});var r=r3(t),i=p.useMemo(function(){return new K2(r)},[]);return i.config=e,i.handlers=t,i.nativeRefs=n,p.useEffect(i.effect,[]),i.config.domTarget?n3:i.bind}function n3(){}function r3(t){var e=new Set;return t.drag&&e.add(bn.get("drag")),t.wheel&&e.add(bn.get("wheel")),t.scroll&&e.add(bn.get("scroll")),t.move&&e.add(bn.get("move")),t.pinch&&e.add(bn.get("pinch")),t.hover&&e.add(bn.get("hover")),e}var i3=function(t){Wd(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.getInternalMovement=function(i,o){return Gd(i,o.initial)},n.checkIntentionality=function(i,o){if(i[0]===!1&&i[1]===!1)return{_intentional:i,axis:this.state.axis};var s=o.map(Math.abs),a=s[0],c=s[1],l=this.state.axis||(a>c?"x":a<c?"y":void 0);return!this.config.axis&&!this.config.lockDirection?{_intentional:i,_blocked:!1,axis:l}:l?this.config.axis&&l!==this.config.axis?{_intentional:i,_blocked:!0,axis:l}:(i[l==="x"?1:0]=!1,{_intentional:i,_blocked:!1,axis:l}):{_intentional:[!1,!1],_blocked:!1,axis:l}},n.getKinematics=function(i,o){var s=this.getMovement(i);if(!s._blocked){var a=o.timeStamp-this.state.timeStamp;Object.assign(s,A2(s.movement,s.delta,a))}return s},n.mapStateValues=function(i){return{xy:i.values,vxvy:i.velocities}},e}(G2);function th(t){if("touches"in t){var e=t.targetTouches,n=t.changedTouches;return e.length>0?e:n}return null}function Xl(t){var e="buttons"in t?t.buttons:0,n=th(t),r=n&&n.length||0,i=r>0||e>0,o=t.shiftKey,s=t.altKey,a=t.metaKey,c=t.ctrlKey;return{touches:r,down:i,buttons:e,shiftKey:o,altKey:s,metaKey:a,ctrlKey:c}}function Yl(t){var e=th(t),n=e?e[0]:t,r=n.clientX,i=n.clientY;return[r,i]}var o3=3,s3=220,a3=function(t){Wd(e,t);function e(){var r;return r=t.apply(this,arguments)||this,r.ingKey="dragging",r.stateKey="drag",r.onDragStart=function(i){!r.enabled||r.state._active||(X2(r.controller,r.stateKey,[["pointermove",r.onDragChange],["pointerup",r.onDragEnd],["pointercancel",r.onDragEnd]]),r.updateGestureState({_pointerId:i.pointerId}),r.config.delay>0?(r.state._delayedEvent=!0,"persist"in i&&typeof i.persist=="function"&&i.persist(),r.setTimeout(r.startDrag.bind(fo(r)),r.config.delay,i)):r.startDrag(i))},r.onDragChange=function(i){if(!r.state.canceled&&i.pointerId===r.state._pointerId){if(!r.state._active){r.state._delayedEvent&&(r.clearTimeout(),r.startDrag(i));return}var o=Xl(i);if(!o.down){r.onDragEnd(i);return}r.updateSharedState(o);var s=Yl(i),a=r.getKinematics(s,i),c=Qs(fo(r),i),l=r.state._isTap,u=Va(a._movement);l&&u>=o3&&(l=!1),r.updateGestureState(He({},c,a,{_isTap:l})),r.fireGestureHandler()}},r.onDragEnd=function(i){if(i.pointerId===r.state._pointerId){r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0});var o=r.state._isTap,s=r.state.velocities,a=s[0],c=s[1],l=r.state.movement,u=l[0],f=l[1],d=r.state._intentional,y=d[0],m=d[1],h=r.config.swipeVelocity,_=h[0],b=h[1],C=r.config.swipeDistance,v=C[0],E=C[1],x=He({},Qs(fo(r),i),r.getMovement(r.state.values)),g=[0,0];x.elapsedTime<s3&&(y!==!1&&Math.abs(a)>_&&Math.abs(u)>v&&(g[0]=Ha(a)),m!==!1&&Math.abs(c)>b&&Math.abs(f)>E&&(g[1]=Ha(c))),r.updateGestureState(He({},x,{tap:o,swipe:g})),r.fireGestureHandler(o===!0)}},r.clean=function(){t.prototype.clean.call(fo(r)),r.state._delayedEvent=!1,J2(r.controller,r.stateKey)},r.onCancel=function(){r.state.canceled||(r.updateGestureState({canceled:!0}),r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame(function(){return r.fireGestureHandler()}))},r.onClick=function(i){r.state._isTap||i.stopPropagation()},r}var n=e.prototype;return n.startDrag=function(i){var o=Yl(i);this.updateSharedState(Xl(i)),this.updateGestureState(He({},W2(this,o,i),Qs(this,i,!0),{_pointerId:i.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(o)),this.fireGestureHandler()},n.addBindings=function(i){if($a(i,"onPointerDown",this.onDragStart),this.config.filterTaps){var o=this.controller.config.eventOptions.capture?"onClick":"onClickCapture";$a(i,o,this.onClick)}},e}(i3);function c3(t,e){var n,r=[],i,o=!1;function s(){for(var a=arguments.length,c=new Array(a),l=0;l<a;l++)c[l]=arguments[l];return o&&n===this&&e(c,r)||(i=t.apply(this,c),o=!0,n=this,r=c),i}return s}function Vo(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Vo(t[r],e[r]))return!1;return!0}var o;if(typeof Map=="function"&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=t.entries();!(r=o.next()).done;)if(!Vo(r.value[1],e.get(r.value[0])))return!1;return!0}if(typeof Set=="function"&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(typeof Element<"u"&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!(i[r]==="_owner"&&t.$$typeof)&&!Vo(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}function l3(t,e){try{return Vo(t,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}function u3(t,e){e===void 0&&(e={}),bn.set("drag",a3);var n=p.useRef();return n.current||(n.current=c3(q2,l3)),t3({drag:t},n.current(e))}/*!
45
45
  * tabbable 5.3.3
46
46
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
47
- */var Mh=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],ms=Mh.join(","),Oh=typeof Element>"u",hr=Oh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,el=!Oh&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},Ph=function(e,n,r){var i=Array.prototype.slice.apply(e.querySelectorAll(ms));return n&&hr.call(e,ms)&&i.unshift(e),i=i.filter(r),i},kh=function t(e,n,r){for(var i=[],o=Array.from(e);o.length;){var s=o.shift();if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=t(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scope:s,candidates:u})}else{var f=hr.call(s,ms);f&&r.filter(s)&&(n||!e.includes(s))&&i.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!r.shadowRootFilter||r.shadowRootFilter(s);if(d&&h){var v=t(d===!0?s.children:d.children,!0,r);r.flatten?i.push.apply(i,v):i.push({scope:s,candidates:v})}else o.unshift.apply(o,s.children)}}return i},Th=function(e,n){return e.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},i2=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Rh=function(e){return e.tagName==="INPUT"},o2=function(e){return Rh(e)&&e.type==="hidden"},s2=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},a2=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},l2=function(e){if(!e.name)return!0;var n=e.form||el(e),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=a2(i,e.form);return!o||o===e},u2=function(e){return Rh(e)&&e.type==="radio"},c2=function(e){return u2(e)&&!l2(e)},tc=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},f2=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var o=hr.call(e,"details>summary:first-of-type"),s=o?e.parentElement:e;if(hr.call(s,"details:not([open]) *"))return!0;var a=el(e).host,l=(a==null?void 0:a.ownerDocument.contains(a))||e.ownerDocument.contains(e);if(!r||r==="full"){if(typeof i=="function"){for(var u=e;e;){var f=e.parentElement,d=el(e);if(f&&!f.shadowRoot&&i(f)===!0)return tc(e);e.assignedSlot?e=e.assignedSlot:!f&&d!==e.ownerDocument?e=d.host:e=f}e=u}if(l)return!e.getClientRects().length}else if(r==="non-zero-area")return tc(e);return!1},d2=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return hr.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},ys=function(e,n){return!(n.disabled||o2(n)||f2(n,e)||s2(n)||d2(n))},tl=function(e,n){return!(c2(n)||Th(n)<0||!ys(e,n))},h2=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},p2=function t(e){var n=[],r=[];return e.forEach(function(i,o){var s=!!i.scope,a=s?i.scope:i,l=Th(a,s),u=s?t(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(i2).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},g2=function(e,n){n=n||{};var r;return n.getShadowRoot?r=kh([e],n.includeContainer,{filter:tl.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:h2}):r=Ph(e,n.includeContainer,tl.bind(null,n)),p2(r)},v2=function(e,n){n=n||{};var r;return n.getShadowRoot?r=kh([e],n.includeContainer,{filter:ys.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Ph(e,n.includeContainer,ys.bind(null,n)),r},Po=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return hr.call(e,ms)===!1?!1:tl(n,e)},m2=Mh.concat("iframe").join(","),sa=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return hr.call(e,m2)===!1?!1:ys(n,e)};/*!
47
+ */var nh=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],is=nh.join(","),rh=typeof Element>"u",jn=rh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ua=!rh&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},ih=function(e,n,r){var i=Array.prototype.slice.apply(e.querySelectorAll(is));return n&&jn.call(e,is)&&i.unshift(e),i=i.filter(r),i},oh=function t(e,n,r){for(var i=[],o=Array.from(e);o.length;){var s=o.shift();if(s.tagName==="SLOT"){var a=s.assignedElements(),c=a.length?a:s.children,l=t(c,!0,r);r.flatten?i.push.apply(i,l):i.push({scope:s,candidates:l})}else{var u=jn.call(s,is);u&&r.filter(s)&&(n||!e.includes(s))&&i.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!r.shadowRootFilter||r.shadowRootFilter(s);if(f&&d){var y=t(f===!0?s.children:f.children,!0,r);r.flatten?i.push.apply(i,y):i.push({scope:s,candidates:y})}else o.unshift.apply(o,s.children)}}return i},sh=function(e,n){return e.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},f3=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},ah=function(e){return e.tagName==="INPUT"},d3=function(e){return ah(e)&&e.type==="hidden"},h3=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},p3=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},m3=function(e){if(!e.name)return!0;var n=e.form||Ua(e),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=p3(i,e.form);return!o||o===e},g3=function(e){return ah(e)&&e.type==="radio"},v3=function(e){return g3(e)&&!m3(e)},eu=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},y3=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var o=jn.call(e,"details>summary:first-of-type"),s=o?e.parentElement:e;if(jn.call(s,"details:not([open]) *"))return!0;var a=Ua(e).host,c=(a==null?void 0:a.ownerDocument.contains(a))||e.ownerDocument.contains(e);if(!r||r==="full"){if(typeof i=="function"){for(var l=e;e;){var u=e.parentElement,f=Ua(e);if(u&&!u.shadowRoot&&i(u)===!0)return eu(e);e.assignedSlot?e=e.assignedSlot:!u&&f!==e.ownerDocument?e=f.host:e=u}e=l}if(c)return!e.getClientRects().length}else if(r==="non-zero-area")return eu(e);return!1},b3=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return jn.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},os=function(e,n){return!(n.disabled||d3(n)||y3(n,e)||h3(n)||b3(n))},za=function(e,n){return!(v3(n)||sh(n)<0||!os(e,n))},w3=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},_3=function t(e){var n=[],r=[];return e.forEach(function(i,o){var s=!!i.scope,a=s?i.scope:i,c=sh(a,s),l=s?t(i.candidates):a;c===0?s?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:c,item:i,isScope:s,content:l})}),r.sort(f3).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},S3=function(e,n){n=n||{};var r;return n.getShadowRoot?r=oh([e],n.includeContainer,{filter:za.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:w3}):r=ih(e,n.includeContainer,za.bind(null,n)),_3(r)},C3=function(e,n){n=n||{};var r;return n.getShadowRoot?r=oh([e],n.includeContainer,{filter:os.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=ih(e,n.includeContainer,os.bind(null,n)),r},po=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return jn.call(e,is)===!1?!1:za(n,e)},E3=nh.concat("iframe").join(","),Js=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return jn.call(e,E3)===!1?!1:os(n,e)};/*!
48
48
  * focus-trap 6.9.4
49
49
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
50
- */function nc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?nc(Object(n),!0).forEach(function(r){y2(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nc(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function y2(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ic=function(){var t=[];return{activateTrap:function(n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}}}(),b2=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},w2=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},C2=function(e){return e.key==="Tab"||e.keyCode===9},oc=function(e){return setTimeout(e,0)},sc=function(e,n){var r=-1;return e.every(function(i,o){return n(i)?(r=o,!1):!0}),r},gi=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,r):e},ko=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},S2=function(e,n){var r=(n==null?void 0:n.document)||document,i=rc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s,a=function(p,b,x){return p&&p[b]!==void 0?p[b]:i[x||b]},l=function(p){return o.containerGroups.findIndex(function(b){var x=b.container,P=b.tabbableNodes;return x.contains(p)||P.find(function(O){return O===p})})},u=function(p){var b=i[p];if(typeof b=="function"){for(var x=arguments.length,P=new Array(x>1?x-1:0),O=1;O<x;O++)P[O-1]=arguments[O];b=b.apply(void 0,P)}if(b===!0&&(b=void 0),!b){if(b===void 0||b===!1)return b;throw new Error("`".concat(p,"` was specified but was not a node, or did not return a node"))}var T=b;if(typeof b=="string"&&(T=r.querySelector(b),!T))throw new Error("`".concat(p,"` as selector refers to no known node"));return T},f=function(){var p=u("initialFocus");if(p===!1)return!1;if(p===void 0)if(l(r.activeElement)>=0)p=r.activeElement;else{var b=o.tabbableGroups[0],x=b&&b.firstTabbableNode;p=x||u("fallbackFocus")}if(!p)throw new Error("Your focus-trap needs to have at least one focusable element");return p},d=function(){if(o.containerGroups=o.containers.map(function(p){var b=g2(p,i.tabbableOptions),x=v2(p,i.tabbableOptions);return{container:p,tabbableNodes:b,focusableNodes:x,firstTabbableNode:b.length>0?b[0]:null,lastTabbableNode:b.length>0?b[b.length-1]:null,nextTabbableNode:function(O){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,M=x.findIndex(function(R){return R===O});if(!(M<0))return T?x.slice(M+1).find(function(R){return Po(R,i.tabbableOptions)}):x.slice(0,M).reverse().find(function(R){return Po(R,i.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(p){return p.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},h=function E(p){if(p!==!1&&p!==r.activeElement){if(!p||!p.focus){E(f());return}p.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=p,b2(p)&&p.select()}},v=function(p){var b=u("setReturnFocus",p);return b||(b===!1?!1:p)},y=function(p){var b=ko(p);if(!(l(b)>=0)){if(gi(i.clickOutsideDeactivates,p)){s.deactivate({returnFocus:i.returnFocusOnDeactivate&&!sa(b,i.tabbableOptions)});return}gi(i.allowOutsideClick,p)||p.preventDefault()}},g=function(p){var b=ko(p),x=l(b)>=0;x||b instanceof Document?x&&(o.mostRecentlyFocusedNode=b):(p.stopImmediatePropagation(),h(o.mostRecentlyFocusedNode||f()))},S=function(p){var b=ko(p);d();var x=null;if(o.tabbableGroups.length>0){var P=l(b),O=P>=0?o.containerGroups[P]:void 0;if(P<0)p.shiftKey?x=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:x=o.tabbableGroups[0].firstTabbableNode;else if(p.shiftKey){var T=sc(o.tabbableGroups,function(N){var z=N.firstTabbableNode;return b===z});if(T<0&&(O.container===b||sa(b,i.tabbableOptions)&&!Po(b,i.tabbableOptions)&&!O.nextTabbableNode(b,!1))&&(T=P),T>=0){var M=T===0?o.tabbableGroups.length-1:T-1,R=o.tabbableGroups[M];x=R.lastTabbableNode}}else{var A=sc(o.tabbableGroups,function(N){var z=N.lastTabbableNode;return b===z});if(A<0&&(O.container===b||sa(b,i.tabbableOptions)&&!Po(b,i.tabbableOptions)&&!O.nextTabbableNode(b))&&(A=P),A>=0){var B=A===o.tabbableGroups.length-1?0:A+1,V=o.tabbableGroups[B];x=V.firstTabbableNode}}}else x=u("fallbackFocus");x&&(p.preventDefault(),h(x))},w=function(p){if(w2(p)&&gi(i.escapeDeactivates,p)!==!1){p.preventDefault(),s.deactivate();return}if(C2(p)){S(p);return}},L=function(p){var b=ko(p);l(b)>=0||gi(i.clickOutsideDeactivates,p)||gi(i.allowOutsideClick,p)||(p.preventDefault(),p.stopImmediatePropagation())},m=function(){if(o.active)return ic.activateTrap(s),o.delayInitialFocusTimer=i.delayInitialFocus?oc(function(){h(f())}):h(f()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",L,{capture:!0,passive:!1}),r.addEventListener("keydown",w,{capture:!0,passive:!1}),s},_=function(){if(o.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",L,!0),r.removeEventListener("keydown",w,!0),s};return s={get active(){return o.active},get paused(){return o.paused},activate:function(p){if(o.active)return this;var b=a(p,"onActivate"),x=a(p,"onPostActivate"),P=a(p,"checkCanFocusTrap");P||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,b&&b();var O=function(){P&&d(),m(),x&&x()};return P?(P(o.containers.concat()).then(O,O),this):(O(),this)},deactivate:function(p){if(!o.active)return this;var b=rc({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},p);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,_(),o.active=!1,o.paused=!1,ic.deactivateTrap(s);var x=a(b,"onDeactivate"),P=a(b,"onPostDeactivate"),O=a(b,"checkCanReturnFocus"),T=a(b,"returnFocus","returnFocusOnDeactivate");x&&x();var M=function(){oc(function(){T&&h(v(o.nodeFocusedBeforeActivation)),P&&P()})};return T&&O?(O(v(o.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,_(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,d(),m(),this)},updateContainerElements:function(p){var b=[].concat(p).filter(Boolean);return o.containers=b.map(function(x){return typeof x=="string"?r.querySelector(x):x}),o.active&&d(),this}},s.updateContainerElements(e),s};function L2(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}else return Array.from(t)}var Hl=!1;if(typeof window<"u"){var ac={get passive(){Hl=!0}};window.addEventListener("testPassive",null,ac),window.removeEventListener("testPassive",null,ac)}var Dh=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),Un=[],bs=!1,Ah=-1,Ai=void 0,Ii=void 0,Ih=function(e){return Un.some(function(n){return!!(n.options.allowTouchMove&&n.options.allowTouchMove(e))})},ws=function(e){var n=e||window.event;return Ih(n.target)||n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)},x2=function(e){if(Ii===void 0){var n=!!e&&e.reserveScrollBarGap===!0,r=window.innerWidth-document.documentElement.clientWidth;n&&r>0&&(Ii=document.body.style.paddingRight,document.body.style.paddingRight=r+"px")}Ai===void 0&&(Ai=document.body.style.overflow,document.body.style.overflow="hidden")},E2=function(){Ii!==void 0&&(document.body.style.paddingRight=Ii,Ii=void 0),Ai!==void 0&&(document.body.style.overflow=Ai,Ai=void 0)},_2=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},M2=function(e,n){var r=e.targetTouches[0].clientY-Ah;return Ih(e.target)?!1:n&&n.scrollTop===0&&r>0||_2(n)&&r<0?ws(e):(e.stopPropagation(),!0)},O2=function(e,n){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Un.some(function(i){return i.targetElement===e})){var r={targetElement:e,options:n||{}};Un=[].concat(L2(Un),[r]),Dh?(e.ontouchstart=function(i){i.targetTouches.length===1&&(Ah=i.targetTouches[0].clientY)},e.ontouchmove=function(i){i.targetTouches.length===1&&M2(i,e)},bs||(document.addEventListener("touchmove",ws,Hl?{passive:!1}:void 0),bs=!0)):x2(n)}},P2=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Un=Un.filter(function(n){return n.targetElement!==e}),Dh?(e.ontouchstart=null,e.ontouchmove=null,bs&&Un.length===0&&(document.removeEventListener("touchmove",ws,Hl?{passive:!1}:void 0),bs=!1)):Un.length||E2()},fr=[],k2=function(){return fr.some(function(t){return t.activeTargets.length>0})},T2=function(){return fr.some(function(t){return t.skippedTargets.length>0})},lc="ResizeObserver loop completed with undelivered notifications.",R2=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:lc}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=lc),window.dispatchEvent(t)},Hi;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Hi||(Hi={}));var dr=function(t){return Object.freeze(t)},D2=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,dr(this)}return t}(),jh=function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,dr(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,o=e.right,s=e.bottom,a=e.left,l=e.width,u=e.height;return{x:n,y:r,top:i,right:o,bottom:s,left:a,width:l,height:u}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),$l=function(t){return t instanceof SVGElement&&"getBBox"in t},Nh=function(t){if($l(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||t.getClientRects().length)},uc=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},A2=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},ji=typeof window<"u"?window:{},To=new WeakMap,cc=/auto|scroll/,I2=/^tb|vertical/,j2=/msie|trident/i.test(ji.navigator&&ji.navigator.userAgent),Jt=function(t){return parseFloat(t||"0")},Tr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new D2((n?e:t)||0,(n?t:e)||0)},fc=dr({devicePixelContentBoxSize:Tr(),borderBoxSize:Tr(),contentBoxSize:Tr(),contentRect:new jh(0,0,0,0)}),Bh=function(t,e){if(e===void 0&&(e=!1),To.has(t)&&!e)return To.get(t);if(Nh(t))return To.set(t,fc),fc;var n=getComputedStyle(t),r=$l(t)&&t.ownerSVGElement&&t.getBBox(),i=!j2&&n.boxSizing==="border-box",o=I2.test(n.writingMode||""),s=!r&&cc.test(n.overflowY||""),a=!r&&cc.test(n.overflowX||""),l=r?0:Jt(n.paddingTop),u=r?0:Jt(n.paddingRight),f=r?0:Jt(n.paddingBottom),d=r?0:Jt(n.paddingLeft),h=r?0:Jt(n.borderTopWidth),v=r?0:Jt(n.borderRightWidth),y=r?0:Jt(n.borderBottomWidth),g=r?0:Jt(n.borderLeftWidth),S=d+u,w=l+f,L=g+v,m=h+y,_=a?t.offsetHeight-m-t.clientHeight:0,E=s?t.offsetWidth-L-t.clientWidth:0,p=i?S+L:0,b=i?w+m:0,x=r?r.width:Jt(n.width)-p-E,P=r?r.height:Jt(n.height)-b-_,O=x+S+E+L,T=P+w+_+m,M=dr({devicePixelContentBoxSize:Tr(Math.round(x*devicePixelRatio),Math.round(P*devicePixelRatio),o),borderBoxSize:Tr(O,T,o),contentBoxSize:Tr(x,P,o),contentRect:new jh(d,l,x,P)});return To.set(t,M),M},Fh=function(t,e,n){var r=Bh(t,n),i=r.borderBoxSize,o=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case Hi.DEVICE_PIXEL_CONTENT_BOX:return s;case Hi.BORDER_BOX:return i;default:return o}},N2=function(){function t(e){var n=Bh(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=dr([n.borderBoxSize]),this.contentBoxSize=dr([n.contentBoxSize]),this.devicePixelContentBoxSize=dr([n.devicePixelContentBoxSize])}return t}(),Uh=function(t){if(Nh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},B2=function(){var t=1/0,e=[];fr.forEach(function(s){if(s.activeTargets.length!==0){var a=[];s.activeTargets.forEach(function(u){var f=new N2(u.target),d=Uh(u.target);a.push(f),u.lastReportedSize=Fh(u.target,u.observedBox),d<t&&(t=d)}),e.push(function(){s.callback.call(s.observer,a,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},dc=function(t){fr.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(Uh(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},F2=function(){var t=0;for(dc(t);k2();)t=B2(),dc(t);return T2()&&R2(),t>0},aa,Vh=[],U2=function(){return Vh.splice(0).forEach(function(t){return t()})},V2=function(t){if(!aa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return U2()}).observe(n,r),aa=function(){n.textContent="".concat(e?e--:e++)}}Vh.push(t),aa()},z2=function(t){V2(function(){requestAnimationFrame(t)})},es=0,H2=function(){return!!es},$2=250,W2={attributes:!0,characterData:!0,childList:!0,subtree:!0},hc=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],pc=function(t){return t===void 0&&(t=0),Date.now()+t},la=!1,G2=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=$2),!la){la=!0;var r=pc(e);z2(function(){var i=!1;try{i=F2()}finally{if(la=!1,e=r-pc(),!H2())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,W2)};document.body?n():ji.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),hc.forEach(function(n){return ji.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),hc.forEach(function(n){return ji.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),nl=new G2,gc=function(t){!es&&t>0&&nl.start(),es+=t,!es&&nl.stop()},Z2=function(t){return!$l(t)&&!A2(t)&&getComputedStyle(t).display==="inline"},q2=function(){function t(e,n){this.target=e,this.observedBox=n||Hi.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Fh(this.target,this.observedBox,!0);return Z2(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),K2=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),Ro=new WeakMap,vc=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Do=function(){function t(){}return t.connect=function(e,n){var r=new K2(e,n);Ro.set(e,r)},t.observe=function(e,n,r){var i=Ro.get(e),o=i.observationTargets.length===0;vc(i.observationTargets,n)<0&&(o&&fr.push(i),i.observationTargets.push(new q2(n,r&&r.box)),gc(1),nl.schedule())},t.unobserve=function(e,n){var r=Ro.get(e),i=vc(r.observationTargets,n),o=r.observationTargets.length===1;i>=0&&(o&&fr.splice(fr.indexOf(r),1),r.observationTargets.splice(i,1),gc(-1))},t.disconnect=function(e){var n=this,r=Ro.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Q2=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Do.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uc(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Do.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uc(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Do.unobserve(this,e)},t.prototype.disconnect=function(){Do.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function pt(){return pt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pt.apply(this,arguments)}function ts(t,e){if(t==null)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)e.indexOf(n=o[r])>=0||(i[n]=t[n]);return i}var Ni=typeof window<"u"?c.useLayoutEffect:c.useEffect;function vi(t,e,n){return e=(e=+e)==e?e:0,n=(n=+n)==n?n:0,(t=+t)==t&&(t=(t=t<=n?t:n)>=e?t:e),t}function Ao(t){var e=Math.round(t);if(Number.isNaN(t))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return e}var J2={box:"border-box"};function ua(t,e){var n=e.label,r=e.enabled,i=e.resizeSourceRef,o=c.useState(0),s=o[0],a=o[1];c.useDebugValue(n+": "+s);var l=c.useCallback(function(u){a(u[0].borderBoxSize[0].blockSize),i.current="element"},[i]);return Ni(function(){if(t.current&&r){var u=new Q2(l);return u.observe(t.current,J2),function(){u.disconnect()}}},[t,l,r]),r?s:0}function dt(t){return t===void 0&&(t=1e3),new Promise(function(e){return setTimeout(e,t)})}var mc={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},yc={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},Y2=x1({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:pt({},mc,yc)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:pt({},mc,yc)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:pt({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[E1({y:function(t,e){return e.payload.y},velocity:function(t,e){return e.payload.velocity},snapSource:function(t,e){var n=e.payload.source;return n===void 0?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(t,e){},onSnapCancel:function(t,e){},onResizeCancel:function(t,e){},onCloseCancel:function(t,e){},onOpenEnd:function(t,e){},onSnapEnd:function(t,e){},onRezizeEnd:function(t,e){}},services:{onSnapStart:function(){try{return Promise.resolve(dt()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenStart:function(){try{return Promise.resolve(dt()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseStart:function(){try{return Promise.resolve(dt()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeStart:function(){try{return Promise.resolve(dt()).then(function(){})}catch(t){return Promise.reject(t)}},onSnapEnd:function(){try{return Promise.resolve(dt()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenEnd:function(){try{return Promise.resolve(dt()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseEnd:function(){try{return Promise.resolve(dt()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeEnd:function(){try{return Promise.resolve(dt()).then(function(){})}catch(t){return Promise.reject(t)}},renderVisuallyHidden:function(t,e){try{return Promise.resolve(dt()).then(function(){})}catch(n){return Promise.reject(n)}},activate:function(t,e){try{return Promise.resolve(dt()).then(function(){})}catch(n){return Promise.reject(n)}},deactivate:function(t,e){try{return Promise.resolve(dt()).then(function(){})}catch(n){return Promise.reject(n)}},openSmoothly:function(t,e){try{return Promise.resolve(dt()).then(function(){})}catch(n){return Promise.reject(n)}},openImmediately:function(t,e){try{return Promise.resolve(dt()).then(function(){})}catch(n){return Promise.reject(n)}},snapSmoothly:function(t,e){try{return Promise.resolve(dt()).then(function(){})}catch(n){return Promise.reject(n)}},resizeSmoothly:function(t,e){try{return Promise.resolve(dt()).then(function(){})}catch(n){return Promise.reject(n)}},closeSmoothly:function(t,e){try{return Promise.resolve(dt()).then(function(){})}catch(n){return Promise.reject(n)}}},guards:{initiallyClosed:function(t){return t.initialState==="CLOSED"},initiallyOpen:function(t){return t.initialState==="OPEN"}}}),X2=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],e3=["velocity"],t3=["onRest","config"],zh=J1.default,n3=zh.tension,Io=zh.friction,r3=c.forwardRef(function(t,e){var n=t.children,r=t.sibling,i=t.className,o=t.footer,s=t.header,a=t.open,l=t.initialState,u=t.lastSnapRef,f=t.initialFocusRef,d=t.onDismiss,h=t.maxHeight,v=t.defaultSnap,y=v===void 0?o3:v,g=t.snapPoints,S=g===void 0?s3:g,w=t.blocking,L=w===void 0||w,m=t.scrollLocking,_=m===void 0||m,E=t.style,p=t.onSpringStart,b=t.onSpringCancel,x=t.onSpringEnd,P=t.reserveScrollBarGap,O=P===void 0?L:P,T=t.expandOnContentDrag,M=T!==void 0&&T,R=ts(t,X2),A=function(){var j=c.useState(!1),X=j[0],W=j[1],fe=c.useState({}),Ne=fe[0],Le=fe[1],Be=c.useCallback(function(Te){return Le(function(He){var ae;return pt({},He,((ae={})[Te]=!1,ae))}),function(){Le(function(He){var ae;return pt({},He,((ae={})[Te]=!0,ae))})}},[]);return c.useEffect(function(){var Te=Object.values(Ne);Te.length!==0&&Te.every(Boolean)&&W(!0)},[Ne]),{ready:X,registerReady:Be}}(),B=A.ready,V=A.registerReady,N=c.useRef(!1),z=c.useRef(p),Y=c.useRef(b),G=c.useRef(x);c.useEffect(function(){z.current=p,Y.current=b,G.current=x},[b,p,x]);var H,Q,oe=nb(function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}}),te=oe[0],ee=oe[1],D=c.useRef(null),ve=c.useRef(null),Pe=c.useRef(null),Z=c.useRef(null),De=c.useRef(null),Ae=c.useRef(null),ue=c.useRef(0),_e=c.useRef(),Ve=c.useRef(!1),Ce=(H=c.useMemo(function(){return typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null},[]),Q=c.useRef(H==null?void 0:H.matches),c.useDebugValue(Q.current?"reduce":"no-preference"),c.useEffect(function(){var j=function(X){Q.current=X.matches};return H==null||H.addListener(j),function(){return H==null?void 0:H.removeListener(j)}},[H]),Q),Me=function(j){var X=j.targetRef,W=j.enabled,fe=j.reserveScrollBarGap,Ne=c.useRef({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return c.useDebugValue(W?"Enabled":"Disabled"),c.useEffect(function(){if(!W)return Ne.current.deactivate(),void(Ne.current={activate:function(){},deactivate:function(){}});var Le=X.current,Be=!1;Ne.current={activate:function(){Be||(Be=!0,O2(Le,{allowTouchMove:function(Te){return Te.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:fe}))},deactivate:function(){Be&&(Be=!1,P2(Le))}}},[W,X,fe]),Ne}({targetRef:ve,enabled:B&&_,reserveScrollBarGap:O}),Ie=function(j){var X=j.targetRef,W=j.enabled,fe=c.useRef({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return c.useDebugValue(W?"Enabled":"Disabled"),c.useEffect(function(){if(!W)return fe.current.deactivate(),void(fe.current={activate:function(){},deactivate:function(){}});var Ne=X.current,Le=!1,Be=[],Te=[];fe.current={activate:function(){if(!Le){Le=!0;var He=Ne.parentNode;document.querySelectorAll("body > *").forEach(function(ae){if(ae!==He){var me=ae.getAttribute("aria-hidden");me!==null&&me!=="false"||(Be.push(me),Te.push(ae),ae.setAttribute("aria-hidden","true"))}})}},deactivate:function(){Le&&(Le=!1,Te.forEach(function(He,ae){var me=Be[ae];me===null?He.removeAttribute("aria-hidden"):He.setAttribute("aria-hidden",me)}),Be=[],Te=[])}}},[X,W]),fe}({targetRef:D,enabled:B&&L}),ke=function(j){var X=j.targetRef,W=j.fallbackRef,fe=j.initialFocusRef,Ne=j.enabled,Le=c.useRef({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return c.useDebugValue(Ne?"Enabled":"Disabled"),c.useEffect(function(){if(!Ne)return Le.current.deactivate(),void(Le.current={activate:function(){},deactivate:function(){}});var Be=W.current,Te=S2(X.current,{onActivate:void 0,initialFocus:fe?function(){return(fe==null?void 0:fe.current)||Be}:void 0,fallbackFocus:Be,escapeDeactivates:!1,clickOutsideDeactivates:!1}),He=!1;Le.current={activate:function(){try{return He?Promise.resolve():(He=!0,Promise.resolve(Te.activate()).then(function(){return Promise.resolve(new Promise(function(ae){return setTimeout(function(){return ae(void 0)},0)})).then(function(){})}))}catch(ae){return Promise.reject(ae)}},deactivate:function(){He&&(He=!1,Te.deactivate())}}},[Ne,W,fe,X]),Le}({targetRef:D,fallbackRef:Ae,initialFocusRef:f||void 0,enabled:B&&L&&f!==!1}),je=function(j){var X=j.getSnapPoints,W=j.heightRef,fe=j.lastSnapRef,Ne=j.ready,Le=function(tt){var Ct=tt.contentRef,St=tt.controlledMaxHeight,rt=tt.footerEnabled,Qt=tt.footerRef,Vt=tt.headerEnabled,Lt=tt.headerRef,Cn=tt.registerReady,fn=tt.resizeSourceRef,ii=c.useMemo(function(){return Cn("contentHeight")},[Cn]),oi=function(Sn,Wn,Gn){var Zn=c.useMemo(function(){return Wn("maxHeight")},[Wn]),qn=c.useState(function(){return Ao(Sn)||typeof window<"u"?window.innerHeight:0}),li=qn[0],ui=qn[1],Ln=li>0,ne=c.useRef(0);return c.useDebugValue(Sn?"controlled":"auto"),c.useEffect(function(){Ln&&Zn()},[Ln,Zn]),Ni(function(){if(Sn)return ui(Ao(Sn)),void(Gn.current="maxheightprop");var Xl=function(){ne.current||(ne.current=requestAnimationFrame(function(){ui(window.innerHeight),Gn.current="window",ne.current=0}))};return window.addEventListener("resize",Xl),ui(window.innerHeight),Gn.current="window",Zn(),function(){window.removeEventListener("resize",Xl),cancelAnimationFrame(ne.current)}},[Sn,Zn,Gn]),li}(St,Cn,fn),vr=ua(Lt,{label:"headerHeight",enabled:Vt,resizeSourceRef:fn}),si=ua(Ct,{label:"contentHeight",enabled:!0,resizeSourceRef:fn}),mr=ua(Qt,{label:"footerHeight",enabled:rt,resizeSourceRef:fn}),$n=Math.min(oi-vr-mr,si)+vr+mr;c.useDebugValue("minHeight: "+$n);var ai=si>0;return c.useEffect(function(){ai&&ii()},[ai,ii]),{maxHeight:oi,minHeight:$n,headerHeight:vr,footerHeight:mr}}({contentRef:j.contentRef,controlledMaxHeight:j.controlledMaxHeight,footerEnabled:j.footerEnabled,footerRef:j.footerRef,headerEnabled:j.headerEnabled,headerRef:j.headerRef,registerReady:j.registerReady,resizeSourceRef:j.resizeSourceRef}),Be=Le.maxHeight,Te=Le.minHeight,He=Le.headerHeight,ae=Le.footerHeight,me=function(tt,Ct){var St=[].concat(tt).map(Ao).reduce(function(Lt,Cn){return Lt.add(vi(Cn,0,Ct)),Lt},new Set),rt=Array.from(St),Qt=Math.min.apply(Math,rt);if(Number.isNaN(Qt))throw new TypeError("minSnap is NaN");var Vt=Math.max.apply(Math,rt);if(Number.isNaN(Vt))throw new TypeError("maxSnap is NaN");return{snapPoints:rt,minSnap:Qt,maxSnap:Vt}}(Ne?X({height:W.current,footerHeight:ae,headerHeight:He,minHeight:Te,maxHeight:Be}):[0],Be),gt=me.snapPoints,cn=me.minSnap,ft=me.maxSnap;return c.useDebugValue("minSnap: "+cn+", maxSnap:"+ft),{minSnap:cn,maxSnap:ft,findSnap:function(tt){var Ct=Ao(typeof tt=="function"?tt({footerHeight:ae,headerHeight:He,height:W.current,minHeight:Te,maxHeight:Be,snapPoints:gt,lastSnap:fe.current}):tt);return gt.reduce(function(St,rt){return Math.abs(rt-Ct)<Math.abs(St-Ct)?rt:St},cn)},maxHeight:Be}}({contentRef:Pe,controlledMaxHeight:h,footerEnabled:!!o,footerRef:De,getSnapPoints:S,headerEnabled:s!==!1,headerRef:Z,heightRef:ue,lastSnapRef:u,ready:B,registerReady:V,resizeSourceRef:_e}),ie=je.minSnap,We=je.maxSnap,re=je.maxHeight,nt=je.findSnap,q=c.useRef(re),Ge=c.useRef(ie),ze=c.useRef(We),wt=c.useRef(nt),ct=c.useRef(0);Ni(function(){q.current=re,ze.current=We,Ge.current=ie,wt.current=nt,ct.current=nt(y)},[nt,y,re,We,ie]);var se=c.useCallback(function(j){var X=j.onRest,W=j.config,fe=(W=W===void 0?{}:W).velocity,Ne=fe===void 0?1:fe,Le=ts(W,e3),Be=ts(j,t3);return new Promise(function(Te){return ee(pt({},Be,{config:pt({velocity:Ne},Le,{mass:1,tension:n3,friction:Math.max(Io,Io+(Io-Io*Ne))}),onRest:function(){var He=[].slice.call(arguments);Te.apply(void 0,He),X==null||X.apply(void 0,He)}}))})},[ee]),Hn=A1(Y2,{devTools:!1,actions:{onOpenCancel:c.useCallback(function(){return Y.current==null?void 0:Y.current({type:"OPEN"})},[]),onSnapCancel:c.useCallback(function(j){return Y.current==null?void 0:Y.current({type:"SNAP",source:j.snapSource})},[]),onCloseCancel:c.useCallback(function(){return Y.current==null?void 0:Y.current({type:"CLOSE"})},[]),onResizeCancel:c.useCallback(function(){return Y.current==null?void 0:Y.current({type:"RESIZE",source:_e.current})},[]),onOpenEnd:c.useCallback(function(){return G.current==null?void 0:G.current({type:"OPEN"})},[]),onSnapEnd:c.useCallback(function(j,X){return G.current==null?void 0:G.current({type:"SNAP",source:j.snapSource})},[]),onResizeEnd:c.useCallback(function(){return G.current==null?void 0:G.current({type:"RESIZE",source:_e.current})},[])},context:{initialState:l},services:{onSnapStart:c.useCallback(function(j,X){try{return Promise.resolve(z.current==null?void 0:z.current({type:"SNAP",source:X.payload.source||"custom"}))}catch(W){return Promise.reject(W)}},[]),onOpenStart:c.useCallback(function(){try{return Promise.resolve(z.current==null?void 0:z.current({type:"OPEN"}))}catch(j){return Promise.reject(j)}},[]),onCloseStart:c.useCallback(function(){try{return Promise.resolve(z.current==null?void 0:z.current({type:"CLOSE"}))}catch(j){return Promise.reject(j)}},[]),onResizeStart:c.useCallback(function(){try{return Promise.resolve(z.current==null?void 0:z.current({type:"RESIZE",source:_e.current}))}catch(j){return Promise.reject(j)}},[]),onSnapEnd:c.useCallback(function(j,X){try{return Promise.resolve(G.current==null?void 0:G.current({type:"SNAP",source:j.snapSource}))}catch(W){return Promise.reject(W)}},[]),onOpenEnd:c.useCallback(function(){try{return Promise.resolve(G.current==null?void 0:G.current({type:"OPEN"}))}catch(j){return Promise.reject(j)}},[]),onCloseEnd:c.useCallback(function(){try{return Promise.resolve(G.current==null?void 0:G.current({type:"CLOSE"}))}catch(j){return Promise.reject(j)}},[]),onResizeEnd:c.useCallback(function(){try{return Promise.resolve(G.current==null?void 0:G.current({type:"RESIZE",source:_e.current}))}catch(j){return Promise.reject(j)}},[]),renderVisuallyHidden:c.useCallback(function(j,X){try{return Promise.resolve(se({y:ct.current,ready:0,maxHeight:q.current,maxSnap:ze.current,minSnap:ct.current,immediate:!0})).then(function(){})}catch(W){return Promise.reject(W)}},[se]),activate:c.useCallback(function(j,X){try{return N.current=!0,Promise.resolve(Promise.all([Me.current.activate(),ke.current.activate(),Ie.current.activate()])).then(function(){})}catch(W){return Promise.reject(W)}},[Ie,ke,Me]),deactivate:c.useCallback(function(){try{return Me.current.deactivate(),ke.current.deactivate(),Ie.current.deactivate(),N.current=!1,Promise.resolve()}catch(j){return Promise.reject(j)}},[Ie,ke,Me]),openImmediately:c.useCallback(function(){try{return ue.current=ct.current,Promise.resolve(se({y:ct.current,ready:1,maxHeight:q.current,maxSnap:ze.current,minSnap:ct.current,immediate:!0})).then(function(){})}catch(j){return Promise.reject(j)}},[se]),openSmoothly:c.useCallback(function(){try{return Promise.resolve(se({y:0,ready:1,maxHeight:q.current,maxSnap:ze.current,minSnap:ct.current,immediate:!0})).then(function(){return ue.current=ct.current,Promise.resolve(se({y:ct.current,ready:1,maxHeight:q.current,maxSnap:ze.current,minSnap:ct.current,immediate:Ce.current})).then(function(){})})}catch(j){return Promise.reject(j)}},[se,Ce]),snapSmoothly:c.useCallback(function(j,X){try{var W=wt.current(j.y);return ue.current=W,u.current=W,Promise.resolve(se({y:W,ready:1,maxHeight:q.current,maxSnap:ze.current,minSnap:Ge.current,immediate:Ce.current,config:{velocity:j.velocity}})).then(function(){})}catch(fe){return Promise.reject(fe)}},[se,u,Ce]),resizeSmoothly:c.useCallback(function(){try{var j=wt.current(ue.current);return ue.current=j,u.current=j,Promise.resolve(se({y:j,ready:1,maxHeight:q.current,maxSnap:ze.current,minSnap:Ge.current,immediate:_e.current!=="element"||Ce.current})).then(function(){})}catch(X){return Promise.reject(X)}},[se,u,Ce]),closeSmoothly:c.useCallback(function(j,X){try{return se({minSnap:ue.current,immediate:!0}),ue.current=0,Promise.resolve(se({y:0,maxHeight:q.current,maxSnap:ze.current,immediate:Ce.current})).then(function(){return Promise.resolve(se({ready:0,immediate:!0})).then(function(){})})}catch(W){return Promise.reject(W)}},[se,Ce])}}),co=Hn[0],Ut=Hn[1];c.useEffect(function(){B&&Ut(a?"OPEN":"CLOSE")},[a,Ut,B]),Ni(function(){(re||We||ie)&&Ut("RESIZE")},[re,We,ie,Ut]),c.useEffect(function(){return function(){Me.current.deactivate(),ke.current.deactivate(),Ie.current.deactivate()}},[Ie,ke,Me]),c.useImperativeHandle(e,function(){return{snapTo:function(j,X){var W=X===void 0?{}:X,fe=W.velocity,Ne=fe===void 0?1:fe,Le=W.source,Be=Le===void 0?"custom":Le;Ut("SNAP",{payload:{y:wt.current(j),velocity:Ne,source:Be}})},get height(){return ue.current}}},[Ut]),c.useEffect(function(){var j=ve.current,X=function(fe){Ve.current&&fe.preventDefault()},W=function(fe){j.scrollTop<0&&(requestAnimationFrame(function(){j.style.overflow="hidden",j.scrollTop=0,j.style.removeProperty("overflow")}),fe.preventDefault())};return M&&(j.addEventListener("scroll",X),j.addEventListener("touchmove",X),j.addEventListener("touchstart",W)),function(){j.removeEventListener("scroll",X),j.removeEventListener("touchmove",X),j.removeEventListener("touchstart",W)}},[M,ve]);var un=r2(function(j){var X=j.args,W=(X=X===void 0?[]:X)[0],fe=(W=W===void 0?{}:W).closeOnTap,Ne=fe!==void 0&&fe,Le=W.isContentDragging,Be=Le!==void 0&&Le,Te=j.cancel,He=j.direction[1],ae=j.down,me=j.first,gt=j.last,cn=j.memo,ft=cn===void 0?te.y.getValue():cn,tt=j.tap,Ct=j.velocity,St=-1*j.movement[1];if(!N.current)return Te(),ft;if(d&&Ne&&tt)return Te(),setTimeout(function(){return d()},0),ft;if(tt)return ft;var rt=ft+St,Qt=St*Ct,Vt=Math.max(Ge.current,Math.min(ze.current,rt+2*Qt));if(!ae&&d&&He>0&&rt+Qt<Ge.current/2)return Te(),d(),ft;var Lt=ae?d||Ge.current!==ze.current?Di(rt,d?0:Ge.current,ze.current,.55):rt<Ge.current?Di(rt,Ge.current,2*ze.current,.55):Di(rt,Ge.current/2,ze.current,.55):Vt;return M&&Be?(Lt>=ze.current&&(Lt=ze.current),ft===ze.current&&ve.current.scrollTop>0&&(Lt=ze.current),Ve.current=Lt<ze.current):Ve.current=!1,me&&Ut("DRAG"),gt?(Ut("SNAP",{payload:{y:Lt,velocity:Ct>.05?Ct:1,source:"dragging"}}),ft):(ee({y:Lt,ready:1,maxHeight:q.current,maxSnap:ze.current,minSnap:Ge.current,immediate:!0,config:{velocity:Ct}}),ft)},{filterTaps:!0});if(Number.isNaN(ze.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(Ge.current))throw new TypeError("minSnapRef is NaN!!");var fo=function(j){var X,W=j.spring,fe=Sr([W.y,W.maxHeight],function(ae,me){return Math.round(vi(me-ae,0,16))+"px"}),Ne=Sr([W.y,W.minSnap,W.maxSnap],function(ae,me,gt){return vi(ae,me,gt)+"px"}),Le=Sr([W.y,W.minSnap,W.maxSnap],function(ae,me,gt){return ae<me?me-ae+"px":ae>gt?gt-ae+"px":"0px"}),Be=Sr([W.y,W.maxSnap],function(ae,me){return ae>=me?Math.ceil(ae-me):0}),Te=Sr([W.y,W.minSnap],function(ae,me){if(!me)return 0;var gt=Math.max(me/2-45,0);return vi((ae-gt)*(1/(Math.min(me/2+45,me)-gt)+0),0,1)}),He=Sr([W.y,W.minSnap],function(ae,me){return me?vi(ae/me,0,1):0});return(X={})["--rsbs-content-opacity"]=Te,X["--rsbs-backdrop-opacity"]=He,X["--rsbs-antigap-scale-y"]=Be,X["--rsbs-overlay-translate-y"]=Le,X["--rsbs-overlay-rounded"]=fe,X["--rsbs-overlay-h"]=Ne,X}({spring:te});return c.createElement(Cb.div,pt({},R,{"data-rsbs-root":!0,"data-rsbs-state":i3.find(co.matches),"data-rsbs-is-blocking":L,"data-rsbs-is-dismissable":!!d,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!o,className:i,ref:D,style:pt({},fo,E,{opacity:te.ready})}),r,L&&c.createElement("div",pt({key:"backdrop","data-rsbs-backdrop":!0},un({closeOnTap:!0}))),c.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:Ae,onKeyDown:function(j){j.key==="Escape"&&(j.stopPropagation(),d&&d())}},s!==!1&&c.createElement("div",pt({key:"header","data-rsbs-header":!0,ref:Z},un()),s),c.createElement("div",pt({key:"scroll","data-rsbs-scroll":!0,ref:ve},M?un({isContentDragging:!0}):{}),c.createElement("div",{"data-rsbs-content":!0,ref:Pe},n)),o&&c.createElement("div",pt({key:"footer",ref:De,"data-rsbs-footer":!0},un()),o)))}),i3=["closed","opening","open","closing","dragging","snapping","resizing"];function o3(t){var e=t.lastSnap;return e??Math.min.apply(Math,t.snapPoints)}function s3(t){return t.minHeight}var a3=["onSpringStart","onSpringEnd","skipInitialTransition"],Hh=c.forwardRef(function(t,e){var n=t.onSpringStart,r=t.onSpringEnd,i=t.skipInitialTransition,o=ts(t,a3),s=c.useState(!1),a=s[0],l=s[1],u=c.useRef(),f=c.useRef(null),d=c.useRef(i&&o.open?"OPEN":"CLOSED");Ni(function(){if(o.open)return cancelAnimationFrame(u.current),l(!0),function(){d.current="CLOSED"}},[o.open]);var h=c.useCallback(function(y){return Promise.resolve(n==null?void 0:n(y)).then(function(){y.type==="OPEN"&&cancelAnimationFrame(u.current)})},[n]),v=c.useCallback(function(y){return Promise.resolve(r==null?void 0:r(y)).then(function(){y.type==="CLOSE"&&(u.current=requestAnimationFrame(function(){return l(!1)}))})},[r]);return a?c.createElement(Py,{"data-rsbs-portal":!0},c.createElement(r3,pt({},o,{lastSnapRef:f,ref:e,initialState:d.current,onSpringStart:h,onSpringEnd:v}))):null});const $h=28,l3="MapGoogle-module__root__Vi-sMl",u3="MapGoogle-module__mapContainer__OCCTIX",c3="MapGoogle-module__balloon__4UVhuT",f3="MapGoogle-module__details__4osNXn",d3="MapGoogle-module__cluster__5qmRds",h3="MapGoogle-module__overlay__g-nEoT",p3="MapGoogle-module__mapControl__mzyTwr",g3="MapGoogle-module__geolocationControl__1exHgA",v3="MapGoogle-module__bottomSheet__avcBmY",m3="MapGoogle-module__locationViewContent__xwLeDh",y3="MapGoogle-module__locationViewHeader__maBLv0",b3="MapGoogle-module__deliveryDetailsViewContent__wH-RCe",w3="MapGoogle-module__deliveryDetailsViewHeader__4AKoBe",C3="MapGoogle-module__sheetSubmit__rPQG26",ot={root:l3,mapContainer:u3,balloon:c3,details:f3,cluster:d3,overlay:h3,mapControl:p3,geolocationControl:g3,bottomSheet:v3,locationViewContent:m3,locationViewHeader:y3,deliveryDetailsViewContent:b3,deliveryDetailsViewHeader:w3,sheetSubmit:C3},Wh=({children:t,hideFooter:e,minSnapHeight:n,onSubmitClick:r,open:i,submitDisabled:o,submitLoading:s,...a})=>{const[l,u]=c.useState(!1);return c.useEffect(()=>{let f;return i?f=setTimeout(()=>{u(i)},400):u(i),()=>{clearTimeout(f)}},[i]),C.jsx(Hh,{expandOnContentDrag:!0,open:l,initialFocusRef:!1,defaultSnap:({snapPoints:f})=>Math.min(...f),blocking:!1,snapPoints:({footerHeight:f,headerHeight:d,maxHeight:h,minHeight:v})=>[n==null?v:d+f+n,h-$h],footer:e?null:C.jsx(Ft,{disabled:o,loading:s,variant:"primary",className:ot.sheetSubmit,onClick:r,children:C.jsx(mn,{keyName:"choose",ns:"common"})}),sibling:C.jsx("div",{role:"presentation","data-rsbs-backdrop":"true",onClick:f=>{var d;f.stopPropagation(),f.preventDefault(),(d=a.onDismiss)==null||d.call(a)}}),children:C.jsx("div",{className:ot.bottomSheet,children:t})})},S3={header:ot.locationViewHeader,content:ot.locationViewContent},L3=({handleCloseClick:t,handleSubmitClick:e})=>{const n=gr("screenSm"),r=Rt(l=>l.location),i=!!r,o=Al({isSelectedPoint:i}),{isIdle:s}=pe(),a=s&&i&&o;return n&&r?C.jsx(Wh,{minSnapHeight:300,open:!!a,onDismiss:t,onSubmitClick:()=>e(r),children:C.jsx(Gd,{hideActions:!0,classes:S3,location:r,onClose:t})}):null},x3="Overlay-module__root__3qTsUC",E3={root:x3},Gh=({children:t,className:e})=>C.jsx("div",{className:ge(E3.root,e),children:t}),_3=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32",fill:"none",...t},U.createElement("path",{d:"M25.7074 24.2926C25.8004 24.3855 25.8741 24.4958 25.9243 24.6172C25.9746 24.7386 26.0005 24.8687 26.0005 25.0001C26.0005 25.1315 25.9746 25.2616 25.9243 25.383C25.8741 25.5044 25.8004 25.6147 25.7074 25.7076C25.6145 25.8005 25.5042 25.8742 25.3828 25.9245C25.2614 25.9747 25.1313 26.0006 24.9999 26.0006C24.8686 26.0006 24.7384 25.9747 24.6171 25.9245C24.4957 25.8742 24.3854 25.8005 24.2924 25.7076L15.9999 17.4138L7.70745 25.7076C7.5198 25.8952 7.26531 26.0006 6.99995 26.0006C6.73458 26.0006 6.48009 25.8952 6.29245 25.7076C6.1048 25.5199 5.99939 25.2654 5.99939 25.0001C5.99939 24.7347 6.10481 24.4802 6.29245 24.2926L14.5862 16.0001L6.29245 7.70757C6.1048 7.51993 5.99939 7.26543 5.99939 7.00007C5.99939 6.7347 6.1048 6.48021 6.29245 6.29257C6.48009 6.10493 6.73458 5.99951 6.99995 5.99951C7.26531 5.99951 7.5198 6.10493 7.70745 6.29257L15.9999 14.5863L24.2924 6.29257C24.4801 6.10493 24.7346 5.99951 24.9999 5.99951C25.2653 5.99951 25.5198 6.10493 25.7074 6.29257C25.8951 6.48021 26.0005 6.7347 26.0005 7.00007C26.0005 7.26543 25.8951 7.51993 25.7074 7.70757L17.4137 16.0001L25.7074 24.2926Z",fill:"#000000"})),M3='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66"><path fill="url(#a)" fill-opacity=".4" d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z" style="mix-blend-mode:darken"/><g filter="url(#b)"><path fill="currentColor" fill-opacity=".8" fill-rule="evenodd" d="M24 0c11.211 0 24 8.288 24 24.088C48 34.6 40.011 48.411 24 60 7.989 48.41 0 34.6 0 24.088 0 8.288 12.789 0 24 0Z" clip-rule="evenodd"/></g><path fill="#fff" fill-rule="evenodd" d="M36.503 33.501V19.625a3 3 0 0 0-1.583-2.645l-9.502-5.091a3 3 0 0 0-2.834 0l-9.501 5.091a3 3 0 0 0-1.583 2.645V33.5a3 3 0 0 0 3 3h19.003a3 3 0 0 0 3-3Zm-7.752 1h4.752a1 1 0 0 0 1-1V19.625a1 1 0 0 0-.528-.882l-9.501-5.091a1 1 0 0 0-.945 0l-9.501 5.091a1 1 0 0 0-.528.882V33.5a1 1 0 0 0 1 1h4.75a2.516 2.516 0 0 1-.05-.5V23.747a2.5 2.5 0 0 1 2.5-2.5h4.602a2.5 2.5 0 0 1 2.5 2.5V34c0 .172-.018.339-.05.5Zm-2.434 0a.5.5 0 0 0 .485-.5V23.747a.5.5 0 0 0-.5-.5H21.7a.5.5 0 0 0-.5.5V34a.5.5 0 0 0 .484.5h4.632Z" clip-rule="evenodd"/><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 6 -20 0 24 60)" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-opacity="0"/></radialGradient><filter id="b" width="56" height="68" x="-4" y="-4" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feGaussianBlur in="BackgroundImageFix" stdDeviation="2"/><feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_1068_16960"/><feBlend in="SourceGraphic" in2="effect1_backgroundBlur_1068_16960" result="shape"/></filter></defs></svg>',O3=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
50
+ */function tu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function nu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tu(Object(n),!0).forEach(function(r){x3(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function x3(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ru=function(){var t=[];return{activateTrap:function(n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}}}(),O3=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},P3=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},T3=function(e){return e.key==="Tab"||e.keyCode===9},iu=function(e){return setTimeout(e,0)},ou=function(e,n){var r=-1;return e.every(function(i,o){return n(i)?(r=o,!1):!0}),r},zr=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,r):e},mo=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},A3=function(e,n){var r=(n==null?void 0:n.document)||document,i=nu({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s,a=function(g,S,O){return g&&g[S]!==void 0?g[S]:i[O||S]},c=function(g){return o.containerGroups.findIndex(function(S){var O=S.container,T=S.tabbableNodes;return O.contains(g)||T.find(function(R){return R===g})})},l=function(g){var S=i[g];if(typeof S=="function"){for(var O=arguments.length,T=new Array(O>1?O-1:0),R=1;R<O;R++)T[R-1]=arguments[R];S=S.apply(void 0,T)}if(S===!0&&(S=void 0),!S){if(S===void 0||S===!1)return S;throw new Error("`".concat(g,"` was specified but was not a node, or did not return a node"))}var L=S;if(typeof S=="string"&&(L=r.querySelector(S),!L))throw new Error("`".concat(g,"` as selector refers to no known node"));return L},u=function(){var g=l("initialFocus");if(g===!1)return!1;if(g===void 0)if(c(r.activeElement)>=0)g=r.activeElement;else{var S=o.tabbableGroups[0],O=S&&S.firstTabbableNode;g=O||l("fallbackFocus")}if(!g)throw new Error("Your focus-trap needs to have at least one focusable element");return g},f=function(){if(o.containerGroups=o.containers.map(function(g){var S=S3(g,i.tabbableOptions),O=C3(g,i.tabbableOptions);return{container:g,tabbableNodes:S,focusableNodes:O,firstTabbableNode:S.length>0?S[0]:null,lastTabbableNode:S.length>0?S[S.length-1]:null,nextTabbableNode:function(R){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,A=O.findIndex(function(D){return D===R});if(!(A<0))return L?O.slice(A+1).find(function(D){return po(D,i.tabbableOptions)}):O.slice(0,A).reverse().find(function(D){return po(D,i.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(g){return g.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},d=function x(g){if(g!==!1&&g!==r.activeElement){if(!g||!g.focus){x(u());return}g.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=g,O3(g)&&g.select()}},y=function(g){var S=l("setReturnFocus",g);return S||(S===!1?!1:g)},m=function(g){var S=mo(g);if(!(c(S)>=0)){if(zr(i.clickOutsideDeactivates,g)){s.deactivate({returnFocus:i.returnFocusOnDeactivate&&!Js(S,i.tabbableOptions)});return}zr(i.allowOutsideClick,g)||g.preventDefault()}},h=function(g){var S=mo(g),O=c(S)>=0;O||S instanceof Document?O&&(o.mostRecentlyFocusedNode=S):(g.stopImmediatePropagation(),d(o.mostRecentlyFocusedNode||u()))},_=function(g){var S=mo(g);f();var O=null;if(o.tabbableGroups.length>0){var T=c(S),R=T>=0?o.containerGroups[T]:void 0;if(T<0)g.shiftKey?O=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:O=o.tabbableGroups[0].firstTabbableNode;else if(g.shiftKey){var L=ou(o.tabbableGroups,function(z){var W=z.firstTabbableNode;return S===W});if(L<0&&(R.container===S||Js(S,i.tabbableOptions)&&!po(S,i.tabbableOptions)&&!R.nextTabbableNode(S,!1))&&(L=T),L>=0){var A=L===0?o.tabbableGroups.length-1:L-1,D=o.tabbableGroups[A];O=D.lastTabbableNode}}else{var I=ou(o.tabbableGroups,function(z){var W=z.lastTabbableNode;return S===W});if(I<0&&(R.container===S||Js(S,i.tabbableOptions)&&!po(S,i.tabbableOptions)&&!R.nextTabbableNode(S))&&(I=T),I>=0){var $=I===o.tabbableGroups.length-1?0:I+1,V=o.tabbableGroups[$];O=V.firstTabbableNode}}}else O=l("fallbackFocus");O&&(g.preventDefault(),d(O))},b=function(g){if(P3(g)&&zr(i.escapeDeactivates,g)!==!1){g.preventDefault(),s.deactivate();return}if(T3(g)){_(g);return}},C=function(g){var S=mo(g);c(S)>=0||zr(i.clickOutsideDeactivates,g)||zr(i.allowOutsideClick,g)||(g.preventDefault(),g.stopImmediatePropagation())},v=function(){if(o.active)return ru.activateTrap(s),o.delayInitialFocusTimer=i.delayInitialFocus?iu(function(){d(u())}):d(u()),r.addEventListener("focusin",h,!0),r.addEventListener("mousedown",m,{capture:!0,passive:!1}),r.addEventListener("touchstart",m,{capture:!0,passive:!1}),r.addEventListener("click",C,{capture:!0,passive:!1}),r.addEventListener("keydown",b,{capture:!0,passive:!1}),s},E=function(){if(o.active)return r.removeEventListener("focusin",h,!0),r.removeEventListener("mousedown",m,!0),r.removeEventListener("touchstart",m,!0),r.removeEventListener("click",C,!0),r.removeEventListener("keydown",b,!0),s};return s={get active(){return o.active},get paused(){return o.paused},activate:function(g){if(o.active)return this;var S=a(g,"onActivate"),O=a(g,"onPostActivate"),T=a(g,"checkCanFocusTrap");T||f(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,S&&S();var R=function(){T&&f(),v(),O&&O()};return T?(T(o.containers.concat()).then(R,R),this):(R(),this)},deactivate:function(g){if(!o.active)return this;var S=nu({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},g);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,E(),o.active=!1,o.paused=!1,ru.deactivateTrap(s);var O=a(S,"onDeactivate"),T=a(S,"onPostDeactivate"),R=a(S,"checkCanReturnFocus"),L=a(S,"returnFocus","returnFocusOnDeactivate");O&&O();var A=function(){iu(function(){L&&d(y(o.nodeFocusedBeforeActivation)),T&&T()})};return L&&R?(R(y(o.nodeFocusedBeforeActivation)).then(A,A),this):(A(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,E(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,f(),v(),this)},updateContainerElements:function(g){var S=[].concat(g).filter(Boolean);return o.containers=S.map(function(O){return typeof O=="string"?r.querySelector(O):O}),o.active&&f(),this}},s.updateContainerElements(e),s};function R3(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}else return Array.from(t)}var Rc=!1;if(typeof window<"u"){var su={get passive(){Rc=!0}};window.addEventListener("testPassive",null,su),window.removeEventListener("testPassive",null,su)}var ch=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),fn=[],ss=!1,lh=-1,li=void 0,ui=void 0,uh=function(e){return fn.some(function(n){return!!(n.options.allowTouchMove&&n.options.allowTouchMove(e))})},as=function(e){var n=e||window.event;return uh(n.target)||n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)},L3=function(e){if(ui===void 0){var n=!!e&&e.reserveScrollBarGap===!0,r=window.innerWidth-document.documentElement.clientWidth;n&&r>0&&(ui=document.body.style.paddingRight,document.body.style.paddingRight=r+"px")}li===void 0&&(li=document.body.style.overflow,document.body.style.overflow="hidden")},M3=function(){ui!==void 0&&(document.body.style.paddingRight=ui,ui=void 0),li!==void 0&&(document.body.style.overflow=li,li=void 0)},k3=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},D3=function(e,n){var r=e.targetTouches[0].clientY-lh;return uh(e.target)?!1:n&&n.scrollTop===0&&r>0||k3(n)&&r<0?as(e):(e.stopPropagation(),!0)},j3=function(e,n){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!fn.some(function(i){return i.targetElement===e})){var r={targetElement:e,options:n||{}};fn=[].concat(R3(fn),[r]),ch?(e.ontouchstart=function(i){i.targetTouches.length===1&&(lh=i.targetTouches[0].clientY)},e.ontouchmove=function(i){i.targetTouches.length===1&&D3(i,e)},ss||(document.addEventListener("touchmove",as,Rc?{passive:!1}:void 0),ss=!0)):L3(n)}},N3=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}fn=fn.filter(function(n){return n.targetElement!==e}),ch?(e.ontouchstart=null,e.ontouchmove=null,ss&&fn.length===0&&(document.removeEventListener("touchmove",as,Rc?{passive:!1}:void 0),ss=!1)):fn.length||M3()},Mn=[],I3=function(){return Mn.some(function(t){return t.activeTargets.length>0})},F3=function(){return Mn.some(function(t){return t.skippedTargets.length>0})},au="ResizeObserver loop completed with undelivered notifications.",B3=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:au}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=au),window.dispatchEvent(t)},yi;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(yi||(yi={}));var kn=function(t){return Object.freeze(t)},V3=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,kn(this)}return t}(),fh=function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,kn(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,o=e.right,s=e.bottom,a=e.left,c=e.width,l=e.height;return{x:n,y:r,top:i,right:o,bottom:s,left:a,width:c,height:l}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Lc=function(t){return t instanceof SVGElement&&"getBBox"in t},dh=function(t){if(Lc(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||t.getClientRects().length)},cu=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},H3=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},fi=typeof window<"u"?window:{},go=new WeakMap,lu=/auto|scroll/,$3=/^tb|vertical/,U3=/msie|trident/i.test(fi.navigator&&fi.navigator.userAgent),wt=function(t){return parseFloat(t||"0")},sr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new V3((n?e:t)||0,(n?t:e)||0)},uu=kn({devicePixelContentBoxSize:sr(),borderBoxSize:sr(),contentBoxSize:sr(),contentRect:new fh(0,0,0,0)}),hh=function(t,e){if(e===void 0&&(e=!1),go.has(t)&&!e)return go.get(t);if(dh(t))return go.set(t,uu),uu;var n=getComputedStyle(t),r=Lc(t)&&t.ownerSVGElement&&t.getBBox(),i=!U3&&n.boxSizing==="border-box",o=$3.test(n.writingMode||""),s=!r&&lu.test(n.overflowY||""),a=!r&&lu.test(n.overflowX||""),c=r?0:wt(n.paddingTop),l=r?0:wt(n.paddingRight),u=r?0:wt(n.paddingBottom),f=r?0:wt(n.paddingLeft),d=r?0:wt(n.borderTopWidth),y=r?0:wt(n.borderRightWidth),m=r?0:wt(n.borderBottomWidth),h=r?0:wt(n.borderLeftWidth),_=f+l,b=c+u,C=h+y,v=d+m,E=a?t.offsetHeight-v-t.clientHeight:0,x=s?t.offsetWidth-C-t.clientWidth:0,g=i?_+C:0,S=i?b+v:0,O=r?r.width:wt(n.width)-g-x,T=r?r.height:wt(n.height)-S-E,R=O+_+x+C,L=T+b+E+v,A=kn({devicePixelContentBoxSize:sr(Math.round(O*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:sr(R,L,o),contentBoxSize:sr(O,T,o),contentRect:new fh(f,c,O,T)});return go.set(t,A),A},ph=function(t,e,n){var r=hh(t,n),i=r.borderBoxSize,o=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case yi.DEVICE_PIXEL_CONTENT_BOX:return s;case yi.BORDER_BOX:return i;default:return o}},z3=function(){function t(e){var n=hh(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=kn([n.borderBoxSize]),this.contentBoxSize=kn([n.contentBoxSize]),this.devicePixelContentBoxSize=kn([n.devicePixelContentBoxSize])}return t}(),mh=function(t){if(dh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},q3=function(){var t=1/0,e=[];Mn.forEach(function(s){if(s.activeTargets.length!==0){var a=[];s.activeTargets.forEach(function(l){var u=new z3(l.target),f=mh(l.target);a.push(u),l.lastReportedSize=ph(l.target,l.observedBox),f<t&&(t=f)}),e.push(function(){s.callback.call(s.observer,a,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},fu=function(t){Mn.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(mh(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},G3=function(){var t=0;for(fu(t);I3();)t=q3(),fu(t);return F3()&&B3(),t>0},Xs,gh=[],W3=function(){return gh.splice(0).forEach(function(t){return t()})},Z3=function(t){if(!Xs){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return W3()}).observe(n,r),Xs=function(){n.textContent="".concat(e?e--:e++)}}gh.push(t),Xs()},K3=function(t){Z3(function(){requestAnimationFrame(t)})},Ho=0,Q3=function(){return!!Ho},J3=250,X3={attributes:!0,characterData:!0,childList:!0,subtree:!0},du=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],hu=function(t){return t===void 0&&(t=0),Date.now()+t},Ys=!1,Y3=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=J3),!Ys){Ys=!0;var r=hu(e);K3(function(){var i=!1;try{i=G3()}finally{if(Ys=!1,e=r-hu(),!Q3())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,X3)};document.body?n():fi.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),du.forEach(function(n){return fi.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),du.forEach(function(n){return fi.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),qa=new Y3,pu=function(t){!Ho&&t>0&&qa.start(),Ho+=t,!Ho&&qa.stop()},eb=function(t){return!Lc(t)&&!H3(t)&&getComputedStyle(t).display==="inline"},tb=function(){function t(e,n){this.target=e,this.observedBox=n||yi.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=ph(this.target,this.observedBox,!0);return eb(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),nb=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),vo=new WeakMap,mu=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},yo=function(){function t(){}return t.connect=function(e,n){var r=new nb(e,n);vo.set(e,r)},t.observe=function(e,n,r){var i=vo.get(e),o=i.observationTargets.length===0;mu(i.observationTargets,n)<0&&(o&&Mn.push(i),i.observationTargets.push(new tb(n,r&&r.box)),pu(1),qa.schedule())},t.unobserve=function(e,n){var r=vo.get(e),i=mu(r.observationTargets,n),o=r.observationTargets.length===1;i>=0&&(o&&Mn.splice(Mn.indexOf(r),1),r.observationTargets.splice(i,1),pu(-1))},t.disconnect=function(e){var n=this,r=vo.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),rb=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");yo.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!cu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");yo.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!cu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");yo.unobserve(this,e)},t.prototype.disconnect=function(){yo.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function je(){return je=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},je.apply(this,arguments)}function $o(t,e){if(t==null)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)e.indexOf(n=o[r])>=0||(i[n]=t[n]);return i}var di=typeof window<"u"?p.useLayoutEffect:p.useEffect;function qr(t,e,n){return e=(e=+e)==e?e:0,n=(n=+n)==n?n:0,(t=+t)==t&&(t=(t=t<=n?t:n)>=e?t:e),t}function bo(t){var e=Math.round(t);if(Number.isNaN(t))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return e}var ib={box:"border-box"};function ea(t,e){var n=e.label,r=e.enabled,i=e.resizeSourceRef,o=p.useState(0),s=o[0],a=o[1];p.useDebugValue(n+": "+s);var c=p.useCallback(function(l){a(l[0].borderBoxSize[0].blockSize),i.current="element"},[i]);return di(function(){if(t.current&&r){var l=new rb(c);return l.observe(t.current,ib),function(){l.disconnect()}}},[t,c,r]),r?s:0}function ke(t){return t===void 0&&(t=1e3),new Promise(function(e){return setTimeout(e,t)})}var gu={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},vu={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},ob=Ly({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:je({},gu,vu)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:je({},gu,vu)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:je({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[My({y:function(t,e){return e.payload.y},velocity:function(t,e){return e.payload.velocity},snapSource:function(t,e){var n=e.payload.source;return n===void 0?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(t,e){},onSnapCancel:function(t,e){},onResizeCancel:function(t,e){},onCloseCancel:function(t,e){},onOpenEnd:function(t,e){},onSnapEnd:function(t,e){},onRezizeEnd:function(t,e){}},services:{onSnapStart:function(){try{return Promise.resolve(ke()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenStart:function(){try{return Promise.resolve(ke()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseStart:function(){try{return Promise.resolve(ke()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeStart:function(){try{return Promise.resolve(ke()).then(function(){})}catch(t){return Promise.reject(t)}},onSnapEnd:function(){try{return Promise.resolve(ke()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenEnd:function(){try{return Promise.resolve(ke()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseEnd:function(){try{return Promise.resolve(ke()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeEnd:function(){try{return Promise.resolve(ke()).then(function(){})}catch(t){return Promise.reject(t)}},renderVisuallyHidden:function(t,e){try{return Promise.resolve(ke()).then(function(){})}catch(n){return Promise.reject(n)}},activate:function(t,e){try{return Promise.resolve(ke()).then(function(){})}catch(n){return Promise.reject(n)}},deactivate:function(t,e){try{return Promise.resolve(ke()).then(function(){})}catch(n){return Promise.reject(n)}},openSmoothly:function(t,e){try{return Promise.resolve(ke()).then(function(){})}catch(n){return Promise.reject(n)}},openImmediately:function(t,e){try{return Promise.resolve(ke()).then(function(){})}catch(n){return Promise.reject(n)}},snapSmoothly:function(t,e){try{return Promise.resolve(ke()).then(function(){})}catch(n){return Promise.reject(n)}},resizeSmoothly:function(t,e){try{return Promise.resolve(ke()).then(function(){})}catch(n){return Promise.reject(n)}},closeSmoothly:function(t,e){try{return Promise.resolve(ke()).then(function(){})}catch(n){return Promise.reject(n)}}},guards:{initiallyClosed:function(t){return t.initialState==="CLOSED"},initiallyOpen:function(t){return t.initialState==="OPEN"}}}),sb=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],ab=["velocity"],cb=["onRest","config"],vh=i2.default,lb=vh.tension,wo=vh.friction,ub=p.forwardRef(function(t,e){var n=t.children,r=t.sibling,i=t.className,o=t.footer,s=t.header,a=t.open,c=t.initialState,l=t.lastSnapRef,u=t.initialFocusRef,f=t.onDismiss,d=t.maxHeight,y=t.defaultSnap,m=y===void 0?db:y,h=t.snapPoints,_=h===void 0?hb:h,b=t.blocking,C=b===void 0||b,v=t.scrollLocking,E=v===void 0||v,x=t.style,g=t.onSpringStart,S=t.onSpringCancel,O=t.onSpringEnd,T=t.reserveScrollBarGap,R=T===void 0?C:T,L=t.expandOnContentDrag,A=L!==void 0&&L,D=$o(t,sb),I=function(){var k=p.useState(!1),U=k[0],B=k[1],Y=p.useState({}),pe=Y[0],ie=Y[1],fe=p.useCallback(function(de){return ie(function(ge){var q;return je({},ge,((q={})[de]=!1,q))}),function(){ie(function(ge){var q;return je({},ge,((q={})[de]=!0,q))})}},[]);return p.useEffect(function(){var de=Object.values(pe);de.length!==0&&de.every(Boolean)&&B(!0)},[pe]),{ready:U,registerReady:fe}}(),$=I.ready,V=I.registerReady,z=p.useRef(!1),W=p.useRef(g),ce=p.useRef(S),le=p.useRef(O);p.useEffect(function(){W.current=g,ce.current=S,le.current=O},[S,g,O]);var ue,ne,We=l2(function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}}),xe=We[0],me=We[1],zt=p.useRef(null),qt=p.useRef(null),Mr=p.useRef(null),yt=p.useRef(null),Hi=p.useRef(null),Bn=p.useRef(null),Je=p.useRef(0),Vn=p.useRef(),As=p.useRef(!1),Gt=(ue=p.useMemo(function(){return typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null},[]),ne=p.useRef(ue==null?void 0:ue.matches),p.useDebugValue(ne.current?"reduce":"no-preference"),p.useEffect(function(){var k=function(U){ne.current=U.matches};return ue==null||ue.addListener(k),function(){return ue==null?void 0:ue.removeListener(k)}},[ue]),ne),Hn=function(k){var U=k.targetRef,B=k.enabled,Y=k.reserveScrollBarGap,pe=p.useRef({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return p.useDebugValue(B?"Enabled":"Disabled"),p.useEffect(function(){if(!B)return pe.current.deactivate(),void(pe.current={activate:function(){},deactivate:function(){}});var ie=U.current,fe=!1;pe.current={activate:function(){fe||(fe=!0,j3(ie,{allowTouchMove:function(de){return de.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:Y}))},deactivate:function(){fe&&(fe=!1,N3(ie))}}},[B,U,Y]),pe}({targetRef:qt,enabled:$&&E,reserveScrollBarGap:R}),$n=function(k){var U=k.targetRef,B=k.enabled,Y=p.useRef({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return p.useDebugValue(B?"Enabled":"Disabled"),p.useEffect(function(){if(!B)return Y.current.deactivate(),void(Y.current={activate:function(){},deactivate:function(){}});var pe=U.current,ie=!1,fe=[],de=[];Y.current={activate:function(){if(!ie){ie=!0;var ge=pe.parentNode;document.querySelectorAll("body > *").forEach(function(q){if(q!==ge){var oe=q.getAttribute("aria-hidden");oe!==null&&oe!=="false"||(fe.push(oe),de.push(q),q.setAttribute("aria-hidden","true"))}})}},deactivate:function(){ie&&(ie=!1,de.forEach(function(ge,q){var oe=fe[q];oe===null?ge.removeAttribute("aria-hidden"):ge.setAttribute("aria-hidden",oe)}),fe=[],de=[])}}},[U,B]),Y}({targetRef:zt,enabled:$&&C}),Un=function(k){var U=k.targetRef,B=k.fallbackRef,Y=k.initialFocusRef,pe=k.enabled,ie=p.useRef({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return p.useDebugValue(pe?"Enabled":"Disabled"),p.useEffect(function(){if(!pe)return ie.current.deactivate(),void(ie.current={activate:function(){},deactivate:function(){}});var fe=B.current,de=A3(U.current,{onActivate:void 0,initialFocus:Y?function(){return(Y==null?void 0:Y.current)||fe}:void 0,fallbackFocus:fe,escapeDeactivates:!1,clickOutsideDeactivates:!1}),ge=!1;ie.current={activate:function(){try{return ge?Promise.resolve():(ge=!0,Promise.resolve(de.activate()).then(function(){return Promise.resolve(new Promise(function(q){return setTimeout(function(){return q(void 0)},0)})).then(function(){})}))}catch(q){return Promise.reject(q)}},deactivate:function(){ge&&(ge=!1,de.deactivate())}}},[pe,B,Y,U]),ie}({targetRef:zt,fallbackRef:Bn,initialFocusRef:u||void 0,enabled:$&&C&&u!==!1}),$i=function(k){var U=k.getSnapPoints,B=k.heightRef,Y=k.lastSnapRef,pe=k.ready,ie=function(Pe){var ct=Pe.contentRef,kt=Pe.controlledMaxHeight,Ie=Pe.footerEnabled,mn=Pe.footerRef,qn=Pe.headerEnabled,lt=Pe.headerRef,Nr=Pe.registerReady,Gi=Pe.resizeSourceRef,Vc=p.useMemo(function(){return Nr("contentHeight")},[Nr]),Hc=function(Ir,qc,Wi){var Zi=p.useMemo(function(){return qc("maxHeight")},[qc]),Gc=p.useState(function(){return bo(Ir)||typeof window<"u"?window.innerHeight:0}),Wc=Gc[0],Ms=Gc[1],Zc=Wc>0,Ki=p.useRef(0);return p.useDebugValue(Ir?"controlled":"auto"),p.useEffect(function(){Zc&&Zi()},[Zc,Zi]),di(function(){if(Ir)return Ms(bo(Ir)),void(Wi.current="maxheightprop");var Kc=function(){Ki.current||(Ki.current=requestAnimationFrame(function(){Ms(window.innerHeight),Wi.current="window",Ki.current=0}))};return window.addEventListener("resize",Kc),Ms(window.innerHeight),Wi.current="window",Zi(),function(){window.removeEventListener("resize",Kc),cancelAnimationFrame(Ki.current)}},[Ir,Zi,Wi]),Wc}(kt,Nr,Gi),Rs=ea(lt,{label:"headerHeight",enabled:qn,resizeSourceRef:Gi}),$c=ea(ct,{label:"contentHeight",enabled:!0,resizeSourceRef:Gi}),Ls=ea(mn,{label:"footerHeight",enabled:Ie,resizeSourceRef:Gi}),Uc=Math.min(Hc-Rs-Ls,$c)+Rs+Ls;p.useDebugValue("minHeight: "+Uc);var zc=$c>0;return p.useEffect(function(){zc&&Vc()},[zc,Vc]),{maxHeight:Hc,minHeight:Uc,headerHeight:Rs,footerHeight:Ls}}({contentRef:k.contentRef,controlledMaxHeight:k.controlledMaxHeight,footerEnabled:k.footerEnabled,footerRef:k.footerRef,headerEnabled:k.headerEnabled,headerRef:k.headerRef,registerReady:k.registerReady,resizeSourceRef:k.resizeSourceRef}),fe=ie.maxHeight,de=ie.minHeight,ge=ie.headerHeight,q=ie.footerHeight,oe=function(Pe,ct){var kt=[].concat(Pe).map(bo).reduce(function(lt,Nr){return lt.add(qr(Nr,0,ct)),lt},new Set),Ie=Array.from(kt),mn=Math.min.apply(Math,Ie);if(Number.isNaN(mn))throw new TypeError("minSnap is NaN");var qn=Math.max.apply(Math,Ie);if(Number.isNaN(qn))throw new TypeError("maxSnap is NaN");return{snapPoints:Ie,minSnap:mn,maxSnap:qn}}(pe?U({height:B.current,footerHeight:q,headerHeight:ge,minHeight:de,maxHeight:fe}):[0],fe),Ye=oe.snapPoints,zn=oe.minSnap,at=oe.maxSnap;return p.useDebugValue("minSnap: "+zn+", maxSnap:"+at),{minSnap:zn,maxSnap:at,findSnap:function(Pe){var ct=bo(typeof Pe=="function"?Pe({footerHeight:q,headerHeight:ge,height:B.current,minHeight:de,maxHeight:fe,snapPoints:Ye,lastSnap:Y.current}):Pe);return Ye.reduce(function(kt,Ie){return Math.abs(Ie-ct)<Math.abs(kt-ct)?Ie:kt},zn)},maxHeight:fe}}({contentRef:Mr,controlledMaxHeight:d,footerEnabled:!!o,footerRef:Hi,getSnapPoints:_,headerEnabled:s!==!1,headerRef:yt,heightRef:Je,lastSnapRef:l,ready:$,registerReady:V,resizeSourceRef:Vn}),kr=$i.minSnap,Dr=$i.maxSnap,jr=$i.maxHeight,Ui=$i.findSnap,Mt=p.useRef(jr),Xe=p.useRef(kr),Ee=p.useRef(Dr),zi=p.useRef(Ui),bt=p.useRef(0);di(function(){Mt.current=jr,Ee.current=Dr,Xe.current=kr,zi.current=Ui,bt.current=Ui(m)},[Ui,m,jr,Dr,kr]);var Ne=p.useCallback(function(k){var U=k.onRest,B=k.config,Y=(B=B===void 0?{}:B).velocity,pe=Y===void 0?1:Y,ie=$o(B,ab),fe=$o(k,cb);return new Promise(function(de){return me(je({},fe,{config:je({velocity:pe},ie,{mass:1,tension:lb,friction:Math.max(wo,wo+(wo-wo*pe))}),onRest:function(){var ge=[].slice.call(arguments);de.apply(void 0,ge),U==null||U.apply(void 0,ge)}}))})},[me]),Bc=Hy(ob,{devTools:!1,actions:{onOpenCancel:p.useCallback(function(){return ce.current==null?void 0:ce.current({type:"OPEN"})},[]),onSnapCancel:p.useCallback(function(k){return ce.current==null?void 0:ce.current({type:"SNAP",source:k.snapSource})},[]),onCloseCancel:p.useCallback(function(){return ce.current==null?void 0:ce.current({type:"CLOSE"})},[]),onResizeCancel:p.useCallback(function(){return ce.current==null?void 0:ce.current({type:"RESIZE",source:Vn.current})},[]),onOpenEnd:p.useCallback(function(){return le.current==null?void 0:le.current({type:"OPEN"})},[]),onSnapEnd:p.useCallback(function(k,U){return le.current==null?void 0:le.current({type:"SNAP",source:k.snapSource})},[]),onResizeEnd:p.useCallback(function(){return le.current==null?void 0:le.current({type:"RESIZE",source:Vn.current})},[])},context:{initialState:c},services:{onSnapStart:p.useCallback(function(k,U){try{return Promise.resolve(W.current==null?void 0:W.current({type:"SNAP",source:U.payload.source||"custom"}))}catch(B){return Promise.reject(B)}},[]),onOpenStart:p.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"OPEN"}))}catch(k){return Promise.reject(k)}},[]),onCloseStart:p.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"CLOSE"}))}catch(k){return Promise.reject(k)}},[]),onResizeStart:p.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"RESIZE",source:Vn.current}))}catch(k){return Promise.reject(k)}},[]),onSnapEnd:p.useCallback(function(k,U){try{return Promise.resolve(le.current==null?void 0:le.current({type:"SNAP",source:k.snapSource}))}catch(B){return Promise.reject(B)}},[]),onOpenEnd:p.useCallback(function(){try{return Promise.resolve(le.current==null?void 0:le.current({type:"OPEN"}))}catch(k){return Promise.reject(k)}},[]),onCloseEnd:p.useCallback(function(){try{return Promise.resolve(le.current==null?void 0:le.current({type:"CLOSE"}))}catch(k){return Promise.reject(k)}},[]),onResizeEnd:p.useCallback(function(){try{return Promise.resolve(le.current==null?void 0:le.current({type:"RESIZE",source:Vn.current}))}catch(k){return Promise.reject(k)}},[]),renderVisuallyHidden:p.useCallback(function(k,U){try{return Promise.resolve(Ne({y:bt.current,ready:0,maxHeight:Mt.current,maxSnap:Ee.current,minSnap:bt.current,immediate:!0})).then(function(){})}catch(B){return Promise.reject(B)}},[Ne]),activate:p.useCallback(function(k,U){try{return z.current=!0,Promise.resolve(Promise.all([Hn.current.activate(),Un.current.activate(),$n.current.activate()])).then(function(){})}catch(B){return Promise.reject(B)}},[$n,Un,Hn]),deactivate:p.useCallback(function(){try{return Hn.current.deactivate(),Un.current.deactivate(),$n.current.deactivate(),z.current=!1,Promise.resolve()}catch(k){return Promise.reject(k)}},[$n,Un,Hn]),openImmediately:p.useCallback(function(){try{return Je.current=bt.current,Promise.resolve(Ne({y:bt.current,ready:1,maxHeight:Mt.current,maxSnap:Ee.current,minSnap:bt.current,immediate:!0})).then(function(){})}catch(k){return Promise.reject(k)}},[Ne]),openSmoothly:p.useCallback(function(){try{return Promise.resolve(Ne({y:0,ready:1,maxHeight:Mt.current,maxSnap:Ee.current,minSnap:bt.current,immediate:!0})).then(function(){return Je.current=bt.current,Promise.resolve(Ne({y:bt.current,ready:1,maxHeight:Mt.current,maxSnap:Ee.current,minSnap:bt.current,immediate:Gt.current})).then(function(){})})}catch(k){return Promise.reject(k)}},[Ne,Gt]),snapSmoothly:p.useCallback(function(k,U){try{var B=zi.current(k.y);return Je.current=B,l.current=B,Promise.resolve(Ne({y:B,ready:1,maxHeight:Mt.current,maxSnap:Ee.current,minSnap:Xe.current,immediate:Gt.current,config:{velocity:k.velocity}})).then(function(){})}catch(Y){return Promise.reject(Y)}},[Ne,l,Gt]),resizeSmoothly:p.useCallback(function(){try{var k=zi.current(Je.current);return Je.current=k,l.current=k,Promise.resolve(Ne({y:k,ready:1,maxHeight:Mt.current,maxSnap:Ee.current,minSnap:Xe.current,immediate:Vn.current!=="element"||Gt.current})).then(function(){})}catch(U){return Promise.reject(U)}},[Ne,l,Gt]),closeSmoothly:p.useCallback(function(k,U){try{return Ne({minSnap:Je.current,immediate:!0}),Je.current=0,Promise.resolve(Ne({y:0,maxHeight:Mt.current,maxSnap:Ee.current,immediate:Gt.current})).then(function(){return Promise.resolve(Ne({ready:0,immediate:!0})).then(function(){})})}catch(B){return Promise.reject(B)}},[Ne,Gt])}}),sp=Bc[0],Wt=Bc[1];p.useEffect(function(){$&&Wt(a?"OPEN":"CLOSE")},[a,Wt,$]),di(function(){(jr||Dr||kr)&&Wt("RESIZE")},[jr,Dr,kr,Wt]),p.useEffect(function(){return function(){Hn.current.deactivate(),Un.current.deactivate(),$n.current.deactivate()}},[$n,Un,Hn]),p.useImperativeHandle(e,function(){return{snapTo:function(k,U){var B=U===void 0?{}:U,Y=B.velocity,pe=Y===void 0?1:Y,ie=B.source,fe=ie===void 0?"custom":ie;Wt("SNAP",{payload:{y:zi.current(k),velocity:pe,source:fe}})},get height(){return Je.current}}},[Wt]),p.useEffect(function(){var k=qt.current,U=function(Y){As.current&&Y.preventDefault()},B=function(Y){k.scrollTop<0&&(requestAnimationFrame(function(){k.style.overflow="hidden",k.scrollTop=0,k.style.removeProperty("overflow")}),Y.preventDefault())};return A&&(k.addEventListener("scroll",U),k.addEventListener("touchmove",U),k.addEventListener("touchstart",B)),function(){k.removeEventListener("scroll",U),k.removeEventListener("touchmove",U),k.removeEventListener("touchstart",B)}},[A,qt]);var qi=u3(function(k){var U=k.args,B=(U=U===void 0?[]:U)[0],Y=(B=B===void 0?{}:B).closeOnTap,pe=Y!==void 0&&Y,ie=B.isContentDragging,fe=ie!==void 0&&ie,de=k.cancel,ge=k.direction[1],q=k.down,oe=k.first,Ye=k.last,zn=k.memo,at=zn===void 0?xe.y.getValue():zn,Pe=k.tap,ct=k.velocity,kt=-1*k.movement[1];if(!z.current)return de(),at;if(f&&pe&&Pe)return de(),setTimeout(function(){return f()},0),at;if(Pe)return at;var Ie=at+kt,mn=kt*ct,qn=Math.max(Xe.current,Math.min(Ee.current,Ie+2*mn));if(!q&&f&&ge>0&&Ie+mn<Xe.current/2)return de(),f(),at;var lt=q?f||Xe.current!==Ee.current?ci(Ie,f?0:Xe.current,Ee.current,.55):Ie<Xe.current?ci(Ie,Xe.current,2*Ee.current,.55):ci(Ie,Xe.current/2,Ee.current,.55):qn;return A&&fe?(lt>=Ee.current&&(lt=Ee.current),at===Ee.current&&qt.current.scrollTop>0&&(lt=Ee.current),As.current=lt<Ee.current):As.current=!1,oe&&Wt("DRAG"),Ye?(Wt("SNAP",{payload:{y:lt,velocity:ct>.05?ct:1,source:"dragging"}}),at):(me({y:lt,ready:1,maxHeight:Mt.current,maxSnap:Ee.current,minSnap:Xe.current,immediate:!0,config:{velocity:ct}}),at)},{filterTaps:!0});if(Number.isNaN(Ee.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(Xe.current))throw new TypeError("minSnapRef is NaN!!");var ap=function(k){var U,B=k.spring,Y=Qn([B.y,B.maxHeight],function(q,oe){return Math.round(qr(oe-q,0,16))+"px"}),pe=Qn([B.y,B.minSnap,B.maxSnap],function(q,oe,Ye){return qr(q,oe,Ye)+"px"}),ie=Qn([B.y,B.minSnap,B.maxSnap],function(q,oe,Ye){return q<oe?oe-q+"px":q>Ye?Ye-q+"px":"0px"}),fe=Qn([B.y,B.maxSnap],function(q,oe){return q>=oe?Math.ceil(q-oe):0}),de=Qn([B.y,B.minSnap],function(q,oe){if(!oe)return 0;var Ye=Math.max(oe/2-45,0);return qr((q-Ye)*(1/(Math.min(oe/2+45,oe)-Ye)+0),0,1)}),ge=Qn([B.y,B.minSnap],function(q,oe){return oe?qr(q/oe,0,1):0});return(U={})["--rsbs-content-opacity"]=de,U["--rsbs-backdrop-opacity"]=ge,U["--rsbs-antigap-scale-y"]=fe,U["--rsbs-overlay-translate-y"]=ie,U["--rsbs-overlay-rounded"]=Y,U["--rsbs-overlay-h"]=pe,U}({spring:xe});return p.createElement(T2.div,je({},D,{"data-rsbs-root":!0,"data-rsbs-state":fb.find(sp.matches),"data-rsbs-is-blocking":C,"data-rsbs-is-dismissable":!!f,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!o,className:i,ref:zt,style:je({},ap,x,{opacity:xe.ready})}),r,C&&p.createElement("div",je({key:"backdrop","data-rsbs-backdrop":!0},qi({closeOnTap:!0}))),p.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:Bn,onKeyDown:function(k){k.key==="Escape"&&(k.stopPropagation(),f&&f())}},s!==!1&&p.createElement("div",je({key:"header","data-rsbs-header":!0,ref:yt},qi()),s),p.createElement("div",je({key:"scroll","data-rsbs-scroll":!0,ref:qt},A?qi({isContentDragging:!0}):{}),p.createElement("div",{"data-rsbs-content":!0,ref:Mr},n)),o&&p.createElement("div",je({key:"footer",ref:Hi,"data-rsbs-footer":!0},qi()),o)))}),fb=["closed","opening","open","closing","dragging","snapping","resizing"];function db(t){var e=t.lastSnap;return e??Math.min.apply(Math,t.snapPoints)}function hb(t){return t.minHeight}var pb=["onSpringStart","onSpringEnd","skipInitialTransition"],yh=p.forwardRef(function(t,e){var n=t.onSpringStart,r=t.onSpringEnd,i=t.skipInitialTransition,o=$o(t,pb),s=p.useState(!1),a=s[0],c=s[1],l=p.useRef(),u=p.useRef(null),f=p.useRef(i&&o.open?"OPEN":"CLOSED");di(function(){if(o.open)return cancelAnimationFrame(l.current),c(!0),function(){f.current="CLOSED"}},[o.open]);var d=p.useCallback(function(m){return Promise.resolve(n==null?void 0:n(m)).then(function(){m.type==="OPEN"&&cancelAnimationFrame(l.current)})},[n]),y=p.useCallback(function(m){return Promise.resolve(r==null?void 0:r(m)).then(function(){m.type==="CLOSE"&&(l.current=requestAnimationFrame(function(){return c(!1)}))})},[r]);return a?p.createElement(N1,{"data-rsbs-portal":!0},p.createElement(ub,je({},o,{lastSnapRef:u,ref:e,initialState:f.current,onSpringStart:d,onSpringEnd:y}))):null});const bh=28,mb="MapGoogle-module__root__Vi-sMl",gb="MapGoogle-module__mapContainer__OCCTIX",vb="MapGoogle-module__balloon__4UVhuT",yb="MapGoogle-module__details__4osNXn",bb="MapGoogle-module__cluster__5qmRds",wb="MapGoogle-module__number__JdGUGZ",_b="MapGoogle-module__overlay__g-nEoT",Sb="MapGoogle-module__mapControl__mzyTwr",Cb="MapGoogle-module__geolocationControl__1exHgA",Eb="MapGoogle-module__bottomSheet__avcBmY",xb="MapGoogle-module__locationViewContent__xwLeDh",Ob="MapGoogle-module__locationViewHeader__maBLv0",Pb="MapGoogle-module__deliveryDetailsViewContent__wH-RCe",Tb="MapGoogle-module__deliveryDetailsViewHeader__4AKoBe",Ab="MapGoogle-module__sheetSubmit__rPQG26",Me={root:mb,mapContainer:gb,balloon:vb,details:yb,cluster:bb,number:wb,overlay:_b,mapControl:Sb,geolocationControl:Cb,bottomSheet:Eb,locationViewContent:xb,locationViewHeader:Ob,deliveryDetailsViewContent:Pb,deliveryDetailsViewHeader:Tb,sheetSubmit:Ab},wh=({children:t,hideFooter:e,minSnapHeight:n,onSubmitClick:r,open:i,submitDisabled:o,submitLoading:s,...a})=>{const[c,l]=p.useState(!1);return p.useEffect(()=>{let u;return i?u=setTimeout(()=>{l(i)},400):l(i),()=>{clearTimeout(u)}},[i]),w.jsx(yh,{expandOnContentDrag:!0,open:c,initialFocusRef:!1,defaultSnap:({snapPoints:u})=>Math.min(...u),blocking:!1,snapPoints:({footerHeight:u,headerHeight:f,maxHeight:d,minHeight:y})=>[n==null?y:f+u+n,d-bh],footer:e?null:w.jsx(ot,{disabled:o,loading:s,variant:"primary",className:Me.sheetSubmit,onClick:r,children:w.jsx(Bt,{keyName:"choose",ns:"common"})}),sibling:w.jsx("div",{role:"presentation","data-rsbs-backdrop":"true",onClick:u=>{var f;u.stopPropagation(),u.preventDefault(),(f=a.onDismiss)==null||f.call(a)}}),children:w.jsx("div",{className:Me.bottomSheet,children:t})})},Rb={header:Me.locationViewHeader,content:Me.locationViewContent},Lb=({handleCloseClick:t,handleSubmitClick:e})=>{const n=Fn("screenSm"),r=st(c=>c.location),i=!!r,o=_c({isSelectedPoint:i}),{isIdle:s}=Z(),a=s&&i&&o;return n&&r?w.jsx(wh,{minSnapHeight:300,open:!!a,onDismiss:t,onSubmitClick:()=>e(r),children:w.jsx(_d,{hideActions:!0,classes:Rb,location:r,onClose:t})}):null},Mb="Overlay-module__root__3qTsUC",kb={root:Mb},_h=({children:t,className:e})=>w.jsx("div",{className:K(kb.root,e),children:t}),Db=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32",fill:"none",...t},N.createElement("path",{d:"M25.7074 24.2926C25.8004 24.3855 25.8741 24.4958 25.9243 24.6172C25.9746 24.7386 26.0005 24.8687 26.0005 25.0001C26.0005 25.1315 25.9746 25.2616 25.9243 25.383C25.8741 25.5044 25.8004 25.6147 25.7074 25.7076C25.6145 25.8005 25.5042 25.8742 25.3828 25.9245C25.2614 25.9747 25.1313 26.0006 24.9999 26.0006C24.8686 26.0006 24.7384 25.9747 24.6171 25.9245C24.4957 25.8742 24.3854 25.8005 24.2924 25.7076L15.9999 17.4138L7.70745 25.7076C7.5198 25.8952 7.26531 26.0006 6.99995 26.0006C6.73458 26.0006 6.48009 25.8952 6.29245 25.7076C6.1048 25.5199 5.99939 25.2654 5.99939 25.0001C5.99939 24.7347 6.10481 24.4802 6.29245 24.2926L14.5862 16.0001L6.29245 7.70757C6.1048 7.51993 5.99939 7.26543 5.99939 7.00007C5.99939 6.7347 6.1048 6.48021 6.29245 6.29257C6.48009 6.10493 6.73458 5.99951 6.99995 5.99951C7.26531 5.99951 7.5198 6.10493 7.70745 6.29257L15.9999 14.5863L24.2924 6.29257C24.4801 6.10493 24.7346 5.99951 24.9999 5.99951C25.2653 5.99951 25.5198 6.10493 25.7074 6.29257C25.8951 6.48021 26.0005 6.7347 26.0005 7.00007C26.0005 7.26543 25.8951 7.51993 25.7074 7.70757L17.4137 16.0001L25.7074 24.2926Z",fill:"#000000"})),jb='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66"><path fill="url(#a)" fill-opacity=".4" d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z" style="mix-blend-mode:darken"/><g filter="url(#b)"><path fill="currentColor" fill-opacity=".8" fill-rule="evenodd" d="M24 0c11.211 0 24 8.288 24 24.088C48 34.6 40.011 48.411 24 60 7.989 48.41 0 34.6 0 24.088 0 8.288 12.789 0 24 0Z" clip-rule="evenodd"/></g><path fill="#fff" fill-rule="evenodd" d="M36.503 33.501V19.625a3 3 0 0 0-1.583-2.645l-9.502-5.091a3 3 0 0 0-2.834 0l-9.501 5.091a3 3 0 0 0-1.583 2.645V33.5a3 3 0 0 0 3 3h19.003a3 3 0 0 0 3-3Zm-7.752 1h4.752a1 1 0 0 0 1-1V19.625a1 1 0 0 0-.528-.882l-9.501-5.091a1 1 0 0 0-.945 0l-9.501 5.091a1 1 0 0 0-.528.882V33.5a1 1 0 0 0 1 1h4.75a2.516 2.516 0 0 1-.05-.5V23.747a2.5 2.5 0 0 1 2.5-2.5h4.602a2.5 2.5 0 0 1 2.5 2.5V34c0 .172-.018.339-.05.5Zm-2.434 0a.5.5 0 0 0 .485-.5V23.747a.5.5 0 0 0-.5-.5H21.7a.5.5 0 0 0-.5.5V34a.5.5 0 0 0 .484.5h4.632Z" clip-rule="evenodd"/><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 6 -20 0 24 60)" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-opacity="0"/></radialGradient><filter id="b" width="56" height="68" x="-4" y="-4" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feGaussianBlur in="BackgroundImageFix" stdDeviation="2"/><feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_1068_16960"/><feBlend in="SourceGraphic" in2="effect1_backgroundBlur_1068_16960" result="shape"/></filter></defs></svg>',Nb=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
51
51
  <path
52
52
  d="M23.999 66C35.0452 66 44 63.3137 44 59.9999C44 56.6863 35.0452 54 23.999 54C12.9548 54 4 56.6863 4 59.9999C4 63.3137 12.9548 66 23.999 66Z"
53
53
  fill="url(#paint0_radial_10036_91741)" fill-opacity="0.4" />
@@ -64,7 +64,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
64
64
  <stop offset="1" stop-opacity="0" />
65
65
  </radialGradient>
66
66
  </defs>
67
- </svg>`,P3=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
67
+ </svg>`,Ib=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
68
68
  <path
69
69
  d="M23.999 66C35.0452 66 44 63.3137 44 59.9999C44 56.6863 35.0452 54 23.999 54C12.9548 54 4 56.6863 4 59.9999C4 63.3137 12.9548 66 23.999 66Z"
70
70
  fill="url(#paint0_radial_10036_91748)" fill-opacity="0.4" />
@@ -81,7 +81,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
81
81
  <stop offset="1" stop-opacity="0" />
82
82
  </radialGradient>
83
83
  </defs>
84
- </svg>`,k3=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
84
+ </svg>`,Fb=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
85
85
  <path
86
86
  d="M23.999 66C35.0452 66 44 63.3137 44 59.9999C44 56.6863 35.0452 54 23.999 54C12.9548 54 4 56.6863 4 59.9999C4 63.3137 12.9548 66 23.999 66Z"
87
87
  fill="url(#paint0_radial_2882_25472)" fill-opacity="0.4" />
@@ -98,7 +98,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
98
98
  <stop offset="1" stop-opacity="0" />
99
99
  </radialGradient>
100
100
  </defs>
101
- </svg>`,T3=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
101
+ </svg>`,Bb=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
102
102
  <path
103
103
  d="M23.999 66C35.0452 66 44 63.3137 44 59.9999C44 56.6863 35.0452 54 23.999 54C12.9548 54 4 56.6863 4 59.9999C4 63.3137 12.9548 66 23.999 66Z"
104
104
  fill="url(#paint0_radial_9911_141382)" fill-opacity="0.4" />
@@ -115,7 +115,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
115
115
  <stop offset="1" stop-opacity="0" />
116
116
  </radialGradient>
117
117
  </defs>
118
- </svg>`,R3=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66">
118
+ </svg>`,Vb=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66">
119
119
  <path fill="url(#a)" fill-opacity=".4"
120
120
  d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z"
121
121
  style="mix-blend-mode:darken" />
@@ -153,7 +153,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
153
153
  <feBlend in="SourceGraphic" in2="effect1_backgroundBlur_958_9661" result="shape" />
154
154
  </filter>
155
155
  </defs>
156
- </svg>`,D3=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
156
+ </svg>`,Hb=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
157
157
  <path
158
158
  d="M23.999 66C35.0452 66 44 63.3137 44 59.9999C44 56.6863 35.0452 54 23.999 54C12.9548 54 4 56.6863 4 59.9999C4 63.3137 12.9548 66 23.999 66Z"
159
159
  fill="url(#paint0_radial_12732_84274)" fill-opacity="0.4" />
@@ -176,7 +176,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
176
176
  <stop offset="1" stop-opacity="0" />
177
177
  </radialGradient>
178
178
  </defs>
179
- </svg>`,A3=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
179
+ </svg>`,$b=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" viewBox="0 0 48 66" fill="none">
180
180
  <path
181
181
  d="M23.999 66C35.0452 66 44 63.3137 44 59.9999C44 56.6863 35.0452 54 23.999 54C12.9548 54 4 56.6863 4 59.9999C4 63.3137 12.9548 66 23.999 66Z"
182
182
  fill="url(#paint0_radial_12732_84297)" fill-opacity="0.4" />
@@ -199,18 +199,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
199
199
  <stop offset="1" stop-opacity="0" />
200
200
  </radialGradient>
201
201
  </defs>
202
- </svg>`,I3=`<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
202
+ </svg>`,Ub=`<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
203
203
  <rect width="48" height="48" fill="#6A4A9D"/>
204
204
  <path d="M16.3444 36.5C15.3815 36.5 14.4907 36.2685 13.6722 35.8056C12.8537 35.3426 12.2037 34.7176 11.7222 33.9306C11.2407 33.1435 11 32.287 11 31.3611V16.6389C11 15.6898 11.2407 14.8333 11.7222 14.0694C12.2037 13.2824 12.8537 12.6574 13.6722 12.1944C14.4907 11.7315 15.3815 11.5 16.3444 11.5H31.6556C32.6185 11.5 33.4972 11.7315 34.2917 12.1944C35.1102 12.6574 35.7602 13.2824 36.2417 14.0694C36.7472 14.8333 37 15.6898 37 16.6389V31.3611C37 32.287 36.7472 33.1435 36.2417 33.9306C35.7602 34.7176 35.1102 35.3426 34.2917 35.8056C33.4972 36.2685 32.6185 36.5 31.6556 36.5H16.3444ZM16.5972 31.0833H31.3306V16.9167H16.5972V31.0833Z" fill="white"/>
205
205
  </svg>
206
- `,j3=`<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
206
+ `,zb=`<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
207
207
  <path
208
208
  d="M48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0C37.2548 0 48 10.7452 48 24Z"
209
209
  fill="currentColor" />
210
210
  <path fill-rule="evenodd" clip-rule="evenodd"
211
211
  d="M10.0042 24.2835C9.80882 16.3692 16.4453 10 24.2856 10C31.7119 10.1904 37.8053 16.1895 37.9957 23.7122C38.1861 31.4253 31.9975 37.8053 24.2856 37.9957C16.5736 38.1862 10.1946 31.9966 10.0042 24.2835ZM24 31.7778C28.2955 31.7778 31.7778 28.2955 31.7778 24C31.7778 19.7045 28.2955 16.2222 24 16.2222C19.7044 16.2222 16.2222 19.7045 16.2222 24C16.2222 28.2955 19.7044 31.7778 24 31.7778Z"
212
212
  fill="#000000" />
213
- </svg>`,N3=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none">
213
+ </svg>`,qb=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none">
214
214
  <rect width="48" height="48" fill="black" />
215
215
  <path
216
216
  d="M28.1433 19.2998C22.809 16.6897 22.3296 12.1691 22.88 9H20.3824C14.0984 9 9 14.217 9 20.6578V36.4793C11.3696 31.1249 12.9529 27.7475 20.2514 26.189C30.442 24.0131 38.6069 24.4126 28.1433 19.2982V19.2998ZM16.9937 22.161C15.5106 22.161 14.3096 20.9309 14.3096 19.4119C14.3096 17.8929 15.5106 16.6645 16.9937 16.6645C18.4768 16.6645 19.6763 17.8945 19.6763 19.4119C19.6763 20.9293 18.4753 22.161 16.9937 22.161Z"
@@ -221,43 +221,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
221
221
  <path
222
222
  d="M28.0662 30.4213C32.4169 29.5418 36.0122 29.0523 39 27.2396V27.3265C39 27.4007 39 27.4796 38.9969 27.5538C38.8443 33.8888 31.6754 39 23.6816 39H19.1629C19.1043 35.2404 20.3886 31.9735 28.0678 30.4213"
223
223
  fill="#8ECFD3" />
224
- </svg>`,Pt={PinPvz:R3,PinHome:M3,PinOmnic:k3,PinWeChip:D3,PinOmnicSelected:T3,PinWeChipSelected:A3,PinLlamaSelected:P3,PinLlama:O3,PointOmnic:j3,PointLlama:I3,PointWeChip:N3},Zh=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...t},U.createElement("path",{fill:"currentcolor",d:"M12.5 8c0 .287-.108.573-.324.792l-6.789 6.88a1.095 1.095 0 0 1-1.563 0 1.131 1.131 0 0 1 0-1.585L9.83 8 3.824 1.913a1.131 1.131 0 0 1 0-1.585 1.095 1.095 0 0 1 1.564 0l6.789 6.88c.215.219.323.505.323.792Z"})),B3="PointItem-module__point__-1jMFG",F3="PointItem-module__pointButton__-wAVuy",U3="PointItem-module__pointData__CrnHK9",V3="PointItem-module__title__I5whAh",z3="PointItem-module__address__tRkAx3",H3="PointItem-module__arrow__AMAx4z",xr={point:B3,pointButton:F3,pointData:U3,title:V3,address:z3,arrow:H3},$3=({handleDetailsClick:t,handlePointClick:e,point:n})=>{const{iconType:r,palette:i,skipPointInfo:o}=Ze(),s=gr("screenSm"),a=(i==null?void 0:i.primary)||"#fc0",l=function(){switch(r){case"omni-llama":return Pt.PointLlama;case"we-chip":return Pt.PointWeChip;default:return Or(Pt.PointOmnic,a)}}();function u(){e(n),!o&&!s&&t(n)}return C.jsx("li",{className:xr.point,children:C.jsxs("button",{className:xr.pointButton,type:"button",tabIndex:0,onClick:u,children:[C.jsx("div",{dangerouslySetInnerHTML:{__html:l}}),C.jsxs("div",{className:xr.pointData,children:[C.jsx("h3",{className:xr.title,children:n.name}),C.jsx("p",{className:xr.address,children:n.location.full_address})]}),C.jsx("span",{className:xr.arrow,children:C.jsx(Zh,{})})]})},n.uid)},W3="SamePoints-module__container__oYvAF2",G3="SamePoints-module__header__nnMDp4",Z3="SamePoints-module__closeButton__gd1RzT",q3="SamePoints-module__sameList__GhS89e",jo={container:W3,header:G3,closeButton:Z3,sameList:q3},K3=t=>{const{closeSamePoints:e,samePoints:n}=an(),{hideSearchInput:r}=Ze(),i=!!n.length;return C.jsxs("div",{className:jo.container,"data-visible":i,"data-hide-search-input":r,children:[C.jsx("div",{className:jo.header,children:C.jsx("button",{className:jo.closeButton,type:"button","aria-label":"Close points",tabIndex:0,onClick:e,children:C.jsx(_3,{})})}),C.jsx("ul",{className:jo.sameList,children:n.map(o=>C.jsx($3,{point:o,...t},o.uid))})]})};var lo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},pr=typeof window>"u"||"Deno"in globalThis;function jt(){}function Q3(t,e){return typeof t=="function"?t(e):t}function rl(t){return typeof t=="number"&&t>=0&&t!==1/0}function qh(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Rr(t,e){return typeof t=="function"?t(e):t}function $t(t,e){return typeof t=="function"?t(e):t}function bc(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=t;if(s){if(r){if(e.queryHash!==Wl(s,e.options))return!1}else if(!Wi(e.queryKey,s))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||o&&!o(e))}function wc(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if($i(e.options.mutationKey)!==$i(o))return!1}else if(!Wi(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Wl(t,e){return((e==null?void 0:e.queryKeyHashFn)||$i)(t)}function $i(t){return JSON.stringify(t,(e,n)=>ol(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Wi(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Wi(t[n],e[n])):!1}function Kh(t,e){if(t===e)return t;const n=Cc(t)&&Cc(e);if(n||ol(t)&&ol(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),s=o.length,a=n?[]:{};let l=0;for(let u=0;u<s;u++){const f=n?u:o[u];(!n&&r.includes(f)||n)&&t[f]===void 0&&e[f]===void 0?(a[f]=void 0,l++):(a[f]=Kh(t[f],e[f]),a[f]===t[f]&&t[f]!==void 0&&l++)}return i===s&&l===i?t:a}return e}function il(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Cc(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function ol(t){if(!Sc(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Sc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Sc(t){return Object.prototype.toString.call(t)==="[object Object]"}function J3(t){return new Promise(e=>{setTimeout(e,t)})}function sl(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Kh(t,e):e}function Y3(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function X3(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Gl=Symbol();function Qh(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Gl?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var nr,Dn,Ar,Pf,e4=(Pf=class extends lo{constructor(){super();J(this,nr,void 0);J(this,Dn,void 0);J(this,Ar,void 0);$(this,Ar,e=>{if(!pr&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Dn)||this.setEventListener(k(this,Ar))}onUnsubscribe(){var e;this.hasListeners()||((e=k(this,Dn))==null||e.call(this),$(this,Dn,void 0))}setEventListener(e){var n;$(this,Ar,e),(n=k(this,Dn))==null||n.call(this),$(this,Dn,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){k(this,nr)!==e&&($(this,nr,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof k(this,nr)=="boolean"?k(this,nr):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},nr=new WeakMap,Dn=new WeakMap,Ar=new WeakMap,Pf),Zl=new e4,Ir,An,jr,kf,t4=(kf=class extends lo{constructor(){super();J(this,Ir,!0);J(this,An,void 0);J(this,jr,void 0);$(this,jr,e=>{if(!pr&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,An)||this.setEventListener(k(this,jr))}onUnsubscribe(){var e;this.hasListeners()||((e=k(this,An))==null||e.call(this),$(this,An,void 0))}setEventListener(e){var n;$(this,jr,e),(n=k(this,An))==null||n.call(this),$(this,An,e(this.setOnline.bind(this)))}setOnline(e){k(this,Ir)!==e&&($(this,Ir,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return k(this,Ir)}},Ir=new WeakMap,An=new WeakMap,jr=new WeakMap,kf),Cs=new t4;function al(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function n4(t){return Math.min(1e3*2**t,3e4)}function Jh(t){return(t??"online")==="online"?Cs.isOnline():!0}var Yh=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function ca(t){return t instanceof Yh}function Xh(t){let e=!1,n=0,r=!1,i;const o=al(),s=g=>{var S;r||(h(new Yh(g)),(S=t.abort)==null||S.call(t))},a=()=>{e=!0},l=()=>{e=!1},u=()=>Zl.isFocused()&&(t.networkMode==="always"||Cs.isOnline())&&t.canRun(),f=()=>Jh(t.networkMode)&&t.canRun(),d=g=>{var S;r||(r=!0,(S=t.onSuccess)==null||S.call(t,g),i==null||i(),o.resolve(g))},h=g=>{var S;r||(r=!0,(S=t.onError)==null||S.call(t,g),i==null||i(),o.reject(g))},v=()=>new Promise(g=>{var S;i=w=>{(r||u())&&g(w)},(S=t.onPause)==null||S.call(t)}).then(()=>{var g;i=void 0,r||(g=t.onContinue)==null||g.call(t)}),y=()=>{if(r)return;let g;const S=n===0?t.initialPromise:void 0;try{g=S??t.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(d).catch(w=>{var p;if(r)return;const L=t.retry??(pr?0:3),m=t.retryDelay??n4,_=typeof m=="function"?m(n,w):m,E=L===!0||typeof L=="number"&&n<L||typeof L=="function"&&L(n,w);if(e||!E){h(w);return}n++,(p=t.onFail)==null||p.call(t,n,w),J3(_).then(()=>u()?void 0:v()).then(()=>{e?h(w):y()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?y():v().then(y),o)}}function r4(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const o=a=>{e?t.push(a):i(()=>{n(a)})},s=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var lt=r4(),rr,Tf,ep=(Tf=class{constructor(){J(this,rr,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rl(this.gcTime)&&$(this,rr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(pr?1/0:5*60*1e3))}clearGcTimeout(){k(this,rr)&&(clearTimeout(k(this,rr)),$(this,rr,void 0))}},rr=new WeakMap,Tf),Nr,Br,At,ht,Gi,ir,Ht,gn,Rf,i4=(Rf=class extends ep{constructor(e){super();J(this,Ht);J(this,Nr,void 0);J(this,Br,void 0);J(this,At,void 0);J(this,ht,void 0);J(this,Gi,void 0);J(this,ir,void 0);$(this,ir,!1),$(this,Gi,e.defaultOptions),this.setOptions(e.options),this.observers=[],$(this,At,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,$(this,Nr,o4(this.options)),this.state=e.state??k(this,Nr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=k(this,ht))==null?void 0:e.promise}setOptions(e){this.options={...k(this,Gi),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,At).remove(this)}setData(e,n){const r=sl(this.state.data,e,this.options);return ye(this,Ht,gn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){ye(this,Ht,gn).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=k(this,ht))==null?void 0:r.promise;return(i=k(this,ht))==null||i.cancel(e),n?n.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,Nr))}isActive(){return this.observers.some(e=>$t(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gl||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!qh(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=k(this,ht))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=k(this,ht))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),k(this,At).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(k(this,ht)&&(k(this,ir)?k(this,ht).cancel({revert:!0}):k(this,ht).cancelRetry()),this.scheduleGc()),k(this,At).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ye(this,Ht,gn).call(this,{type:"invalidate"})}fetch(e,n){var l,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,ht))return k(this,ht).continueRetry(),k(this,ht).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>($(this,ir,!0),r.signal)})},o=()=>{const d=Qh(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return i(h),$(this,ir,!1),this.options.persister?this.options.persister(d,h,this):d(h)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(l=this.options.behavior)==null||l.onFetch(s,this),$(this,Br,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&ye(this,Ht,gn).call(this,{type:"fetch",meta:(f=s.fetchOptions)==null?void 0:f.meta});const a=d=>{var h,v,y,g;ca(d)&&d.silent||ye(this,Ht,gn).call(this,{type:"error",error:d}),ca(d)||((v=(h=k(this,At).config).onError)==null||v.call(h,d,this),(g=(y=k(this,At).config).onSettled)==null||g.call(y,this.state.data,d,this)),this.scheduleGc()};return $(this,ht,Xh({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,v,y,g;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(S){a(S);return}(v=(h=k(this,At).config).onSuccess)==null||v.call(h,d,this),(g=(y=k(this,At).config).onSettled)==null||g.call(y,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,h)=>{ye(this,Ht,gn).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{ye(this,Ht,gn).call(this,{type:"pause"})},onContinue:()=>{ye(this,Ht,gn).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),k(this,ht).start()}},Nr=new WeakMap,Br=new WeakMap,At=new WeakMap,ht=new WeakMap,Gi=new WeakMap,ir=new WeakMap,Ht=new WeakSet,gn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...tp(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return ca(i)&&i.revert&&k(this,Br)?{...k(this,Br),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),lt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,At).notify({query:this,type:"updated",action:e})})},Rf);function tp(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jh(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function o4(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Xt,Df,s4=(Df=class extends lo{constructor(e={}){super();J(this,Xt,void 0);this.config=e,$(this,Xt,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??Wl(i,n);let s=this.get(o);return s||(s=new i4({cache:this,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){k(this,Xt).has(e.queryHash)||(k(this,Xt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=k(this,Xt).get(e.queryHash);n&&(e.destroy(),n===e&&k(this,Xt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){lt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return k(this,Xt).get(e)}getAll(){return[...k(this,Xt).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>bc(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>bc(e,r)):n}notify(e){lt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Xt=new WeakMap,Df),en,vt,or,tn,_n,Af,a4=(Af=class extends ep{constructor(e){super();J(this,tn);J(this,en,void 0);J(this,vt,void 0);J(this,or,void 0);this.mutationId=e.mutationId,$(this,vt,e.mutationCache),$(this,en,[]),this.state=e.state||l4(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){k(this,en).includes(e)||(k(this,en).push(e),this.clearGcTimeout(),k(this,vt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){$(this,en,k(this,en).filter(n=>n!==e)),this.scheduleGc(),k(this,vt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){k(this,en).length||(this.state.status==="pending"?this.scheduleGc():k(this,vt).remove(this))}continue(){var e;return((e=k(this,or))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,s,a,l,u,f,d,h,v,y,g,S,w,L,m,_,E,p,b;$(this,or,Xh({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(x,P)=>{ye(this,tn,_n).call(this,{type:"failed",failureCount:x,error:P})},onPause:()=>{ye(this,tn,_n).call(this,{type:"pause"})},onContinue:()=>{ye(this,tn,_n).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,vt).canRun(this)}));const n=this.state.status==="pending",r=!k(this,or).canStart();try{if(!n){ye(this,tn,_n).call(this,{type:"pending",variables:e,isPaused:r}),await((o=(i=k(this,vt).config).onMutate)==null?void 0:o.call(i,e,this));const P=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,e));P!==this.state.context&&ye(this,tn,_n).call(this,{type:"pending",context:P,variables:e,isPaused:r})}const x=await k(this,or).start();return await((u=(l=k(this,vt).config).onSuccess)==null?void 0:u.call(l,x,e,this.state.context,this)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,x,e,this.state.context)),await((v=(h=k(this,vt).config).onSettled)==null?void 0:v.call(h,x,null,this.state.variables,this.state.context,this)),await((g=(y=this.options).onSettled)==null?void 0:g.call(y,x,null,e,this.state.context)),ye(this,tn,_n).call(this,{type:"success",data:x}),x}catch(x){try{throw await((w=(S=k(this,vt).config).onError)==null?void 0:w.call(S,x,e,this.state.context,this)),await((m=(L=this.options).onError)==null?void 0:m.call(L,x,e,this.state.context)),await((E=(_=k(this,vt).config).onSettled)==null?void 0:E.call(_,void 0,x,this.state.variables,this.state.context,this)),await((b=(p=this.options).onSettled)==null?void 0:b.call(p,void 0,x,e,this.state.context)),x}finally{ye(this,tn,_n).call(this,{type:"error",error:x})}}finally{k(this,vt).runNext(this)}}},en=new WeakMap,vt=new WeakMap,or=new WeakMap,tn=new WeakSet,_n=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),lt.batch(()=>{k(this,en).forEach(r=>{r.onMutationUpdate(e)}),k(this,vt).notify({mutation:this,type:"updated",action:e})})},Af);function l4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ot,Zi,If,u4=(If=class extends lo{constructor(e={}){super();J(this,Ot,void 0);J(this,Zi,void 0);this.config=e,$(this,Ot,new Map),$(this,Zi,Date.now())}build(e,n,r){const i=new a4({mutationCache:this,mutationId:++ho(this,Zi)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){const n=No(e),r=k(this,Ot).get(n)??[];r.push(e),k(this,Ot).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=No(e);if(k(this,Ot).has(n)){const i=(r=k(this,Ot).get(n))==null?void 0:r.filter(o=>o!==e);i&&(i.length===0?k(this,Ot).delete(n):k(this,Ot).set(n,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=k(this,Ot).get(No(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=k(this,Ot).get(No(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){lt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...k(this,Ot).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>wc(n,r))}findAll(e={}){return this.getAll().filter(n=>wc(e,n))}notify(e){lt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return lt.batch(()=>Promise.all(e.map(n=>n.continue().catch(jt))))}},Ot=new WeakMap,Zi=new WeakMap,If);function No(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function Lc(t){return{onFetch:(e,n)=>{var f,d,h,v,y;const r=e.options,i=(h=(d=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,o=((v=e.state.data)==null?void 0:v.pages)||[],s=((y=e.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let g=!1;const S=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},w=Qh(e.options,e.fetchOptions),L=async(m,_,E)=>{if(g)return Promise.reject();if(_==null&&m.pages.length)return Promise.resolve(m);const p={queryKey:e.queryKey,pageParam:_,direction:E?"backward":"forward",meta:e.options.meta};S(p);const b=await w(p),{maxPages:x}=e.options,P=E?X3:Y3;return{pages:P(m.pages,b,x),pageParams:P(m.pageParams,_,x)}};if(i&&o.length){const m=i==="backward",_=m?c4:xc,E={pages:o,pageParams:s},p=_(r,E);a=await L(E,p,m)}else{const m=t??o.length;do{const _=l===0?s[0]??r.initialPageParam:xc(r,a);if(l>0&&_==null)break;a=await L(a,_),l++}while(l<m)}return a};e.options.persister?e.fetchFn=()=>{var g,S;return(S=(g=e.options).persister)==null?void 0:S.call(g,u,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function xc(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function c4(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Qe,In,jn,Fr,Ur,Nn,Vr,zr,jf,f4=(jf=class{constructor(t={}){J(this,Qe,void 0);J(this,In,void 0);J(this,jn,void 0);J(this,Fr,void 0);J(this,Ur,void 0);J(this,Nn,void 0);J(this,Vr,void 0);J(this,zr,void 0);$(this,Qe,t.queryCache||new s4),$(this,In,t.mutationCache||new u4),$(this,jn,t.defaultOptions||{}),$(this,Fr,new Map),$(this,Ur,new Map),$(this,Nn,0)}mount(){ho(this,Nn)._++,k(this,Nn)===1&&($(this,Vr,Zl.subscribe(async t=>{t&&(await this.resumePausedMutations(),k(this,Qe).onFocus())})),$(this,zr,Cs.subscribe(async t=>{t&&(await this.resumePausedMutations(),k(this,Qe).onOnline())})))}unmount(){var t,e;ho(this,Nn)._--,k(this,Nn)===0&&((t=k(this,Vr))==null||t.call(this),$(this,Vr,void 0),(e=k(this,zr))==null||e.call(this),$(this,zr,void 0))}isFetching(t){return k(this,Qe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return k(this,In).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=k(this,Qe).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=k(this,Qe).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(Rr(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return k(this,Qe).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=k(this,Qe).get(r.queryHash),o=i==null?void 0:i.state.data,s=Q3(e,o);if(s!==void 0)return k(this,Qe).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(t,e,n){return lt.batch(()=>k(this,Qe).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=k(this,Qe).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=k(this,Qe);lt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=k(this,Qe),r={type:"active",...t};return lt.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=lt.batch(()=>k(this,Qe).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(jt).catch(jt)}invalidateQueries(t={},e={}){return lt.batch(()=>{if(k(this,Qe).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=lt.batch(()=>k(this,Qe).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(jt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(jt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=k(this,Qe).build(this,e);return n.isStaleByTime(Rr(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(jt).catch(jt)}fetchInfiniteQuery(t){return t.behavior=Lc(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(jt).catch(jt)}ensureInfiniteQueryData(t){return t.behavior=Lc(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Cs.isOnline()?k(this,In).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,Qe)}getMutationCache(){return k(this,In)}getDefaultOptions(){return k(this,jn)}setDefaultOptions(t){$(this,jn,t)}setQueryDefaults(t,e){k(this,Fr).set($i(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...k(this,Fr).values()];let n={};return e.forEach(r=>{Wi(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){k(this,Ur).set($i(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...k(this,Ur).values()];let n={};return e.forEach(r=>{Wi(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...k(this,jn).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Wl(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===Gl&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...k(this,jn).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){k(this,Qe).clear(),k(this,In).clear()}},Qe=new WeakMap,In=new WeakMap,jn=new WeakMap,Fr=new WeakMap,Ur=new WeakMap,Nn=new WeakMap,Vr=new WeakMap,zr=new WeakMap,jf),_t,be,qi,mt,sr,Hr,Bn,nn,Ki,$r,Wr,ar,lr,Fn,Gr,ur,Ei,Qi,ll,Ji,ul,Yi,cl,Xi,fl,eo,dl,to,hl,no,pl,Es,np,Nf,d4=(Nf=class extends lo{constructor(e,n){super();J(this,ur);J(this,Qi);J(this,Ji);J(this,Yi);J(this,Xi);J(this,eo);J(this,to);J(this,no);J(this,Es);J(this,_t,void 0);J(this,be,void 0);J(this,qi,void 0);J(this,mt,void 0);J(this,sr,void 0);J(this,Hr,void 0);J(this,Bn,void 0);J(this,nn,void 0);J(this,Ki,void 0);J(this,$r,void 0);J(this,Wr,void 0);J(this,ar,void 0);J(this,lr,void 0);J(this,Fn,void 0);J(this,Gr,new Set);this.options=n,$(this,_t,e),$(this,nn,null),$(this,Bn,al()),this.options.experimental_prefetchInRender||k(this,Bn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,be).addObserver(this),Ec(k(this,be),this.options)?ye(this,ur,Ei).call(this):this.updateResult(),ye(this,Xi,fl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gl(k(this,be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gl(k(this,be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,eo,dl).call(this),ye(this,to,hl).call(this),k(this,be).removeObserver(this)}setOptions(e,n){const r=this.options,i=k(this,be);if(this.options=k(this,_t).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $t(this.options.enabled,k(this,be))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ye(this,no,pl).call(this),k(this,be).setOptions(this.options),r._defaulted&&!il(this.options,r)&&k(this,_t).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,be),observer:this});const o=this.hasListeners();o&&_c(k(this,be),i,this.options,r)&&ye(this,ur,Ei).call(this),this.updateResult(n),o&&(k(this,be)!==i||$t(this.options.enabled,k(this,be))!==$t(r.enabled,k(this,be))||Rr(this.options.staleTime,k(this,be))!==Rr(r.staleTime,k(this,be)))&&ye(this,Qi,ll).call(this);const s=ye(this,Ji,ul).call(this);o&&(k(this,be)!==i||$t(this.options.enabled,k(this,be))!==$t(r.enabled,k(this,be))||s!==k(this,Fn))&&ye(this,Yi,cl).call(this,s)}getOptimisticResult(e){const n=k(this,_t).getQueryCache().build(k(this,_t),e),r=this.createResult(n,e);return p4(this,r)&&($(this,mt,r),$(this,Hr,this.options),$(this,sr,k(this,be).state)),r}getCurrentResult(){return k(this,mt)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){k(this,Gr).add(e)}getCurrentQuery(){return k(this,be)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=k(this,_t).defaultQueryOptions(e),r=k(this,_t).getQueryCache().build(k(this,_t),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ye(this,ur,Ei).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,mt)))}createResult(e,n){var x;const r=k(this,be),i=this.options,o=k(this,mt),s=k(this,sr),a=k(this,Hr),u=e!==r?e.state:k(this,qi),{state:f}=e;let d={...f},h=!1,v;if(n._optimisticResults){const P=this.hasListeners(),O=!P&&Ec(e,n),T=P&&_c(e,r,n,i);(O||T)&&(d={...d,...tp(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:S}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===k(this,Ki))v=k(this,$r);else try{$(this,Ki,n.select),v=n.select(d.data),v=sl(o==null?void 0:o.data,v,n),$(this,$r,v),$(this,nn,null)}catch(P){$(this,nn,P)}else v=d.data;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let P;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))P=o.data;else if(P=typeof n.placeholderData=="function"?n.placeholderData((x=k(this,Wr))==null?void 0:x.state.data,k(this,Wr)):n.placeholderData,n.select&&P!==void 0)try{P=n.select(P),$(this,nn,null)}catch(O){$(this,nn,O)}P!==void 0&&(S="success",v=sl(o==null?void 0:o.data,P,n),h=!0)}k(this,nn)&&(y=k(this,nn),v=k(this,$r),g=Date.now(),S="error");const w=d.fetchStatus==="fetching",L=S==="pending",m=S==="error",_=L&&w,E=v!==void 0,b={status:S,fetchStatus:d.fetchStatus,isPending:L,isSuccess:S==="success",isError:m,isInitialLoading:_,isLoading:_,data:v,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!L,isLoadingError:m&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:m&&E,isStale:ql(e,n),refetch:this.refetch,promise:k(this,Bn)};if(this.options.experimental_prefetchInRender){const P=M=>{b.status==="error"?M.reject(b.error):b.data!==void 0&&M.resolve(b.data)},O=()=>{const M=$(this,Bn,b.promise=al());P(M)},T=k(this,Bn);switch(T.status){case"pending":e.queryHash===r.queryHash&&P(T);break;case"fulfilled":(b.status==="error"||b.data!==T.value)&&O();break;case"rejected":(b.status!=="error"||b.error!==T.reason)&&O();break}}return b}updateResult(e){const n=k(this,mt),r=this.createResult(k(this,be),this.options);if($(this,sr,k(this,be).state),$(this,Hr,this.options),k(this,sr).data!==void 0&&$(this,Wr,k(this,be)),il(r,n))return;$(this,mt,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!k(this,Gr).size)return!0;const l=new Set(a??k(this,Gr));return this.options.throwOnError&&l.add("error"),Object.keys(k(this,mt)).some(u=>{const f=u;return k(this,mt)[f]!==n[f]&&l.has(f)})};(e==null?void 0:e.listeners)!==!1&&o()&&(i.listeners=!0),ye(this,Es,np).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,Xi,fl).call(this)}},_t=new WeakMap,be=new WeakMap,qi=new WeakMap,mt=new WeakMap,sr=new WeakMap,Hr=new WeakMap,Bn=new WeakMap,nn=new WeakMap,Ki=new WeakMap,$r=new WeakMap,Wr=new WeakMap,ar=new WeakMap,lr=new WeakMap,Fn=new WeakMap,Gr=new WeakMap,ur=new WeakSet,Ei=function(e){ye(this,no,pl).call(this);let n=k(this,be).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(jt)),n},Qi=new WeakSet,ll=function(){ye(this,eo,dl).call(this);const e=Rr(this.options.staleTime,k(this,be));if(pr||k(this,mt).isStale||!rl(e))return;const r=qh(k(this,mt).dataUpdatedAt,e)+1;$(this,ar,setTimeout(()=>{k(this,mt).isStale||this.updateResult()},r))},Ji=new WeakSet,ul=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,be)):this.options.refetchInterval)??!1},Yi=new WeakSet,cl=function(e){ye(this,to,hl).call(this),$(this,Fn,e),!(pr||$t(this.options.enabled,k(this,be))===!1||!rl(k(this,Fn))||k(this,Fn)===0)&&$(this,lr,setInterval(()=>{(this.options.refetchIntervalInBackground||Zl.isFocused())&&ye(this,ur,Ei).call(this)},k(this,Fn)))},Xi=new WeakSet,fl=function(){ye(this,Qi,ll).call(this),ye(this,Yi,cl).call(this,ye(this,Ji,ul).call(this))},eo=new WeakSet,dl=function(){k(this,ar)&&(clearTimeout(k(this,ar)),$(this,ar,void 0))},to=new WeakSet,hl=function(){k(this,lr)&&(clearInterval(k(this,lr)),$(this,lr,void 0))},no=new WeakSet,pl=function(){const e=k(this,_t).getQueryCache().build(k(this,_t),this.options);if(e===k(this,be))return;const n=k(this,be);$(this,be,e),$(this,qi,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},Es=new WeakSet,np=function(e){lt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(k(this,mt))}),k(this,_t).getQueryCache().notify({query:k(this,be),type:"observerResultsUpdated"})})},Nf);function h4(t,e){return $t(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Ec(t,e){return h4(t,e)||t.state.data!==void 0&&gl(t,e,e.refetchOnMount)}function gl(t,e,n){if($t(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&ql(t,e)}return!1}function _c(t,e,n,r){return(t!==e||$t(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&ql(t,n)}function ql(t,e){return $t(e.enabled,t)!==!1&&t.isStaleByTime(Rr(e.staleTime,t))}function p4(t,e){return!il(t.getCurrentResult(),e)}var rp=U.createContext(void 0),g4=t=>{const e=U.useContext(rp);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},v4=({client:t,children:e})=>(U.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),C.jsx(rp.Provider,{value:t,children:e})),ip=U.createContext(!1),m4=()=>U.useContext(ip);ip.Provider;function y4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var b4=U.createContext(y4()),w4=()=>U.useContext(b4);function C4(t,e){return typeof t=="function"?t(...e):!!t}function S4(){}var L4=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},x4=t=>{U.useEffect(()=>{t.clearReset()},[t])},E4=({result:t,errorResetBoundary:e,throwOnError:n,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&C4(n,[t.error,r]),_4=t=>{t.suspense&&(t.staleTime===void 0&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},M4=(t,e)=>t.isLoading&&t.isFetching&&!e,O4=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Mc=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function P4(t,e,n){var f,d,h,v,y;const r=g4(n),i=m4(),o=w4(),s=r.defaultQueryOptions(t);(d=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||d.call(f,s),s._optimisticResults=i?"isRestoring":"optimistic",_4(s),L4(s,o),x4(o);const a=!r.getQueryCache().get(s.queryHash),[l]=U.useState(()=>new e(r,s)),u=l.getOptimisticResult(s);if(U.useSyncExternalStore(U.useCallback(g=>{const S=i?()=>{}:l.subscribe(lt.batchCalls(g));return l.updateResult(),S},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),U.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),O4(s,u))throw Mc(s,l,o);if(E4({result:u,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw u.error;if((v=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,s,u),s.experimental_prefetchInRender&&!pr&&M4(u,i)){const g=a?Mc(s,l,o):(y=r.getQueryCache().get(s.queryHash))==null?void 0:y.promise;g==null||g.catch(S4).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?u:l.trackResult(u)}function op(t,e){return P4(t,d4,e)}async function k4(t){return(await Ye.request({method:"GET",baseURL:"https://erpru.omnic.solutions",url:`/lms/hs/lms_ecomgate/points?project=5e50288b-3806-11ed-a300-a2873e29cd09&code=${t}`})).data.data}function T4(){const[t,e]=c.useState(""),{setLMSData:n,setLoading:r}=Rs(),{data:i,isLoading:o}=op({queryKey:["lms-data",t],queryFn:()=>k4(t),enabled:!!t,refetchOnWindowFocus:!1,retry:2});return c.useEffect(()=>{const s=i==null?void 0:i.results[0];s&&n(s)},[i,n]),c.useEffect(()=>{r(o)},[o,r]),{getLMSData:e}}/*! *****************************************************************************
225
- Copyright (c) Microsoft Corporation.
226
-
227
- Permission to use, copy, modify, and/or distribute this software for any
228
- purpose with or without fee is hereby granted.
229
-
230
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
231
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
232
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
233
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
234
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
235
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
236
- PERFORMANCE OF THIS SOFTWARE.
237
- ***************************************************************************** */var vl=function(t,e){return vl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},vl(t,e)};function Ue(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");vl(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var K=function(){return K=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},K.apply(this,arguments)};function Kl(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function R4(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(d){s(d)}}function l(f){try{u(r.throw(f))}catch(d){s(d)}}function u(f){f.done?o(f.value):i(f.value).then(a,l)}u((r=r.apply(t,e||[])).next())})}function D4(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function sp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var A4=function(t,e,n,r,i,o,s,a){if(!t){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],f=0;l=new Error(e.replace(/%s/g,function(){return u[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},I4=A4,et=sp(I4),le=c.createContext(null);function j4(){et(!!c.useContext,"useGoogleMap is React hook and requires React version 16.8+");var t=c.useContext(le);return et(!!t,"useGoogleMap needs a GoogleMap available up in the tree"),t}function N4(t,e,n){return Object.keys(t).reduce(function(i,o){return e(i,t[o],o)},n)}function B4(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function F4(t,e,n,r){var i={},o=function(s,a){var l=n[a];l!==e[a]&&(i[a]=l,s(r,l))};return B4(t,o),i}function U4(t,e,n){var r=N4(n,function(o,s,a){return typeof t[a]=="function"&&o.push(google.maps.event.addListener(e,s,t[a])),o},[]);return r}function V4(t){google.maps.event.removeListener(t)}function he(t){t===void 0&&(t=[]),t.forEach(V4)}function ce(t){var e=t.updaterMap,n=t.eventMap,r=t.prevProps,i=t.nextProps,o=t.instance,s=U4(i,o,n);return F4(e,r,i,o),s}var Oc={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},Pc={extraMapTypes:function(t,e){e.forEach(function(r,i){t.mapTypes.set(String(i),r)})},center:function(t,e){t.setCenter(e)},clickableIcons:function(t,e){t.setClickableIcons(e)},heading:function(t,e){t.setHeading(e)},mapTypeId:function(t,e){t.setMapTypeId(e)},options:function(t,e){t.setOptions(e)},streetView:function(t,e){t.setStreetView(e)},tilt:function(t,e){t.setTilt(e)},zoom:function(t,e){t.setZoom(e)}};function z4(t){var e=t.children,n=t.options,r=t.id,i=t.mapContainerStyle,o=t.mapContainerClassName,s=t.center,a=t.onClick,l=t.onDblClick,u=t.onDrag,f=t.onDragEnd,d=t.onDragStart,h=t.onMouseMove,v=t.onMouseOut,y=t.onMouseOver,g=t.onMouseDown,S=t.onMouseUp,w=t.onRightClick,L=t.onCenterChanged,m=t.onLoad,_=t.onUnmount,E=c.useState(null),p=E[0],b=E[1],x=c.useRef(null),P=c.useState(null),O=P[0],T=P[1],M=c.useState(null),R=M[0],A=M[1],B=c.useState(null),V=B[0],N=B[1],z=c.useState(null),Y=z[0],G=z[1],H=c.useState(null),Q=H[0],oe=H[1],te=c.useState(null),ee=te[0],D=te[1],ve=c.useState(null),Pe=ve[0],Z=ve[1],De=c.useState(null),Ae=De[0],ue=De[1],_e=c.useState(null),Ve=_e[0],Ce=_e[1],Me=c.useState(null),Ie=Me[0],ke=Me[1],je=c.useState(null),ie=je[0],We=je[1],re=c.useState(null),nt=re[0],q=re[1];return c.useEffect(function(){n&&p!==null&&p.setOptions(n)},[p,n]),c.useEffect(function(){p!==null&&typeof s<"u"&&p.setCenter(s)},[p,s]),c.useEffect(function(){p&&l&&(R!==null&&google.maps.event.removeListener(R),A(google.maps.event.addListener(p,"dblclick",l)))},[l]),c.useEffect(function(){p&&f&&(V!==null&&google.maps.event.removeListener(V),N(google.maps.event.addListener(p,"dragend",f)))},[f]),c.useEffect(function(){p&&d&&(Y!==null&&google.maps.event.removeListener(Y),G(google.maps.event.addListener(p,"dragstart",d)))},[d]),c.useEffect(function(){p&&g&&(Q!==null&&google.maps.event.removeListener(Q),oe(google.maps.event.addListener(p,"mousedown",g)))},[g]),c.useEffect(function(){p&&h&&(ee!==null&&google.maps.event.removeListener(ee),D(google.maps.event.addListener(p,"mousemove",h)))},[h]),c.useEffect(function(){p&&v&&(Pe!==null&&google.maps.event.removeListener(Pe),Z(google.maps.event.addListener(p,"mouseout",v)))},[v]),c.useEffect(function(){p&&y&&(Ae!==null&&google.maps.event.removeListener(Ae),ue(google.maps.event.addListener(p,"mouseover",y)))},[y]),c.useEffect(function(){p&&S&&(Ve!==null&&google.maps.event.removeListener(Ve),Ce(google.maps.event.addListener(p,"mouseup",S)))},[S]),c.useEffect(function(){p&&w&&(Ie!==null&&google.maps.event.removeListener(Ie),ke(google.maps.event.addListener(p,"rightclick",w)))},[w]),c.useEffect(function(){p&&a&&(ie!==null&&google.maps.event.removeListener(ie),We(google.maps.event.addListener(p,"click",a)))},[a]),c.useEffect(function(){p&&u&&(nt!==null&&google.maps.event.removeListener(nt),q(google.maps.event.addListener(p,"drag",u)))},[u]),c.useEffect(function(){p&&L&&(O!==null&&google.maps.event.removeListener(O),T(google.maps.event.addListener(p,"center_changed",L)))},[a]),c.useEffect(function(){var Ge=x.current===null?null:new google.maps.Map(x.current,n);return b(Ge),Ge!==null&&m&&m(Ge),function(){Ge!==null&&_&&_(Ge)}},[]),C.jsx("div",{id:r,ref:x,style:i,className:o,children:C.jsx(le.Provider,{value:p,children:p!==null?e:null})})}c.memo(z4);var H4=function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={map:null},n.registeredEvents=[],n.mapRef=null,n.getInstance=function(){return n.mapRef===null?null:new google.maps.Map(n.mapRef,n.props.options)},n.panTo=function(r){var i=n.getInstance();i&&i.panTo(r)},n.setMapCallback=function(){n.state.map!==null&&n.props.onLoad&&n.props.onLoad(n.state.map)},n.getRef=function(r){n.mapRef=r},n}return e.prototype.componentDidMount=function(){var n=this.getInstance();this.registeredEvents=ce({updaterMap:Pc,eventMap:Oc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{map:n}},this.setMapCallback)},e.prototype.componentDidUpdate=function(n){this.state.map!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:Pc,eventMap:Oc,prevProps:n,nextProps:this.props,instance:this.state.map}))},e.prototype.componentWillUnmount=function(){this.state.map!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),he(this.registeredEvents))},e.prototype.render=function(){return C.jsx("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:C.jsx(le.Provider,{value:this.state.map,children:this.state.map!==null?this.props.children:null})})},e}(c.PureComponent),tr=typeof document<"u";function ap(t){var e=t.url,n=t.id,r=t.nonce;return tr?new Promise(function(o,s){var a=document.getElementById(n),l=window;if(a){var u=a.getAttribute("data-state");if(a.src===e&&u!=="error"){if(u==="ready")return o(n);var f=l.initMap,d=a.onerror;l.initMap=function(){f&&f(),o(n)},a.onerror=function(v){d&&d(v),s(v)};return}else a.remove()}var h=document.createElement("script");h.type="text/javascript",h.src=e,h.id=n,h.async=!0,h.nonce=r||"",h.onerror=function(y){h.setAttribute("data-state","error"),s(y)},l.initMap=function(){h.setAttribute("data-state","ready"),o(n)},document.head.appendChild(h)}).catch(function(i){throw console.error("injectScript error: ",i),i}):Promise.reject(new Error("document is undefined"))}function kc(t){var e=t.href;return e&&(e.indexOf("https://fonts.googleapis.com/css?family=Roboto")===0||e.indexOf("https://fonts.googleapis.com/css?family=Google+Sans+Text")===0)?!0:t.tagName.toLowerCase()==="style"&&t.styleSheet&&t.styleSheet.cssText&&t.styleSheet.cssText.replace(`\r
238
- `,"").indexOf(".gm-style")===0?(t.styleSheet.cssText="",!0):t.tagName.toLowerCase()==="style"&&t.innerHTML&&t.innerHTML.replace(`\r
239
- `,"").indexOf(".gm-style")===0?(t.innerHTML="",!0):t.tagName.toLowerCase()==="style"&&!t.styleSheet&&!t.innerHTML}function lp(){var t=document.getElementsByTagName("head")[0];if(t){var e=t.insertBefore.bind(t);t.insertBefore=function(i,o){return kc(i)||Reflect.apply(e,t,[i,o]),i};var n=t.appendChild.bind(t);t.appendChild=function(i){return kc(i)||Reflect.apply(n,t,[i]),i}}}function up(t){var e=t.googleMapsApiKey,n=t.googleMapsClientId,r=t.version,i=r===void 0?"weekly":r,o=t.language,s=t.region,a=t.libraries,l=t.channel,u=t.mapIds,f=t.authReferrerPolicy,d=[];return et(e&&n||!(e&&n),"You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time."),e?d.push("key=".concat(e)):n&&d.push("client=".concat(n)),i&&d.push("v=".concat(i)),o&&d.push("language=".concat(o)),s&&d.push("region=".concat(s)),a&&a.length&&d.push("libraries=".concat(a.sort().join(","))),l&&d.push("channel=".concat(l)),u&&u.length&&d.push("map_ids=".concat(u.join(","))),f&&d.push("auth_referrer_policy=".concat(f)),d.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?".concat(d.join("&"))}var mi=!1;function cp(){return C.jsx("div",{children:"Loading..."})}var ml={id:"script-loader",version:"weekly"};(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.check=c.createRef(),n.state={loaded:!1},n.cleanupCallback=function(){delete window.google.maps,n.injectScript()},n.isCleaningUp=function(){return R4(n,void 0,void 0,function(){function r(i){if(!mi)i();else if(tr)var o=window.setInterval(function(){mi||(window.clearInterval(o),i())},1)}return D4(this,function(i){return[2,new Promise(r)]})})},n.cleanup=function(){mi=!0;var r=document.getElementById(n.props.id);r&&r.parentNode&&r.parentNode.removeChild(r),Array.prototype.slice.call(document.getElementsByTagName("script")).filter(function(o){return typeof o.src=="string"&&o.src.includes("maps.googleapis")}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)}),Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(o){return o.href==="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)}),Array.prototype.slice.call(document.getElementsByTagName("style")).filter(function(o){return o.innerText!==void 0&&o.innerText.length>0&&o.innerText.includes(".gm-")}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)})},n.injectScript=function(){n.props.preventGoogleFontsLoading&&lp(),et(!!n.props.id,'LoadScript requires "id" prop to be a string: %s',n.props.id);var r={id:n.props.id,nonce:n.props.nonce,url:up(n.props)};ap(r).then(function(){n.props.onLoad&&n.props.onLoad(),n.setState(function(){return{loaded:!0}})}).catch(function(i){n.props.onError&&n.props.onError(i),console.error(`
240
- There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(n.props.googleMapsApiKey||"-",") or Client ID (").concat(n.props.googleMapsClientId||"-",`) to <LoadScript />
241
- Otherwise it is a Network issue.
242
- `))})},n}return e.prototype.componentDidMount=function(){if(tr){if(window.google&&window.google.maps&&!mi){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(r){console.error("Error at injecting script after cleaning up: ",r)})}},e.prototype.componentDidUpdate=function(n){this.props.libraries!==n.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),tr&&n.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))},e.prototype.componentWillUnmount=function(){var n=this;if(tr){this.cleanup();var r=function(){n.check.current||(delete window.google,mi=!1)};window.setTimeout(r,1),this.props.onUnmount&&this.props.onUnmount()}},e.prototype.render=function(){return C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||C.jsx(cp,{})]})},e.defaultProps=ml,e})(c.PureComponent);var Tc;function fp(t){var e=t.id,n=e===void 0?ml.id:e,r=t.version,i=r===void 0?ml.version:r,o=t.nonce,s=t.googleMapsApiKey,a=t.googleMapsClientId,l=t.language,u=t.region,f=t.libraries,d=t.preventGoogleFontsLoading,h=t.channel,v=t.mapIds,y=t.authReferrerPolicy,g=c.useRef(!1),S=c.useState(!1),w=S[0],L=S[1],m=c.useState(void 0),_=m[0],E=m[1];c.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]),c.useEffect(function(){tr&&d&&lp()},[d]),c.useEffect(function(){w&&et(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[w]);var p=up({version:i,googleMapsApiKey:s,googleMapsClientId:a,language:l,region:u,libraries:f,channel:h,mapIds:v,authReferrerPolicy:y});c.useEffect(function(){if(!tr)return;function P(){g.current&&(L(!0),Tc=p)}if(window.google&&window.google.maps&&Tc===p){P();return}ap({id:n,url:p,nonce:o}).then(P).catch(function(T){g.current&&E(T),console.warn(`
243
- There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(s||"-",") or Client ID (").concat(a||"-",`)
244
- Otherwise it is a Network issue.
245
- `)),console.error(T)})},[n,p,o]);var b=c.useRef();return c.useEffect(function(){b.current&&f!==b.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),b.current=f},[f]),{isLoaded:w,loadError:_,url:p}}var $4=C.jsx(cp,{});function W4(t){var e=t.loadingElement,n=t.onLoad,r=t.onError,i=t.onUnmount,o=t.children,s=Kl(t,["loadingElement","onLoad","onError","onUnmount","children"]),a=fp(s),l=a.isLoaded,u=a.loadError;return c.useEffect(function(){l&&typeof n=="function"&&n()},[l,n]),c.useEffect(function(){u&&typeof r=="function"&&r(u)},[u,r]),c.useEffect(function(){return function(){i&&i()}},[i]),l?o:e||$4}c.memo(W4);var Rc;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(Rc||(Rc={}));var Dc={},Ac={options:function(t,e){t.setOptions(e)}};function G4(t){var e=t.options,n=t.onLoad,r=t.onUnmount,i=c.useContext(le),o=c.useState(null),s=o[0],a=o[1];return c.useEffect(function(){s!==null&&s.setMap(i)},[i]),c.useEffect(function(){e&&s!==null&&s.setOptions(e)},[s,e]),c.useEffect(function(){var l=new google.maps.TrafficLayer(K(K({},e||{}),{map:i}));return a(l),n&&n(l),function(){s!==null&&(r&&r(s),s.setMap(null))}},[]),null}c.memo(G4);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={trafficLayer:null},n.setTrafficLayerCallback=function(){n.state.trafficLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.trafficLayer)},n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=new google.maps.TrafficLayer(K(K({},this.props.options||{}),{map:this.context}));this.registeredEvents=ce({updaterMap:Ac,eventMap:Dc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{trafficLayer:n}},this.setTrafficLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.trafficLayer!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:Ac,eventMap:Dc,prevProps:n,nextProps:this.props,instance:this.state.trafficLayer}))},e.prototype.componentWillUnmount=function(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),he(this.registeredEvents),this.state.trafficLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);function Z4(t){var e=t.onLoad,n=t.onUnmount,r=c.useContext(le),i=c.useState(null),o=i[0],s=i[1];return c.useEffect(function(){o!==null&&o.setMap(r)},[r]),c.useEffect(function(){var a=new google.maps.BicyclingLayer;return s(a),a.setMap(r),e&&e(a),function(){a!==null&&(n&&n(a),a.setMap(null))}},[]),null}c.memo(Z4);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={bicyclingLayer:null},n.setBicyclingLayerCallback=function(){n.state.bicyclingLayer!==null&&(n.state.bicyclingLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.bicyclingLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.BicyclingLayer;this.setState(function(){return{bicyclingLayer:n}},this.setBicyclingLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);function q4(t){var e=t.onLoad,n=t.onUnmount,r=c.useContext(le),i=c.useState(null),o=i[0],s=i[1];return c.useEffect(function(){o!==null&&o.setMap(r)},[r]),c.useEffect(function(){var a=new google.maps.TransitLayer;return s(a),a.setMap(r),e&&e(a),function(){o!==null&&(n&&n(o),o.setMap(null))}},[]),null}c.memo(q4);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={transitLayer:null},n.setTransitLayerCallback=function(){n.state.transitLayer!==null&&(n.state.transitLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.transitLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:n}},this.setTransitLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);var Ic={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},jc={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}};function K4(t){var e=t.options,n=t.drawingMode,r=t.onCircleComplete,i=t.onMarkerComplete,o=t.onOverlayComplete,s=t.onPolygonComplete,a=t.onPolylineComplete,l=t.onRectangleComplete,u=t.onLoad,f=t.onUnmount,d=c.useContext(le),h=c.useState(null),v=h[0],y=h[1],g=c.useState(null),S=g[0],w=g[1],L=c.useState(null),m=L[0],_=L[1],E=c.useState(null),p=E[0],b=E[1],x=c.useState(null),P=x[0],O=x[1],T=c.useState(null),M=T[0],R=T[1],A=c.useState(null),B=A[0],V=A[1];return c.useEffect(function(){v!==null&&v.setMap(d)},[d]),c.useEffect(function(){e&&v!==null&&v.setOptions(e)},[v,e]),c.useEffect(function(){v!==null&&v.setDrawingMode(n??null)},[v,n]),c.useEffect(function(){v&&r&&(S!==null&&google.maps.event.removeListener(S),w(google.maps.event.addListener(v,"circlecomplete",r)))},[v,r]),c.useEffect(function(){v&&i&&(m!==null&&google.maps.event.removeListener(m),_(google.maps.event.addListener(v,"markercomplete",i)))},[v,i]),c.useEffect(function(){v&&o&&(p!==null&&google.maps.event.removeListener(p),b(google.maps.event.addListener(v,"overlaycomplete",o)))},[v,o]),c.useEffect(function(){v&&s&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(v,"polygoncomplete",s)))},[v,s]),c.useEffect(function(){v&&a&&(M!==null&&google.maps.event.removeListener(M),R(google.maps.event.addListener(v,"polylinecomplete",a)))},[v,a]),c.useEffect(function(){v&&l&&(B!==null&&google.maps.event.removeListener(B),V(google.maps.event.addListener(v,"rectanglecomplete",l)))},[v,l]),c.useEffect(function(){et(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var N=new google.maps.drawing.DrawingManager(K(K({},e||{}),{map:d}));return n&&N.setDrawingMode(n),r&&w(google.maps.event.addListener(N,"circlecomplete",r)),i&&_(google.maps.event.addListener(N,"markercomplete",i)),o&&b(google.maps.event.addListener(N,"overlaycomplete",o)),s&&O(google.maps.event.addListener(N,"polygoncomplete",s)),a&&R(google.maps.event.addListener(N,"polylinecomplete",a)),l&&V(google.maps.event.addListener(N,"rectanglecomplete",l)),y(N),u&&u(N),function(){v!==null&&(S&&google.maps.event.removeListener(S),m&&google.maps.event.removeListener(m),p&&google.maps.event.removeListener(p),P&&google.maps.event.removeListener(P),M&&google.maps.event.removeListener(M),B&&google.maps.event.removeListener(B),f&&f(v),v.setMap(null))}},[]),null}c.memo(K4);(function(t){Ue(e,t);function e(n){var r=t.call(this,n)||this;return r.registeredEvents=[],r.state={drawingManager:null},r.setDrawingManagerCallback=function(){r.state.drawingManager!==null&&r.props.onLoad&&r.props.onLoad(r.state.drawingManager)},et(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),r}return e.prototype.componentDidMount=function(){var n=new google.maps.drawing.DrawingManager(K(K({},this.props.options||{}),{map:this.context}));this.registeredEvents=ce({updaterMap:jc,eventMap:Ic,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{drawingManager:n}},this.setDrawingManagerCallback)},e.prototype.componentDidUpdate=function(n){this.state.drawingManager!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:jc,eventMap:Ic,prevProps:n,nextProps:this.props,instance:this.state.drawingManager}))},e.prototype.componentWillUnmount=function(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),he(this.registeredEvents),this.state.drawingManager.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);var Nc={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},Bc={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},Ss={};function Q4(t){var e=t.position,n=t.options,r=t.clusterer,i=t.noClustererRedraw,o=t.children,s=t.draggable,a=t.visible,l=t.animation,u=t.clickable,f=t.cursor,d=t.icon,h=t.label,v=t.opacity,y=t.shape,g=t.title,S=t.zIndex,w=t.onClick,L=t.onDblClick,m=t.onDrag,_=t.onDragEnd,E=t.onDragStart,p=t.onMouseOut,b=t.onMouseOver,x=t.onMouseUp,P=t.onMouseDown,O=t.onRightClick,T=t.onClickableChanged,M=t.onCursorChanged,R=t.onAnimationChanged,A=t.onDraggableChanged,B=t.onFlatChanged,V=t.onIconChanged,N=t.onPositionChanged,z=t.onShapeChanged,Y=t.onTitleChanged,G=t.onVisibleChanged,H=t.onZindexChanged,Q=t.onLoad,oe=t.onUnmount,te=c.useContext(le),ee=c.useState(null),D=ee[0],ve=ee[1],Pe=c.useState(null),Z=Pe[0],De=Pe[1],Ae=c.useState(null),ue=Ae[0],_e=Ae[1],Ve=c.useState(null),Ce=Ve[0],Me=Ve[1],Ie=c.useState(null),ke=Ie[0],je=Ie[1],ie=c.useState(null),We=ie[0],re=ie[1],nt=c.useState(null),q=nt[0],Ge=nt[1],ze=c.useState(null),wt=ze[0],ct=ze[1],se=c.useState(null),Hn=se[0],co=se[1],Ut=c.useState(null),un=Ut[0],fo=Ut[1],j=c.useState(null),X=j[0],W=j[1],fe=c.useState(null),Ne=fe[0],Le=fe[1],Be=c.useState(null),Te=Be[0],He=Be[1],ae=c.useState(null),me=ae[0],gt=ae[1],cn=c.useState(null),ft=cn[0],tt=cn[1],Ct=c.useState(null),St=Ct[0],rt=Ct[1],Qt=c.useState(null),Vt=Qt[0],Lt=Qt[1],Cn=c.useState(null),fn=Cn[0],ii=Cn[1],oi=c.useState(null),vr=oi[0],si=oi[1],mr=c.useState(null),$n=mr[0],ai=mr[1],Sn=c.useState(null),Wn=Sn[0],Gn=Sn[1],Zn=c.useState(null),qn=Zn[0],li=Zn[1];c.useEffect(function(){D!==null&&D.setMap(te)},[te]),c.useEffect(function(){typeof n<"u"&&D!==null&&D.setOptions(n)},[D,n]),c.useEffect(function(){typeof s<"u"&&D!==null&&D.setDraggable(s)},[D,s]),c.useEffect(function(){e&&D!==null&&D.setPosition(e)},[D,e]),c.useEffect(function(){typeof a<"u"&&D!==null&&D.setVisible(a)},[D,a]),c.useEffect(function(){D==null||D.setAnimation(l)},[D,l]),c.useEffect(function(){D&&u!==void 0&&D.setClickable(u)},[D,u]),c.useEffect(function(){D&&f!==void 0&&D.setCursor(f)},[D,f]),c.useEffect(function(){D&&d!==void 0&&D.setIcon(d)},[D,d]),c.useEffect(function(){D&&h!==void 0&&D.setLabel(h)},[D,h]),c.useEffect(function(){D&&v!==void 0&&D.setOpacity(v)},[D,v]),c.useEffect(function(){D&&y!==void 0&&D.setShape(y)},[D,y]),c.useEffect(function(){D&&g!==void 0&&D.setTitle(g)},[D,g]),c.useEffect(function(){D&&S!==void 0&&D.setZIndex(S)},[D,S]),c.useEffect(function(){D&&L&&(Z!==null&&google.maps.event.removeListener(Z),De(google.maps.event.addListener(D,"dblclick",L)))},[L]),c.useEffect(function(){D&&_&&(ue!==null&&google.maps.event.removeListener(ue),_e(google.maps.event.addListener(D,"dragend",_)))},[_]),c.useEffect(function(){D&&E&&(Ce!==null&&google.maps.event.removeListener(Ce),Me(google.maps.event.addListener(D,"dragstart",E)))},[E]),c.useEffect(function(){D&&P&&(ke!==null&&google.maps.event.removeListener(ke),je(google.maps.event.addListener(D,"mousedown",P)))},[P]),c.useEffect(function(){D&&p&&(We!==null&&google.maps.event.removeListener(We),re(google.maps.event.addListener(D,"mouseout",p)))},[p]),c.useEffect(function(){D&&b&&(q!==null&&google.maps.event.removeListener(q),Ge(google.maps.event.addListener(D,"mouseover",b)))},[b]),c.useEffect(function(){D&&x&&(wt!==null&&google.maps.event.removeListener(wt),ct(google.maps.event.addListener(D,"mouseup",x)))},[x]),c.useEffect(function(){D&&O&&(Hn!==null&&google.maps.event.removeListener(Hn),co(google.maps.event.addListener(D,"rightclick",O)))},[O]),c.useEffect(function(){D&&w&&(un!==null&&google.maps.event.removeListener(un),fo(google.maps.event.addListener(D,"click",w)))},[w]),c.useEffect(function(){D&&m&&(X!==null&&google.maps.event.removeListener(X),W(google.maps.event.addListener(D,"drag",m)))},[m]),c.useEffect(function(){D&&T&&(Ne!==null&&google.maps.event.removeListener(Ne),Le(google.maps.event.addListener(D,"clickable_changed",T)))},[T]),c.useEffect(function(){D&&M&&(Te!==null&&google.maps.event.removeListener(Te),He(google.maps.event.addListener(D,"cursor_changed",M)))},[M]),c.useEffect(function(){D&&R&&(me!==null&&google.maps.event.removeListener(me),gt(google.maps.event.addListener(D,"animation_changed",R)))},[R]),c.useEffect(function(){D&&A&&(ft!==null&&google.maps.event.removeListener(ft),tt(google.maps.event.addListener(D,"draggable_changed",A)))},[A]),c.useEffect(function(){D&&B&&(St!==null&&google.maps.event.removeListener(St),rt(google.maps.event.addListener(D,"flat_changed",B)))},[B]),c.useEffect(function(){D&&V&&(Vt!==null&&google.maps.event.removeListener(Vt),Lt(google.maps.event.addListener(D,"icon_changed",V)))},[V]),c.useEffect(function(){D&&N&&(fn!==null&&google.maps.event.removeListener(fn),ii(google.maps.event.addListener(D,"position_changed",N)))},[N]),c.useEffect(function(){D&&z&&(vr!==null&&google.maps.event.removeListener(vr),si(google.maps.event.addListener(D,"shape_changed",z)))},[z]),c.useEffect(function(){D&&Y&&($n!==null&&google.maps.event.removeListener($n),ai(google.maps.event.addListener(D,"title_changed",Y)))},[Y]),c.useEffect(function(){D&&G&&(Wn!==null&&google.maps.event.removeListener(Wn),Gn(google.maps.event.addListener(D,"visible_changed",G)))},[G]),c.useEffect(function(){D&&H&&(qn!==null&&google.maps.event.removeListener(qn),li(google.maps.event.addListener(D,"zindex_changed",H)))},[H]),c.useEffect(function(){var Ln=K(K(K({},n||Ss),r?Ss:{map:te}),{position:e}),ne=new google.maps.Marker(Ln);return r?r.addMarker(ne,!!i):ne.setMap(te),e&&ne.setPosition(e),typeof a<"u"&&ne.setVisible(a),typeof s<"u"&&ne.setDraggable(s),typeof u<"u"&&ne.setClickable(u),typeof f=="string"&&ne.setCursor(f),d&&ne.setIcon(d),typeof h<"u"&&ne.setLabel(h),typeof v<"u"&&ne.setOpacity(v),y&&ne.setShape(y),typeof g=="string"&&ne.setTitle(g),typeof S=="number"&&ne.setZIndex(S),L&&De(google.maps.event.addListener(ne,"dblclick",L)),_&&_e(google.maps.event.addListener(ne,"dragend",_)),E&&Me(google.maps.event.addListener(ne,"dragstart",E)),P&&je(google.maps.event.addListener(ne,"mousedown",P)),p&&re(google.maps.event.addListener(ne,"mouseout",p)),b&&Ge(google.maps.event.addListener(ne,"mouseover",b)),x&&ct(google.maps.event.addListener(ne,"mouseup",x)),O&&co(google.maps.event.addListener(ne,"rightclick",O)),w&&fo(google.maps.event.addListener(ne,"click",w)),m&&W(google.maps.event.addListener(ne,"drag",m)),T&&Le(google.maps.event.addListener(ne,"clickable_changed",T)),M&&He(google.maps.event.addListener(ne,"cursor_changed",M)),R&&gt(google.maps.event.addListener(ne,"animation_changed",R)),A&&tt(google.maps.event.addListener(ne,"draggable_changed",A)),B&&rt(google.maps.event.addListener(ne,"flat_changed",B)),V&&Lt(google.maps.event.addListener(ne,"icon_changed",V)),N&&ii(google.maps.event.addListener(ne,"position_changed",N)),z&&si(google.maps.event.addListener(ne,"shape_changed",z)),Y&&ai(google.maps.event.addListener(ne,"title_changed",Y)),G&&Gn(google.maps.event.addListener(ne,"visible_changed",G)),H&&li(google.maps.event.addListener(ne,"zindex_changed",H)),ve(ne),Q&&Q(ne),function(){Z!==null&&google.maps.event.removeListener(Z),ue!==null&&google.maps.event.removeListener(ue),Ce!==null&&google.maps.event.removeListener(Ce),ke!==null&&google.maps.event.removeListener(ke),We!==null&&google.maps.event.removeListener(We),q!==null&&google.maps.event.removeListener(q),wt!==null&&google.maps.event.removeListener(wt),Hn!==null&&google.maps.event.removeListener(Hn),un!==null&&google.maps.event.removeListener(un),Ne!==null&&google.maps.event.removeListener(Ne),Te!==null&&google.maps.event.removeListener(Te),me!==null&&google.maps.event.removeListener(me),ft!==null&&google.maps.event.removeListener(ft),St!==null&&google.maps.event.removeListener(St),Vt!==null&&google.maps.event.removeListener(Vt),fn!==null&&google.maps.event.removeListener(fn),$n!==null&&google.maps.event.removeListener($n),Wn!==null&&google.maps.event.removeListener(Wn),qn!==null&&google.maps.event.removeListener(qn),oe&&oe(ne),r?r.removeMarker(ne,!!i):ne&&ne.setMap(null)}},[]);var ui=c.useMemo(function(){return o?c.Children.map(o,function(Ln){if(!c.isValidElement(Ln))return Ln;var ne=Ln;return c.cloneElement(ne,{anchor:D})}):null},[o,D]);return C.jsx(C.Fragment,{children:ui})||null}c.memo(Q4);var dp=function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=K(K(K({},this.props.options||Ss),this.props.clusterer?Ss:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(n),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=ce({updaterMap:Bc,eventMap:Nc,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)},e.prototype.componentDidUpdate=function(n){this.marker&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:Bc,eventMap:Nc,prevProps:n,nextProps:this.props,instance:this.marker}))},e.prototype.componentWillUnmount=function(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),he(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))},e.prototype.render=function(){var n=this,r=null;return this.props.children&&(r=c.Children.map(this.props.children,function(i){if(!c.isValidElement(i))return i;var o=i;return c.cloneElement(o,{anchor:n.marker})})),r||null},e.contextType=le,e}(c.PureComponent),J4=function(){function t(e,n){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=n,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(e.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return t.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},t.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},t.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var n=this.cluster.getClusterer();if(google.maps.event.trigger(n,"click",this.cluster),google.maps.event.trigger(n,"clusterclick",this.cluster),n.getZoomOnClick()){var r=n.getMaxZoom(),i=this.cluster.getBounds(),o=n.getMap();o!==null&&"fitBounds"in o&&o.fitBounds(i),this.timeOut=window.setTimeout(function(){var s=n.getMap();if(s!==null){"fitBounds"in s&&s.fitBounds(i);var a=s.getZoom()||0;r!==null&&a>r&&s.setZoom(r+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},t.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},t.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},t.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),(e=this.getPanes())===null||e===void 0||e.overlayMouseTarget.appendChild(this.div);var n=this.getMap();n!==null&&(this.boundsChangedListener=google.maps.event.addListener(n,"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),this.boundsChangedListener!==null&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),this.timeOut!==null&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},t.prototype.draw=function(){if(this.visible&&this.div!==null&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=e!==null?"".concat(e.y,"px"):"0",this.div.style.left=e!==null?"".concat(e.x,"px"):"0"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){var e,n,r,i,o,s;if(this.div&&this.center){var a=this.sums===null||typeof this.sums.title>"u"||this.sums.title===""?this.cluster.getClusterer().getTitle():this.sums.title,l=this.backgroundPosition.split(" "),u=parseInt(((e=l[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),f=parseInt(((n=l[1])===null||n===void 0?void 0:n.replace(/^\s+|\s+$/g,""))||"0",10),d=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(d!==null?"".concat(d.y,"px"):"0","; left: ").concat(d!==null?"".concat(d.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var h=document.createElement("img");h.alt=a,h.src=this.url,h.width=this.width,h.height=this.height,h.setAttribute("style","position: absolute; top: ".concat(f,"px; left: ").concat(u,"px")),this.cluster.getClusterer().enableRetinaIcons||(h.style.clip="rect(-".concat(f,"px, -").concat(u+this.width,"px, -").concat(f+this.height,", -").concat(u,")"));var v=document.createElement("div");v.setAttribute("style","position: absolute; top: ".concat(this.anchorText[0],"px; left: ").concat(this.anchorText[1],"px; color: ").concat(this.textColor,"; font-size: ").concat(this.textSize,"px; font-family: ").concat(this.fontFamily,"; font-weight: ").concat(this.fontWeight,"; fontStyle: ").concat(this.fontStyle,"; text-decoration: ").concat(this.textDecoration,"; text-align: center; width: ").concat(this.width,"px; line-height: ").concat(this.height,"px")),!((r=this.sums)===null||r===void 0)&&r.text&&(v.innerText="".concat((i=this.sums)===null||i===void 0?void 0:i.text)),!((o=this.sums)===null||o===void 0)&&o.html&&(v.innerHTML="".concat((s=this.sums)===null||s===void 0?void 0:s.html)),this.div.innerHTML="",this.div.appendChild(h),this.div.appendChild(v),this.div.title=a,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(e){this.sums=e;var n=this.cluster.getClusterer().getStyles(),r=n[Math.min(n.length-1,Math.max(0,e.index-1))];r&&(this.url=r.url,this.height=r.height,this.width=r.width,r.className&&(this.className="".concat(this.clusterClassName," ").concat(r.className)),this.anchorText=r.anchorText||[0,0],this.anchorIcon=r.anchorIcon||[this.height/2,this.width/2],this.textColor=r.textColor||"black",this.textSize=r.textSize||11,this.textDecoration=r.textDecoration||"none",this.fontWeight=r.fontWeight||"bold",this.fontStyle=r.fontStyle||"normal",this.fontFamily=r.fontFamily||"Arial,sans-serif",this.backgroundPosition=r.backgroundPosition||"0 0")},t.prototype.setCenter=function(e){this.center=e},t.prototype.getPosFromLatLng=function(e){var n=this.getProjection().fromLatLngToDivPixel(e);return n!==null&&(n.x-=this.anchorIcon[1],n.y-=this.anchorIcon[0]),n},t}(),Y4=function(){function t(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new J4(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),n=this.getMarkers(),r=0,i=n;r<i.length;r++){var o=i[r],s=o.getPosition();s&&e.extend(s)}return e},t.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},t.prototype.addMarker=function(e){var n;if(this.isMarkerAlreadyAdded(e))return!1;if(this.center){if(this.averageCenter){var r=e.getPosition();if(r){var i=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(i-1)+r.lat())/i,(this.center.lng()*(i-1)+r.lng())/i),this.calculateBounds()}}}else{var r=e.getPosition();r&&(this.center=r,this.calculateBounds())}e.isAdded=!0,this.markers.push(e);var o=this.markers.length,s=this.markerClusterer.getMaxZoom(),a=(n=this.map)===null||n===void 0?void 0:n.getZoom();if(s!==null&&typeof a<"u"&&a>s)e.getMap()!==this.map&&e.setMap(this.map);else if(o<this.minClusterSize)e.getMap()!==this.map&&e.setMap(this.map);else if(o===this.minClusterSize)for(var l=0,u=this.markers;l<u.length;l++){var f=u[l];f.setMap(null)}else e.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(e){if(this.bounds!==null){var n=e.getPosition();if(n)return this.bounds.contains(n)}return!1},t.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},t.prototype.updateIcon=function(){var e,n=this.markers.length,r=this.markerClusterer.getMaxZoom(),i=(e=this.map)===null||e===void 0?void 0:e.getZoom();if(r!==null&&typeof i<"u"&&i>r){this.clusterIcon.hide();return}if(n<this.minClusterSize){this.clusterIcon.hide();return}this.center&&this.clusterIcon.setCenter(this.center),this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers,this.markerClusterer.getStyles().length)),this.clusterIcon.show()},t.prototype.isMarkerAlreadyAdded=function(e){if(this.markers.includes)return this.markers.includes(e);for(var n=0;n<this.markers.length;n++)if(e===this.markers[n])return!0;return!1},t}();function X4(t,e){var n=t.length,r=n.toString().length,i=Math.min(r,e);return{text:n.toString(),index:i,title:""}}var ew=2e3,tw=500,nw="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",rw="png",iw=[53,56,66,78,90],ow="cluster",hp=function(){function t(e,n,r){n===void 0&&(n=[]),r===void 0&&(r={}),this.getMinimumClusterSize=this.getMinimumClusterSize.bind(this),this.setMinimumClusterSize=this.setMinimumClusterSize.bind(this),this.getEnableRetinaIcons=this.getEnableRetinaIcons.bind(this),this.setEnableRetinaIcons=this.setEnableRetinaIcons.bind(this),this.addToClosestCluster=this.addToClosestCluster.bind(this),this.getImageExtension=this.getImageExtension.bind(this),this.setImageExtension=this.setImageExtension.bind(this),this.getExtendedBounds=this.getExtendedBounds.bind(this),this.getAverageCenter=this.getAverageCenter.bind(this),this.setAverageCenter=this.setAverageCenter.bind(this),this.getTotalClusters=this.getTotalClusters.bind(this),this.fitMapToMarkers=this.fitMapToMarkers.bind(this),this.getIgnoreHidden=this.getIgnoreHidden.bind(this),this.setIgnoreHidden=this.setIgnoreHidden.bind(this),this.getClusterClass=this.getClusterClass.bind(this),this.setClusterClass=this.setClusterClass.bind(this),this.getTotalMarkers=this.getTotalMarkers.bind(this),this.getZoomOnClick=this.getZoomOnClick.bind(this),this.setZoomOnClick=this.setZoomOnClick.bind(this),this.getBatchSizeIE=this.getBatchSizeIE.bind(this),this.setBatchSizeIE=this.setBatchSizeIE.bind(this),this.createClusters=this.createClusters.bind(this),this.onZoomChanged=this.onZoomChanged.bind(this),this.getImageSizes=this.getImageSizes.bind(this),this.setImageSizes=this.setImageSizes.bind(this),this.getCalculator=this.getCalculator.bind(this),this.setCalculator=this.setCalculator.bind(this),this.removeMarkers=this.removeMarkers.bind(this),this.resetViewport=this.resetViewport.bind(this),this.getImagePath=this.getImagePath.bind(this),this.setImagePath=this.setImagePath.bind(this),this.pushMarkerTo=this.pushMarkerTo.bind(this),this.removeMarker=this.removeMarker.bind(this),this.clearMarkers=this.clearMarkers.bind(this),this.setupStyles=this.setupStyles.bind(this),this.getGridSize=this.getGridSize.bind(this),this.setGridSize=this.setGridSize.bind(this),this.getClusters=this.getClusters.bind(this),this.getMaxZoom=this.getMaxZoom.bind(this),this.setMaxZoom=this.setMaxZoom.bind(this),this.getMarkers=this.getMarkers.bind(this),this.addMarkers=this.addMarkers.bind(this),this.getStyles=this.getStyles.bind(this),this.setStyles=this.setStyles.bind(this),this.addMarker=this.addMarker.bind(this),this.onRemove=this.onRemove.bind(this),this.getTitle=this.getTitle.bind(this),this.setTitle=this.setTitle.bind(this),this.repaint=this.repaint.bind(this),this.onIdle=this.onIdle.bind(this),this.redraw=this.redraw.bind(this),this.onAdd=this.onAdd.bind(this),this.draw=this.draw.bind(this),this.extend=this.extend.bind(this),this.extend(t,google.maps.OverlayView),this.markers=[],this.clusters=[],this.listeners=[],this.activeMap=null,this.ready=!1,this.gridSize=r.gridSize||60,this.minClusterSize=r.minimumClusterSize||2,this.maxZoom=r.maxZoom||null,this.styles=r.styles||[],this.title=r.title||"",this.zoomOnClick=!0,r.zoomOnClick!==void 0&&(this.zoomOnClick=r.zoomOnClick),this.averageCenter=!1,r.averageCenter!==void 0&&(this.averageCenter=r.averageCenter),this.ignoreHidden=!1,r.ignoreHidden!==void 0&&(this.ignoreHidden=r.ignoreHidden),this.enableRetinaIcons=!1,r.enableRetinaIcons!==void 0&&(this.enableRetinaIcons=r.enableRetinaIcons),this.imagePath=r.imagePath||nw,this.imageExtension=r.imageExtension||rw,this.imageSizes=r.imageSizes||iw,this.calculator=r.calculator||X4,this.batchSize=r.batchSize||ew,this.batchSizeIE=r.batchSizeIE||tw,this.clusterClass=r.clusterClass||ow,navigator.userAgent.toLowerCase().indexOf("msie")!==-1&&(this.batchSize=this.batchSizeIE),this.timerRefStatic=null,this.setupStyles(),this.addMarkers(n,!0),this.setMap(e)}return t.prototype.onZoomChanged=function(){var e,n;this.resetViewport(!1),(((e=this.getMap())===null||e===void 0?void 0:e.getZoom())===(this.get("minZoom")||0)||((n=this.getMap())===null||n===void 0?void 0:n.getZoom())===this.get("maxZoom"))&&google.maps.event.trigger(this,"idle")},t.prototype.onIdle=function(){this.redraw()},t.prototype.onAdd=function(){var e=this.getMap();this.activeMap=e,this.ready=!0,this.repaint(),e!==null&&(this.listeners=[google.maps.event.addListener(e,"zoom_changed",this.onZoomChanged),google.maps.event.addListener(e,"idle",this.onIdle)])},t.prototype.onRemove=function(){for(var e=0,n=this.markers;e<n.length;e++){var r=n[e];r.getMap()!==this.activeMap&&r.setMap(this.activeMap)}for(var i=0,o=this.clusters;i<o.length;i++){var s=o[i];s.remove()}this.clusters=[];for(var a=0,l=this.listeners;a<l.length;a++){var u=l[a];google.maps.event.removeListener(u)}this.listeners=[],this.activeMap=null,this.ready=!1},t.prototype.draw=function(){},t.prototype.getMap=function(){return null},t.prototype.getPanes=function(){return null},t.prototype.getProjection=function(){return{fromContainerPixelToLatLng:function(){return null},fromDivPixelToLatLng:function(){return null},fromLatLngToContainerPixel:function(){return null},fromLatLngToDivPixel:function(){return null},getVisibleRegion:function(){return null},getWorldWidth:function(){return 0}}},t.prototype.setMap=function(){},t.prototype.addListener=function(){return{remove:function(){}}},t.prototype.bindTo=function(){},t.prototype.get=function(){},t.prototype.notify=function(){},t.prototype.set=function(){},t.prototype.setValues=function(){},t.prototype.unbind=function(){},t.prototype.unbindAll=function(){},t.prototype.setupStyles=function(){if(!(this.styles.length>0))for(var e=0;e<this.imageSizes.length;e++)this.styles.push({url:"".concat(this.imagePath+(e+1),".").concat(this.imageExtension),height:this.imageSizes[e]||0,width:this.imageSizes[e]||0})},t.prototype.fitMapToMarkers=function(){for(var e=this.getMarkers(),n=new google.maps.LatLngBounds,r=0,i=e;r<i.length;r++){var o=i[r],s=o.getPosition();s&&n.extend(s)}var a=this.getMap();a!==null&&"fitBounds"in a&&a.fitBounds(n)},t.prototype.getGridSize=function(){return this.gridSize},t.prototype.setGridSize=function(e){this.gridSize=e},t.prototype.getMinimumClusterSize=function(){return this.minClusterSize},t.prototype.setMinimumClusterSize=function(e){this.minClusterSize=e},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.setMaxZoom=function(e){this.maxZoom=e},t.prototype.getStyles=function(){return this.styles},t.prototype.setStyles=function(e){this.styles=e},t.prototype.getTitle=function(){return this.title},t.prototype.setTitle=function(e){this.title=e},t.prototype.getZoomOnClick=function(){return this.zoomOnClick},t.prototype.setZoomOnClick=function(e){this.zoomOnClick=e},t.prototype.getAverageCenter=function(){return this.averageCenter},t.prototype.setAverageCenter=function(e){this.averageCenter=e},t.prototype.getIgnoreHidden=function(){return this.ignoreHidden},t.prototype.setIgnoreHidden=function(e){this.ignoreHidden=e},t.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},t.prototype.setEnableRetinaIcons=function(e){this.enableRetinaIcons=e},t.prototype.getImageExtension=function(){return this.imageExtension},t.prototype.setImageExtension=function(e){this.imageExtension=e},t.prototype.getImagePath=function(){return this.imagePath},t.prototype.setImagePath=function(e){this.imagePath=e},t.prototype.getImageSizes=function(){return this.imageSizes},t.prototype.setImageSizes=function(e){this.imageSizes=e},t.prototype.getCalculator=function(){return this.calculator},t.prototype.setCalculator=function(e){this.calculator=e},t.prototype.getBatchSizeIE=function(){return this.batchSizeIE},t.prototype.setBatchSizeIE=function(e){this.batchSizeIE=e},t.prototype.getClusterClass=function(){return this.clusterClass},t.prototype.setClusterClass=function(e){this.clusterClass=e},t.prototype.getMarkers=function(){return this.markers},t.prototype.getTotalMarkers=function(){return this.markers.length},t.prototype.getClusters=function(){return this.clusters},t.prototype.getTotalClusters=function(){return this.clusters.length},t.prototype.addMarker=function(e,n){this.pushMarkerTo(e),n||this.redraw()},t.prototype.addMarkers=function(e,n){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];i&&this.pushMarkerTo(i)}n||this.redraw()},t.prototype.pushMarkerTo=function(e){var n=this;e.getDraggable()&&google.maps.event.addListener(e,"dragend",function(){n.ready&&(e.isAdded=!1,n.repaint())}),e.isAdded=!1,this.markers.push(e)},t.prototype.removeMarker_=function(e){var n=-1;if(this.markers.indexOf)n=this.markers.indexOf(e);else for(var r=0;r<this.markers.length;r++)if(e===this.markers[r]){n=r;break}return n===-1?!1:(e.setMap(null),this.markers.splice(n,1),!0)},t.prototype.removeMarker=function(e,n){var r=this.removeMarker_(e);return!n&&r&&this.repaint(),r},t.prototype.removeMarkers=function(e,n){for(var r=!1,i=0,o=e;i<o.length;i++){var s=o[i];r=r||this.removeMarker_(s)}return!n&&r&&this.repaint(),r},t.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]},t.prototype.repaint=function(){var e=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout(function(){for(var r=0,i=e;r<i.length;r++){var o=i[r];o.remove()}},0)},t.prototype.getExtendedBounds=function(e){var n=this.getProjection(),r=n.fromLatLngToDivPixel(new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()));r!==null&&(r.x+=this.gridSize,r.y-=this.gridSize);var i=n.fromLatLngToDivPixel(new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()));if(i!==null&&(i.x-=this.gridSize,i.y+=this.gridSize),r!==null){var o=n.fromDivPixelToLatLng(r);o!==null&&e.extend(o)}if(i!==null){var s=n.fromDivPixelToLatLng(i);s!==null&&e.extend(s)}return e},t.prototype.redraw=function(){this.createClusters(0)},t.prototype.resetViewport=function(e){for(var n=0,r=this.clusters;n<r.length;n++){var i=r[n];i.remove()}this.clusters=[];for(var o=0,s=this.markers;o<s.length;o++){var a=s[o];a.isAdded=!1,e&&a.setMap(null)}},t.prototype.distanceBetweenPoints=function(e,n){var r=6371,i=(n.lat()-e.lat())*Math.PI/180,o=(n.lng()-e.lng())*Math.PI/180,s=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(n.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return r*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))},t.prototype.isMarkerInBounds=function(e,n){var r=e.getPosition();return r?n.contains(r):!1},t.prototype.addToClosestCluster=function(e){for(var n,r=4e4,i=null,o=0,s=this.clusters;o<s.length;o++){var a=s[o];n=a;var l=n.getCenter(),u=e.getPosition();if(l&&u){var f=this.distanceBetweenPoints(l,u);f<r&&(r=f,i=n)}}i&&i.isMarkerInClusterBounds(e)?i.addMarker(e):(n=new Y4(this),n.addMarker(e),this.clusters.push(n))},t.prototype.createClusters=function(e){var n=this;if(this.ready){e===0&&(google.maps.event.trigger(this,"clusteringbegin",this),this.timerRefStatic!==null&&(window.clearTimeout(this.timerRefStatic),delete this.timerRefStatic));for(var r=this.getMap(),i=r!==null&&("getBounds"in r)?r.getBounds():null,o=(r==null?void 0:r.getZoom())||0,s=o>3?new google.maps.LatLngBounds(i==null?void 0:i.getSouthWest(),i==null?void 0:i.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),a=this.getExtendedBounds(s),l=Math.min(e+this.batchSize,this.markers.length),u=e;u<l;u++){var f=this.markers[u];f&&!f.isAdded&&this.isMarkerInBounds(f,a)&&(!this.ignoreHidden||this.ignoreHidden&&f.getVisible())&&this.addToClosestCluster(f)}if(l<this.markers.length)this.timerRefStatic=window.setTimeout(function(){n.createClusters(l)},0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);for(var d=0,h=this.clusters;d<h.length;d++){var v=h[d];v.updateIcon()}}}},t.prototype.extend=function(e,n){return(function(i){for(var o in i.prototype){var s=o;this.prototype[s]=i.prototype[s]}return this}).apply(e,[n])},t}(),Dt={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},xe={averageCenter:function(t,e){t.setAverageCenter(e)},batchSizeIE:function(t,e){t.setBatchSizeIE(e)},calculator:function(t,e){t.setCalculator(e)},clusterClass:function(t,e){t.setClusterClass(e)},enableRetinaIcons:function(t,e){t.setEnableRetinaIcons(e)},gridSize:function(t,e){t.setGridSize(e)},ignoreHidden:function(t,e){t.setIgnoreHidden(e)},imageExtension:function(t,e){t.setImageExtension(e)},imagePath:function(t,e){t.setImagePath(e)},imageSizes:function(t,e){t.setImageSizes(e)},maxZoom:function(t,e){t.setMaxZoom(e)},minimumClusterSize:function(t,e){t.setMinimumClusterSize(e)},styles:function(t,e){t.setStyles(e)},title:function(t,e){t.setTitle(e)},zoomOnClick:function(t,e){t.setZoomOnClick(e)}},sw={};function aw(t){var e=t.children,n=t.options,r=t.averageCenter,i=t.batchSizeIE,o=t.calculator,s=t.clusterClass,a=t.enableRetinaIcons,l=t.gridSize,u=t.ignoreHidden,f=t.imageExtension,d=t.imagePath,h=t.imageSizes,v=t.maxZoom,y=t.minimumClusterSize,g=t.styles,S=t.title,w=t.zoomOnClick,L=t.onClick,m=t.onClusteringBegin,_=t.onClusteringEnd,E=t.onMouseOver,p=t.onMouseOut,b=t.onLoad,x=t.onUnmount,P=c.useState(null),O=P[0],T=P[1],M=c.useContext(le),R=c.useState(null),A=R[0],B=R[1],V=c.useState(null),N=V[0],z=V[1],Y=c.useState(null),G=Y[0],H=Y[1],Q=c.useState(null),oe=Q[0],te=Q[1],ee=c.useState(null),D=ee[0],ve=ee[1];return c.useEffect(function(){O&&p&&(oe!==null&&google.maps.event.removeListener(oe),te(google.maps.event.addListener(O,Dt.onMouseOut,p)))},[p]),c.useEffect(function(){O&&E&&(D!==null&&google.maps.event.removeListener(D),ve(google.maps.event.addListener(O,Dt.onMouseOver,E)))},[E]),c.useEffect(function(){O&&L&&(A!==null&&google.maps.event.removeListener(A),B(google.maps.event.addListener(O,Dt.onClick,L)))},[L]),c.useEffect(function(){O&&m&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(O,Dt.onClusteringBegin,m)))},[m]),c.useEffect(function(){O&&_&&(G!==null&&google.maps.event.removeListener(G),z(google.maps.event.addListener(O,Dt.onClusteringEnd,_)))},[_]),c.useEffect(function(){typeof r<"u"&&O!==null&&xe.averageCenter(O,r)},[O,r]),c.useEffect(function(){typeof i<"u"&&O!==null&&xe.batchSizeIE(O,i)},[O,i]),c.useEffect(function(){typeof o<"u"&&O!==null&&xe.calculator(O,o)},[O,o]),c.useEffect(function(){typeof s<"u"&&O!==null&&xe.clusterClass(O,s)},[O,s]),c.useEffect(function(){typeof a<"u"&&O!==null&&xe.enableRetinaIcons(O,a)},[O,a]),c.useEffect(function(){typeof l<"u"&&O!==null&&xe.gridSize(O,l)},[O,l]),c.useEffect(function(){typeof u<"u"&&O!==null&&xe.ignoreHidden(O,u)},[O,u]),c.useEffect(function(){typeof f<"u"&&O!==null&&xe.imageExtension(O,f)},[O,f]),c.useEffect(function(){typeof d<"u"&&O!==null&&xe.imagePath(O,d)},[O,d]),c.useEffect(function(){typeof h<"u"&&O!==null&&xe.imageSizes(O,h)},[O,h]),c.useEffect(function(){typeof v<"u"&&O!==null&&xe.maxZoom(O,v)},[O,v]),c.useEffect(function(){typeof y<"u"&&O!==null&&xe.minimumClusterSize(O,y)},[O,y]),c.useEffect(function(){typeof g<"u"&&O!==null&&xe.styles(O,g)},[O,g]),c.useEffect(function(){typeof S<"u"&&O!==null&&xe.title(O,S)},[O,S]),c.useEffect(function(){typeof w<"u"&&O!==null&&xe.zoomOnClick(O,w)},[O,w]),c.useEffect(function(){if(M){var Pe=K({},n||sw),Z=new hp(M,[],Pe);return r&&xe.averageCenter(Z,r),i&&xe.batchSizeIE(Z,i),o&&xe.calculator(Z,o),s&&xe.clusterClass(Z,s),a&&xe.enableRetinaIcons(Z,a),l&&xe.gridSize(Z,l),u&&xe.ignoreHidden(Z,u),f&&xe.imageExtension(Z,f),d&&xe.imagePath(Z,d),h&&xe.imageSizes(Z,h),v&&xe.maxZoom(Z,v),y&&xe.minimumClusterSize(Z,y),g&&xe.styles(Z,g),S&&xe.title(Z,S),w&&xe.zoomOnClick(Z,w),p&&te(google.maps.event.addListener(Z,Dt.onMouseOut,p)),E&&ve(google.maps.event.addListener(Z,Dt.onMouseOver,E)),L&&B(google.maps.event.addListener(Z,Dt.onClick,L)),m&&z(google.maps.event.addListener(Z,Dt.onClusteringBegin,m)),_&&H(google.maps.event.addListener(Z,Dt.onClusteringEnd,_)),T(Z),b&&b(Z),function(){oe!==null&&google.maps.event.removeListener(oe),D!==null&&google.maps.event.removeListener(D),A!==null&&google.maps.event.removeListener(A),N!==null&&google.maps.event.removeListener(N),G!==null&&google.maps.event.removeListener(G),x&&x(Z)}}},[]),O!==null&&e(O)||null}c.memo(aw);var lw=function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={markerClusterer:null},n.setClustererCallback=function(){n.state.markerClusterer!==null&&n.props.onLoad&&n.props.onLoad(n.state.markerClusterer)},n}return e.prototype.componentDidMount=function(){if(this.context){var n=new hp(this.context,[],this.props.options);this.registeredEvents=ce({updaterMap:xe,eventMap:Dt,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{markerClusterer:n}},this.setClustererCallback)}},e.prototype.componentDidUpdate=function(n){this.state.markerClusterer&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:xe,eventMap:Dt,prevProps:n,nextProps:this.props,instance:this.state.markerClusterer}))},e.prototype.componentWillUnmount=function(){this.state.markerClusterer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),he(this.registeredEvents),this.state.markerClusterer.setMap(null))},e.prototype.render=function(){return this.state.markerClusterer!==null?this.props.children(this.state.markerClusterer):null},e.contextType=le,e}(c.PureComponent);function Fc(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}var pp=function(){function t(e){e===void 0&&(e={}),this.getCloseClickHandler=this.getCloseClickHandler.bind(this),this.closeClickHandler=this.closeClickHandler.bind(this),this.createInfoBoxDiv=this.createInfoBoxDiv.bind(this),this.addClickHandler=this.addClickHandler.bind(this),this.getCloseBoxImg=this.getCloseBoxImg.bind(this),this.getBoxWidths=this.getBoxWidths.bind(this),this.setBoxStyle=this.setBoxStyle.bind(this),this.setPosition=this.setPosition.bind(this),this.getPosition=this.getPosition.bind(this),this.setOptions=this.setOptions.bind(this),this.setContent=this.setContent.bind(this),this.setVisible=this.setVisible.bind(this),this.getContent=this.getContent.bind(this),this.getVisible=this.getVisible.bind(this),this.setZIndex=this.setZIndex.bind(this),this.getZIndex=this.getZIndex.bind(this),this.onRemove=this.onRemove.bind(this),this.panBox=this.panBox.bind(this),this.extend=this.extend.bind(this),this.close=this.close.bind(this),this.draw=this.draw.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.open=this.open.bind(this),this.extend(t,google.maps.OverlayView),this.content=e.content||"",this.disableAutoPan=e.disableAutoPan||!1,this.maxWidth=e.maxWidth||0,this.pixelOffset=e.pixelOffset||new google.maps.Size(0,0),this.position=e.position||new google.maps.LatLng(0,0),this.zIndex=e.zIndex||null,this.boxClass=e.boxClass||"infoBox",this.boxStyle=e.boxStyle||{},this.closeBoxMargin=e.closeBoxMargin||"2px",this.closeBoxURL=e.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",e.closeBoxURL===""&&(this.closeBoxURL=""),this.infoBoxClearance=e.infoBoxClearance||new google.maps.Size(1,1),typeof e.visible>"u"&&(typeof e.isHidden>"u"?e.visible=!0:e.visible=!e.isHidden),this.isHidden=!e.visible,this.alignBottom=e.alignBottom||!1,this.pane=e.pane||"floatPane",this.enableEventPropagation=e.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return t.prototype.createInfoBoxDiv=function(){var e=this,n=function(u){u.returnValue=!1,u.preventDefault&&u.preventDefault(),e.enableEventPropagation||Fc(u)};if(!this.div){this.div=document.createElement("div"),this.setBoxStyle(),typeof this.content=="string"?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var r=this.getPanes();if(r!==null&&r[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(this.maxWidth!==0&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var i=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-i.left-i.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var o=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],s=0,a=o;s<a.length;s++){var l=a[s];this.eventListeners.push(google.maps.event.addListener(this.div,l,Fc))}this.eventListeners.push(google.maps.event.addListener(this.div,"mouseover",function(){e.div&&(e.div.style.cursor="default")}))}this.contextListener=google.maps.event.addListener(this.div,"contextmenu",n),google.maps.event.trigger(this,"domready")}},t.prototype.getCloseBoxImg=function(){var e="";return this.closeBoxURL!==""&&(e='<img alt=""',e+=' aria-hidden="true"',e+=" src='"+this.closeBoxURL+"'",e+=" align=right",e+=" style='",e+=" position: relative;",e+=" cursor: pointer;",e+=" margin: "+this.closeBoxMargin+";",e+="'>"),e},t.prototype.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&this.closeBoxURL!==""?google.maps.event.addListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},t.prototype.closeClickHandler=function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),google.maps.event.trigger(this,"closeclick"),this.close()},t.prototype.getCloseClickHandler=function(){return this.closeClickHandler},t.prototype.panBox=function(e){if(this.div&&!e){var n=this.getMap();if(n instanceof google.maps.Map){var r=0,i=0,o=n.getBounds();o&&!o.contains(this.position)&&n.setCenter(this.position);var s=n.getDiv(),a=s.offsetWidth,l=s.offsetHeight,u=this.pixelOffset.width,f=this.pixelOffset.height,d=this.div.offsetWidth,h=this.div.offsetHeight,v=this.infoBoxClearance.width,y=this.infoBoxClearance.height,g=this.getProjection(),S=g.fromLatLngToContainerPixel(this.position);S!==null&&(S.x<-u+v?r=S.x+u-v:S.x+d+u+v>a&&(r=S.x+d+u+v-a),this.alignBottom?S.y<-f+y+h?i=S.y+f-y-h:S.y+f+y>l&&(i=S.y+f+y-l):S.y<-f+y?i=S.y+f-y:S.y+h+f+y>l&&(i=S.y+h+f+y-l)),r===0&&i===0||n.panBy(r,i)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.div.style[n]=e[n]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var r=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+r*100+')"',this.div.style.filter="alpha(opacity="+r*100+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",this.zIndex!==null&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},t.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var n=this.div.ownerDocument,r=n&&n.defaultView?n.defaultView.getComputedStyle(this.div,""):null;r&&(e.top=parseInt(r.borderTopWidth||"",10)||0,e.bottom=parseInt(r.borderBottomWidth||"",10)||0,e.left=parseInt(r.borderLeftWidth||"",10)||0,e.right=parseInt(r.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var i=this.div.currentStyle;i&&(e.top=parseInt(i.borderTopWidth||"",10)||0,e.bottom=parseInt(i.borderBottomWidth||"",10)||0,e.left=parseInt(i.borderLeftWidth||"",10)||0,e.right=parseInt(i.borderRightWidth||"",10)||0)}return e},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),n=e.fromLatLngToDivPixel(this.position);n!==null&&(this.div.style.left=n.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(n.y+this.pixelOffset.height)+"px":this.div.style.top=n.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.prototype.setOptions=function(e){e===void 0&&(e={}),typeof e.boxClass<"u"&&(this.boxClass=e.boxClass,this.setBoxStyle()),typeof e.boxStyle<"u"&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),typeof e.content<"u"&&this.setContent(e.content),typeof e.disableAutoPan<"u"&&(this.disableAutoPan=e.disableAutoPan),typeof e.maxWidth<"u"&&(this.maxWidth=e.maxWidth),typeof e.pixelOffset<"u"&&(this.pixelOffset=e.pixelOffset),typeof e.alignBottom<"u"&&(this.alignBottom=e.alignBottom),typeof e.position<"u"&&this.setPosition(e.position),typeof e.zIndex<"u"&&this.setZIndex(e.zIndex),typeof e.closeBoxMargin<"u"&&(this.closeBoxMargin=e.closeBoxMargin),typeof e.closeBoxURL<"u"&&(this.closeBoxURL=e.closeBoxURL),typeof e.infoBoxClearance<"u"&&(this.infoBoxClearance=e.infoBoxClearance),typeof e.isHidden<"u"&&(this.isHidden=e.isHidden),typeof e.visible<"u"&&(this.isHidden=!e.visible),typeof e.enableEventPropagation<"u"&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},t.prototype.setContent=function(e){this.content=e,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px",typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},t.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(e,n){var r=this;n&&(this.position=n.getPosition(),this.moveListener=google.maps.event.addListener(n,"position_changed",function(){var i=n.getPosition();r.setPosition(i)}),this.mapListener=google.maps.event.addListener(n,"map_changed",function(){r.setMap(n.map)})),this.setMap(e),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,n=this.eventListeners;e<n.length;e++){var r=n[e];google.maps.event.removeListener(r)}this.eventListeners=null}this.moveListener&&(google.maps.event.removeListener(this.moveListener),this.moveListener=null),this.mapListener&&(google.maps.event.removeListener(this.mapListener),this.mapListener=null),this.contextListener&&(google.maps.event.removeListener(this.contextListener),this.contextListener=null),this.setMap(null)},t.prototype.extend=function(e,n){return(function(i){for(var o in i.prototype)Object.prototype.hasOwnProperty.call(this,o)||(this.prototype[o]=i.prototype[o]);return this}).apply(e,[n])},t}(),Uc={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Vc={options:function(t,e){t.setOptions(e)},position:function(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},uw={};function cw(t){var e=t.children,n=t.anchor,r=t.options,i=t.position,o=t.zIndex,s=t.onCloseClick,a=t.onDomReady,l=t.onContentChanged,u=t.onPositionChanged,f=t.onZindexChanged,d=t.onLoad,h=t.onUnmount,v=c.useContext(le),y=c.useState(null),g=y[0],S=y[1],w=c.useState(null),L=w[0],m=w[1],_=c.useState(null),E=_[0],p=_[1],b=c.useState(null),x=b[0],P=b[1],O=c.useState(null),T=O[0],M=O[1],R=c.useState(null),A=R[0],B=R[1],V=c.useRef(null);return c.useEffect(function(){v&&g!==null&&(g.close(),n?g.open(v,n):g.getPosition()&&g.open(v))},[v,g,n]),c.useEffect(function(){r&&g!==null&&g.setOptions(r)},[g,r]),c.useEffect(function(){if(i&&g!==null){var N=i instanceof google.maps.LatLng?i:new google.maps.LatLng(i.lat,i.lng);g.setPosition(N)}},[i]),c.useEffect(function(){typeof o=="number"&&g!==null&&g.setZIndex(o)},[o]),c.useEffect(function(){g&&s&&(L!==null&&google.maps.event.removeListener(L),m(google.maps.event.addListener(g,"closeclick",s)))},[s]),c.useEffect(function(){g&&a&&(E!==null&&google.maps.event.removeListener(E),p(google.maps.event.addListener(g,"domready",a)))},[a]),c.useEffect(function(){g&&l&&(x!==null&&google.maps.event.removeListener(x),P(google.maps.event.addListener(g,"content_changed",l)))},[l]),c.useEffect(function(){g&&u&&(T!==null&&google.maps.event.removeListener(T),M(google.maps.event.addListener(g,"position_changed",u)))},[u]),c.useEffect(function(){g&&f&&(A!==null&&google.maps.event.removeListener(A),B(google.maps.event.addListener(g,"zindex_changed",f)))},[f]),c.useEffect(function(){if(v){var N=r||uw,z=N.position,Y=Kl(N,["position"]),G=void 0;z&&!(z instanceof google.maps.LatLng)&&(G=new google.maps.LatLng(z.lat,z.lng));var H=new pp(K(K({},Y),G?{position:G}:{}));V.current=document.createElement("div"),S(H),s&&m(google.maps.event.addListener(H,"closeclick",s)),a&&p(google.maps.event.addListener(H,"domready",a)),l&&P(google.maps.event.addListener(H,"content_changed",l)),u&&M(google.maps.event.addListener(H,"position_changed",u)),f&&B(google.maps.event.addListener(H,"zindex_changed",f)),H.setContent(V.current),n?H.open(v,n):H.getPosition()?H.open(v):et(!1,"You must provide either an anchor or a position prop for <InfoBox>."),d&&d(H)}return function(){g!==null&&(L&&google.maps.event.removeListener(L),x&&google.maps.event.removeListener(x),E&&google.maps.event.removeListener(E),T&&google.maps.event.removeListener(T),A&&google.maps.event.removeListener(A),h&&h(g),g.close())}},[]),V.current?ei.createPortal(c.Children.only(e),V.current):null}c.memo(cw);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoBox:null},n.open=function(r,i){i?n.context!==null&&r.open(n.context,i):r.getPosition()?n.context!==null&&r.open(n.context):et(!1,"You must provide either an anchor or a position prop for <InfoBox>.")},n.setInfoBoxCallback=function(){n.state.infoBox!==null&&n.containerElement!==null&&(n.state.infoBox.setContent(n.containerElement),n.open(n.state.infoBox,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoBox))},n}return e.prototype.componentDidMount=function(){var n=this.props.options||{},r=n.position,i=Kl(n,["position"]),o;r&&!(r instanceof google.maps.LatLng)&&(o=new google.maps.LatLng(r.lat,r.lng));var s=new pp(K(K({},i),o?{position:o}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=ce({updaterMap:Vc,eventMap:Uc,prevProps:{},nextProps:this.props,instance:s}),this.setState({infoBox:s},this.setInfoBoxCallback)},e.prototype.componentDidUpdate=function(n){var r=this.state.infoBox;r!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:Vc,eventMap:Uc,prevProps:n,nextProps:this.props,instance:r}))},e.prototype.componentWillUnmount=function(){var n=this.props.onUnmount,r=this.state.infoBox;r!==null&&(n&&n(r),he(this.registeredEvents),r.close())},e.prototype.render=function(){return this.containerElement?ei.createPortal(c.Children.only(this.props.children),this.containerElement):null},e.contextType=le,e})(c.PureComponent);var fw=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},zc=sp(fw);const Hc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],fa=1,yi=8;class Ql{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const i=r>>4;if(i!==fa)throw new Error(`Got v${i} data when expected v${fa}.`);const o=Hc[r&15];if(!o)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new Ql(a,s,o,e)}constructor(e,n=64,r=Float64Array,i){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=Hc.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,yi,e),this.coords=new this.ArrayType(this.data,yi+a+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(yi+s+a+l),this.ids=new this.IndexArrayType(this.data,yi,e),this.coords=new this.ArrayType(this.data,yi+a+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(fa<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=n,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return yl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,r,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:a}=this,l=[0,o.length-1,0],u=[];for(;l.length;){const f=l.pop()||0,d=l.pop()||0,h=l.pop()||0;if(d-h<=a){for(let S=h;S<=d;S++){const w=s[2*S],L=s[2*S+1];w>=e&&w<=r&&L>=n&&L<=i&&u.push(o[S])}continue}const v=h+d>>1,y=s[2*v],g=s[2*v+1];y>=e&&y<=r&&g>=n&&g<=i&&u.push(o[v]),(f===0?e<=y:n<=g)&&(l.push(h),l.push(v-1),l.push(1-f)),(f===0?r>=y:i>=g)&&(l.push(v+1),l.push(d),l.push(1-f))}return u}within(e,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:s}=this,a=[0,i.length-1,0],l=[],u=r*r;for(;a.length;){const f=a.pop()||0,d=a.pop()||0,h=a.pop()||0;if(d-h<=s){for(let S=h;S<=d;S++)$c(o[2*S],o[2*S+1],e,n)<=u&&l.push(i[S]);continue}const v=h+d>>1,y=o[2*v],g=o[2*v+1];$c(y,g,e,n)<=u&&l.push(i[v]),(f===0?e-r<=y:n-r<=g)&&(a.push(h),a.push(v-1),a.push(1-f)),(f===0?e+r>=y:n+r>=g)&&(a.push(v+1),a.push(d),a.push(1-f))}return l}}function yl(t,e,n,r,i,o){if(i-r<=n)return;const s=r+i>>1;gp(t,e,s,r,i,o),yl(t,e,n,r,s-1,1-o),yl(t,e,n,s+1,i,1-o)}function gp(t,e,n,r,i,o){for(;i>r;){if(i-r>600){const u=i-r+1,f=n-r+1,d=Math.log(u),h=.5*Math.exp(2*d/3),v=.5*Math.sqrt(d*h*(u-h)/u)*(f-u/2<0?-1:1),y=Math.max(r,Math.floor(n-f*h/u+v)),g=Math.min(i,Math.floor(n+(u-f)*h/u+v));gp(t,e,n,y,g,o)}const s=e[2*n+o];let a=r,l=i;for(bi(t,e,r,n),e[2*i+o]>s&&bi(t,e,r,i);a<l;){for(bi(t,e,a,l),a++,l--;e[2*a+o]<s;)a++;for(;e[2*l+o]>s;)l--}e[2*r+o]===s?bi(t,e,r,l):(l++,bi(t,e,l,i)),l<=n&&(r=l+1),n<=l&&(i=l-1)}}function bi(t,e,n,r){da(t,n,r),da(e,2*n,2*r),da(e,2*n+1,2*r+1)}function da(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function $c(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}const dw={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},Wc=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),Qn=2,Pn=3,ha=4,Mn=5,vp=6;class hw{constructor(e){this.options=Object.assign(Object.create(dw),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:n,minZoom:r,maxZoom:i}=this.options;n&&console.time("total time");const o=`prepare ${e.length} points`;n&&console.time(o),this.points=e;const s=[];for(let l=0;l<e.length;l++){const u=e[l];if(!u.geometry)continue;const[f,d]=u.geometry.coordinates,h=Wc(Bo(f)),v=Wc(Fo(d));s.push(h,v,1/0,l,-1,1),this.options.reduce&&s.push(0)}let a=this.trees[i+1]=this._createTree(s);n&&console.timeEnd(o);for(let l=i;l>=r;l--){const u=+Date.now();a=this.trees[l]=this._createTree(this._cluster(a,l)),n&&console.log("z%d: %d clusters in %dms",l,a.numItems,+Date.now()-u)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let r=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const d=this.getClusters([r,i,180,s],n),h=this.getClusters([-180,i,o,s],n);return d.concat(h)}const a=this.trees[this._limitZoom(n)],l=a.range(Bo(r),Fo(s),Bo(o),Fo(i)),u=a.data,f=[];for(const d of l){const h=this.stride*d;f.push(u[h+Mn]>1?Gc(u,h,this.clusterProps):this.points[u[h+Pn]])}return f}getChildren(e){const n=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(i);const s=o.data;if(n*this.stride>=s.length)throw new Error(i);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=s[n*this.stride],u=s[n*this.stride+1],f=o.within(l,u,a),d=[];for(const h of f){const v=h*this.stride;s[v+ha]===e&&d.push(s[v+Mn]>1?Gc(s,v,this.clusterProps):this.points[s[v+Pn]])}if(d.length===0)throw new Error(i);return d}getLeaves(e,n,r){n=n||10,r=r||0;const i=[];return this._appendLeaves(i,e,n,r,0),i}getTile(e,n,r){const i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:s,radius:a}=this.options,l=a/s,u=(r-l)/o,f=(r+1+l)/o,d={features:[]};return this._addTileFeatures(i.range((n-l)/o,u,(n+1+l)/o,f),i.data,n,r,o,d),n===0&&this._addTileFeatures(i.range(1-l/o,u,1,f),i.data,o,r,o,d),n===o-1&&this._addTileFeatures(i.range(0,u,l/o,f),i.data,-1,r,o,d),d.features.length?d:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const r=this.getChildren(e);if(n++,r.length!==1)break;e=r[0].properties.cluster_id}return n}_appendLeaves(e,n,r,i,o){const s=this.getChildren(n);for(const a of s){const l=a.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(e,l.cluster_id,r,i,o):o<i?o++:e.push(a),e.length===r)break}return o}_createTree(e){const n=new Ql(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)n.add(e[r],e[r+1]);return n.finish(),n.data=e,n}_addTileFeatures(e,n,r,i,o,s){for(const a of e){const l=a*this.stride,u=n[l+Mn]>1;let f,d,h;if(u)f=mp(n,l,this.clusterProps),d=n[l],h=n[l+1];else{const g=this.points[n[l+Pn]];f=g.properties;const[S,w]=g.geometry.coordinates;d=Bo(S),h=Fo(w)}const v={type:1,geometry:[[Math.round(this.options.extent*(d*o-r)),Math.round(this.options.extent*(h*o-i))]],tags:f};let y;u||this.options.generateId?y=n[l+Pn]:y=this.points[n[l+Pn]].id,y!==void 0&&(v.id=y),s.features.push(v)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const{radius:r,extent:i,reduce:o,minPoints:s}=this.options,a=r/(i*Math.pow(2,n)),l=e.data,u=[],f=this.stride;for(let d=0;d<l.length;d+=f){if(l[d+Qn]<=n)continue;l[d+Qn]=n;const h=l[d],v=l[d+1],y=e.within(l[d],l[d+1],a),g=l[d+Mn];let S=g;for(const w of y){const L=w*f;l[L+Qn]>n&&(S+=l[L+Mn])}if(S>g&&S>=s){let w=h*g,L=v*g,m,_=-1;const E=((d/f|0)<<5)+(n+1)+this.points.length;for(const p of y){const b=p*f;if(l[b+Qn]<=n)continue;l[b+Qn]=n;const x=l[b+Mn];w+=l[b]*x,L+=l[b+1]*x,l[b+ha]=E,o&&(m||(m=this._map(l,d,!0),_=this.clusterProps.length,this.clusterProps.push(m)),o(m,this._map(l,b)))}l[d+ha]=E,u.push(w/S,L/S,1/0,E,-1,S),o&&u.push(_)}else{for(let w=0;w<f;w++)u.push(l[d+w]);if(S>1)for(const w of y){const L=w*f;if(!(l[L+Qn]<=n)){l[L+Qn]=n;for(let m=0;m<f;m++)u.push(l[L+m])}}}}return u}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,r){if(e[n+Mn]>1){const s=this.clusterProps[e[n+vp]];return r?Object.assign({},s):s}const i=this.points[e[n+Pn]].properties,o=this.options.map(i);return r&&o===i?Object.assign({},o):o}}function Gc(t,e,n){return{type:"Feature",id:t[e+Pn],properties:mp(t,e,n),geometry:{type:"Point",coordinates:[pw(t[e]),gw(t[e+1])]}}}function mp(t,e,n){const r=t[e+Mn],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=t[e+vp],s=o===-1?{}:Object.assign({},n[o]);return Object.assign(s,{cluster:!0,cluster_id:t[e+Pn],point_count:r,point_count_abbreviated:i})}function Bo(t){return t/360+.5}function Fo(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function pw(t){return(t-.5)*360}function gw(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! *****************************************************************************
246
- Copyright (c) Microsoft Corporation.
247
-
248
- Permission to use, copy, modify, and/or distribute this software for any
249
- purpose with or without fee is hereby granted.
250
-
251
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
252
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
253
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
254
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
255
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
256
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
257
- PERFORMANCE OF THIS SOFTWARE.
258
- ***************************************************************************** */function vw(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}class Tt{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,n){this.isAdvancedMarker(e)?e.map=n:e.setMap(n)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class bl{constructor({markers:e,position:n}){this.markers=e,n&&(n instanceof google.maps.LatLng?this._position=n:this._position=new google.maps.LatLng(n))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const n of this.markers)e.extend(Tt.getPosition(n));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>Tt.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(Tt.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class mw{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return yw(e)}}const yw=t=>t.map(n=>new bl({position:Tt.getPosition(n),markers:[n]}));class bw extends mw{constructor(e){var{maxZoom:n,radius:r=60}=e,i=vw(e,["maxZoom","radius"]);super({maxZoom:n}),this.state={zoom:-1},this.superCluster=new hw(Object.assign({maxZoom:this.maxZoom,radius:r},i))}calculate(e){let n=!1;const r={zoom:e.map.getZoom()};if(!zc(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const i=this.markers.map(o=>{const s=Tt.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[s.lng(),s.lat()]},properties:{marker:o}}});this.superCluster.load(i)}return n||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(n=!zc(this.state,r)),this.state=r,n&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:n}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,n]},properties:r}){if(r.cluster)return new bl({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:n,lng:e}});const i=r.marker;return new bl({markers:[i],position:Tt.getPosition(i)})}}class ww{constructor(e,n){this.markers={sum:e.length};const r=n.map(o=>o.count),i=r.reduce((o,s)=>o+s,0);this.clusters={count:n.length,markers:{mean:i/n.length,sum:i,min:Math.min(...r),max:Math.max(...r)}}}}class Cw{render({count:e,position:n},r,i){const s=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
224
+ </svg>`,Ke={PinPvz:Vb,PinHome:jb,PinOmnic:Fb,PinWeChip:Hb,PinOmnicSelected:Bb,PinWeChipSelected:$b,PinLlamaSelected:Ib,PinLlama:Nb,PointOmnic:zb,PointLlama:Ub,PointWeChip:qb},Sh=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...t},N.createElement("path",{fill:"currentcolor",d:"M12.5 8c0 .287-.108.573-.324.792l-6.789 6.88a1.095 1.095 0 0 1-1.563 0 1.131 1.131 0 0 1 0-1.585L9.83 8 3.824 1.913a1.131 1.131 0 0 1 0-1.585 1.095 1.095 0 0 1 1.564 0l6.789 6.88c.215.219.323.505.323.792Z"})),Gb="PointItem-module__point__-1jMFG",Wb="PointItem-module__pointButton__-wAVuy",Zb="PointItem-module__pointData__CrnHK9",Kb="PointItem-module__title__I5whAh",Qb="PointItem-module__address__tRkAx3",Jb="PointItem-module__arrow__AMAx4z",Xn={point:Gb,pointButton:Wb,pointData:Zb,title:Kb,address:Qb,arrow:Jb},Xb=({handleDetailsClick:t,handlePointClick:e,point:n})=>{const{iconType:r,palette:i,skipPointInfo:o}=be(),s=Fn("screenSm"),a=(i==null?void 0:i.primary)||"#fc0",c=function(){switch(r){case"omni-llama":return Ke.PointLlama;case"we-chip":return Ke.PointWeChip;default:return rr(Ke.PointOmnic,a)}}();function l(){e(n),!o&&!s&&t(n)}return w.jsx("li",{className:Xn.point,children:w.jsxs("button",{className:Xn.pointButton,type:"button",tabIndex:0,onClick:l,children:[w.jsx("div",{dangerouslySetInnerHTML:{__html:c}}),w.jsxs("div",{className:Xn.pointData,children:[w.jsx("h3",{className:Xn.title,children:n.name}),w.jsx("p",{className:Xn.address,children:n.location.full_address})]}),w.jsx("span",{className:Xn.arrow,children:w.jsx(Sh,{})})]})},n.uid)},Yb="SamePoints-module__container__oYvAF2",e4="SamePoints-module__header__nnMDp4",t4="SamePoints-module__closeButton__gd1RzT",n4="SamePoints-module__sameList__GhS89e",_o={container:Yb,header:e4,closeButton:t4,sameList:n4},r4=t=>{const{closeSamePoints:e,samePoints:n}=Rt(),{hideSearchInput:r}=be(),i=!!n.length;return w.jsxs("div",{className:_o.container,"data-visible":i,"data-hide-search-input":r,children:[w.jsx("div",{className:_o.header,children:w.jsx("button",{className:_o.closeButton,type:"button","aria-label":"Close points",tabIndex:0,onClick:e,children:w.jsx(Db,{})})}),w.jsx("ul",{className:_o.sameList,children:n.map(o=>w.jsx(Xb,{point:o,...t},o.uid))})]})};var Bi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Nn=typeof window>"u"||"Deno"in globalThis;function nt(){}function i4(t,e){return typeof t=="function"?t(e):t}function Ga(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ch(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ar(t,e){return typeof t=="function"?t(e):t}function dt(t,e){return typeof t=="function"?t(e):t}function yu(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=t;if(s){if(r){if(e.queryHash!==Mc(s,e.options))return!1}else if(!wi(e.queryKey,s))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||o&&!o(e))}function bu(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(bi(e.options.mutationKey)!==bi(o))return!1}else if(!wi(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Mc(t,e){return((e==null?void 0:e.queryKeyHashFn)||bi)(t)}function bi(t){return JSON.stringify(t,(e,n)=>Za(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function wi(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!wi(t[n],e[n])):!1}function Eh(t,e){if(t===e)return t;const n=wu(t)&&wu(e);if(n||Za(t)&&Za(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),s=o.length,a=n?[]:{};let c=0;for(let l=0;l<s;l++){const u=n?l:o[l];(!n&&r.includes(u)||n)&&t[u]===void 0&&e[u]===void 0?(a[u]=void 0,c++):(a[u]=Eh(t[u],e[u]),a[u]===t[u]&&t[u]!==void 0&&c++)}return i===s&&c===i?t:a}return e}function Wa(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function wu(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Za(t){if(!_u(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!_u(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function _u(t){return Object.prototype.toString.call(t)==="[object Object]"}function o4(t){return new Promise(e=>{setTimeout(e,t)})}function Ka(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Eh(t,e):e}function s4(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function a4(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var kc=Symbol();function xh(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===kc?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Cn,rn,lr,Zu,c4=(Zu=class extends Bi{constructor(){super();H(this,Cn,void 0);H(this,rn,void 0);H(this,lr,void 0);F(this,lr,e=>{if(!Nn&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,rn)||this.setEventListener(P(this,lr))}onUnsubscribe(){var e;this.hasListeners()||((e=P(this,rn))==null||e.call(this),F(this,rn,void 0))}setEventListener(e){var n;F(this,lr,e),(n=P(this,rn))==null||n.call(this),F(this,rn,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){P(this,Cn)!==e&&(F(this,Cn,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof P(this,Cn)=="boolean"?P(this,Cn):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Cn=new WeakMap,rn=new WeakMap,lr=new WeakMap,Zu),Dc=new c4,ur,on,fr,Ku,l4=(Ku=class extends Bi{constructor(){super();H(this,ur,!0);H(this,on,void 0);H(this,fr,void 0);F(this,fr,e=>{if(!Nn&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,on)||this.setEventListener(P(this,fr))}onUnsubscribe(){var e;this.hasListeners()||((e=P(this,on))==null||e.call(this),F(this,on,void 0))}setEventListener(e){var n;F(this,fr,e),(n=P(this,on))==null||n.call(this),F(this,on,e(this.setOnline.bind(this)))}setOnline(e){P(this,ur)!==e&&(F(this,ur,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return P(this,ur)}},ur=new WeakMap,on=new WeakMap,fr=new WeakMap,Ku),cs=new l4;function Qa(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function u4(t){return Math.min(1e3*2**t,3e4)}function Oh(t){return(t??"online")==="online"?cs.isOnline():!0}var Ph=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function ta(t){return t instanceof Ph}function Th(t){let e=!1,n=0,r=!1,i;const o=Qa(),s=h=>{var _;r||(d(new Ph(h)),(_=t.abort)==null||_.call(t))},a=()=>{e=!0},c=()=>{e=!1},l=()=>Dc.isFocused()&&(t.networkMode==="always"||cs.isOnline())&&t.canRun(),u=()=>Oh(t.networkMode)&&t.canRun(),f=h=>{var _;r||(r=!0,(_=t.onSuccess)==null||_.call(t,h),i==null||i(),o.resolve(h))},d=h=>{var _;r||(r=!0,(_=t.onError)==null||_.call(t,h),i==null||i(),o.reject(h))},y=()=>new Promise(h=>{var _;i=b=>{(r||l())&&h(b)},(_=t.onPause)==null||_.call(t)}).then(()=>{var h;i=void 0,r||(h=t.onContinue)==null||h.call(t)}),m=()=>{if(r)return;let h;const _=n===0?t.initialPromise:void 0;try{h=_??t.fn()}catch(b){h=Promise.reject(b)}Promise.resolve(h).then(f).catch(b=>{var g;if(r)return;const C=t.retry??(Nn?0:3),v=t.retryDelay??u4,E=typeof v=="function"?v(n,b):v,x=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,b);if(e||!x){d(b);return}n++,(g=t.onFail)==null||g.call(t,n,b),o4(E).then(()=>l()?void 0:y()).then(()=>{e?d(b):m()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?m():y().then(m),o)}}function f4(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const o=a=>{e?t.push(a):i(()=>{n(a)})},s=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||s()}return c},batchCalls:a=>(...c)=>{o(()=>{a(...c)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Re=f4(),En,Qu,Ah=(Qu=class{constructor(){H(this,En,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ga(this.gcTime)&&F(this,En,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Nn?1/0:5*60*1e3))}clearGcTimeout(){P(this,En)&&(clearTimeout(P(this,En)),F(this,En,void 0))}},En=new WeakMap,Qu),dr,hr,et,De,_i,xn,ft,It,Ju,d4=(Ju=class extends Ah{constructor(e){super();H(this,ft);H(this,dr,void 0);H(this,hr,void 0);H(this,et,void 0);H(this,De,void 0);H(this,_i,void 0);H(this,xn,void 0);F(this,xn,!1),F(this,_i,e.defaultOptions),this.setOptions(e.options),this.observers=[],F(this,et,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,F(this,dr,h4(this.options)),this.state=e.state??P(this,dr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=P(this,De))==null?void 0:e.promise}setOptions(e){this.options={...P(this,_i),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,et).remove(this)}setData(e,n){const r=Ka(this.state.data,e,this.options);return Q(this,ft,It).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Q(this,ft,It).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=P(this,De))==null?void 0:r.promise;return(i=P(this,De))==null||i.cancel(e),n?n.then(nt).catch(nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,dr))}isActive(){return this.observers.some(e=>dt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Ch(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=P(this,De))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=P(this,De))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),P(this,et).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(P(this,De)&&(P(this,xn)?P(this,De).cancel({revert:!0}):P(this,De).cancelRetry()),this.scheduleGc()),P(this,et).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Q(this,ft,It).call(this,{type:"invalidate"})}fetch(e,n){var c,l,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,De))return P(this,De).continueRetry(),P(this,De).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(F(this,xn,!0),r.signal)})},o=()=>{const f=xh(this.options,n),d={queryKey:this.queryKey,meta:this.meta};return i(d),F(this,xn,!1),this.options.persister?this.options.persister(f,d,this):f(d)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(c=this.options.behavior)==null||c.onFetch(s,this),F(this,hr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=s.fetchOptions)==null?void 0:l.meta))&&Q(this,ft,It).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=f=>{var d,y,m,h;ta(f)&&f.silent||Q(this,ft,It).call(this,{type:"error",error:f}),ta(f)||((y=(d=P(this,et).config).onError)==null||y.call(d,f,this),(h=(m=P(this,et).config).onSettled)==null||h.call(m,this.state.data,f,this)),this.scheduleGc()};return F(this,De,Th({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var d,y,m,h;if(f===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(_){a(_);return}(y=(d=P(this,et).config).onSuccess)==null||y.call(d,f,this),(h=(m=P(this,et).config).onSettled)==null||h.call(m,f,this.state.error,this),this.scheduleGc()},onError:a,onFail:(f,d)=>{Q(this,ft,It).call(this,{type:"failed",failureCount:f,error:d})},onPause:()=>{Q(this,ft,It).call(this,{type:"pause"})},onContinue:()=>{Q(this,ft,It).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),P(this,De).start()}},dr=new WeakMap,hr=new WeakMap,et=new WeakMap,De=new WeakMap,_i=new WeakMap,xn=new WeakMap,ft=new WeakSet,It=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Rh(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return ta(i)&&i.revert&&P(this,hr)?{...P(this,hr),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Re.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,et).notify({query:this,type:"updated",action:e})})},Ju);function Rh(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Oh(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function h4(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var St,Xu,p4=(Xu=class extends Bi{constructor(e={}){super();H(this,St,void 0);this.config=e,F(this,St,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??Mc(i,n);let s=this.get(o);return s||(s=new d4({cache:this,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){P(this,St).has(e.queryHash)||(P(this,St).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=P(this,St).get(e.queryHash);n&&(e.destroy(),n===e&&P(this,St).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Re.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return P(this,St).get(e)}getAll(){return[...P(this,St).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>yu(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>yu(e,r)):n}notify(e){Re.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Re.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Re.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},St=new WeakMap,Xu),Ct,Fe,On,Et,Qt,Yu,m4=(Yu=class extends Ah{constructor(e){super();H(this,Et);H(this,Ct,void 0);H(this,Fe,void 0);H(this,On,void 0);this.mutationId=e.mutationId,F(this,Fe,e.mutationCache),F(this,Ct,[]),this.state=e.state||g4(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){P(this,Ct).includes(e)||(P(this,Ct).push(e),this.clearGcTimeout(),P(this,Fe).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){F(this,Ct,P(this,Ct).filter(n=>n!==e)),this.scheduleGc(),P(this,Fe).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){P(this,Ct).length||(this.state.status==="pending"?this.scheduleGc():P(this,Fe).remove(this))}continue(){var e;return((e=P(this,On))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,s,a,c,l,u,f,d,y,m,h,_,b,C,v,E,x,g,S;F(this,On,Th({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(O,T)=>{Q(this,Et,Qt).call(this,{type:"failed",failureCount:O,error:T})},onPause:()=>{Q(this,Et,Qt).call(this,{type:"pause"})},onContinue:()=>{Q(this,Et,Qt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,Fe).canRun(this)}));const n=this.state.status==="pending",r=!P(this,On).canStart();try{if(!n){Q(this,Et,Qt).call(this,{type:"pending",variables:e,isPaused:r}),await((o=(i=P(this,Fe).config).onMutate)==null?void 0:o.call(i,e,this));const T=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,e));T!==this.state.context&&Q(this,Et,Qt).call(this,{type:"pending",context:T,variables:e,isPaused:r})}const O=await P(this,On).start();return await((l=(c=P(this,Fe).config).onSuccess)==null?void 0:l.call(c,O,e,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,O,e,this.state.context)),await((y=(d=P(this,Fe).config).onSettled)==null?void 0:y.call(d,O,null,this.state.variables,this.state.context,this)),await((h=(m=this.options).onSettled)==null?void 0:h.call(m,O,null,e,this.state.context)),Q(this,Et,Qt).call(this,{type:"success",data:O}),O}catch(O){try{throw await((b=(_=P(this,Fe).config).onError)==null?void 0:b.call(_,O,e,this.state.context,this)),await((v=(C=this.options).onError)==null?void 0:v.call(C,O,e,this.state.context)),await((x=(E=P(this,Fe).config).onSettled)==null?void 0:x.call(E,void 0,O,this.state.variables,this.state.context,this)),await((S=(g=this.options).onSettled)==null?void 0:S.call(g,void 0,O,e,this.state.context)),O}finally{Q(this,Et,Qt).call(this,{type:"error",error:O})}}finally{P(this,Fe).runNext(this)}}},Ct=new WeakMap,Fe=new WeakMap,On=new WeakMap,Et=new WeakSet,Qt=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Re.batch(()=>{P(this,Ct).forEach(r=>{r.onMutationUpdate(e)}),P(this,Fe).notify({mutation:this,type:"updated",action:e})})},Yu);function g4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ze,Si,ef,v4=(ef=class extends Bi{constructor(e={}){super();H(this,Ze,void 0);H(this,Si,void 0);this.config=e,F(this,Ze,new Map),F(this,Si,Date.now())}build(e,n,r){const i=new m4({mutationCache:this,mutationId:++Qi(this,Si)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){const n=So(e),r=P(this,Ze).get(n)??[];r.push(e),P(this,Ze).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=So(e);if(P(this,Ze).has(n)){const i=(r=P(this,Ze).get(n))==null?void 0:r.filter(o=>o!==e);i&&(i.length===0?P(this,Ze).delete(n):P(this,Ze).set(n,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=P(this,Ze).get(So(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=P(this,Ze).get(So(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Re.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...P(this,Ze).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>bu(n,r))}findAll(e={}){return this.getAll().filter(n=>bu(e,n))}notify(e){Re.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Re.batch(()=>Promise.all(e.map(n=>n.continue().catch(nt))))}},Ze=new WeakMap,Si=new WeakMap,ef);function So(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function Su(t){return{onFetch:(e,n)=>{var u,f,d,y,m;const r=e.options,i=(d=(f=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:d.direction,o=((y=e.state.data)==null?void 0:y.pages)||[],s=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let h=!1;const _=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},b=xh(e.options,e.fetchOptions),C=async(v,E,x)=>{if(h)return Promise.reject();if(E==null&&v.pages.length)return Promise.resolve(v);const g={queryKey:e.queryKey,pageParam:E,direction:x?"backward":"forward",meta:e.options.meta};_(g);const S=await b(g),{maxPages:O}=e.options,T=x?a4:s4;return{pages:T(v.pages,S,O),pageParams:T(v.pageParams,E,O)}};if(i&&o.length){const v=i==="backward",E=v?y4:Cu,x={pages:o,pageParams:s},g=E(r,x);a=await C(x,g,v)}else{const v=t??o.length;do{const E=c===0?s[0]??r.initialPageParam:Cu(r,a);if(c>0&&E==null)break;a=await C(a,E),c++}while(c<v)}return a};e.options.persister?e.fetchFn=()=>{var h,_;return(_=(h=e.options).persister)==null?void 0:_.call(h,l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=l}}}function Cu(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function y4(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var we,sn,an,pr,mr,cn,gr,vr,tf,b4=(tf=class{constructor(t={}){H(this,we,void 0);H(this,sn,void 0);H(this,an,void 0);H(this,pr,void 0);H(this,mr,void 0);H(this,cn,void 0);H(this,gr,void 0);H(this,vr,void 0);F(this,we,t.queryCache||new p4),F(this,sn,t.mutationCache||new v4),F(this,an,t.defaultOptions||{}),F(this,pr,new Map),F(this,mr,new Map),F(this,cn,0)}mount(){Qi(this,cn)._++,P(this,cn)===1&&(F(this,gr,Dc.subscribe(async t=>{t&&(await this.resumePausedMutations(),P(this,we).onFocus())})),F(this,vr,cs.subscribe(async t=>{t&&(await this.resumePausedMutations(),P(this,we).onOnline())})))}unmount(){var t,e;Qi(this,cn)._--,P(this,cn)===0&&((t=P(this,gr))==null||t.call(this),F(this,gr,void 0),(e=P(this,vr))==null||e.call(this),F(this,vr,void 0))}isFetching(t){return P(this,we).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return P(this,sn).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=P(this,we).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=P(this,we).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(ar(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return P(this,we).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=P(this,we).get(r.queryHash),o=i==null?void 0:i.state.data,s=i4(e,o);if(s!==void 0)return P(this,we).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(t,e,n){return Re.batch(()=>P(this,we).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=P(this,we).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=P(this,we);Re.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=P(this,we),r={type:"active",...t};return Re.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=Re.batch(()=>P(this,we).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(nt).catch(nt)}invalidateQueries(t={},e={}){return Re.batch(()=>{if(P(this,we).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=Re.batch(()=>P(this,we).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(nt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(nt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=P(this,we).build(this,e);return n.isStaleByTime(ar(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(nt).catch(nt)}fetchInfiniteQuery(t){return t.behavior=Su(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(nt).catch(nt)}ensureInfiniteQueryData(t){return t.behavior=Su(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return cs.isOnline()?P(this,sn).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,we)}getMutationCache(){return P(this,sn)}getDefaultOptions(){return P(this,an)}setDefaultOptions(t){F(this,an,t)}setQueryDefaults(t,e){P(this,pr).set(bi(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...P(this,pr).values()];let n={};return e.forEach(r=>{wi(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){P(this,mr).set(bi(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...P(this,mr).values()];let n={};return e.forEach(r=>{wi(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...P(this,an).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Mc(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===kc&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...P(this,an).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){P(this,we).clear(),P(this,sn).clear()}},we=new WeakMap,sn=new WeakMap,an=new WeakMap,pr=new WeakMap,mr=new WeakMap,cn=new WeakMap,gr=new WeakMap,vr=new WeakMap,tf),ze,J,Ci,Be,Pn,yr,ln,xt,Ei,br,wr,Tn,An,un,_r,Rn,ei,xi,Ja,Oi,Xa,Pi,Ya,Ti,ec,Ai,tc,Ri,nc,Li,rc,fs,Lh,nf,w4=(nf=class extends Bi{constructor(e,n){super();H(this,Rn);H(this,xi);H(this,Oi);H(this,Pi);H(this,Ti);H(this,Ai);H(this,Ri);H(this,Li);H(this,fs);H(this,ze,void 0);H(this,J,void 0);H(this,Ci,void 0);H(this,Be,void 0);H(this,Pn,void 0);H(this,yr,void 0);H(this,ln,void 0);H(this,xt,void 0);H(this,Ei,void 0);H(this,br,void 0);H(this,wr,void 0);H(this,Tn,void 0);H(this,An,void 0);H(this,un,void 0);H(this,_r,new Set);this.options=n,F(this,ze,e),F(this,xt,null),F(this,ln,Qa()),this.options.experimental_prefetchInRender||P(this,ln).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,J).addObserver(this),Eu(P(this,J),this.options)?Q(this,Rn,ei).call(this):this.updateResult(),Q(this,Ti,ec).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ic(P(this,J),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ic(P(this,J),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Q(this,Ai,tc).call(this),Q(this,Ri,nc).call(this),P(this,J).removeObserver(this)}setOptions(e,n){const r=this.options,i=P(this,J);if(this.options=P(this,ze).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof dt(this.options.enabled,P(this,J))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Q(this,Li,rc).call(this),P(this,J).setOptions(this.options),r._defaulted&&!Wa(this.options,r)&&P(this,ze).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,J),observer:this});const o=this.hasListeners();o&&xu(P(this,J),i,this.options,r)&&Q(this,Rn,ei).call(this),this.updateResult(n),o&&(P(this,J)!==i||dt(this.options.enabled,P(this,J))!==dt(r.enabled,P(this,J))||ar(this.options.staleTime,P(this,J))!==ar(r.staleTime,P(this,J)))&&Q(this,xi,Ja).call(this);const s=Q(this,Oi,Xa).call(this);o&&(P(this,J)!==i||dt(this.options.enabled,P(this,J))!==dt(r.enabled,P(this,J))||s!==P(this,un))&&Q(this,Pi,Ya).call(this,s)}getOptimisticResult(e){const n=P(this,ze).getQueryCache().build(P(this,ze),e),r=this.createResult(n,e);return S4(this,r)&&(F(this,Be,r),F(this,yr,this.options),F(this,Pn,P(this,J).state)),r}getCurrentResult(){return P(this,Be)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){P(this,_r).add(e)}getCurrentQuery(){return P(this,J)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=P(this,ze).defaultQueryOptions(e),r=P(this,ze).getQueryCache().build(P(this,ze),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Q(this,Rn,ei).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Be)))}createResult(e,n){var O;const r=P(this,J),i=this.options,o=P(this,Be),s=P(this,Pn),a=P(this,yr),l=e!==r?e.state:P(this,Ci),{state:u}=e;let f={...u},d=!1,y;if(n._optimisticResults){const T=this.hasListeners(),R=!T&&Eu(e,n),L=T&&xu(e,r,n,i);(R||L)&&(f={...f,...Rh(u.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:h,status:_}=f;if(n.select&&f.data!==void 0)if(o&&f.data===(s==null?void 0:s.data)&&n.select===P(this,Ei))y=P(this,br);else try{F(this,Ei,n.select),y=n.select(f.data),y=Ka(o==null?void 0:o.data,y,n),F(this,br,y),F(this,xt,null)}catch(T){F(this,xt,T)}else y=f.data;if(n.placeholderData!==void 0&&y===void 0&&_==="pending"){let T;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=o.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((O=P(this,wr))==null?void 0:O.state.data,P(this,wr)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),F(this,xt,null)}catch(R){F(this,xt,R)}T!==void 0&&(_="success",y=Ka(o==null?void 0:o.data,T,n),d=!0)}P(this,xt)&&(m=P(this,xt),y=P(this,br),h=Date.now(),_="error");const b=f.fetchStatus==="fetching",C=_==="pending",v=_==="error",E=C&&b,x=y!==void 0,S={status:_,fetchStatus:f.fetchStatus,isPending:C,isSuccess:_==="success",isError:v,isInitialLoading:E,isLoading:E,data:y,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!C,isLoadingError:v&&!x,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:v&&x,isStale:jc(e,n),refetch:this.refetch,promise:P(this,ln)};if(this.options.experimental_prefetchInRender){const T=A=>{S.status==="error"?A.reject(S.error):S.data!==void 0&&A.resolve(S.data)},R=()=>{const A=F(this,ln,S.promise=Qa());T(A)},L=P(this,ln);switch(L.status){case"pending":e.queryHash===r.queryHash&&T(L);break;case"fulfilled":(S.status==="error"||S.data!==L.value)&&R();break;case"rejected":(S.status!=="error"||S.error!==L.reason)&&R();break}}return S}updateResult(e){const n=P(this,Be),r=this.createResult(P(this,J),this.options);if(F(this,Pn,P(this,J).state),F(this,yr,this.options),P(this,Pn).data!==void 0&&F(this,wr,P(this,J)),Wa(r,n))return;F(this,Be,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!P(this,_r).size)return!0;const c=new Set(a??P(this,_r));return this.options.throwOnError&&c.add("error"),Object.keys(P(this,Be)).some(l=>{const u=l;return P(this,Be)[u]!==n[u]&&c.has(u)})};(e==null?void 0:e.listeners)!==!1&&o()&&(i.listeners=!0),Q(this,fs,Lh).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Q(this,Ti,ec).call(this)}},ze=new WeakMap,J=new WeakMap,Ci=new WeakMap,Be=new WeakMap,Pn=new WeakMap,yr=new WeakMap,ln=new WeakMap,xt=new WeakMap,Ei=new WeakMap,br=new WeakMap,wr=new WeakMap,Tn=new WeakMap,An=new WeakMap,un=new WeakMap,_r=new WeakMap,Rn=new WeakSet,ei=function(e){Q(this,Li,rc).call(this);let n=P(this,J).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(nt)),n},xi=new WeakSet,Ja=function(){Q(this,Ai,tc).call(this);const e=ar(this.options.staleTime,P(this,J));if(Nn||P(this,Be).isStale||!Ga(e))return;const r=Ch(P(this,Be).dataUpdatedAt,e)+1;F(this,Tn,setTimeout(()=>{P(this,Be).isStale||this.updateResult()},r))},Oi=new WeakSet,Xa=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,J)):this.options.refetchInterval)??!1},Pi=new WeakSet,Ya=function(e){Q(this,Ri,nc).call(this),F(this,un,e),!(Nn||dt(this.options.enabled,P(this,J))===!1||!Ga(P(this,un))||P(this,un)===0)&&F(this,An,setInterval(()=>{(this.options.refetchIntervalInBackground||Dc.isFocused())&&Q(this,Rn,ei).call(this)},P(this,un)))},Ti=new WeakSet,ec=function(){Q(this,xi,Ja).call(this),Q(this,Pi,Ya).call(this,Q(this,Oi,Xa).call(this))},Ai=new WeakSet,tc=function(){P(this,Tn)&&(clearTimeout(P(this,Tn)),F(this,Tn,void 0))},Ri=new WeakSet,nc=function(){P(this,An)&&(clearInterval(P(this,An)),F(this,An,void 0))},Li=new WeakSet,rc=function(){const e=P(this,ze).getQueryCache().build(P(this,ze),this.options);if(e===P(this,J))return;const n=P(this,J);F(this,J,e),F(this,Ci,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},fs=new WeakSet,Lh=function(e){Re.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(P(this,Be))}),P(this,ze).getQueryCache().notify({query:P(this,J),type:"observerResultsUpdated"})})},nf);function _4(t,e){return dt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Eu(t,e){return _4(t,e)||t.state.data!==void 0&&ic(t,e,e.refetchOnMount)}function ic(t,e,n){if(dt(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&jc(t,e)}return!1}function xu(t,e,n,r){return(t!==e||dt(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&jc(t,n)}function jc(t,e){return dt(e.enabled,t)!==!1&&t.isStaleByTime(ar(e.staleTime,t))}function S4(t,e){return!Wa(t.getCurrentResult(),e)}var Mh=N.createContext(void 0),C4=t=>{const e=N.useContext(Mh);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},E4=({client:t,children:e})=>(N.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(Mh.Provider,{value:t,children:e})),kh=N.createContext(!1),x4=()=>N.useContext(kh);kh.Provider;function O4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var P4=N.createContext(O4()),T4=()=>N.useContext(P4);function A4(t,e){return typeof t=="function"?t(...e):!!t}function R4(){}var L4=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},M4=t=>{N.useEffect(()=>{t.clearReset()},[t])},k4=({result:t,errorResetBoundary:e,throwOnError:n,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&A4(n,[t.error,r]),D4=t=>{t.suspense&&(t.staleTime===void 0&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},j4=(t,e)=>t.isLoading&&t.isFetching&&!e,N4=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Ou=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function I4(t,e,n){var u,f,d,y,m;const r=C4(n),i=x4(),o=T4(),s=r.defaultQueryOptions(t);(f=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||f.call(u,s),s._optimisticResults=i?"isRestoring":"optimistic",D4(s),L4(s,o),M4(o);const a=!r.getQueryCache().get(s.queryHash),[c]=N.useState(()=>new e(r,s)),l=c.getOptimisticResult(s);if(N.useSyncExternalStore(N.useCallback(h=>{const _=i?()=>{}:c.subscribe(Re.batchCalls(h));return c.updateResult(),_},[c,i]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setOptions(s,{listeners:!1})},[s,c]),N4(s,l))throw Ou(s,c,o);if(k4({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;if((y=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||y.call(d,s,l),s.experimental_prefetchInRender&&!Nn&&j4(l,i)){const h=a?Ou(s,c,o):(m=r.getQueryCache().get(s.queryHash))==null?void 0:m.promise;h==null||h.catch(R4).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?l:c.trackResult(l)}function Dh(t,e){return I4(t,w4,e)}async function F4(t){return(await Se.request({method:"GET",baseURL:"https://erpru.omnic.solutions",url:`/lms/hs/lms_ecomgate/points?project=5e50288b-3806-11ed-a300-a2873e29cd09&code=${t}`})).data.data}function B4(){const[t,e]=p.useState(""),{setLMSData:n,setLoading:r}=bs(),{data:i,isLoading:o}=Dh({queryKey:["lms-data",t],queryFn:()=>F4(t),enabled:!!t,refetchOnWindowFocus:!1,retry:2});return p.useEffect(()=>{const s=i==null?void 0:i.results[0];s&&n(s)},[i,n]),p.useEffect(()=>{r(o)},[o,r]),{getLMSData:e}}var V4=Object.getOwnPropertyNames,H4=Object.getOwnPropertySymbols,$4=Object.prototype.hasOwnProperty;function Pu(t,e){return function(r,i,o){return t(r,i,o)&&e(r,i,o)}}function Co(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var o=i.cache,s=o.get(n),a=o.get(r);if(s&&a)return s===r&&a===n;o.set(n,r),o.set(r,n);var c=t(n,r,i);return o.delete(n),o.delete(r),c}}function U4(t){return t!=null?t[Symbol.toStringTag]:void 0}function Tu(t){return V4(t).concat(H4(t))}var z4=Object.hasOwn||function(t,e){return $4.call(t,e)};function In(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var q4="__v",G4="__o",W4="_owner",Au=Object.getOwnPropertyDescriptor,Ru=Object.keys;function Z4(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function K4(t,e){return In(t.getTime(),e.getTime())}function Q4(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function J4(t,e){return t===e}function Lu(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.entries(),s,a,c=0;(s=o.next())&&!s.done;){for(var l=e.entries(),u=!1,f=0;(a=l.next())&&!a.done;){if(i[f]){f++;continue}var d=s.value,y=a.value;if(n.equals(d[0],y[0],c,f,t,e,n)&&n.equals(d[1],y[1],d[0],y[0],t,e,n)){u=i[f]=!0;break}f++}if(!u)return!1;c++}return!0}var X4=In;function Y4(t,e,n){var r=Ru(t),i=r.length;if(Ru(e).length!==i)return!1;for(;i-- >0;)if(!jh(t,e,n,r[i]))return!1;return!0}function Gr(t,e,n){var r=Tu(t),i=r.length;if(Tu(e).length!==i)return!1;for(var o,s,a;i-- >0;)if(o=r[i],!jh(t,e,n,o)||(s=Au(t,o),a=Au(e,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function e5(t,e){return In(t.valueOf(),e.valueOf())}function t5(t,e){return t.source===e.source&&t.flags===e.flags}function Mu(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.values(),s,a;(s=o.next())&&!s.done;){for(var c=e.values(),l=!1,u=0;(a=c.next())&&!a.done;){if(!i[u]&&n.equals(s.value,a.value,s.value,a.value,t,e,n)){l=i[u]=!0;break}u++}if(!l)return!1}return!0}function n5(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function r5(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function jh(t,e,n,r){return(r===W4||r===G4||r===q4)&&(t.$$typeof||e.$$typeof)?!0:z4(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var i5="[object Arguments]",o5="[object Boolean]",s5="[object Date]",a5="[object Error]",c5="[object Map]",l5="[object Number]",u5="[object Object]",f5="[object RegExp]",d5="[object Set]",h5="[object String]",p5="[object URL]",m5=Array.isArray,ku=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Du=Object.assign,g5=Object.prototype.toString.call.bind(Object.prototype.toString);function v5(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,o=t.areMapsEqual,s=t.areNumbersEqual,a=t.areObjectsEqual,c=t.arePrimitiveWrappersEqual,l=t.areRegExpsEqual,u=t.areSetsEqual,f=t.areTypedArraysEqual,d=t.areUrlsEqual,y=t.unknownTagComparators;return function(h,_,b){if(h===_)return!0;if(h==null||_==null)return!1;var C=typeof h;if(C!==typeof _)return!1;if(C!=="object")return C==="number"?s(h,_,b):C==="function"?i(h,_,b):!1;var v=h.constructor;if(v!==_.constructor)return!1;if(v===Object)return a(h,_,b);if(m5(h))return e(h,_,b);if(ku!=null&&ku(h))return f(h,_,b);if(v===Date)return n(h,_,b);if(v===RegExp)return l(h,_,b);if(v===Map)return o(h,_,b);if(v===Set)return u(h,_,b);var E=g5(h);if(E===s5)return n(h,_,b);if(E===f5)return l(h,_,b);if(E===c5)return o(h,_,b);if(E===d5)return u(h,_,b);if(E===u5)return typeof h.then!="function"&&typeof _.then!="function"&&a(h,_,b);if(E===p5)return d(h,_,b);if(E===a5)return r(h,_,b);if(E===i5)return a(h,_,b);if(E===o5||E===l5||E===h5)return c(h,_,b);if(y){var x=y[E];if(!x){var g=U4(h);g&&(x=y[g])}if(x)return x(h,_,b)}return!1}}function y5(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Gr:Z4,areDatesEqual:K4,areErrorsEqual:Q4,areFunctionsEqual:J4,areMapsEqual:r?Pu(Lu,Gr):Lu,areNumbersEqual:X4,areObjectsEqual:r?Gr:Y4,arePrimitiveWrappersEqual:e5,areRegExpsEqual:t5,areSetsEqual:r?Pu(Mu,Gr):Mu,areTypedArraysEqual:r?Gr:n5,areUrlsEqual:r5,unknownTagComparators:void 0};if(n&&(i=Du({},i,n(i))),e){var o=Co(i.areArraysEqual),s=Co(i.areMapsEqual),a=Co(i.areObjectsEqual),c=Co(i.areSetsEqual);i=Du({},i,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:c})}return i}function b5(t){return function(e,n,r,i,o,s,a){return t(e,n,a)}}function w5(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(c,l){var u=r(),f=u.cache,d=f===void 0?e?new WeakMap:void 0:f,y=u.meta;return n(c,l,{cache:d,equals:i,meta:y,strict:o})};if(e)return function(c,l){return n(c,l,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var s={cache:void 0,equals:i,meta:void 0,strict:o};return function(c,l){return n(c,l,s)}}var ju=pn();pn({strict:!0});pn({circular:!0});pn({circular:!0,strict:!0});pn({createInternalComparator:function(){return In}});pn({strict:!0,createInternalComparator:function(){return In}});pn({circular:!0,createInternalComparator:function(){return In}});pn({circular:!0,createInternalComparator:function(){return In},strict:!0});function pn(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,s=o===void 0?!1:o,a=y5(t),c=v5(a),l=r?r(c):b5(c);return w5({circular:n,comparator:c,createState:i,equals:l,strict:s})}const Nu=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],na=1,Wr=8;class Nc{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const i=r>>4;if(i!==na)throw new Error(`Got v${i} data when expected v${na}.`);const o=Nu[r&15];if(!o)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new Nc(a,s,o,e)}constructor(e,n=64,r=Float64Array,i){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=Nu.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,Wr,e),this.coords=new this.ArrayType(this.data,Wr+a+c,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Wr+s+a+c),this.ids=new this.IndexArrayType(this.data,Wr,e),this.coords=new this.ArrayType(this.data,Wr+a+c,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(na<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=n,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return oc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,r,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],l=[];for(;c.length;){const u=c.pop()||0,f=c.pop()||0,d=c.pop()||0;if(f-d<=a){for(let _=d;_<=f;_++){const b=s[2*_],C=s[2*_+1];b>=e&&b<=r&&C>=n&&C<=i&&l.push(o[_])}continue}const y=d+f>>1,m=s[2*y],h=s[2*y+1];m>=e&&m<=r&&h>=n&&h<=i&&l.push(o[y]),(u===0?e<=m:n<=h)&&(c.push(d),c.push(y-1),c.push(1-u)),(u===0?r>=m:i>=h)&&(c.push(y+1),c.push(f),c.push(1-u))}return l}within(e,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:s}=this,a=[0,i.length-1,0],c=[],l=r*r;for(;a.length;){const u=a.pop()||0,f=a.pop()||0,d=a.pop()||0;if(f-d<=s){for(let _=d;_<=f;_++)Iu(o[2*_],o[2*_+1],e,n)<=l&&c.push(i[_]);continue}const y=d+f>>1,m=o[2*y],h=o[2*y+1];Iu(m,h,e,n)<=l&&c.push(i[y]),(u===0?e-r<=m:n-r<=h)&&(a.push(d),a.push(y-1),a.push(1-u)),(u===0?e+r>=m:n+r>=h)&&(a.push(y+1),a.push(f),a.push(1-u))}return c}}function oc(t,e,n,r,i,o){if(i-r<=n)return;const s=r+i>>1;Nh(t,e,s,r,i,o),oc(t,e,n,r,s-1,1-o),oc(t,e,n,s+1,i,1-o)}function Nh(t,e,n,r,i,o){for(;i>r;){if(i-r>600){const l=i-r+1,u=n-r+1,f=Math.log(l),d=.5*Math.exp(2*f/3),y=.5*Math.sqrt(f*d*(l-d)/l)*(u-l/2<0?-1:1),m=Math.max(r,Math.floor(n-u*d/l+y)),h=Math.min(i,Math.floor(n+(l-u)*d/l+y));Nh(t,e,n,m,h,o)}const s=e[2*n+o];let a=r,c=i;for(Zr(t,e,r,n),e[2*i+o]>s&&Zr(t,e,r,i);a<c;){for(Zr(t,e,a,c),a++,c--;e[2*a+o]<s;)a++;for(;e[2*c+o]>s;)c--}e[2*r+o]===s?Zr(t,e,r,c):(c++,Zr(t,e,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function Zr(t,e,n,r){ra(t,n,r),ra(e,2*n,2*r),ra(e,2*n+1,2*r+1)}function ra(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Iu(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}const _5={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},Fu=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),vn=2,Yt=3,ia=4,Jt=5,Ih=6;class S5{constructor(e){this.options=Object.assign(Object.create(_5),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:n,minZoom:r,maxZoom:i}=this.options;n&&console.time("total time");const o=`prepare ${e.length} points`;n&&console.time(o),this.points=e;const s=[];for(let c=0;c<e.length;c++){const l=e[c];if(!l.geometry)continue;const[u,f]=l.geometry.coordinates,d=Fu(Eo(u)),y=Fu(xo(f));s.push(d,y,1/0,c,-1,1),this.options.reduce&&s.push(0)}let a=this.trees[i+1]=this._createTree(s);n&&console.timeEnd(o);for(let c=i;c>=r;c--){const l=+Date.now();a=this.trees[c]=this._createTree(this._cluster(a,c)),n&&console.log("z%d: %d clusters in %dms",c,a.numItems,+Date.now()-l)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let r=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const f=this.getClusters([r,i,180,s],n),d=this.getClusters([-180,i,o,s],n);return f.concat(d)}const a=this.trees[this._limitZoom(n)],c=a.range(Eo(r),xo(s),Eo(o),xo(i)),l=a.data,u=[];for(const f of c){const d=this.stride*f;u.push(l[d+Jt]>1?Bu(l,d,this.clusterProps):this.points[l[d+Yt]])}return u}getChildren(e){const n=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(i);const s=o.data;if(n*this.stride>=s.length)throw new Error(i);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),c=s[n*this.stride],l=s[n*this.stride+1],u=o.within(c,l,a),f=[];for(const d of u){const y=d*this.stride;s[y+ia]===e&&f.push(s[y+Jt]>1?Bu(s,y,this.clusterProps):this.points[s[y+Yt]])}if(f.length===0)throw new Error(i);return f}getLeaves(e,n,r){n=n||10,r=r||0;const i=[];return this._appendLeaves(i,e,n,r,0),i}getTile(e,n,r){const i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:s,radius:a}=this.options,c=a/s,l=(r-c)/o,u=(r+1+c)/o,f={features:[]};return this._addTileFeatures(i.range((n-c)/o,l,(n+1+c)/o,u),i.data,n,r,o,f),n===0&&this._addTileFeatures(i.range(1-c/o,l,1,u),i.data,o,r,o,f),n===o-1&&this._addTileFeatures(i.range(0,l,c/o,u),i.data,-1,r,o,f),f.features.length?f:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const r=this.getChildren(e);if(n++,r.length!==1)break;e=r[0].properties.cluster_id}return n}_appendLeaves(e,n,r,i,o){const s=this.getChildren(n);for(const a of s){const c=a.properties;if(c&&c.cluster?o+c.point_count<=i?o+=c.point_count:o=this._appendLeaves(e,c.cluster_id,r,i,o):o<i?o++:e.push(a),e.length===r)break}return o}_createTree(e){const n=new Nc(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)n.add(e[r],e[r+1]);return n.finish(),n.data=e,n}_addTileFeatures(e,n,r,i,o,s){for(const a of e){const c=a*this.stride,l=n[c+Jt]>1;let u,f,d;if(l)u=Fh(n,c,this.clusterProps),f=n[c],d=n[c+1];else{const h=this.points[n[c+Yt]];u=h.properties;const[_,b]=h.geometry.coordinates;f=Eo(_),d=xo(b)}const y={type:1,geometry:[[Math.round(this.options.extent*(f*o-r)),Math.round(this.options.extent*(d*o-i))]],tags:u};let m;l||this.options.generateId?m=n[c+Yt]:m=this.points[n[c+Yt]].id,m!==void 0&&(y.id=m),s.features.push(y)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const{radius:r,extent:i,reduce:o,minPoints:s}=this.options,a=r/(i*Math.pow(2,n)),c=e.data,l=[],u=this.stride;for(let f=0;f<c.length;f+=u){if(c[f+vn]<=n)continue;c[f+vn]=n;const d=c[f],y=c[f+1],m=e.within(c[f],c[f+1],a),h=c[f+Jt];let _=h;for(const b of m){const C=b*u;c[C+vn]>n&&(_+=c[C+Jt])}if(_>h&&_>=s){let b=d*h,C=y*h,v,E=-1;const x=((f/u|0)<<5)+(n+1)+this.points.length;for(const g of m){const S=g*u;if(c[S+vn]<=n)continue;c[S+vn]=n;const O=c[S+Jt];b+=c[S]*O,C+=c[S+1]*O,c[S+ia]=x,o&&(v||(v=this._map(c,f,!0),E=this.clusterProps.length,this.clusterProps.push(v)),o(v,this._map(c,S)))}c[f+ia]=x,l.push(b/_,C/_,1/0,x,-1,_),o&&l.push(E)}else{for(let b=0;b<u;b++)l.push(c[f+b]);if(_>1)for(const b of m){const C=b*u;if(!(c[C+vn]<=n)){c[C+vn]=n;for(let v=0;v<u;v++)l.push(c[C+v])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,r){if(e[n+Jt]>1){const s=this.clusterProps[e[n+Ih]];return r?Object.assign({},s):s}const i=this.points[e[n+Yt]].properties,o=this.options.map(i);return r&&o===i?Object.assign({},o):o}}function Bu(t,e,n){return{type:"Feature",id:t[e+Yt],properties:Fh(t,e,n),geometry:{type:"Point",coordinates:[C5(t[e]),E5(t[e+1])]}}}function Fh(t,e,n){const r=t[e+Jt],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=t[e+Ih],s=o===-1?{}:Object.assign({},n[o]);return Object.assign(s,{cluster:!0,cluster_id:t[e+Yt],point_count:r,point_count_abbreviated:i})}function Eo(t){return t/360+.5}function xo(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function C5(t){return(t-.5)*360}function E5(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function x5(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}class Ge{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,n){this.isAdvancedMarker(e)?e.map=n:e.setMap(n)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class sc{constructor({markers:e,position:n}){this.markers=[],e&&(this.markers=e),n&&(n instanceof google.maps.LatLng?this._position=n:this._position=new google.maps.LatLng(n))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const n of this.markers)e.extend(Ge.getPosition(n));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>Ge.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(Ge.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function ac(t,e="assertion failed"){if(t==null)throw Error(e)}class O5{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return P5(e)}}const P5=t=>t.map(n=>new sc({position:Ge.getPosition(n),markers:[n]}));class T5 extends O5{constructor(e){var{maxZoom:n,radius:r=60}=e,i=x5(e,["maxZoom","radius"]);super({maxZoom:n}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new S5(Object.assign({maxZoom:this.maxZoom,radius:r},i))}calculate(e){let n=!1,r=e.map.getZoom();ac(r),r=Math.round(r);const i={zoom:r};if(!ju(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const o=this.markers.map(s=>{const a=Ge.getPosition(s);return{type:"Feature",geometry:{type:"Point",coordinates:[a.lng(),a.lat()]},properties:{marker:s}}});this.superCluster.load(o)}return n||(this.state.zoom<=this.maxZoom||i.zoom<=this.maxZoom)&&(n=!ju(this.state,i)),this.state=i,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:n}):(n&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:n})}cluster({map:e}){const n=e.getZoom();return ac(n),this.superCluster.getClusters([-180,-90,180,90],Math.round(n)).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,n]},properties:r}){if(r.cluster)return new sc({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:n,lng:e}});const i=r.marker;return new sc({markers:[i],position:Ge.getPosition(i)})}}class A5{constructor(e,n){this.markers={sum:e.length};const r=n.map(o=>o.count),i=r.reduce((o,s)=>o+s,0);this.clusters={count:n.length,markers:{mean:i/n.length,sum:i,min:Math.min(...r),max:Math.max(...r)}}}}class R5{render({count:e,position:n},r,i){const s=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
259
225
  <circle cx="120" cy="120" opacity=".6" r="70" />
260
226
  <circle cx="120" cy="120" opacity=".3" r="90" />
261
227
  <circle cx="120" cy="120" opacity=".2" r="110" />
262
228
  <text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
263
- </svg>`,a=`Cluster of ${e} markers`,l=Number(google.maps.Marker.MAX_ZINDEX)+e;if(Tt.isAdvancedMarkerAvailable(i)){const d=new DOMParser().parseFromString(s,"image/svg+xml").documentElement;d.setAttribute("transform","translate(0 25)");const h={map:i,position:n,zIndex:l,title:a,content:d};return new google.maps.marker.AdvancedMarkerElement(h)}const u={position:n,zIndex:l,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(u)}}function Sw(t,e){for(let n in e.prototype)t.prototype[n]=e.prototype[n]}class Jl{constructor(){Sw(Jl,google.maps.OverlayView)}}var Bi;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})(Bi||(Bi={}));const Lw=(t,e,n)=>{n.fitBounds(e.bounds)};class xw extends Jl{constructor({map:e,markers:n=[],algorithmOptions:r={},algorithm:i=new bw(r),renderer:o=new Cw,onClusterClick:s=Lw}){super(),this.markers=[...n],this.clusters=[],this.algorithm=i,this.renderer=o,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(r=>{this.addMarker(r,!0)}),n||this.render()}removeMarker(e,n){const r=this.markers.indexOf(e);return r===-1?!1:(Tt.setMap(e,null),this.markers.splice(r,1),n||this.render(),!0)}removeMarkers(e,n){let r=!1;return e.forEach(i=>{r=this.removeMarker(i,!0)||r}),r&&!n&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,Bi.CLUSTERING_BEGIN,this);const{clusters:n,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const i=new Set;for(const s of n)s.markers.length==1&&i.add(s.markers[0]);const o=[];for(const s of this.clusters)s.marker!=null&&(s.markers.length==1?i.has(s.marker)||Tt.setMap(s.marker,null):o.push(s.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>o.forEach(s=>Tt.setMap(s,null)))}google.maps.event.trigger(this,Bi.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>Tt.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new ww(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,n),r.markers.forEach(i=>Tt.setMap(i,null)),this.onClusterClick&&r.marker.addListener("click",i=>{google.maps.event.trigger(this,Bi.CLUSTER_CLICK,r),this.onClusterClick(i,r,n)})),Tt.setMap(r.marker,n)})}}function Ew(t){var e=j4(),n=c.useState(null),r=n[0],i=n[1];return c.useEffect(function(){if(e&&r===null){var o=new xw(K(K({},t),{map:e}));i(o)}},[e]),r}function _w(t){var e=t.children,n=t.options,r=Ew(n);return r!==null?e(r):null}c.memo(_w);var Zc={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},qc={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}};function Mw(t){var e=t.children,n=t.anchor,r=t.options,i=t.position,o=t.zIndex,s=t.onCloseClick,a=t.onDomReady,l=t.onContentChanged,u=t.onPositionChanged,f=t.onZindexChanged,d=t.onLoad,h=t.onUnmount,v=c.useContext(le),y=c.useState(null),g=y[0],S=y[1],w=c.useState(null),L=w[0],m=w[1],_=c.useState(null),E=_[0],p=_[1],b=c.useState(null),x=b[0],P=b[1],O=c.useState(null),T=O[0],M=O[1],R=c.useState(null),A=R[0],B=R[1],V=c.useRef(null);return c.useEffect(function(){g!==null&&(g.close(),n?g.open(v,n):g.getPosition()&&g.open(v))},[v,g,n]),c.useEffect(function(){r&&g!==null&&g.setOptions(r)},[g,r]),c.useEffect(function(){i&&g!==null&&g.setPosition(i)},[i]),c.useEffect(function(){typeof o=="number"&&g!==null&&g.setZIndex(o)},[o]),c.useEffect(function(){g&&s&&(L!==null&&google.maps.event.removeListener(L),m(google.maps.event.addListener(g,"closeclick",s)))},[s]),c.useEffect(function(){g&&a&&(E!==null&&google.maps.event.removeListener(E),p(google.maps.event.addListener(g,"domready",a)))},[a]),c.useEffect(function(){g&&l&&(x!==null&&google.maps.event.removeListener(x),P(google.maps.event.addListener(g,"content_changed",l)))},[l]),c.useEffect(function(){g&&u&&(T!==null&&google.maps.event.removeListener(T),M(google.maps.event.addListener(g,"position_changed",u)))},[u]),c.useEffect(function(){g&&f&&(A!==null&&google.maps.event.removeListener(A),B(google.maps.event.addListener(g,"zindex_changed",f)))},[f]),c.useEffect(function(){var N=new google.maps.InfoWindow(K({},r||{}));return S(N),V.current=document.createElement("div"),s&&m(google.maps.event.addListener(N,"closeclick",s)),a&&p(google.maps.event.addListener(N,"domready",a)),l&&P(google.maps.event.addListener(N,"content_changed",l)),u&&M(google.maps.event.addListener(N,"position_changed",u)),f&&B(google.maps.event.addListener(N,"zindex_changed",f)),N.setContent(V.current),i&&N.setPosition(i),o&&N.setZIndex(o),n?N.open(v,n):N.getPosition()?N.open(v):et(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>."),d&&d(N),function(){L&&google.maps.event.removeListener(L),x&&google.maps.event.removeListener(x),E&&google.maps.event.removeListener(E),T&&google.maps.event.removeListener(T),A&&google.maps.event.removeListener(A),h&&h(N),N.close()}},[]),V.current?ei.createPortal(c.Children.only(e),V.current):null}c.memo(Mw);var yp=function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoWindow:null},n.open=function(r,i){i?r.open(n.context,i):r.getPosition()?r.open(n.context):et(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>.")},n.setInfoWindowCallback=function(){n.state.infoWindow!==null&&n.containerElement!==null&&(n.state.infoWindow.setContent(n.containerElement),n.open(n.state.infoWindow,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoWindow))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.InfoWindow(K({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=ce({updaterMap:qc,eventMap:Zc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{infoWindow:n}},this.setInfoWindowCallback)},e.prototype.componentDidUpdate=function(n){this.state.infoWindow!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:qc,eventMap:Zc,prevProps:n,nextProps:this.props,instance:this.state.infoWindow}))},e.prototype.componentWillUnmount=function(){this.state.infoWindow!==null&&(he(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())},e.prototype.render=function(){return this.containerElement?ei.createPortal(c.Children.only(this.props.children),this.containerElement):null},e.contextType=le,e}(c.PureComponent),Kc={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Qc={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},Ow={};function Pw(t){var e=t.options,n=t.draggable,r=t.editable,i=t.visible,o=t.path,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,u=t.onMouseDown,f=t.onMouseMove,d=t.onMouseOut,h=t.onMouseOver,v=t.onMouseUp,y=t.onRightClick,g=t.onClick,S=t.onDrag,w=t.onLoad,L=t.onUnmount,m=c.useContext(le),_=c.useState(null),E=_[0],p=_[1],b=c.useState(null),x=b[0],P=b[1],O=c.useState(null),T=O[0],M=O[1],R=c.useState(null),A=R[0],B=R[1],V=c.useState(null),N=V[0],z=V[1],Y=c.useState(null),G=Y[0],H=Y[1],Q=c.useState(null),oe=Q[0],te=Q[1],ee=c.useState(null),D=ee[0],ve=ee[1],Pe=c.useState(null),Z=Pe[0],De=Pe[1],Ae=c.useState(null),ue=Ae[0],_e=Ae[1],Ve=c.useState(null),Ce=Ve[0],Me=Ve[1],Ie=c.useState(null),ke=Ie[0],je=Ie[1];return c.useEffect(function(){E!==null&&E.setMap(m)},[m]),c.useEffect(function(){typeof e<"u"&&E!==null&&E.setOptions(e)},[E,e]),c.useEffect(function(){typeof n<"u"&&E!==null&&E.setDraggable(n)},[E,n]),c.useEffect(function(){typeof r<"u"&&E!==null&&E.setEditable(r)},[E,r]),c.useEffect(function(){typeof i<"u"&&E!==null&&E.setVisible(i)},[E,i]),c.useEffect(function(){typeof o<"u"&&E!==null&&E.setPath(o)},[E,o]),c.useEffect(function(){E&&s&&(x!==null&&google.maps.event.removeListener(x),P(google.maps.event.addListener(E,"dblclick",s)))},[s]),c.useEffect(function(){E&&a&&(T!==null&&google.maps.event.removeListener(T),M(google.maps.event.addListener(E,"dragend",a)))},[a]),c.useEffect(function(){E&&l&&(A!==null&&google.maps.event.removeListener(A),B(google.maps.event.addListener(E,"dragstart",l)))},[l]),c.useEffect(function(){E&&u&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(E,"mousedown",u)))},[u]),c.useEffect(function(){E&&f&&(G!==null&&google.maps.event.removeListener(G),H(google.maps.event.addListener(E,"mousemove",f)))},[f]),c.useEffect(function(){E&&d&&(oe!==null&&google.maps.event.removeListener(oe),te(google.maps.event.addListener(E,"mouseout",d)))},[d]),c.useEffect(function(){E&&h&&(D!==null&&google.maps.event.removeListener(D),ve(google.maps.event.addListener(E,"mouseover",h)))},[h]),c.useEffect(function(){E&&v&&(Z!==null&&google.maps.event.removeListener(Z),De(google.maps.event.addListener(E,"mouseup",v)))},[v]),c.useEffect(function(){E&&y&&(ue!==null&&google.maps.event.removeListener(ue),_e(google.maps.event.addListener(E,"rightclick",y)))},[y]),c.useEffect(function(){E&&g&&(Ce!==null&&google.maps.event.removeListener(Ce),Me(google.maps.event.addListener(E,"click",g)))},[g]),c.useEffect(function(){E&&S&&(ke!==null&&google.maps.event.removeListener(ke),je(google.maps.event.addListener(E,"drag",S)))},[S]),c.useEffect(function(){var ie=new google.maps.Polyline(K(K({},e||Ow),{map:m}));return o&&ie.setPath(o),typeof i<"u"&&ie.setVisible(i),typeof r<"u"&&ie.setEditable(r),typeof n<"u"&&ie.setDraggable(n),s&&P(google.maps.event.addListener(ie,"dblclick",s)),a&&M(google.maps.event.addListener(ie,"dragend",a)),l&&B(google.maps.event.addListener(ie,"dragstart",l)),u&&z(google.maps.event.addListener(ie,"mousedown",u)),f&&H(google.maps.event.addListener(ie,"mousemove",f)),d&&te(google.maps.event.addListener(ie,"mouseout",d)),h&&ve(google.maps.event.addListener(ie,"mouseover",h)),v&&De(google.maps.event.addListener(ie,"mouseup",v)),y&&_e(google.maps.event.addListener(ie,"rightclick",y)),g&&Me(google.maps.event.addListener(ie,"click",g)),S&&je(google.maps.event.addListener(ie,"drag",S)),p(ie),w&&w(ie),function(){x!==null&&google.maps.event.removeListener(x),T!==null&&google.maps.event.removeListener(T),A!==null&&google.maps.event.removeListener(A),N!==null&&google.maps.event.removeListener(N),G!==null&&google.maps.event.removeListener(G),oe!==null&&google.maps.event.removeListener(oe),D!==null&&google.maps.event.removeListener(D),Z!==null&&google.maps.event.removeListener(Z),ue!==null&&google.maps.event.removeListener(ue),Ce!==null&&google.maps.event.removeListener(Ce),L&&L(ie),ie.setMap(null)}},[]),null}c.memo(Pw);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polyline:null},n.setPolylineCallback=function(){n.state.polyline!==null&&n.props.onLoad&&n.props.onLoad(n.state.polyline)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polyline(K(K({},this.props.options||{}),{map:this.context}));this.registeredEvents=ce({updaterMap:Qc,eventMap:Kc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polyline:n}},this.setPolylineCallback)},e.prototype.componentDidUpdate=function(n){this.state.polyline!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:Qc,eventMap:Kc,prevProps:n,nextProps:this.props,instance:this.state.polyline}))},e.prototype.componentWillUnmount=function(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),he(this.registeredEvents),this.state.polyline.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);var Jc={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Yc={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}};function kw(t){var e=t.options,n=t.draggable,r=t.editable,i=t.visible,o=t.path,s=t.paths,a=t.onDblClick,l=t.onDragEnd,u=t.onDragStart,f=t.onMouseDown,d=t.onMouseMove,h=t.onMouseOut,v=t.onMouseOver,y=t.onMouseUp,g=t.onRightClick,S=t.onClick,w=t.onDrag,L=t.onLoad,m=t.onUnmount,_=t.onEdit,E=c.useContext(le),p=c.useState(null),b=p[0],x=p[1],P=c.useState(null),O=P[0],T=P[1],M=c.useState(null),R=M[0],A=M[1],B=c.useState(null),V=B[0],N=B[1],z=c.useState(null),Y=z[0],G=z[1],H=c.useState(null),Q=H[0],oe=H[1],te=c.useState(null),ee=te[0],D=te[1],ve=c.useState(null),Pe=ve[0],Z=ve[1],De=c.useState(null),Ae=De[0],ue=De[1],_e=c.useState(null),Ve=_e[0],Ce=_e[1],Me=c.useState(null),Ie=Me[0],ke=Me[1],je=c.useState(null),ie=je[0],We=je[1];return c.useEffect(function(){b!==null&&b.setMap(E)},[E]),c.useEffect(function(){typeof e<"u"&&b!==null&&b.setOptions(e)},[b,e]),c.useEffect(function(){typeof n<"u"&&b!==null&&b.setDraggable(n)},[b,n]),c.useEffect(function(){typeof r<"u"&&b!==null&&b.setEditable(r)},[b,r]),c.useEffect(function(){typeof i<"u"&&b!==null&&b.setVisible(i)},[b,i]),c.useEffect(function(){typeof o<"u"&&b!==null&&b.setPath(o)},[b,o]),c.useEffect(function(){typeof s<"u"&&b!==null&&b.setPaths(s)},[b,s]),c.useEffect(function(){b&&a&&(O!==null&&google.maps.event.removeListener(O),T(google.maps.event.addListener(b,"dblclick",a)))},[a]),c.useEffect(function(){b&&(google.maps.event.addListener(b.getPath(),"insert_at",function(){_==null||_(b)}),google.maps.event.addListener(b.getPath(),"set_at",function(){_==null||_(b)}))},[b,_]),c.useEffect(function(){b&&l&&(R!==null&&google.maps.event.removeListener(R),A(google.maps.event.addListener(b,"dragend",l)))},[l]),c.useEffect(function(){b&&u&&(V!==null&&google.maps.event.removeListener(V),N(google.maps.event.addListener(b,"dragstart",u)))},[u]),c.useEffect(function(){b&&f&&(Y!==null&&google.maps.event.removeListener(Y),G(google.maps.event.addListener(b,"mousedown",f)))},[f]),c.useEffect(function(){b&&d&&(Q!==null&&google.maps.event.removeListener(Q),oe(google.maps.event.addListener(b,"mousemove",d)))},[d]),c.useEffect(function(){b&&h&&(ee!==null&&google.maps.event.removeListener(ee),D(google.maps.event.addListener(b,"mouseout",h)))},[h]),c.useEffect(function(){b&&v&&(Pe!==null&&google.maps.event.removeListener(Pe),Z(google.maps.event.addListener(b,"mouseover",v)))},[v]),c.useEffect(function(){b&&y&&(Ae!==null&&google.maps.event.removeListener(Ae),ue(google.maps.event.addListener(b,"mouseup",y)))},[y]),c.useEffect(function(){b&&g&&(Ve!==null&&google.maps.event.removeListener(Ve),Ce(google.maps.event.addListener(b,"rightclick",g)))},[g]),c.useEffect(function(){b&&S&&(Ie!==null&&google.maps.event.removeListener(Ie),ke(google.maps.event.addListener(b,"click",S)))},[S]),c.useEffect(function(){b&&w&&(ie!==null&&google.maps.event.removeListener(ie),We(google.maps.event.addListener(b,"drag",w)))},[w]),c.useEffect(function(){var re=new google.maps.Polygon(K(K({},e||{}),{map:E}));return o&&re.setPath(o),s&&re.setPaths(s),typeof i<"u"&&re.setVisible(i),typeof r<"u"&&re.setEditable(r),typeof n<"u"&&re.setDraggable(n),a&&T(google.maps.event.addListener(re,"dblclick",a)),l&&A(google.maps.event.addListener(re,"dragend",l)),u&&N(google.maps.event.addListener(re,"dragstart",u)),f&&G(google.maps.event.addListener(re,"mousedown",f)),d&&oe(google.maps.event.addListener(re,"mousemove",d)),h&&D(google.maps.event.addListener(re,"mouseout",h)),v&&Z(google.maps.event.addListener(re,"mouseover",v)),y&&ue(google.maps.event.addListener(re,"mouseup",y)),g&&Ce(google.maps.event.addListener(re,"rightclick",g)),S&&ke(google.maps.event.addListener(re,"click",S)),w&&We(google.maps.event.addListener(re,"drag",w)),x(re),L&&L(re),function(){O!==null&&google.maps.event.removeListener(O),R!==null&&google.maps.event.removeListener(R),V!==null&&google.maps.event.removeListener(V),Y!==null&&google.maps.event.removeListener(Y),Q!==null&&google.maps.event.removeListener(Q),ee!==null&&google.maps.event.removeListener(ee),Pe!==null&&google.maps.event.removeListener(Pe),Ae!==null&&google.maps.event.removeListener(Ae),Ve!==null&&google.maps.event.removeListener(Ve),Ie!==null&&google.maps.event.removeListener(Ie),m&&m(re),re.setMap(null)}},[]),null}c.memo(kw);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polygon:null},n.setPolygonCallback=function(){n.state.polygon!==null&&n.props.onLoad&&n.props.onLoad(n.state.polygon)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polygon(K(K({},this.props.options||{}),{map:this.context}));this.registeredEvents=ce({updaterMap:Yc,eventMap:Jc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polygon:n}},this.setPolygonCallback)},e.prototype.componentDidUpdate=function(n){this.state.polygon!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:Yc,eventMap:Jc,prevProps:n,nextProps:this.props,instance:this.state.polygon}))},e.prototype.componentWillUnmount=function(){this.state.polygon!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),he(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);var Xc={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ef={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}};function Tw(t){var e=t.options,n=t.bounds,r=t.draggable,i=t.editable,o=t.visible,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,u=t.onMouseDown,f=t.onMouseMove,d=t.onMouseOut,h=t.onMouseOver,v=t.onMouseUp,y=t.onRightClick,g=t.onClick,S=t.onDrag,w=t.onBoundsChanged,L=t.onLoad,m=t.onUnmount,_=c.useContext(le),E=c.useState(null),p=E[0],b=E[1],x=c.useState(null),P=x[0],O=x[1],T=c.useState(null),M=T[0],R=T[1],A=c.useState(null),B=A[0],V=A[1],N=c.useState(null),z=N[0],Y=N[1],G=c.useState(null),H=G[0],Q=G[1],oe=c.useState(null),te=oe[0],ee=oe[1],D=c.useState(null),ve=D[0],Pe=D[1],Z=c.useState(null),De=Z[0],Ae=Z[1],ue=c.useState(null),_e=ue[0],Ve=ue[1],Ce=c.useState(null),Me=Ce[0],Ie=Ce[1],ke=c.useState(null),je=ke[0],ie=ke[1],We=c.useState(null),re=We[0],nt=We[1];return c.useEffect(function(){p!==null&&p.setMap(_)},[_]),c.useEffect(function(){typeof e<"u"&&p!==null&&p.setOptions(e)},[p,e]),c.useEffect(function(){typeof r<"u"&&p!==null&&p.setDraggable(r)},[p,r]),c.useEffect(function(){typeof i<"u"&&p!==null&&p.setEditable(i)},[p,i]),c.useEffect(function(){typeof o<"u"&&p!==null&&p.setVisible(o)},[p,o]),c.useEffect(function(){typeof n<"u"&&p!==null&&p.setBounds(n)},[p,n]),c.useEffect(function(){p&&s&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(p,"dblclick",s)))},[s]),c.useEffect(function(){p&&a&&(M!==null&&google.maps.event.removeListener(M),R(google.maps.event.addListener(p,"dragend",a)))},[a]),c.useEffect(function(){p&&l&&(B!==null&&google.maps.event.removeListener(B),V(google.maps.event.addListener(p,"dragstart",l)))},[l]),c.useEffect(function(){p&&u&&(z!==null&&google.maps.event.removeListener(z),Y(google.maps.event.addListener(p,"mousedown",u)))},[u]),c.useEffect(function(){p&&f&&(H!==null&&google.maps.event.removeListener(H),Q(google.maps.event.addListener(p,"mousemove",f)))},[f]),c.useEffect(function(){p&&d&&(te!==null&&google.maps.event.removeListener(te),ee(google.maps.event.addListener(p,"mouseout",d)))},[d]),c.useEffect(function(){p&&h&&(ve!==null&&google.maps.event.removeListener(ve),Pe(google.maps.event.addListener(p,"mouseover",h)))},[h]),c.useEffect(function(){p&&v&&(De!==null&&google.maps.event.removeListener(De),Ae(google.maps.event.addListener(p,"mouseup",v)))},[v]),c.useEffect(function(){p&&y&&(_e!==null&&google.maps.event.removeListener(_e),Ve(google.maps.event.addListener(p,"rightclick",y)))},[y]),c.useEffect(function(){p&&g&&(Me!==null&&google.maps.event.removeListener(Me),Ie(google.maps.event.addListener(p,"click",g)))},[g]),c.useEffect(function(){p&&S&&(je!==null&&google.maps.event.removeListener(je),ie(google.maps.event.addListener(p,"drag",S)))},[S]),c.useEffect(function(){p&&w&&(re!==null&&google.maps.event.removeListener(re),nt(google.maps.event.addListener(p,"bounds_changed",w)))},[w]),c.useEffect(function(){var q=new google.maps.Rectangle(K(K({},e||{}),{map:_}));return typeof o<"u"&&q.setVisible(o),typeof i<"u"&&q.setEditable(i),typeof r<"u"&&q.setDraggable(r),typeof n<"u"&&q.setBounds(n),s&&O(google.maps.event.addListener(q,"dblclick",s)),a&&R(google.maps.event.addListener(q,"dragend",a)),l&&V(google.maps.event.addListener(q,"dragstart",l)),u&&Y(google.maps.event.addListener(q,"mousedown",u)),f&&Q(google.maps.event.addListener(q,"mousemove",f)),d&&ee(google.maps.event.addListener(q,"mouseout",d)),h&&Pe(google.maps.event.addListener(q,"mouseover",h)),v&&Ae(google.maps.event.addListener(q,"mouseup",v)),y&&Ve(google.maps.event.addListener(q,"rightclick",y)),g&&Ie(google.maps.event.addListener(q,"click",g)),S&&ie(google.maps.event.addListener(q,"drag",S)),w&&nt(google.maps.event.addListener(q,"bounds_changed",w)),b(q),L&&L(q),function(){P!==null&&google.maps.event.removeListener(P),M!==null&&google.maps.event.removeListener(M),B!==null&&google.maps.event.removeListener(B),z!==null&&google.maps.event.removeListener(z),H!==null&&google.maps.event.removeListener(H),te!==null&&google.maps.event.removeListener(te),ve!==null&&google.maps.event.removeListener(ve),De!==null&&google.maps.event.removeListener(De),_e!==null&&google.maps.event.removeListener(_e),Me!==null&&google.maps.event.removeListener(Me),je!==null&&google.maps.event.removeListener(je),re!==null&&google.maps.event.removeListener(re),m&&m(q),q.setMap(null)}},[]),null}c.memo(Tw);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={rectangle:null},n.setRectangleCallback=function(){n.state.rectangle!==null&&n.props.onLoad&&n.props.onLoad(n.state.rectangle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Rectangle(K(K({},this.props.options||{}),{map:this.context}));this.registeredEvents=ce({updaterMap:ef,eventMap:Xc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{rectangle:n}},this.setRectangleCallback)},e.prototype.componentDidUpdate=function(n){this.state.rectangle!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:ef,eventMap:Xc,prevProps:n,nextProps:this.props,instance:this.state.rectangle}))},e.prototype.componentWillUnmount=function(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),he(this.registeredEvents),this.state.rectangle.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);var tf={onCenterChanged:"center_changed",onRadiusChanged:"radius_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},nf={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},Rw={};function Dw(t){var e=t.options,n=t.center,r=t.radius,i=t.draggable,o=t.editable,s=t.visible,a=t.onDblClick,l=t.onDragEnd,u=t.onDragStart,f=t.onMouseDown,d=t.onMouseMove,h=t.onMouseOut,v=t.onMouseOver,y=t.onMouseUp,g=t.onRightClick,S=t.onClick,w=t.onDrag,L=t.onCenterChanged,m=t.onRadiusChanged,_=t.onLoad,E=t.onUnmount,p=c.useContext(le),b=c.useState(null),x=b[0],P=b[1],O=c.useState(null),T=O[0],M=O[1],R=c.useState(null),A=R[0],B=R[1],V=c.useState(null),N=V[0],z=V[1],Y=c.useState(null),G=Y[0],H=Y[1],Q=c.useState(null),oe=Q[0],te=Q[1],ee=c.useState(null),D=ee[0],ve=ee[1],Pe=c.useState(null),Z=Pe[0],De=Pe[1],Ae=c.useState(null),ue=Ae[0],_e=Ae[1],Ve=c.useState(null),Ce=Ve[0],Me=Ve[1],Ie=c.useState(null),ke=Ie[0],je=Ie[1],ie=c.useState(null),We=ie[0],re=ie[1],nt=c.useState(null),q=nt[0],Ge=nt[1],ze=c.useState(null),wt=ze[0],ct=ze[1];return c.useEffect(function(){x!==null&&x.setMap(p)},[p]),c.useEffect(function(){typeof e<"u"&&x!==null&&x.setOptions(e)},[x,e]),c.useEffect(function(){typeof i<"u"&&x!==null&&x.setDraggable(i)},[x,i]),c.useEffect(function(){typeof o<"u"&&x!==null&&x.setEditable(o)},[x,o]),c.useEffect(function(){typeof s<"u"&&x!==null&&x.setVisible(s)},[x,s]),c.useEffect(function(){typeof r=="number"&&x!==null&&x.setRadius(r)},[x,r]),c.useEffect(function(){typeof n<"u"&&x!==null&&x.setCenter(n)},[x,n]),c.useEffect(function(){x&&a&&(T!==null&&google.maps.event.removeListener(T),M(google.maps.event.addListener(x,"dblclick",a)))},[a]),c.useEffect(function(){x&&l&&(A!==null&&google.maps.event.removeListener(A),B(google.maps.event.addListener(x,"dragend",l)))},[l]),c.useEffect(function(){x&&u&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(x,"dragstart",u)))},[u]),c.useEffect(function(){x&&f&&(G!==null&&google.maps.event.removeListener(G),H(google.maps.event.addListener(x,"mousedown",f)))},[f]),c.useEffect(function(){x&&d&&(oe!==null&&google.maps.event.removeListener(oe),te(google.maps.event.addListener(x,"mousemove",d)))},[d]),c.useEffect(function(){x&&h&&(D!==null&&google.maps.event.removeListener(D),ve(google.maps.event.addListener(x,"mouseout",h)))},[h]),c.useEffect(function(){x&&v&&(Z!==null&&google.maps.event.removeListener(Z),De(google.maps.event.addListener(x,"mouseover",v)))},[v]),c.useEffect(function(){x&&y&&(ue!==null&&google.maps.event.removeListener(ue),_e(google.maps.event.addListener(x,"mouseup",y)))},[y]),c.useEffect(function(){x&&g&&(Ce!==null&&google.maps.event.removeListener(Ce),Me(google.maps.event.addListener(x,"rightclick",g)))},[g]),c.useEffect(function(){x&&S&&(ke!==null&&google.maps.event.removeListener(ke),je(google.maps.event.addListener(x,"click",S)))},[S]),c.useEffect(function(){x&&w&&(We!==null&&google.maps.event.removeListener(We),re(google.maps.event.addListener(x,"drag",w)))},[w]),c.useEffect(function(){x&&L&&(q!==null&&google.maps.event.removeListener(q),Ge(google.maps.event.addListener(x,"center_changed",L)))},[S]),c.useEffect(function(){x&&m&&(wt!==null&&google.maps.event.removeListener(wt),ct(google.maps.event.addListener(x,"radius_changed",m)))},[m]),c.useEffect(function(){var se=new google.maps.Circle(K(K({},e||Rw),{map:p}));return typeof r=="number"&&se.setRadius(r),typeof n<"u"&&se.setCenter(n),typeof r=="number"&&se.setRadius(r),typeof s<"u"&&se.setVisible(s),typeof o<"u"&&se.setEditable(o),typeof i<"u"&&se.setDraggable(i),a&&M(google.maps.event.addListener(se,"dblclick",a)),l&&B(google.maps.event.addListener(se,"dragend",l)),u&&z(google.maps.event.addListener(se,"dragstart",u)),f&&H(google.maps.event.addListener(se,"mousedown",f)),d&&te(google.maps.event.addListener(se,"mousemove",d)),h&&ve(google.maps.event.addListener(se,"mouseout",h)),v&&De(google.maps.event.addListener(se,"mouseover",v)),y&&_e(google.maps.event.addListener(se,"mouseup",y)),g&&Me(google.maps.event.addListener(se,"rightclick",g)),S&&je(google.maps.event.addListener(se,"click",S)),w&&re(google.maps.event.addListener(se,"drag",w)),L&&Ge(google.maps.event.addListener(se,"center_changed",L)),m&&ct(google.maps.event.addListener(se,"radius_changed",m)),P(se),_&&_(se),function(){T!==null&&google.maps.event.removeListener(T),A!==null&&google.maps.event.removeListener(A),N!==null&&google.maps.event.removeListener(N),G!==null&&google.maps.event.removeListener(G),oe!==null&&google.maps.event.removeListener(oe),D!==null&&google.maps.event.removeListener(D),Z!==null&&google.maps.event.removeListener(Z),ue!==null&&google.maps.event.removeListener(ue),Ce!==null&&google.maps.event.removeListener(Ce),ke!==null&&google.maps.event.removeListener(ke),q!==null&&google.maps.event.removeListener(q),wt!==null&&google.maps.event.removeListener(wt),E&&E(se),se.setMap(null)}},[]),null}c.memo(Dw);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={circle:null},n.setCircleCallback=function(){n.state.circle!==null&&n.props.onLoad&&n.props.onLoad(n.state.circle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Circle(K(K({},this.props.options||{}),{map:this.context}));this.registeredEvents=ce({updaterMap:nf,eventMap:tf,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{circle:n}},this.setCircleCallback)},e.prototype.componentDidUpdate=function(n){this.state.circle!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:nf,eventMap:tf,prevProps:n,nextProps:this.props,instance:this.state.circle}))},e.prototype.componentWillUnmount=function(){var n;this.state.circle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),he(this.registeredEvents),(n=this.state.circle)===null||n===void 0||n.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);var rf={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},of={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,r){t.loadGeoJson(e,n,r)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}};function Aw(t){var e=t.options,n=t.onClick,r=t.onDblClick,i=t.onMouseDown,o=t.onMouseMove,s=t.onMouseOut,a=t.onMouseOver,l=t.onMouseUp,u=t.onRightClick,f=t.onAddFeature,d=t.onRemoveFeature,h=t.onRemoveProperty,v=t.onSetGeometry,y=t.onSetProperty,g=t.onLoad,S=t.onUnmount,w=c.useContext(le),L=c.useState(null),m=L[0],_=L[1],E=c.useState(null),p=E[0],b=E[1],x=c.useState(null),P=x[0],O=x[1],T=c.useState(null),M=T[0],R=T[1],A=c.useState(null),B=A[0],V=A[1],N=c.useState(null),z=N[0],Y=N[1],G=c.useState(null),H=G[0],Q=G[1],oe=c.useState(null),te=oe[0],ee=oe[1],D=c.useState(null),ve=D[0],Pe=D[1],Z=c.useState(null),De=Z[0],Ae=Z[1],ue=c.useState(null),_e=ue[0],Ve=ue[1],Ce=c.useState(null),Me=Ce[0],Ie=Ce[1],ke=c.useState(null),je=ke[0],ie=ke[1],We=c.useState(null),re=We[0],nt=We[1];return c.useEffect(function(){m!==null&&m.setMap(w)},[w]),c.useEffect(function(){m&&r&&(p!==null&&google.maps.event.removeListener(p),b(google.maps.event.addListener(m,"dblclick",r)))},[r]),c.useEffect(function(){m&&i&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(m,"mousedown",i)))},[i]),c.useEffect(function(){m&&o&&(M!==null&&google.maps.event.removeListener(M),R(google.maps.event.addListener(m,"mousemove",o)))},[o]),c.useEffect(function(){m&&s&&(B!==null&&google.maps.event.removeListener(B),V(google.maps.event.addListener(m,"mouseout",s)))},[s]),c.useEffect(function(){m&&a&&(z!==null&&google.maps.event.removeListener(z),Y(google.maps.event.addListener(m,"mouseover",a)))},[a]),c.useEffect(function(){m&&l&&(H!==null&&google.maps.event.removeListener(H),Q(google.maps.event.addListener(m,"mouseup",l)))},[l]),c.useEffect(function(){m&&u&&(te!==null&&google.maps.event.removeListener(te),ee(google.maps.event.addListener(m,"rightclick",u)))},[u]),c.useEffect(function(){m&&n&&(ve!==null&&google.maps.event.removeListener(ve),Pe(google.maps.event.addListener(m,"click",n)))},[n]),c.useEffect(function(){m&&f&&(De!==null&&google.maps.event.removeListener(De),Ae(google.maps.event.addListener(m,"addfeature",f)))},[f]),c.useEffect(function(){m&&d&&(_e!==null&&google.maps.event.removeListener(_e),Ve(google.maps.event.addListener(m,"removefeature",d)))},[d]),c.useEffect(function(){m&&h&&(Me!==null&&google.maps.event.removeListener(Me),Ie(google.maps.event.addListener(m,"removeproperty",h)))},[h]),c.useEffect(function(){m&&v&&(je!==null&&google.maps.event.removeListener(je),ie(google.maps.event.addListener(m,"setgeometry",v)))},[v]),c.useEffect(function(){m&&y&&(re!==null&&google.maps.event.removeListener(re),nt(google.maps.event.addListener(m,"setproperty",y)))},[y]),c.useEffect(function(){if(w!==null){var q=new google.maps.Data(K(K({},e||{}),{map:w}));r&&b(google.maps.event.addListener(q,"dblclick",r)),i&&O(google.maps.event.addListener(q,"mousedown",i)),o&&R(google.maps.event.addListener(q,"mousemove",o)),s&&V(google.maps.event.addListener(q,"mouseout",s)),a&&Y(google.maps.event.addListener(q,"mouseover",a)),l&&Q(google.maps.event.addListener(q,"mouseup",l)),u&&ee(google.maps.event.addListener(q,"rightclick",u)),n&&Pe(google.maps.event.addListener(q,"click",n)),f&&Ae(google.maps.event.addListener(q,"addfeature",f)),d&&Ve(google.maps.event.addListener(q,"removefeature",d)),h&&Ie(google.maps.event.addListener(q,"removeproperty",h)),v&&ie(google.maps.event.addListener(q,"setgeometry",v)),y&&nt(google.maps.event.addListener(q,"setproperty",y)),_(q),g&&g(q)}return function(){m&&(p!==null&&google.maps.event.removeListener(p),P!==null&&google.maps.event.removeListener(P),M!==null&&google.maps.event.removeListener(M),B!==null&&google.maps.event.removeListener(B),z!==null&&google.maps.event.removeListener(z),H!==null&&google.maps.event.removeListener(H),te!==null&&google.maps.event.removeListener(te),ve!==null&&google.maps.event.removeListener(ve),De!==null&&google.maps.event.removeListener(De),_e!==null&&google.maps.event.removeListener(_e),Me!==null&&google.maps.event.removeListener(Me),je!==null&&google.maps.event.removeListener(je),re!==null&&google.maps.event.removeListener(re),S&&S(m),m.setMap(null))}},[]),null}c.memo(Aw);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={data:null},n.setDataCallback=function(){n.state.data!==null&&n.props.onLoad&&n.props.onLoad(n.state.data)},n}return e.prototype.componentDidMount=function(){if(this.context!==null){var n=new google.maps.Data(K(K({},this.props.options||{}),{map:this.context}));this.registeredEvents=ce({updaterMap:of,eventMap:rf,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{data:n}},this.setDataCallback)}},e.prototype.componentDidUpdate=function(n){this.state.data!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:of,eventMap:rf,prevProps:n,nextProps:this.props,instance:this.state.data}))},e.prototype.componentWillUnmount=function(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),he(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);var sf={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},af={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}};(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={kmlLayer:null},n.setKmlLayerCallback=function(){n.state.kmlLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.kmlLayer)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.KmlLayer(K(K({},this.props.options),{map:this.context}));this.registeredEvents=ce({updaterMap:af,eventMap:sf,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{kmlLayer:n}},this.setKmlLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.kmlLayer!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:af,eventMap:sf,prevProps:n,nextProps:this.props,instance:this.state.kmlLayer}))},e.prototype.componentWillUnmount=function(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),he(this.registeredEvents),this.state.kmlLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);function bp(t,e){return typeof e=="function"?e(t.offsetWidth,t.offsetHeight):{x:0,y:0}}function Iw(t,e){return new e(t.lat,t.lng)}function jw(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))}function Nw(t,e,n){return t instanceof e?t:n(t,e)}function Bw(t,e,n){return t instanceof e?t:n(t,e)}function Fw(t,e,n){var r=t&&t.fromLatLngToDivPixel(n.getNorthEast()),i=t&&t.fromLatLngToDivPixel(n.getSouthWest());return r&&i?{left:"".concat(i.x+e.x,"px"),top:"".concat(r.y+e.y,"px"),width:"".concat(r.x-i.x-e.x,"px"),height:"".concat(i.y-r.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function Uw(t,e,n){var r=t&&t.fromLatLngToDivPixel(n);if(r){var i=r.x,o=r.y;return{left:"".concat(i+e.x,"px"),top:"".concat(o+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function wp(t,e,n,r){return n!==void 0?Fw(t,e,Bw(n,google.maps.LatLngBounds,jw)):Uw(t,e,Nw(r,google.maps.LatLng,Iw))}function Vw(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.height&&t.height===e.height}function zw(t,e,n,r,i){var o=function(s){Ue(a,s);function a(l,u,f,d){var h=s.call(this)||this;return h.container=l,h.pane=u,h.position=f,h.bounds=d,h}return a.prototype.onAdd=function(){var l,u=(l=this.getPanes())===null||l===void 0?void 0:l[this.pane];u==null||u.appendChild(this.container)},a.prototype.draw=function(){for(var l=this.getProjection(),u=K({},this.container?bp(this.container,i):{x:0,y:0}),f=wp(l,u,this.bounds,this.position),d=0,h=Object.entries(f);d<h.length;d++){var v=h[d],y=v[0],g=v[1];this.container.style[y]=g}},a.prototype.onRemove=function(){this.container.parentNode!==null&&this.container.parentNode.removeChild(this.container)},a}(google.maps.OverlayView);return new o(t,e,n,r)}function lf(t){if(!t)return"";var e=t instanceof google.maps.LatLng?t:new google.maps.LatLng(t.lat,t.lng);return e+""}function uf(t){if(!t)return"";var e=t instanceof google.maps.LatLngBounds?t:new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west));return e+""}function Hw(t){var e=t.position,n=t.bounds,r=t.mapPaneName,i=t.zIndex,o=t.onLoad,s=t.onUnmount,a=t.getPixelPositionOffset,l=t.children,u=c.useContext(le),f=c.useMemo(function(){var h=document.createElement("div");return h.style.position="absolute",h},[]),d=c.useMemo(function(){return zw(f,r,e,n,a)},[f,r,e,n]);return c.useEffect(function(){return o==null||o(d),d==null||d.setMap(u),function(){s==null||s(d),d==null||d.setMap(null)}},[u,d]),c.useEffect(function(){f.style.zIndex="".concat(i)},[i,f]),Ff.createPortal(l,f)}c.memo(Hw);(function(t){Ue(e,t);function e(n){var r=t.call(this,n)||this;r.state={paneEl:null,containerStyle:{position:"absolute"}},r.updatePane=function(){var o=r.props.mapPaneName,s=r.overlayView.getPanes();et(!!o,"OverlayView requires props.mapPaneName but got %s",o),s?r.setState({paneEl:s[o]}):r.setState({paneEl:null})},r.onAdd=function(){var o,s;r.updatePane(),(s=(o=r.props).onLoad)===null||s===void 0||s.call(o,r.overlayView)},r.onPositionElement=function(){var o=r.overlayView.getProjection(),s=K({x:0,y:0},r.containerRef.current?bp(r.containerRef.current,r.props.getPixelPositionOffset):{}),a=wp(o,s,r.props.bounds,r.props.position),l=r.state.containerStyle,u=l.left,f=l.top,d=l.width,h=l.height;Vw(a,{left:u,top:f,width:d,height:h})||r.setState({containerStyle:{top:a.top||0,left:a.left||0,width:a.width||0,height:a.height||0,position:"absolute"}})},r.draw=function(){r.onPositionElement()},r.onRemove=function(){var o,s;r.setState(function(){return{paneEl:null}}),(s=(o=r.props).onUnmount)===null||s===void 0||s.call(o,r.overlayView)},r.containerRef=c.createRef();var i=new google.maps.OverlayView;return i.onAdd=r.onAdd,i.draw=r.draw,i.onRemove=r.onRemove,r.overlayView=i,r}return e.prototype.componentDidMount=function(){this.overlayView.setMap(this.context)},e.prototype.componentDidUpdate=function(n){var r=lf(n.position),i=lf(this.props.position),o=uf(n.bounds),s=uf(this.props.bounds);(r!==i||o!==s)&&this.overlayView.draw(),n.mapPaneName!==this.props.mapPaneName&&this.updatePane()},e.prototype.componentWillUnmount=function(){this.overlayView.setMap(null)},e.prototype.render=function(){var n=this.state.paneEl;return n?Ff.createPortal(C.jsx("div",{ref:this.containerRef,style:this.state.containerStyle,children:c.Children.only(this.props.children)}),n):null},e.FLOAT_PANE="floatPane",e.MAP_PANE="mapPane",e.MARKER_LAYER="markerLayer",e.OVERLAY_LAYER="overlayLayer",e.OVERLAY_MOUSE_TARGET="overlayMouseTarget",e.contextType=le,e})(c.PureComponent);function $w(){}var cf={onDblClick:"dblclick",onClick:"click"},ff={opacity:function(t,e){t.setOpacity(e)}};function Ww(t){var e=t.url,n=t.bounds,r=t.options,i=t.visible,o=c.useContext(le),s=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east)),a=c.useMemo(function(){var l=new google.maps.GroundOverlay(e,s,K({},r));return l},[]);return c.useEffect(function(){a!==null&&a.setMap(o)},[o]),c.useEffect(function(){typeof e<"u"&&a!==null&&(a.set("url",e),a.setMap(o))},[a,e]),c.useEffect(function(){typeof i<"u"&&a!==null&&a.setOpacity(i?1:0)},[a,i]),c.useEffect(function(){var l=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east));typeof n<"u"&&a!==null&&(a.set("bounds",l),a.setMap(o))},[a,n]),null}c.memo(Ww);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={groundOverlay:null},n.setGroundOverlayCallback=function(){n.state.groundOverlay!==null&&n.props.onLoad&&n.props.onLoad(n.state.groundOverlay)},n}return e.prototype.componentDidMount=function(){et(!!this.props.url||!!this.props.bounds,"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655");var n=new google.maps.GroundOverlay(this.props.url,this.props.bounds,K(K({},this.props.options),{map:this.context}));this.registeredEvents=ce({updaterMap:ff,eventMap:cf,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{groundOverlay:n}},this.setGroundOverlayCallback)},e.prototype.componentDidUpdate=function(n){this.state.groundOverlay!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:ff,eventMap:cf,prevProps:n,nextProps:this.props,instance:this.state.groundOverlay}))},e.prototype.componentWillUnmount=function(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))},e.prototype.render=function(){return null},e.defaultProps={onLoad:$w},e.contextType=le,e})(c.PureComponent);var df={},hf={data:function(t,e){t.setData(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)}};function Gw(t){var e=t.data,n=t.onLoad,r=t.onUnmount,i=t.options,o=c.useContext(le),s=c.useState(null),a=s[0],l=s[1];return c.useEffect(function(){google.maps.visualization||et(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} in useJsApiScript? %s',google.maps.visualization)},[]),c.useEffect(function(){et(!!e,"data property is required in HeatmapLayer %s",e)},[e]),c.useEffect(function(){a!==null&&a.setMap(o)},[o]),c.useEffect(function(){i&&a!==null&&a.setOptions(i)},[a,i]),c.useEffect(function(){var u=new google.maps.visualization.HeatmapLayer(K(K({},i||{}),{data:e,map:o}));return l(u),n&&n(u),function(){a!==null&&(r&&r(a),a.setMap(null))}},[]),null}c.memo(Gw);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={heatmapLayer:null},n.setHeatmapLayerCallback=function(){n.state.heatmapLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.heatmapLayer)},n}return e.prototype.componentDidMount=function(){et(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to <LoadScript />? %s',google.maps.visualization),et(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var n=new google.maps.visualization.HeatmapLayer(K(K({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=ce({updaterMap:hf,eventMap:df,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{heatmapLayer:n}},this.setHeatmapLayerCallback)},e.prototype.componentDidUpdate=function(n){he(this.registeredEvents),this.registeredEvents=ce({updaterMap:hf,eventMap:df,prevProps:n,nextProps:this.props,instance:this.state.heatmapLayer})},e.prototype.componentWillUnmount=function(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),he(this.registeredEvents),this.state.heatmapLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);var pf={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},gf={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}};(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={streetViewPanorama:null},n.setStreetViewPanoramaCallback=function(){n.state.streetViewPanorama!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewPanorama)},n}return e.prototype.componentDidMount=function(){var n,r,i=(r=(n=this.context)===null||n===void 0?void 0:n.getStreetView())!==null&&r!==void 0?r:null;this.registeredEvents=ce({updaterMap:gf,eventMap:pf,prevProps:{},nextProps:this.props,instance:i}),this.setState(function(){return{streetViewPanorama:i}},this.setStreetViewPanoramaCallback)},e.prototype.componentDidUpdate=function(n){this.state.streetViewPanorama!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:gf,eventMap:pf,prevProps:n,nextProps:this.props,instance:this.state.streetViewPanorama}))},e.prototype.componentWillUnmount=function(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),he(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={streetViewService:null},n.setStreetViewServiceCallback=function(){n.state.streetViewService!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewService)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:n}},this.setStreetViewServiceCallback)},e.prototype.componentWillUnmount=function(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},e.prototype.render=function(){return null},e.contextType=le,e})(c.PureComponent);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={directionsService:null},n.setDirectionsServiceCallback=function(){n.state.directionsService!==null&&n.props.onLoad&&n.props.onLoad(n.state.directionsService)},n}return e.prototype.componentDidMount=function(){et(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);var n=new google.maps.DirectionsService;this.setState(function(){return{directionsService:n}},this.setDirectionsServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.directionsService!==null&&this.state.directionsService.route(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.directionsService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},e.prototype.render=function(){return null},e})(c.PureComponent);var vf={onDirectionsChanged:"directions_changed"},mf={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}};(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={directionsRenderer:null},n.setDirectionsRendererCallback=function(){n.state.directionsRenderer!==null&&(n.state.directionsRenderer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.directionsRenderer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=ce({updaterMap:mf,eventMap:vf,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{directionsRenderer:n}},this.setDirectionsRendererCallback)},e.prototype.componentDidUpdate=function(n){this.state.directionsRenderer!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:mf,eventMap:vf,prevProps:n,nextProps:this.props,instance:this.state.directionsRenderer}))},e.prototype.componentWillUnmount=function(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),he(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},e.prototype.render=function(){return C.jsx(C.Fragment,{})},e.contextType=le,e})(c.PureComponent);(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={distanceMatrixService:null},n.setDistanceMatrixServiceCallback=function(){n.state.distanceMatrixService!==null&&n.props.onLoad&&n.props.onLoad(n.state.distanceMatrixService)},n}return e.prototype.componentDidMount=function(){et(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);var n=new google.maps.DistanceMatrixService;this.setState(function(){return{distanceMatrixService:n}},this.setDistanceMatrixServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.distanceMatrixService!==null&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.distanceMatrixService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},e.prototype.render=function(){return null},e})(c.PureComponent);var yf={onPlacesChanged:"places_changed"},bf={bounds:function(t,e){t.setBounds(e)}};(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=c.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){n.state.searchBox!==null&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}return e.prototype.componentDidMount=function(){if(et(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var n=this.containerElement.current.querySelector("input");if(n!==null){var r=new google.maps.places.SearchBox(n,this.props.options);this.registeredEvents=ce({updaterMap:bf,eventMap:yf,prevProps:{},nextProps:this.props,instance:r}),this.setState(function(){return{searchBox:r}},this.setSearchBoxCallback)}}},e.prototype.componentDidUpdate=function(n){this.state.searchBox!==null&&(he(this.registeredEvents),this.registeredEvents=ce({updaterMap:bf,eventMap:yf,prevProps:n,nextProps:this.props,instance:this.state.searchBox}))},e.prototype.componentWillUnmount=function(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),he(this.registeredEvents))},e.prototype.render=function(){return C.jsx("div",{ref:this.containerElement,children:c.Children.only(this.props.children)})},e.contextType=le,e})(c.PureComponent);var wf={onPlaceChanged:"place_changed"},Cf={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}};(function(t){Ue(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=c.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){n.state.autocomplete!==null&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}return e.prototype.componentDidMount=function(){var n;et(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places);var r=(n=this.containerElement.current)===null||n===void 0?void 0:n.querySelector("input");if(r){var i=new google.maps.places.Autocomplete(r,this.props.options);this.registeredEvents=ce({updaterMap:Cf,eventMap:wf,prevProps:{},nextProps:this.props,instance:i}),this.setState(function(){return{autocomplete:i}},this.setAutocompleteCallback)}},e.prototype.componentDidUpdate=function(n){he(this.registeredEvents),this.registeredEvents=ce({updaterMap:Cf,eventMap:wf,prevProps:n,nextProps:this.props,instance:this.state.autocomplete})},e.prototype.componentWillUnmount=function(){this.state.autocomplete!==null&&he(this.registeredEvents)},e.prototype.render=function(){return C.jsx("div",{ref:this.containerElement,className:this.props.className,children:c.Children.only(this.props.children)})},e.defaultProps={className:""},e.contextType=le,e})(c.PureComponent);const Zw="LocationBalloon-module__root__GtUl6q",qw="LocationBalloon-module__submit__lNcF4k",Kw="LocationBalloon-module__details__--VOKk",Qw="LocationBalloon-module__icon__X7DOVA",Jw="LocationBalloon-module__header__5VQJDW",Yw="LocationBalloon-module__titleContainer__BAO73U",Xw="LocationBalloon-module__title__bX9pf8",e5="LocationBalloon-module__description__htav7b",t5="LocationBalloon-module__actions__c8dlOR",n5="LocationBalloon-module__close__7Ujvya",Yt={root:Zw,submit:qw,details:Kw,icon:Qw,header:Jw,titleContainer:Yw,title:Xw,description:e5,actions:t5,close:n5},r5={default:Td,llama:Rd},i5=({SSR:t,className:e,hideDetails:n,location:r,location_name:i,name:o,onCloseClick:s,onDetails:a,onSubmit:l})=>{var g;const{logo:u="default"}=Ze(),{isLoading:f,lmsData:d}=Rs(),h=(g=d==null?void 0:d.location)==null?void 0:g.what3words,v=!!(h!=null&&h.id),y=r5[u];return C.jsxs("div",{className:ge(Yt.root,e),children:[C.jsxs("div",{className:Yt.header,children:[C.jsxs("div",{className:Yt.titleContainer,children:[f?C.jsx(kt,{circle:!0,width:40,height:40}):C.jsx("div",{className:Yt.icon,children:C.jsx(y,{})}),f?C.jsx(kt,{width:200}):C.jsx("span",{className:Yt.title,children:o||"{{ properties.point.name }}"})]}),C.jsx("div",{className:Yt.close,children:C.jsx(ni,{position:"relative",onClick:s})})]}),C.jsxs("div",{className:Yt.description,children:[f?C.jsx(kt,{width:300}):(r==null?void 0:r.full_address)||"{{ properties.point.location.full_address }}",f?C.jsx(kt,{width:300}):i||"{{ properties.point.location_name }}"]}),f?C.jsx(kt,{width:150}):v&&C.jsx(Wd,{what3words:h}),C.jsxs("div",{className:Yt.actions,children:[C.jsx(Ft,{id:Yp,variant:"primary",className:Yt.submit,disabled:f,onClick:l,children:t?"{ choose }":C.jsx(mn,{keyName:"choose",ns:"common"})}),!n&&C.jsxs(Ft,{id:Hf,as:"link",variant:"primary",className:Yt.details,disabled:f,onClick:a,children:[t?"{ details }":C.jsx(mn,{keyName:"details",ns:"common"}),C.jsx(Zh,{})]})]})]})},o5=[{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#444444"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f2f2f2"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:-100},{lightness:45}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#ffcc00"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{hue:"#ff0000"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.fill",stylers:[{color:"#ffffff"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#c2c4c4"},{visibility:"on"}]}];function s5(t="#ffcc00"){return[{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#444444"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f2f2f2"}]},{featureType:"landscape",elementType:"geometry.fill",stylers:[{visibility:"on"},{hue:"#ff0000"}]},{featureType:"landscape.man_made",elementType:"geometry",stylers:[{lightness:"100"}]},{featureType:"landscape.man_made",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.natural",elementType:"geometry.fill",stylers:[{lightness:"100"}]},{featureType:"landscape.natural",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.natural.landcover",elementType:"geometry.fill",stylers:[{visibility:"on"}]},{featureType:"landscape.natural.terrain",elementType:"geometry",stylers:[{lightness:"100"}]},{featureType:"landscape.natural.terrain",elementType:"geometry.fill",stylers:[{visibility:"off"},{lightness:"23"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:-100},{lightness:45}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:t}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:t},{visibility:"on"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{visibility:"on"},{color:"#cccccc"}]},{featureType:"water",elementType:"labels",stylers:[{visibility:"off"}]}]}const a5={clickableIcons:!1,disableDefaultUI:!0,minZoom:4,maxZoom:20,restriction:{strictBounds:!0,latLngBounds:{north:85,south:-85,west:-179,east:179}}},Cp={optimized:!0},l5=({clusterer:t,handleCloseClick:e,handleDetailsClick:n,handlePointClick:r,handleSubmitClick:i,point:o})=>{const[s,a]=c.useState(null),{hideDetails:l,iconType:u,palette:f}=Ze(),{closeSamePoints:d}=an(),h=Rt(x=>x.location),v=(f==null?void 0:f.primary)||"#fc0",y=u==="omni-llama"?Pt.PinLlama:Pt.PinOmnic,g=s==null?void 0:s.getVisible(),S=!!o&&(h==null?void 0:h.uid)===o.uid,w=gr("screenSm"),{isIdle:L}=pe(),m=Al({isSelectedPoint:S}),_=L&&S&&m&&g,E=c.useMemo(()=>{let x;if(o.type===30)switch(u){case"omni-llama":{S?x=Pt.PinLlamaSelected:x=Pt.PinLlama;break}case"we-chip":{S?x=Pt.PinWeChipSelected:x=Pt.PinWeChip;break}default:{S?x=Pt.PinOmnicSelected:x=Or(y,v);break}}else S?x=Or(Pt.PinPvz,"--owl-color-black"):x=Or(Pt.PinPvz,"--owl-color-grey-80");return sn(x,"Icon url is not defined"),{url:Rl(x)}},[o.type,S,u,y,v]),p=c.useMemo(()=>({lat:o.location.latitude,lng:o.location.longitude}),[o.location.latitude,o.location.longitude]),b=()=>{d(),r(o)};return C.jsx(dp,{noClustererRedraw:!0,icon:E,position:p,clusterer:t,options:Cp,onLoad:a,onClick:b,children:_&&!w&&C.jsx(yp,{children:C.jsx(i5,{...o,hideDetails:l,className:ot.balloon,onCloseClick:e,onSubmit:()=>i(o),onDetails:()=>n(o)})})},o.uid)},u5=({handleCloseClick:t,points:e,...n})=>{const{setSamePoints:r}=an(),{onSamePointsClusterClick:i}=Ze();return C.jsx(lw,{zoomOnClick:!1,clusterClass:ot.cluster,onClick:o=>{t();const a=o.getMarkers().map(d=>{var h,v;return{lat:(h=d.getPosition())==null?void 0:h.lat(),lng:(v=d.getPosition())==null?void 0:v.lng()}}),{lat:l,lng:u}=a[0];if(a.every(d=>d.lat===l&&d.lng===u)){const d=e.filter(({location:{latitude:h,longitude:v}})=>h===l&&v===u);r(d),i==null||i(d)}else{const d=o.getMap();if(d instanceof google.maps.Map){const h=new window.google.maps.LatLngBounds;o.getMarkers().forEach(v=>{h.extend(v.getPosition())}),d.fitBounds(h)}}},onClusteringEnd:()=>{setTimeout(()=>{const o=document.getElementsByClassName(ot.cluster);for(const s of o)s.addEventListener("touchstart",Oa,{passive:!0})},100)},onUnmount:()=>{const o=document.getElementsByClassName(ot.cluster);for(const s of o)s.removeEventListener("touchstart",Oa)},children:o=>C.jsx(C.Fragment,{children:e.map((s,a)=>C.jsx(l5,{clusterer:o,point:s,handleCloseClick:t,...n},s.uid+a))})})},c5=c.memo(u5),f5=t=>{var s;const{locale:e}=Ze(),n=c.useId(),r=an(dm),i=(s=Rt.getState().location)==null?void 0:s.uid,o=JSON.stringify([r.length,e,i,n]);return C.jsx(c5,{points:r,...t},o)},d5=c.memo(f5),Sp=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:42,height:42,fill:"none",viewBox:"0 0 42 42",...t},U.createElement("rect",{width:42,height:42,fill:"#fff",rx:21}),U.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M31.003 28V17.766a3 3 0 0 0-1.579-2.643l-7.003-3.765a3 3 0 0 0-2.842 0l-7.003 3.765a3 3 0 0 0-1.58 2.643V28a3 3 0 0 0 3 3h14.008a3 3 0 0 0 3-3Zm-5.919 1h2.92a1 1 0 0 0 1-1V17.766a1 1 0 0 0-.527-.881l-7.003-3.766a1 1 0 0 0-.948 0l-7.003 3.766a1 1 0 0 0-.527.88v10.237a1 1 0 0 0 1 1h2.92a2.513 2.513 0 0 1-.05-.5v-7.606a2.5 2.5 0 0 1 2.5-2.5h3.268a2.5 2.5 0 0 1 2.5 2.5V28.5c0 .171-.017.338-.05.5Zm-2.426 0a.5.5 0 0 0 .476-.499v-7.606a.5.5 0 0 0-.5-.5h-3.269a.5.5 0 0 0-.5.5V28.5a.5.5 0 0 0 .476.5h3.317Z",clipRule:"evenodd"}),U.createElement("rect",{width:41,height:41,x:.5,y:.5,stroke:"#1D3665",strokeOpacity:.1,rx:20.5})),h5="DeliveryBalloon-module__root__Nu90iy",p5="DeliveryBalloon-module__details__eqUTaI",g5="DeliveryBalloon-module__wh__1lJtLN",v5="DeliveryBalloon-module__header__JVdyxN",m5="DeliveryBalloon-module__title__-zKKCt",y5="DeliveryBalloon-module__description__no5-ki",b5="DeliveryBalloon-module__actions__C-N0H-",w5="DeliveryBalloon-module__errorVariant__e6uhZl",C5="DeliveryBalloon-module__logo__62gC5h",pn={root:h5,details:p5,wh:g5,header:v5,title:m5,description:y5,actions:b5,errorVariant:w5,logo:C5},S5=({SSR:t,address:e,className:n,hasCloseButton:r,hideDetails:i,onClose:o,onDetails:s,variant:a})=>{const{onWarehouseSelect:l,warehouseSelection:u}=Ze(),{setWarehousePoint:f,warehousePoint:d}=ut(),h=a==="error",v=a==="default",y=function(){return u?t?"{ courier_balloon.warehouse_title }":C.jsx(mn,{keyName:"warehouse_title",ns:"courier_balloon"}):t?"{ courier_balloon.title }":C.jsx(mn,{keyName:"title",ns:"courier_balloon"})}(),g=t?"{ courier_balloon.error_title }":C.jsx(mn,{keyName:"error_title",ns:"courier_balloon"}),S=t?"{ courier_balloon.error_description }":C.jsx(mn,{keyName:"error_description",ns:"courier_balloon"});function w(){d&&(l==null||l(d),f(null))}const{label:L,onClick:m}=u?{onClick:w,label:t?"{ select }":C.jsx(mn,{keyName:"select",ns:"common"})}:{onClick:s,label:t?"{ details }":C.jsx(mn,{keyName:"details",ns:"common"})};return C.jsxs("div",{className:ge(pn.root,n,pn[`${a}Variant`]),children:[C.jsxs("div",{className:pn.header,children:[C.jsx(Sp,{className:pn.logo}),C.jsx("span",{className:pn.title,children:h?g:y}),r&&C.jsx(ni,{onClick:o})]}),C.jsx("div",{className:pn.description,children:h?S:e||"{{ properties.address }}"}),v&&(!i||u)&&C.jsx("div",{className:pn.actions,children:C.jsx(Ft,{id:Hf,as:"button",variant:"primary",className:ge(pn.details,u?pn.wh:""),onClick:m,children:L})})]})},L5="Chip-module__root__zsoSyP",x5="Chip-module__active__BlTSFB",Sf={root:L5,active:x5},Lf=({active:t,children:e,className:n,...r})=>C.jsx("div",{...r,className:ge(Sf.root,n,{[Sf.active]:t}),children:e}),E5="TextArea-module__root__8YFknR",_5={root:E5},xf=c.forwardRef(({className:t,inputRef:e,onBlur:n,onChange:r,onFocus:i,...o},s)=>{const a=c.useRef(null);c.useImperativeHandle(s,()=>({focus:()=>{var u,f;(u=a.current)==null||u.focus(),i&&i({target:{value:(f=a.current)==null?void 0:f.value}})},blur:()=>{var u,f;(u=a.current)==null||u.blur(),n&&n({target:{value:(f=a.current)==null?void 0:f.value}})},setValue:u=>{r&&r({target:{value:u}}),a.current&&(a.current.value=u)}}),[n,r,i]);const l=xp(e,a);return C.jsx("textarea",{...o,ref:l,className:ge(_5.root,t),onBlur:n,onFocus:i,onChange:r})}),M5=({hideDeliveryTime:t,set:e})=>(n,r)=>{let i={...n};switch(r.type){case"SET_COMMENT":{i={...n,comment:r.payload};break}case"SET_DELIVERY_TIME":{i={...n,delivery_time:r.payload};break}case"SET_APARTMENT_NUMBER":{i={...n,apartment_number:r.payload};break}}return i.meta={...i.meta,valid:(t||!!i.delivery_time)&&!!i.apartment_number},e==null||e(i),i},O5="DeliveryDetailsView-module__title__azeoUr",P5="DeliveryDetailsView-module__logo__4zZtpM",k5="DeliveryDetailsView-module__header__oDE9He",T5="DeliveryDetailsView-module__content__6P27SY",R5="DeliveryDetailsView-module__section__2M3Qip",D5="DeliveryDetailsView-module__chips__KmYgha",A5="DeliveryDetailsView-module__actions__43XZ-V",I5="DeliveryDetailsView-module__submit__58LKBw",j5="DeliveryDetailsView-module__actionsHidden__SW-67b",N5="DeliveryDetailsView-module__commentSection__GlX1A2",B5="DeliveryDetailsView-module__comment__2pGG6h",xt={title:O5,logo:P5,header:k5,content:T5,section:R5,chips:D5,actions:A5,submit:I5,actionsHidden:j5,commentSection:N5,comment:B5},F5=c.forwardRef(({classes:t,hideActions:e,location:n,onChange:r,onClose:i,onSubmit:o},s)=>{var p;const{hideDeliveryTime:a,inputs:l,locale:u}=Ze(),{t:f}=Kt(["details_modal","courier_balloon","common"]),d=c.useMemo(()=>M5({set:r,hideDeliveryTime:a}),[a,r]),[h,v]=c.useState(!1),[y,g]=c.useReducer(d,{comment:"",delivery_time:"",apartment_number:"",...n}),S=c.useCallback(async()=>{v(!0);try{sn(n.address,"Address is required");const b=await Up({address:n.address,algorithm:10,service:10,language:u||$f});if(!wd(b))return;const x=b==null?void 0:b.data.data,P={...y,address:x};return o==null||o(P),P}finally{v(!1)}},[u,n.address,o,y]);c.useImperativeHandle(s,()=>({submit:S}),[S]);const w=b=>()=>{g({payload:b,type:"SET_DELIVERY_TIME"})},L=b=>{g({payload:b.target.value,type:"SET_APARTMENT_NUMBER"})},m=b=>{g({payload:b.target.value,type:"SET_COMMENT"})},_=Ls(l==null?void 0:l.apartment),E=Ls(l==null?void 0:l.comment);return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:ge(xt.header,t==null?void 0:t.header),children:[C.jsx(ni,{onClick:i}),C.jsxs("div",{className:xt.title,children:[C.jsx(Sp,{className:xt.logo}),C.jsx("span",{children:f("title",{ns:"courier_balloon"})})]})]}),C.jsxs("div",{className:ge(xt.content,t==null?void 0:t.content),children:[C.jsxs("section",{className:xt.section,children:[C.jsxs("span",{children:[f("address"),":"]}),C.jsx("p",{children:n.address})]}),!a&&C.jsxs("section",{className:xt.section,children:[C.jsxs("span",{children:[f("delivery_time"),":"]}),C.jsxs("div",{className:xt.chips,children:[C.jsx(Lf,{active:y.delivery_time==="8:00-13:00",onClick:w("8:00-13:00"),children:"8:00 - 13:00"}),C.jsx(Lf,{active:y.delivery_time==="14:00-22:00",onClick:w("14:00-22:00"),children:"14:00 - 22:00"})]})]}),C.jsxs("section",{className:xt.section,children:[C.jsxs("span",{children:[f("apartment_number"),":"]}),C.jsx(xf,{..._,rows:1,onChange:L})]}),C.jsxs("section",{className:ge(xt.section,xt.commentSection),children:[C.jsxs("span",{children:[f("comment"),":"]}),C.jsx(xf,{...E,className:xt.comment,onChange:m})]})]}),C.jsx("div",{className:ge(xt.actions,{[xt.actionsHidden]:e}),children:C.jsx(Ft,{loading:h,disabled:!((p=y.meta)!=null&&p.valid)||h,variant:"primary",className:xt.submit,onClick:S,children:f("choose",{ns:"common"})})})]})}),Lp=c.memo(F5),U5={header:ot.deliveryDetailsViewHeader,content:ot.deliveryDetailsViewContent},V5=({hideDeliveryTime:t,hideDetails:e,onPointClick:n,point:r,setDeliveryPoint:i,setOpenDetails:o})=>{const{warehouseSelection:s}=Ze(),{warehousePoint:a}=ut(),l=Al({isSelectedPoint:!0}),u=c.useRef(null),[f,d]=c.useState(!1),[h,v]=c.useState({...r,comment:"",delivery_time:"",apartment_number:""});c.useEffect(()=>{v({...r,comment:"",delivery_time:"",apartment_number:""})},[r]);const[y,g]=c.useState(null),S=gr("screenSm"),w=c.useMemo(()=>({lat:h.coords[0],lng:h.coords[1]}),[h.coords]),L=()=>{o==null||o(!0)},m=()=>{i==null||i(null)},_=c.useMemo(()=>({url:Rl(Or(Pt.PinHome,"--owl-color-success")),scaledSize:new google.maps.Size(...Xp)}),[]),E=async()=>{var P;try{d(!0);const O=await((P=u.current)==null?void 0:P.submit());if(!O)return;n==null||n(O),o==null||o(!1),i==null||i(null)}finally{d(!1)}},p=C.jsx(S5,{...h,hideDetails:e,hasCloseButton:S,variant:h.address?"default":"error",className:ot.balloon,onDetails:L,onClose:m}),b=s?!!a&&!!(y!=null&&y.getVisible()):l&&!!(y!=null&&y.getVisible()),x=t?!!h.apartment_number:!!h.apartment_number&&!!h.delivery_time;return C.jsxs(dp,{noClustererRedraw:!0,icon:_,position:w,options:Cp,onLoad:g,children:[S&&C.jsxs(Wh,{minSnapHeight:h.address?200:void 0,submitDisabled:!x||f,submitLoading:f,hideFooter:!h.address,open:b,onDismiss:m,onSubmitClick:E,children:[h.address&&C.jsx(Lp,{ref:u,hideActions:!0,classes:U5,location:r,onChange:v,onClose:m}),h.address?null:p]}),!S&&b&&C.jsx(yp,{onCloseClick:m,children:p})]})},z5={place:null,mapKey:""},H5=t=>{var e,n;return(n=(e=t.place)==null?void 0:e.address_components)==null?void 0:n.find(r=>r.types.includes("locality"))},uo=wn((t,e)=>({...z5,setMapKey(n){t({mapKey:n})},async setPlace(n,r,i){var l,u,f,d,h,v;const{map:o}=pe.getState();let s,a;if(console.debug("[OmnicWidgetLocations::setDeliveryAdressPlace]",{value:n,types:r}),Pa(n)){const y=await ka(n,e().mapKey,r);s=(l=y==null?void 0:y.results)==null?void 0:l[0],i&&(s=(u=y==null?void 0:y.results)==null?void 0:u.find(g=>{var S;return(S=g.types)==null?void 0:S.includes(i)}))}else if(s=n,s!=null&&s.place_id){const{results:y}=await ka(s.place_id,e().mapKey);a=(d=(f=y==null?void 0:y[0])==null?void 0:f.geometry)==null?void 0:d.viewport}else(h=s==null?void 0:s.geometry)!=null&&h.viewport?a=s.geometry.viewport:(v=s==null?void 0:s.geometry)!=null&&v.location&&(a=new google.maps.LatLngBounds,a.extend(s.geometry.location));return a&&(console.debug("[OmnicWidgetLocations::fitMapBounds]",a.toJSON()),o==null||o.fitBounds(a)),sn(s,"Place is not defined"),t({place:s}),s},async setPlaceAndPoint(n,r){var u;const i=r==null?void 0:r.types,o=Pa(n)?await e().setPlace(n,i):await e().setPlace(n),s=(u=o.geometry)==null?void 0:u.location;sn(s,"Location is not defined");const a=[s.lat(),s.lng()],l={address:o.formatted_address,coords:a};return r!=null&&r.warehouseSelection&&ut.getState().setWarehousePoint({...o,coords:{lat:s.lat(),lng:s.lng()}}),(!(r!=null&&r.ignoreSelection)||r!=null&&r.warehouseSelection)&&ut.getState().setDeliverPoint(l),o},setPlaceSimple(n,r){var i,o;if(r!=null&&r.withNavigation){const{map:s}=pe.getState();sn(s,"Map is not defined");let a;(i=n==null?void 0:n.geometry)!=null&&i.viewport?a=n.geometry.viewport:(o=n==null?void 0:n.geometry)!=null&&o.location&&(a=new google.maps.LatLngBounds,a.extend(n.geometry.location)),a&&(s.fitBounds(a),s.setZoom(12))}t({place:n})}})),$5=({children:t,className:e,...n})=>{const{disableDelivery:r,map:i,mapTheme:o,palette:s,warehouseSelection:a}=Ze(),l=s==null?void 0:s.primary;function u(){switch(o){case"omnic":return o5;case"omnic-light":return s5(l);default:return}}const f=u(),d=c.useMemo(()=>{var v,y;return{lat:((v=i==null?void 0:i.center)==null?void 0:v[0])??wa[0],lng:((y=i==null?void 0:i.center)==null?void 0:y[1])??wa[1]}},[i==null?void 0:i.center]),h=c.useCallback(async v=>{const{latLng:y}=v;if(!y||r&&!a)return;pe.getState().setDetailsOpen(!1),Rt.getState().setSelectedLocation(null);const g=[y.lat(),y.lng()];console.debug("[OmnicLocationsWidget::mapClick]",g);try{await uo.getState().setPlaceAndPoint(g,{warehouseSelection:a})}catch{ut.getState().setDeliverPoint({address:null,coords:g})}},[r,a]);return C.jsx(H4,{zoom:i==null?void 0:i.initialZoom,center:d,mapContainerClassName:ge(ot.root,e),options:{styles:f,...a5},onClick:h,...n,children:t})},W5=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},U.createElement("rect",{width:2,height:20,x:9,fill:"#fff",rx:1}),U.createElement("rect",{width:2,height:20,x:20,y:9,fill:"#fff",rx:1,transform:"rotate(90 20 9)"}),U.createElement("circle",{cx:10,cy:10,r:8,fill:"#fff"}),U.createElement("circle",{cx:10,cy:10,r:6,fill:"currentcolor"}),U.createElement("circle",{cx:10,cy:10,r:4,fill:"#fff"})),G5=t=>{const e=document.createElement("div"),n=document.createElement("div");e.classList.add(ot.mapControl),n.classList.add(ot.mapControl),e.innerHTML="+",n.innerHTML="—",t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(n),t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e),e.addEventListener("click",()=>{const r=t.getZoom()||0;return t.setZoom(r+1)}),n.addEventListener("click",()=>{const r=t.getZoom()||0;return t.setZoom(r-1)})},Z5=t=>{const e=document.createElement("div");e.classList.add(ot.mapControl),e.classList.add(ot.geolocationControl),e.innerHTML=Hp.renderToString(C.jsx(W5,{})),t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e),e.addEventListener("click",()=>{Tl()})},q5=({className:t})=>{const e=Vn(),n=pe(kg),r=pe(Ig),i=an(Sd),o=ut(Ll),{lmsData:s}=Rs(),{cityName:a,countryAbbreviation:l,disableGeolocation:u,hideDeliveryTime:f,hideDetails:d,hideMapControls:h,onPointClick:v,regionName:y,skipPointInfo:g}=Ze(),S=c.useCallback(M=>{console.debug("[OmnicLocationsWidget::loadMap]",M),pe.getState().setMap(M),pe.getState().setLoaded(),h||(G5(M),u||Z5(M))},[u,h]),w=c.useCallback(M=>{const R=s==null?void 0:s.location.what3words,A=R!=null&&R.id?R:void 0;v==null||v(M,A)},[v,s]),L=c.useCallback(()=>{console.debug("[OmnicLocationsWidget::unmountMap]"),pe.getState().setMap(null)},[]),m=c.useCallback(()=>{if(pe.getState().setIdle(!0),!n)return;const M=n==null?void 0:n.getBounds();M&&(console.debug("[OmnicLocationsWidget::changeBounds]",M),an.getState().loadNext({bounds:[[M.getSouthWest().lat(),M.getNorthEast().lat()],[M.getSouthWest().lng(),M.getNorthEast().lng()]],filter:e,city_name:a,country_abbreviation:l,region_name:y}))},[a,l,e,n,y]),_=c.useCallback(async M=>{ut.getState().setDeliverPoint(null),Rt.getState().setSelectedLocation(M)},[]),E=c.useCallback(()=>{console.debug("[OmnicLocationsWidget::tilesLoaded]")},[]),p=pe.getState().setDetailsOpen,{getLMSData:b}=T4(),x=M=>{if(b(M.code),g){w(M);return}p(!1),_(M)},P=()=>{p(!1),_(null)},O=M=>{p(!0),_(M)},T=M=>{w(M),p(!1),_(null)};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:ge(ot.mapContainer,t),children:[C.jsxs($5,{onIdle:m,onLoad:S,onUnmount:L,onTilesLoaded:E,onBoundsChanged:()=>{pe.getState().setIdle(!1)},children:[o&&C.jsx(V5,{hideDeliveryTime:f,hideDetails:d,point:o,setOpenDetails:pe.getState().setDetailsOpen,setDeliveryPoint:ut.getState().setDeliverPoint,onPointClick:w}),C.jsx(d5,{handleCloseClick:P,handleDetailsClick:O,handlePointClick:x,handleSubmitClick:T})]}),(i||r)&&C.jsx(Gh,{className:ot.overlay,children:C.jsx(ls,{})})]}),C.jsx(K3,{handleDetailsClick:O,handlePointClick:x}),C.jsx(L3,{handleCloseClick:P,handleSubmitClick:T})]})},K5=c.memo(q5),Q5=t=>({google:K5})[t];function xp(...t){return c.useCallback(e=>{for(const n of t)typeof n=="function"?n(e):n&&typeof n=="object"&&(n.current=e)},t)}const Ls=t=>{const e=c.useCallback(()=>{var n;(n=t==null?void 0:t.onClick)==null||n.call(t,t.name)},[t]);return{ref:t==null?void 0:t.ref,name:t==null?void 0:t.name,onClick:e}},J5=()=>{throw new Error("useMediaQuery is a client-only hook")};function Y5(t){const e=c.useCallback(r=>{const i=window.matchMedia(t);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[t]),n=()=>window.matchMedia(t).matches;return c.useSyncExternalStore(e,n,J5)}const X5="768px",eC="1024px",tC="1280px",nC="1536px",rC={screenSm:X5,screenMd:eC,screenLg:tC,screenXl:nC};function gr(t){return Y5(`(max-width: calc(${rC[t]} - 1px))`)}const Ep=O0().use(g0()).use(s0()).init({language:"en",defaultNs:"common",ns:["common","courier_balloon","current_location","details_modal","header","location_aside","location_selector","receive_filter","send_filter","type_filter"],apiUrl:"https://tms.omnic.solutions",apiKey:"tgpak_gfpwentkga2g4zdngbzwozdinvztezlknu4xmnlpnbrgc"}),iC=t=>{c.useEffect(()=>{t&&(Ep.changeLanguage(t),ss.setLanguage(t))},[t])},oC=t=>{c.useEffect(()=>{if(t){const e=Object.keys(t);for(const n of e){const r=t[n];r&&oo(`--owl-color-${n}`,r)}}},[t])},sC=t=>{c.useEffect(()=>{t&&t!==void 0&&oo("--owl-button-radius",`${t}px`)},[t])},aC=t=>{c.useEffect(()=>{t&&t!==void 0&&oo("--owl-font",t)},[t])},lC={open:!1},uC=t=>t.open,er=wn(t=>({...lC,toggle(e){t(n=>({open:e??!n.open}))}})),cC=t=>{const e=t==="selector";c.useEffect(()=>{e&&er.getState().toggle(!0)},[e])},fC=({locale:t})=>{const[e,n]=c.useState(!1);return c.useEffect(()=>{n(!1)},[t]),c.useEffect(()=>{e||n(!0)},[e]),console.debug("[OmnicWidgetLocations::remount]",{locale:t,mounted:e}),e},dC=t=>{c.useEffect(()=>{t==="sharp"&&oo("--owl-radius","0")},[t])},hC=({children:t})=>{const{cornersVariant:e,font:n,locale:r,palette:i,radius:o,startScreen:s}=Ze();return aC(n),iC(r),oC(i),sC(o),cC(s),dC(e),C.jsx(C.Fragment,{children:t})},pC=({children:t})=>{const{disableGeolocation:e,map:n}=Ze(),[r,i]=c.useState(e),{loaded:o}=pe();return sn(n==null?void 0:n.center,"Map center is required"),sn(n==null?void 0:n.initialZoom,"Map initial zoom is required"),c.useEffect(()=>{!o||e||r||Tl({success:s=>{n.center=[s.coords.latitude,s.coords.longitude],i(!0),Rt.getState().setIsTrackingEnabled(!0)},error:()=>{i(!0)}})},[e,r,o,n]),t},gC=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:28,fill:"none",viewBox:"0 0 24 28",...t},U.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M24 11.777C24 4.052 17.606 0 12 0S0 4.052 0 11.777C0 16.915 3.994 22.334 12 28c8.006-5.666 12-11.085 12-16.224ZM12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",clipRule:"evenodd"})),vC=()=>{er.getState().toggle(!0),pe.getState().setDetailsOpen(!1),ut.getState().setDeliverPoint(null),Rt.getState().setSelectedLocation(null)},mC="CurrentLocation-module__root__AeQCGT",yC="CurrentLocation-module__icon__459m9q",bC="CurrentLocation-module__text__w-9v28",pa={root:mC,icon:yC,text:bC},_p=({className:t})=>{const{t:e}=Kt("current_location"),n=uo(H5),{location:r}=Rt(),o=(r==null?void 0:r.location.full_address)??(n==null?void 0:n.long_name)??e("choose_from_map");return C.jsxs("div",{role:"presentation",className:ge(pa.root,t),onClick:vC,children:[C.jsx(gC,{className:pa.icon}),C.jsx("span",{className:pa.text,children:o})]})},wC=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:123,height:32,fill:"none",viewBox:"0 0 123 32",...t},U.createElement("path",{fill:"currentcolor",d:"M6.698 32a6.579 6.579 0 0 1-3.35-.889 6.718 6.718 0 0 1-2.443-2.4A6.285 6.285 0 0 1 0 25.422V6.578c0-1.215.302-2.311.905-3.29A6.718 6.718 0 0 1 3.35.889 6.579 6.579 0 0 1 6.698 0h19.188c1.207 0 2.308.296 3.304.889a6.72 6.72 0 0 1 2.444 2.4c.633.978.95 2.074.95 3.289v18.844a6.061 6.061 0 0 1-.95 3.29 6.72 6.72 0 0 1-2.444 2.4c-.996.592-2.097.888-3.304.888H6.698Zm.317-6.933h18.464V6.933H7.015v18.134ZM37.568 32V0h7.24l11.043 12.933L66.848 0h7.287v32h-7.06V10.533L55.85 23.69 44.582 10.578V32h-7.014Zm41.985 0V0h7.241l18.238 21.333V0h7.105v32h-7.241L86.568 10.578V32h-7.015Zm36.523 0V0H123v32h-6.924Z"})),CC=t=>U.createElement("svg",{width:119,height:44,viewBox:"0 0 119 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},U.createElement("path",{d:"M4.70489 0.199253H0V13.4418H10.7452V10.0105H4.70489V0.199253Z",fill:"black"}),U.createElement("path",{d:"M16.9359 0.199253H12.2287V13.4418H22.974V10.0105H16.9359V0.199253Z",fill:"black"}),U.createElement("path",{d:"M27.9807 0.199253L23.6569 13.4418H28.3442L28.9701 10.913H32.5644L33.1703 13.4418H37.9766L33.6354 0.199253H27.9807ZM29.6775 8.00558L30.7881 3.41028L31.879 8.00558H29.6775Z",fill:"black"}),U.createElement("path",{d:"M48.1266 6.0777L47.5404 8.54701H47.5008L46.9146 6.0777L45.3786 0.199253H38.7936V13.4418H42.9146V8.84631L42.8551 4.39405H42.9345L45.48 13.4418H49.2373L51.8222 4.39405H51.8817L51.8222 8.84631V13.4418H55.9233V0.199253H49.6626L48.1266 6.0777Z",fill:"black"}),U.createElement("path",{d:"M61.057 0.199253L56.7333 13.4418H61.4206L62.0465 10.913H65.6429L66.2489 13.4418H71.0552L66.7139 0.199253H61.057ZM62.7539 8.00558L63.8645 3.41028L64.9553 8.00558H62.7539Z",fill:"black"}),U.createElement("path",{d:"M85.656 6.77975C86.6916 6.6323 87.4541 6.28455 87.9389 5.73657C88.4238 5.18853 88.6662 4.51949 88.6662 3.72939C88.6662 2.55195 88.2562 1.67601 87.4344 1.1016C86.6145 0.513972 85.3607 0.212458 83.677 0.199253H76.0413V13.4418H84.2015C85.8301 13.4418 87.0354 13.1533 87.8177 12.5789C88.611 11.9913 89.0099 11.1132 89.0099 9.95118C89.0099 9.09505 88.7411 8.38636 88.2011 7.82518C87.6612 7.26393 86.8151 6.9228 85.656 6.80175V6.77975ZM80.5455 3.41028H82.6457C83.4545 3.41028 83.8577 3.7316 83.8577 4.37425C83.8577 5.01689 83.4545 5.33822 82.6457 5.33822H80.5455V3.41028ZM83.8797 10.1492C83.677 10.312 83.3685 10.3913 82.952 10.3913H80.5499V8.46561H82.952C83.3685 8.46561 83.6792 8.54701 83.8797 8.70549C84.0957 8.86619 84.2015 9.09945 84.2015 9.40754C84.2015 9.71567 84.0935 9.97757 83.8797 10.1492Z",fill:"black"}),U.createElement("path",{d:"M114.374 6.72035L118.616 0.199253H113.485L111.91 3.51152L110.354 0.199253H104.801L109.063 6.8414L104.638 13.4418H109.951L111.566 10.0105L113.325 13.4418H118.999L114.374 6.72035Z",fill:"black"}),U.createElement("path",{d:"M102.472 0.378544C102.053 0.125449 101.59 0 101.086 0H93.0312C92.5242 0 92.0549 0.127649 91.6252 0.378544C91.1931 0.631642 90.8517 0.972769 90.5982 1.40194C90.3448 1.8201 90.217 2.28667 90.217 2.80386V10.8369C90.217 11.3432 90.3448 11.8097 90.5982 12.2388C90.8517 12.6681 91.1931 13.0092 91.6252 13.2622C92.0549 13.5152 92.5242 13.6407 93.0312 13.6407H101.086C101.593 13.6407 102.053 13.513 102.472 13.2622C102.902 13.0092 103.245 12.6681 103.497 12.2388C103.763 11.8097 103.895 11.341 103.895 10.8369V2.80606C103.895 2.28667 103.761 1.8201 103.497 1.40414C103.243 0.974969 102.902 0.633842 102.472 0.380745V0.378544ZM100.116 9.89279H93.9611V3.75243H100.116V9.89279Z",fill:"black"}),U.createElement("path",{d:"M43.3879 27.3704C42.6166 26.8512 41.7372 26.4993 40.7478 26.3145L44.9726 21.5605H40.8226L36.1199 26.794V30.7935C37.0917 30.4415 37.9887 30.2655 38.8107 30.2655C39.5644 30.2655 40.2101 30.4085 40.7478 30.6923C41.6204 31.1455 42.0569 31.8319 42.0569 32.7559V32.8307C42.0569 33.1827 41.973 33.4269 41.8056 33.5611C41.6558 33.6953 41.3692 33.7635 40.9505 33.7635H32.8715C32.2345 33.7635 31.7983 33.6469 31.5625 33.4115C31.3444 33.1607 31.2363 32.6987 31.2363 32.0277V26.3431L27.0866 28.532V32.6569C27.0866 33.0925 27.0117 33.3873 26.8595 33.5369C26.7075 33.6887 26.4144 33.7635 25.9803 33.7635H23.7412C23.305 33.7635 23.0118 33.6887 22.8619 33.5369C22.7121 33.3851 22.6349 33.0925 22.6349 32.6569V26.8468L18.4852 29.0357V32.6591C18.4852 33.0947 18.4103 33.3895 18.2583 33.5391C18.1084 33.6909 17.8131 33.7657 17.379 33.7657H15.1664C14.73 33.7657 14.4369 33.6909 14.2871 33.5391C14.1372 33.3873 14.06 33.0947 14.06 32.6591V27.3506L9.91037 29.5395V35.9282C9.91037 37.6727 8.92967 38.5439 6.96835 38.5439C6.02952 38.5439 5.28242 38.2073 4.72931 37.5386C4.17615 36.8522 3.89848 35.9458 3.89848 34.8216C3.89848 33.6975 4.18276 32.5161 4.75355 31.4249L0.830824 32.2543C0.277676 33.2113 0 34.3091 0 35.5498C0 37.2944 0.50246 38.8033 1.50958 40.0771C2.801 41.7381 4.61911 42.5674 6.96835 42.5674C8.6454 42.5674 10.0779 42.1736 11.2701 41.3861C12.5946 40.5149 13.4497 39.2895 13.8353 37.7123C14.1372 37.7629 14.4568 37.7871 14.7917 37.7871H18.0114C19.0009 37.7365 19.8559 37.4858 20.5767 37.0326C21.3655 37.5364 22.2956 37.7871 23.3689 37.7871H26.5885C27.7125 37.7365 28.6513 37.4352 29.405 36.8808C30.3262 37.4836 31.4259 37.7871 32.6996 37.7871H41.3581C42.7157 37.7871 43.8309 37.4022 44.7036 36.63C45.7107 35.7566 46.2132 34.5334 46.2132 32.9561V32.7053C46.2132 30.3909 45.2745 28.6134 43.3967 27.3726L43.3879 27.3704Z",fill:"#6A4A9D"}),U.createElement("path",{d:"M66.0266 39.8246C65.4051 39.8246 64.9026 40.0094 64.517 40.3789C64.1313 40.7639 63.9397 41.2677 63.9397 41.8881C63.9397 42.5084 64.1335 43.0123 64.517 43.3973C64.9026 43.7998 65.4051 44 66.0266 44C66.648 44 67.1416 43.8064 67.5097 43.4215C67.8953 43.0365 68.0869 42.5238 68.0869 41.8881C68.0869 41.2523 67.8931 40.7639 67.5097 40.3789C67.1416 40.0094 66.6458 39.8246 66.0266 39.8246Z",fill:"#6A4A9D"}),U.createElement("path",{d:"M65.0208 32.6578C65.0208 33.0933 64.9459 33.3881 64.7938 33.5377C64.6418 33.6896 64.3487 33.7644 63.9124 33.7644H59.5733V30.6954C59.5733 29.3205 59.1788 28.2051 58.3922 27.3495C57.4864 26.3441 56.2038 25.8403 54.5444 25.8403C53.002 25.8403 51.752 26.3353 50.7956 27.3253C49.74 28.4165 49.2111 29.9079 49.2111 31.802C49.2111 33.1109 49.6143 34.2835 50.4187 35.3241C51.3751 36.5494 52.6666 37.2862 54.2932 37.5372C54.745 37.6032 55.124 37.6472 55.4259 37.6626C55.3599 37.997 55.124 38.283 54.7207 38.5182C54.3351 38.769 53.9076 38.8946 53.4382 38.8946C52.532 38.8946 51.5339 38.5754 50.4452 37.9398V41.5366C51.5691 42.2229 52.6841 42.5683 53.7908 42.5683C55.1835 42.5683 56.3979 42.1987 57.438 41.4619C58.6962 40.5731 59.3993 39.3478 59.5513 37.788H64.2936C65.6691 37.788 66.793 37.3942 67.6635 36.6044C68.6684 35.6981 69.173 34.4485 69.173 32.8558V26.3397L65.0235 28.5285V32.6534L65.0208 32.6578ZM55.4259 33.6896C55.3599 33.672 55.2674 33.6654 55.1484 33.6654C54.864 33.6147 54.6612 33.573 54.5444 33.5399C53.707 33.3221 53.2861 32.693 53.2861 31.6524C53.2861 30.3787 53.7048 29.7407 54.5444 29.7407C55.1306 29.7407 55.4237 30.0597 55.4237 30.6977V33.6918L55.4259 33.6896Z",fill:"#6A4A9D"}),U.createElement("path",{d:"M95.419 25.837C94.0615 25.837 92.9465 26.2221 92.0734 26.9942C91.0839 27.883 90.5903 29.1149 90.5903 30.6923V32.6547C90.5903 33.0903 90.5155 33.3851 90.3633 33.5347C90.2135 33.6865 89.9182 33.7613 89.4839 33.7613H85.3124C84.8761 33.7613 84.583 33.6865 84.431 33.5347C84.2811 33.3829 84.204 33.0903 84.204 32.6547V21.5605L80.0544 23.7495V32.8571C80.0544 34.2497 80.4489 35.3892 81.2357 36.278C82.1237 37.2834 83.3556 37.7871 84.9334 37.7871H89.8587C90.8305 37.7871 91.6943 37.5782 92.4507 37.158C93.2726 37.5782 94.3282 37.7871 95.6196 37.7871C97.0608 37.7871 98.2354 37.2922 99.1411 36.3022C100.181 35.1956 100.701 33.6953 100.701 31.7989C100.701 30.1731 100.292 28.8224 99.4694 27.7489C98.513 26.4751 97.1644 25.837 95.419 25.837ZM95.3948 33.7613C94.9584 33.7613 94.7403 33.5853 94.7403 33.2333V30.5427C94.7403 30.0059 94.9673 29.7375 95.419 29.7375C96.2234 29.7375 96.6267 30.3755 96.6267 31.6493C96.6267 33.0573 96.2168 33.7635 95.3948 33.7635V33.7613Z",fill:"#6A4A9D"}),U.createElement("path",{d:"M114.85 32.0277C114.85 32.6987 114.734 33.1607 114.498 33.4115C114.28 33.6469 113.852 33.7635 113.215 33.7635H112.31V24.8317L108.159 27.0448V33.7613H105.167L103.08 37.7871H113.392C115.036 37.7871 116.36 37.2921 117.365 36.3021C118.456 35.2462 119 33.8295 119 32.0497V21.5605L114.85 23.7737V32.0277Z",fill:"#6A4A9D"})),SC="Header-module__root__Pe4MYp",LC="Header-module__nav__wtnkmT",xC="Header-module__navItem__-Fy63Z",EC="Header-module__logo__xO2bWO",_i={root:SC,nav:LC,navItem:xC,logo:EC},_C={llama:CC,default:wC},MC=()=>{const{hideLogo:t,logo:e="default"}=Ze();if(t)return null;const n=_C[e];return C.jsx("div",{className:_i.logo,children:C.jsx(n,{})})},OC=({className:t})=>{const{t:e}=Kt("header"),{disableDelivery:n}=Ze(),r=pe(Tg),i=ut(Ll);c.useEffect(()=>{i?pe.getState().setMode("location_delivery"):pe.getState().setMode("self_pickup")},[i]);const o=()=>{ut.getState().setDeliverPoint(null),pe.getState().setMode("self_pickup")},s=()=>{ut.getState().setDeliverPoint(null),pe.getState().setMode("location_delivery")},a=r==="self_pickup",l=r==="location_delivery";return C.jsxs("div",{className:ge(_i.root,t),children:[C.jsx(MC,{}),C.jsxs("nav",{className:_i.nav,children:[!n&&C.jsx(Ft,{as:"link",className:_i.navItem,variant:a?"primary":"secondary",onClick:o,children:e("self_pickup")}),!n&&C.jsx(Ft,{as:"link",className:_i.navItem,variant:l?"primary":"secondary",onClick:s,children:e("courier_delivery")}),C.jsx(_p,{})]})]})},PC=c.memo(OC),kC={open:!1},Yr=wn(t=>({...kC,toggle(e){pe.getState().setDetailsOpen(!1),ut.getState().setDeliverPoint(null),Rt.getState().setSelectedLocation(null),t(n=>({open:e??!n.open}))}})),TC="Layout-module__root__qzPL-f",RC="Layout-module__headerHidden__JEN-d0",DC="Layout-module__sidebarHidden__x017O3",AC="Layout-module__sidebarOpen__IZnIjs",Uo={root:TC,headerHidden:RC,sidebarHidden:DC,sidebarOpen:AC},IC=({children:t})=>{const{hideFilters:e,hideHeader:n}=Ze(),r=Yr(i=>i.open);return C.jsx("div",{className:ge(Uo.root,{[Uo.sidebarOpen]:r,[Uo.headerHidden]:n,[Uo.sidebarHidden]:e}),children:t})},Bs=()=>C.jsx(Gh,{children:C.jsx(ls,{})}),jC=({children:t})=>{const e=an(hm);return an(Sd)&&!e?C.jsx(Bs,{}):C.jsx(C.Fragment,{children:t})};var Mp={},Fs={},Op={exports:{}},NC="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",BC=NC,FC=BC;function Pp(){}function kp(){}kp.resetWarningCache=Pp;var UC=function(){function t(r,i,o,s,a,l){if(l!==FC){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:kp,resetWarningCache:Pp};return n.PropTypes=n,n};Op.exports=UC();var VC=Op.exports,Us={},Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.loadGoogleMapScript=Xr.isBrowser=void 0;var Tp=typeof window<"u"&&window.document;Xr.isBrowser=Tp;var zC=function(e,n){if(!Tp||typeof google<"u"&&google.maps&&google.maps.api)return Promise.resolve();var r=document.querySelectorAll('script[src*="'.concat(e,'"]'));if(r&&r.length)return new Promise(function(s){if(typeof google<"u")return s();r[0].addEventListener("load",function(){return s()})});var i=new URL(n);i.searchParams.set("callback","__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__");var o=document.createElement("script");return o.src=i.toString(),new Promise(function(s){window.__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__=s,document.body.appendChild(o)})};Xr.loadGoogleMapScript=zC;var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.GOOGLE_MAP_SCRIPT_BASE_URL=void 0;var HC="https://maps.googleapis.com/maps/api/js";Vs.GOOGLE_MAP_SCRIPT_BASE_URL=HC;function ns(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ns=function(n){return typeof n}:ns=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ns(t)}Object.defineProperty(Us,"__esModule",{value:!0});Us.default=KC;var Et=WC(c),ga=Xr,$C=Vs;function Rp(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Rp=function(i){return i?n:e})(t)}function WC(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||ns(t)!=="object"&&typeof t!="function")return{default:t};var n=Rp(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function Ef(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _f(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ef(Object(n),!0).forEach(function(r){GC(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ef(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function GC(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZC(t,e){if(t==null)return{};var n=qC(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function qC(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function KC(t){var e=t.ref,n=t.onPlaceSelected,r=t.apiKey,i=t.libraries,o=i===void 0?"places":i,s=t.inputAutocompleteValue,a=s===void 0?"new-password":s,l=t.options;l=l===void 0?{}:l;var u=l.types,f=u===void 0?["(cities)"]:u,d=l.componentRestrictions,h=l.fields,v=h===void 0?["address_components","geometry.location","place_id","formatted_address"]:h,y=l.bounds,g=ZC(l,["types","componentRestrictions","fields","bounds"]),S=t.googleMapsScriptBaseUrl,w=S===void 0?$C.GOOGLE_MAP_SCRIPT_BASE_URL:S,L=t.language,m=(0,Et.useRef)(null),_=(0,Et.useRef)(null),E=(0,Et.useRef)(null),p=(0,Et.useRef)(null),b=L?"&language=".concat(L):"",x="".concat(w,"?libraries=").concat(o,"&key=").concat(r).concat(b),P=(0,Et.useCallback)(function(){return(0,ga.loadGoogleMapScript)(w,x)},[w,x]);return(0,Et.useEffect)(function(){var O=_f(_f({},g),{},{fields:v,types:f,bounds:y});if(d&&(O.componentRestrictions=d),!(E.current||!m.current||!ga.isBrowser)){e&&!e.current&&(e.current=m.current);var T=function(){var R;if(typeof google>"u")return console.error("Google has not been found. Make sure your provide apiKey prop.");if(!((R=google.maps)!==null&&R!==void 0&&R.places))return console.error("Google maps places API must be loaded.");if(!m.current instanceof HTMLInputElement)return console.error("Input ref must be HTMLInputElement.");E.current=new google.maps.places.Autocomplete(m.current,O),E.current&&(_.current=E.current.addListener("place_changed",function(){n&&E&&E.current&&n(E.current.getPlace(),m.current,E.current)}))};return r?P().then(function(){return T()}):T(),function(){return _.current?_.current.remove():void 0}}},[]),(0,Et.useEffect)(function(){var O;!(Et.default!==null&&Et.default!==void 0&&(O=Et.default.version)!==null&&O!==void 0&&O.startsWith("18"))&&ga.isBrowser&&window.MutationObserver&&m.current&&m.current instanceof HTMLInputElement&&(p.current=new MutationObserver(function(){p.current.disconnect(),m.current&&(m.current.autocomplete=a)}),p.current.observe(m.current,{attributes:!0,attributeFilter:["autocomplete"]}))},[a]),(0,Et.useEffect)(function(){E.current&&E.current.setFields(v)},[v]),(0,Et.useEffect)(function(){E.current&&E.current.setBounds(y)},[y]),(0,Et.useEffect)(function(){E.current&&E.current.setComponentRestrictions(d)},[d]),(0,Et.useEffect)(function(){E.current&&E.current.setOptions(g)},[g]),{ref:m,autocompleteRef:E}}function rs(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rs=function(n){return typeof n}:rs=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},rs(t)}Object.defineProperty(Fs,"__esModule",{value:!0});Fs.default=void 0;var wl=JC(c),Xe=Dp(VC),QC=Dp(Us);function Dp(t){return t&&t.__esModule?t:{default:t}}function Ap(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Ap=function(i){return i?n:e})(t)}function JC(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||rs(t)!=="object"&&typeof t!="function")return{default:t};var n=Ap(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function xs(){return xs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xs.apply(this,arguments)}function YC(t,e){if(t==null)return{};var n=XC(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XC(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Ip(t){var e=t.onPlaceSelected,n=t.apiKey,r=t.libraries,i=t.inputAutocompleteValue,o=t.options,s=t.googleMapsScriptBaseUrl,a=t.refProp,l=t.language,u=YC(t,["onPlaceSelected","apiKey","libraries","inputAutocompleteValue","options","googleMapsScriptBaseUrl","refProp","language"]),f=(0,QC.default)({ref:a,googleMapsScriptBaseUrl:s,onPlaceSelected:e,apiKey:n,libraries:r,inputAutocompleteValue:i,options:o,language:l}),d=f.ref;return wl.default.createElement("input",xs({ref:d},u))}Ip.propTypes={apiKey:Xe.default.string,libraries:Xe.default.arrayOf(Xe.default.string),ref:Xe.default.oneOfType([Xe.default.func,Xe.default.shape({current:Xe.default.any})]),googleMapsScriptBaseUrl:Xe.default.string,onPlaceSelected:Xe.default.func,inputAutocompleteValue:Xe.default.string,options:Xe.default.shape({componentRestrictions:Xe.default.object,bounds:Xe.default.object,location:Xe.default.object,offset:Xe.default.number,origin:Xe.default.object,radius:Xe.default.number,sessionToken:Xe.default.object,types:Xe.default.arrayOf(Xe.default.string)}),language:Xe.default.string};var e6=(0,wl.forwardRef)(function(t,e){return wl.default.createElement(Ip,xs({},t,{refProp:e}))});Fs.default=e6;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"usePlacesWidget",{enumerable:!0,get:function(){return n.default}});var e=r(Fs),n=r(Us);function r(i){return i&&i.__esModule?i:{default:i}}})(Mp);var jp=Mp;async function t6(){return(await Ye.request({method:"GET",baseURL:"https://api.geo-data.omnic.solutions/api/1.0/key",headers:{Authorization:"Token fa812020-3197-401a-9b39-345999046111"}})).data.data}function n6(t){return op({queryKey:["wl-map-key-wl"],queryFn:()=>t6(),refetchOnWindowFocus:!1,retry:2,enabled:!t})}const Np=c.createContext(null),r6=({children:t})=>{const{gMapKey:e}=Ze(),{data:n,isFetching:r}=n6(e),i=c.useMemo(()=>({mapKey:e||n||"AIzaSyDsI0AO8VsUrTPoyR9fF7T31FKx1a9TLO0"}),[n,e]);return C.jsx(Np.Provider,{value:i,children:r?C.jsx(Bs,{}):t})},Yl=()=>{const t=c.useContext(Np);if(!t)throw new Error("useMapKeyContext must be used within a MapKeyProvider");return t},i6="Aside-module__root__EotK2f",o6="Aside-module__open__Zwmbs5",s6="Aside-module__overlay__slLdHF",a6="Aside-module__container__28P4wq",Vo={root:i6,open:o6,overlay:s6,container:a6},l6=({children:t,className:e,open:n})=>C.jsxs("div",{className:ge(Vo.root,e,{[Vo.open]:n}),children:[C.jsx("div",{className:Vo.overlay}),C.jsx("div",{className:Vo.container,children:t})]}),u6="Input-module__locationSearchRoot__svh-f9",c6="Input-module__endAdornment__m40K5R",f6="Input-module__input__505b7i",d6="Input-module__startAdornment__D-sJ0N",h6="Input-module__locationSearchInput__2YK1MG",p6="Input-module__label__gmqtsf",g6="Input-module__inputContainer__vubIa-",Er={locationSearchRoot:u6,endAdornment:c6,input:f6,startAdornment:d6,locationSearchInput:h6,label:p6,inputContainer:g6},Cl=c.forwardRef(({className:t,endAdornment:e,inputRef:n,label:r,onBlur:i,onChange:o,startAdornment:s,...a},l)=>{const u=c.useId(),f=c.useRef(null);c.useImperativeHandle(l,()=>({focus:()=>{var h;(h=f.current)==null||h.focus()},blur:()=>{var h;(h=f.current)==null||h.blur()},setValue:h=>{if(o){o({target:{value:h}});return}if(i){i({target:{value:h}});return}f.current&&(f.current.value=h)}}),[i,o]);const d=xp(n,f);return C.jsxs("label",{htmlFor:a.id??u,className:ge(Er.locationSearchRoot,t),children:[r&&C.jsx("span",{className:Er.label,children:r}),C.jsxs("div",{className:Er.inputContainer,children:[s&&C.jsx("div",{className:Er.startAdornment,children:s}),C.jsx("input",{...a,ref:d,id:a.id??u,className:Er.locationSearchInput,onChange:o,onBlur:i}),e&&C.jsx("div",{className:Er.endAdornment,children:e})]})]})}),v6="LocationAside-module__submit__CSKcqi",m6="LocationAside-module__container__S1NejR",y6="LocationAside-module__selector__hl74ke",b6="LocationAside-module__label__0Zk8at",w6="LocationAside-module__header__N1wgyn",C6="LocationAside-module__close__VsE88z",zo={submit:v6,container:m6,selector:y6,label:b6,header:w6,close:C6},S6=c.forwardRef((t,e)=>{const{t:n}=Kt(["location_aside","common"]),{mapKey:r}=Yl(),i=er(uC),{country:o,hideCloseButtonOnLocationScreen:s,inputs:a,onCloseLocationSelector:l,onLocationSelect:u}=Ze(),f=c.useRef(null),[d,h]=c.useState("");c.useImperativeHandle(e,()=>({open:()=>er.getState().toggle(!0),close:()=>er.getState().toggle(!1)}),[]);const v=m=>{er.getState().toggle(!1),uo.getState().setPlaceSimple(m,{withNavigation:!0}),u==null||u(m),m!=null&&m.formatted_address&&h(m==null?void 0:m.formatted_address)},y=()=>{er.getState().toggle(!1),l==null||l()},g=o?{componentRestrictions:{country:o}}:void 0,S=m=>{h(m.target.value)},{ref:w}=jp.usePlacesWidget({libraries:["places"],options:g,onPlaceSelected:v,apiKey:r,inputAutocompleteValue:d}),L=Ls(a==null?void 0:a.city);return C.jsx(l6,{open:i,children:C.jsx("div",{ref:f,className:zo.container,children:C.jsxs("div",{className:zo.selector,children:[C.jsxs("div",{className:zo.header,children:[C.jsx("div",{className:zo.label,children:n("choose_city")}),!s&&C.jsx(ni,{position:"relative",onClick:y})]}),C.jsx(Cl,{...L,inputRef:w,value:d,placeholder:n("placeholder"),onChange:S})]})})})}),L6=c.memo(S6);let is;const x6=({children:t})=>{const{locale:e}=Ze(),{mapKey:n}=Yl(),{isLoaded:r}=fp({language:e,libraries:tg,googleMapsApiKey:n});return is=e,r?C.jsx(C.Fragment,{children:t}):C.jsx(Bs,{})},E6=({children:t})=>{const{disableGoogleInit:e,locale:n}=Ze(),{mapKey:r}=Yl(),{setMapKey:i}=uo();return c.useEffect(()=>{i(r)},[r,i]),e&&(!is||is===n)?(is=n,C.jsx(C.Fragment,{children:t})):C.jsx(x6,{children:t})},Mf=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},U.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M14.617 16.032a9 9 0 1 1 1.414-1.414l3.676 3.675a1 1 0 0 1-1.414 1.414l-3.676-3.675ZM2 9a7 7 0 1 1 12.04 4.858 1.005 1.005 0 0 0-.182.182A7 7 0 0 1 2 9Z",clipRule:"evenodd"})),_6="LocationSelector-module__option__WoAxrr",M6="LocationSelector-module__address__huDzWo",O6="LocationSelector-module__icon__90zfxv",P6="LocationSelector-module__inputGoogle__jtuw-y",k6={option:_6,address:M6,icon:O6,inputGoogle:P6},T6=({className:t})=>{const[e,n]=c.useState(""),{t:r}=Kt("location_selector"),{country:i,inputs:o,onLocationSelect:s}=Ze(),[a,l]=c.useState(""),u=[],f=c.useRef(null),d=i?{componentRestrictions:{country:i},types:u}:{types:u},h=m=>{uo.getState().setPlaceSimple(m,{withNavigation:!0}),s==null||s(m),l(""),n("")},{ref:v}=jp.usePlacesWidget({libraries:["places"],options:d,onPlaceSelected:h,inputAutocompleteValue:a});c.useEffect(()=>{const m=v.current;if(!m||!e)return;const _=setTimeout(()=>{var b;const E=(b=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:b.set;E==null||E.call(m,e),l(e);const p=new Event("input",{bubbles:!0});m.dispatchEvent(p),m.focus()},500);return()=>clearTimeout(_)},[e,v]);const y=()=>{a&&pe.getState().setBlurred(!0),pe.getState().setDetailsOpen(!1),ut.getState().setDeliverPoint(null),Rt.getState().setSelectedLocation(null)},g=()=>{pe.getState().setBlurred(!1)},S=m=>{m.preventDefault(),l(e)},w=m=>{var _;(_=f.current)==null||_.focus(),f.current&&m.key!=="Enter"&&f.current.dispatchEvent(new KeyboardEvent("keydown",{key:m.key}))},L=Ls(o==null?void 0:o.address);return C.jsxs(C.Fragment,{children:[C.jsx(Cl,{...L,value:a,className:ge(t,k6.inputGoogle),endAdornment:C.jsx(Mf,{}),placeholder:r("placeholder"),inputRef:v,onChange:S,onFocus:y,onBlur:g,onKeyDown:w}),C.jsx(Cl,{inputRef:f,className:t,endAdornment:C.jsx(Mf,{}),placeholder:r("placeholder"),value:e,onChange:m=>n(m.currentTarget.value)})]})},R6=({className:t})=>pe(Ag)?C.jsx(T6,{className:t}):null,D6=c.memo(R6),A6="DeliveryDetailsModal-module__root__qwKnjX",I6={root:A6},j6=({className:t,location:e,onClose:n,onSubmit:r})=>C.jsx("div",{className:ge(I6.root,t),children:C.jsx(Lp,{location:e,onClose:n,onSubmit:r})}),N6="LocationDetailsModal-module__root__PyRnLM",B6={root:N6},F6=({className:t,location:e,onClose:n,onSubmit:r})=>{const i=()=>{r==null||r(e)};return C.jsx("div",{className:ge(B6.root,t),children:C.jsx(Gd,{location:e,onClose:n,onSubmit:i})})},U6="MapContainer-module__root__1Os6Q-",V6="MapContainer-module__mapWrapper__Cwe7qC",z6="MapContainer-module__wrapperBlurred__04NN2L",H6="MapContainer-module__locationSelector__Pr1zS-",$6="MapContainer-module__filterButton__CW3Qv7",W6="MapContainer-module__sidebarOpen__lGMVrJ",G6="MapContainer-module__filterIcon__T01XsJ",Z6="MapContainer-module__details__gM8LWX",on={root:U6,mapWrapper:V6,wrapperBlurred:z6,locationSelector:H6,filterButton:$6,sidebarOpen:W6,filterIcon:G6,details:Z6},q6=()=>{const{onPointClick:t}=Ze(),e=pe(xl),n=Rt(Ng),r=ut(Ll),i=c.useCallback(()=>{pe.getState().setDetailsOpen(!1)},[]),o=c.useCallback(s=>{t==null||t(s),pe.getState().setDetailsOpen(!1),Rt.getState().setSelectedLocation(null),ut.getState().setDeliverPoint(null)},[t]);return C.jsxs(C.Fragment,{children:[(r==null?void 0:r.address)&&e&&C.jsx(j6,{location:r,className:on.details,onClose:i,onSubmit:o}),n&&e&&C.jsx(F6,{location:n,className:on.details,onClose:i,onSubmit:o})]})},K6=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:60,height:40,fill:"none",viewBox:"0 0 60 40",...t},U.createElement("path",{d:"M0 0h52a8 8 0 0 1 8 8v24a8 8 0 0 1-8 8H0V0Z"}),U.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:1.5,d:"M32.093 10h13.814c1.151 0 2.093.91 2.093 2.02v2.223c0 .808-.523 1.818-1.047 2.324l-4.5 3.839c-.627.505-1.046 1.515-1.046 2.323v4.344c0 .607-.419 1.415-.942 1.718L39 29.7c-1.36.808-3.244-.101-3.244-1.717v-5.355c0-.707-.419-1.616-.837-2.121l-3.977-4.041c-.523-.506-.942-1.415-.942-2.02V12.12c0-1.21.942-2.12 2.093-2.12Z"})),Q6=t=>U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",viewBox:"0 0 28 28",...t},U.createElement("rect",{width:28,height:28,fill:"#333",rx:4}),U.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.165 7h9.67c.806 0 1.465.636 1.465 1.414V9.97c0 .566-.366 1.273-.733 1.627l-3.15 2.687c-.44.353-.732 1.06-.732 1.627v3.04c0 .425-.293.99-.66 1.203L14 20.79c-.952.566-2.271-.07-2.271-1.202V15.84c0-.495-.293-1.132-.586-1.485l-2.784-2.83c-.366-.353-.659-.99-.659-1.413V8.485C7.7 7.636 8.36 7 9.165 7Z"})),J6=()=>{const t=Yr(i=>i.open),e=Yr(i=>i.toggle),n=gr("screenSm"),r=()=>{e(!0)};return C.jsxs("div",{role:"presentation",className:ge(on.filterButton,{[on.sidebarOpen]:t}),onClick:n?void 0:r,children:[n&&C.jsx(_p,{}),n?C.jsx(Q6,{className:on.filterIcon,onClick:r}):C.jsx(K6,{className:on.filterIcon})]})},Y6=({children:t,className:e})=>{const{hideFilters:n,hideSearchInput:r}=Ze(),i=pe(Dg),o=pe(xl);return C.jsxs("div",{className:ge(on.root,e),children:[!r&&!o&&C.jsx(D6,{className:on.locationSelector}),!n&&C.jsx(J6,{}),C.jsx("div",{className:ge(on.mapWrapper,{[on.wrapperBlurred]:i}),children:t}),C.jsx(q6,{})]})},X6=c.memo(Y6),eS="Separator-module__root__eQtZey",tS={root:eS},va=({className:t,...e})=>C.jsx("hr",{className:ge(tS.root,t),...e}),nS="Sidebar-module__root__4j1MA3",rS="Sidebar-module__closeButton__HLXy1c",iS="Sidebar-module__open__mqQXF6",oS="Sidebar-module__header__Afp6uz",sS="Sidebar-module__typeFilter__GN46u9",aS="Sidebar-module__separator__6I4QoJ",lS="Sidebar-module__withRightPadding__2u1Ina",uS="Sidebar-module__sheetContent__SaoncI",cS="Sidebar-module__doneButton__4aeaSD",yn={root:nS,closeButton:rS,open:iS,header:oS,typeFilter:sS,separator:aS,withRightPadding:lS,sheetContent:uS,doneButton:cS},fS=()=>{const{t}=Kt("common"),e=gr("screenSm"),n=Yr(i=>i.toggle),r=()=>{n(!1)};return C.jsxs("div",{className:yn.header,children:[e&&C.jsx("div",{role:"presentation",className:yn.doneButton,onClick:r,children:t("done")}),!e&&C.jsx(ni,{className:yn.closeButton,onClick:r})]})},dS="Radio-module__root__7ElY2W",hS="Radio-module__label__c-sYW3",Of={root:dS,label:hS},pS=({className:t,label:e,labelProps:n={},...r})=>{const i=c.useId(),{className:o,...s}=n;return C.jsxs("label",{htmlFor:i,className:ge(Of.label,o),...s,children:[C.jsx("input",{id:i,type:"radio",className:ge(Of.root,t),...r}),e]})},Dr=t=>C.jsx(pS,{...t,type:"checkbox"}),gS="RadioGroup-module__root__ewZw-x",vS="RadioGroup-module__body__k8BJAs",mS="RadioGroup-module__legend__tcfV7q",ma={root:gS,body:vS,legend:mS},Bp=({children:t,className:e,label:n,onChange:r,value:i,...o})=>C.jsxs("div",{className:ge(ma.root,e),...o,children:[n&&C.jsx("span",{className:ma.legend,children:n}),C.jsx("div",{className:ma.body,children:c.Children.map(t,s=>c.isValidElement(s)?c.cloneElement(s,{checked:!!(i!=null&&i[s.props.value]),onChange:a=>r==null?void 0:r({...i,[a.target.value]:a.target.checked})}):null)})]}),yS=({className:t,onChange:e})=>{const{t:n}=Kt("receive_filter"),r=Vn(Vg);return C.jsxs(Bp,{value:r,label:n("title"),className:t,onChange:e,children:[C.jsx(Dr,{name:"receive",value:Zt.DressingRoom,label:n("dressing_room")}),C.jsx(Dr,{name:"receive",value:Zt.CheckOrder,label:n("check_order")}),C.jsx(Dr,{name:"receive",value:Zt.PayByCash,label:n("pay_by_cash")})]})},bS=c.memo(yS),wS=({className:t,onChange:e})=>{const{t:n}=Kt("send_filter"),r=Vn(Ug);return C.jsxs(Bp,{className:t,value:r,label:n("title"),onChange:e,children:[C.jsx(Dr,{name:"send",value:qt.Return,label:n("sending_returns")}),C.jsx(Dr,{name:"send",value:qt.Shipping,label:n("shipping")}),C.jsx(Dr,{name:"send",value:qt.Payment,label:n("payment")})]})},CS=c.memo(wS),SS="TypeFilter-module__root__WH5EQV",LS="TypeFilter-module__button__f0mSfo",Ho={root:SS,button:LS},xS=({className:t,onChange:e,value:n})=>{const{t:r}=Kt("type_filter"),i=o=>()=>e==null?void 0:e(o);return C.jsxs("div",{className:ge(Ho.root,t),children:[C.jsx(Ft,{className:Ho.button,variant:n===vn.All?"primary":"secondary",onClick:i(vn.All),children:r("all")}),C.jsx(Ft,{className:Ho.button,variant:n===vn.PostOffice?"primary":"secondary",onClick:i(vn.PostOffice),children:r("post_office")}),C.jsx(Ft,{className:Ho.button,variant:n===vn.PickPoint?"primary":"secondary",onClick:i(vn.PickPoint),children:r("pick_point")})]})},ES=({className:t,onChange:e})=>{const n=Vn(Fg);return C.jsx(xS,{value:n,className:t,onChange:e})},_S=c.memo(ES),MS=({className:t})=>{const e=gr("screenSm"),n=Yr(l=>l.open),r=c.useCallback(l=>Vn.getState().setFilter({type:l}),[]),i=c.useCallback(l=>Vn.getState().setFilter({send:l}),[]),o=c.useCallback(l=>Vn.getState().setFilter({receive:l}),[]),s=c.useCallback(()=>Yr.getState().toggle(!1),[]),a=C.jsxs(C.Fragment,{children:[C.jsx(fS,{}),C.jsxs("div",{className:yn.withRightPadding,children:[C.jsx(_S,{className:yn.typeFilter,onChange:r}),C.jsx(va,{className:yn.separator}),C.jsx(bS,{onChange:o}),C.jsx(va,{}),C.jsx(CS,{onChange:i}),C.jsx(va,{})]})]});return e?C.jsx(Hh,{initialFocusRef:!1,open:n,snapPoints:({maxHeight:l})=>l-$h,onDismiss:s,children:C.jsx("div",{className:yn.sheetContent,children:a})}):C.jsx("div",{className:ge(yn.root,t,{[yn.open]:n}),children:a})},OS="App-module__map__Kf-2JS",PS="App-module__sidebar__ORIzGk",kS="App-module__header__bgP9DA",ya={map:OS,sidebar:PS,header:kS},TS=new f4,Fp=({config:t,options:e})=>{const n=Om(t),{INN:r,cityName:i,countryAbbreviation:o,hideFilters:s,hideHeader:a,locale:l,map:u,regionName:f}=n;sn(r,"INN is required"),Pm(r,e),sn(u==null?void 0:u.provider,"Map provider is required");const d=Q5(u.provider);pm({cityName:i,countryAbbreviation:o,regionName:f});const h=fC({locale:l});return C.jsx(Wp,{baseColor:"#f3f3f3",highlightColor:"#ecebeb",children:C.jsx(v4,{client:TS,children:C.jsx(Wf.Provider,{value:n,children:C.jsx(r6,{children:C.jsx(pC,{children:C.jsx(hC,{children:C.jsx(k0,{tolgee:Ep,fallback:C.jsx(Bs,{}),children:h&&C.jsx(E6,{children:C.jsx(jC,{children:C.jsxs(IC,{children:[!a&&C.jsx(PC,{className:ya.header}),!s&&C.jsx(MS,{className:ya.sidebar}),C.jsx(X6,{className:ya.map,children:C.jsx(d,{})}),C.jsx(L6,{})]})})})})})})})})})})},Up=async t=>Ui.request({baseURL:"https://api.geo-data.omnic.solutions/api/1.0/",method:"POST",url:"normalize/address",data:t,headers:{Authorization:"Token 9877f9631b2e30570cc1c5aa8c740b0c912efe99a8b6c45c21cf4bd394adc7e9"}}),Vp=c.createContext(null);let ba=!1;const RS=({children:t})=>{const[e,n]=c.useState(),[r,i]=c.useState(),o=c.useRef(null),s=c.useRef(null),a=c.useCallback(u=>{if(ba){console.warn("Widget already launched");return}ba=!0,n(u)},[]);c.useEffect(()=>()=>{ba=!1},[]);const l=c.useMemo(()=>({widgetOutHolderRef:o,widgetLocationsRef:s,launchWidget:a,setDynamicConfig:i}),[a]);return C.jsxs(Vp.Provider,{value:l,children:[C.jsx("div",{ref:o,style:{position:"fixed",left:"-9999px",top:"-9999px"},children:C.jsx("div",{ref:s,id:"@omnic/widget-locations",style:{height:"100%",width:"100%"},children:e&&C.jsx(Fp,{options:e.options,config:{...e.config,...r}})})}),t]})};function zp(){const t=c.useContext(Vp);if(!t)throw new Error("Please use hook useWidgetLocationsContext inside WidgetLocationsProvider");return t}const DS=t=>{const{setDynamicConfig:e,widgetLocationsRef:n,widgetOutHolderRef:r}=zp(),i=c.useRef(null);return c.useEffect(()=>{t&&e(t)},[t,e]),c.useEffect(()=>{const o=r.current,s=n.current,a=i.current;return s&&a&&a.appendChild(s),()=>{s&&o&&o.appendChild(s)}},[n,r]),C.jsx("div",{ref:i,style:{width:"100%",height:"100%"}})};exports.EReceiveFilter=Zt;exports.ESendFilter=qt;exports.ETypeFilter=vn;exports.MapPlaceholder=DS;exports.Widget=Fp;exports.WidgetLocationsProvider=RS;exports.createPointsIterator=Ma;exports.fetchPointsRequest=_a;exports.fromHoursMinutesToMinutes=zg;exports.fromMinutesToHoursMinutes=Hg;exports.getAddressFormGeocode=ka;exports.getBoundsFromPoint=$g;exports.getCurrentPosition=Tl;exports.getNormalizedAddress=Up;exports.getPropertyValue=Cd;exports.isCoordinates=Pa;exports.isDeliveryPoint=cm;exports.isHttpSuccess=wd;exports.isPlaceId=bd;exports.replaceSvgCurrentColor=Or;exports.setWidgetCSSProperty=oo;exports.stopImmediatePropagation=Oa;exports.svgStringToBase64URL=Rl;exports.useWidgetLocationsContext=zp;
229
+ </svg>`,a=`Cluster of ${e} markers`,c=Number(google.maps.Marker.MAX_ZINDEX)+e;if(Ge.isAdvancedMarkerAvailable(i)){const f=new DOMParser().parseFromString(s,"image/svg+xml").documentElement;f.setAttribute("transform","translate(0 25)");const d={map:i,position:n,zIndex:c,title:a,content:f};return new google.maps.marker.AdvancedMarkerElement(d)}const l={position:n,zIndex:c,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(l)}}function L5(t,e){for(let n in e.prototype)t.prototype[n]=e.prototype[n]}class Ic{constructor(){L5(Ic,google.maps.OverlayView)}}var _n;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"})(_n||(_n={}));const M5=(t,e,n)=>{e.bounds&&n.fitBounds(e.bounds)};class k5 extends Ic{constructor({map:e,markers:n=[],algorithmOptions:r={},algorithm:i=new T5(r),renderer:o=new R5,onClusterClick:s=M5}){super(),this.map=null,this.idleListener=null,this.markers=[...n],this.clusters=[],this.algorithm=i,this.renderer=o,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(r=>{this.addMarker(r,!0)}),n||this.render()}removeMarker(e,n){const r=this.markers.indexOf(e);return r===-1?!1:(Ge.setMap(e,null),this.markers.splice(r,1),n||this.render(),!0)}removeMarkers(e,n){let r=!1;return e.forEach(i=>{r=this.removeMarker(i,!0)||r}),r&&!n&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,_n.CLUSTERING_BEGIN,this);const{clusters:n,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const i=new Set;for(const s of n)s.markers.length==1&&i.add(s.markers[0]);const o=[];for(const s of this.clusters)s.marker!=null&&(s.markers.length==1?i.has(s.marker)||Ge.setMap(s.marker,null):o.push(s.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>o.forEach(s=>Ge.setMap(s,null)))}google.maps.event.trigger(this,_n.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();ac(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>Ge.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new A5(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(r=>{if(r.markers.length===1)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,e,n),r.markers.forEach(i=>Ge.setMap(i,null)),this.onClusterClick){const i=Ge.isAdvancedMarker(r.marker)?_n.GMP_CLICK:_n.CLUSTER_CLICK;r.marker.addListener(i,o=>{google.maps.event.trigger(this,_n.CLUSTER_CLICK,r),this.onClusterClick(o,r,n)})}Ge.setMap(r.marker,n)})}}const D5="LocationBalloon-module__root__GtUl6q",j5="LocationBalloon-module__submit__lNcF4k",N5="LocationBalloon-module__details__--VOKk",I5="LocationBalloon-module__icon__X7DOVA",F5="LocationBalloon-module__header__5VQJDW",B5="LocationBalloon-module__titleContainer__BAO73U",V5="LocationBalloon-module__title__bX9pf8",H5="LocationBalloon-module__description__htav7b",$5="LocationBalloon-module__actions__c8dlOR",U5="LocationBalloon-module__close__7Ujvya",_t={root:D5,submit:j5,details:N5,icon:I5,header:F5,titleContainer:B5,title:V5,description:H5,actions:$5,close:U5},z5={default:sd,llama:ad},q5=({SSR:t,className:e,hideDetails:n,location:r,location_name:i,name:o,onCloseClick:s,onDetails:a,onSubmit:c})=>{var h;const{logo:l="default"}=be(),{isLoading:u,lmsData:f}=bs(),d=(h=f==null?void 0:f.location)==null?void 0:h.what3words,y=!!(d!=null&&d.id),m=z5[l];return w.jsxs("div",{className:K(_t.root,e),children:[w.jsxs("div",{className:_t.header,children:[w.jsxs("div",{className:_t.titleContainer,children:[u?w.jsx(Qe,{circle:!0,width:40,height:40}):w.jsx("div",{className:_t.icon,children:w.jsx(m,{})}),u?w.jsx(Qe,{width:200}):w.jsx("span",{className:_t.title,children:o||"{{ properties.point.name }}"})]}),w.jsx("div",{className:_t.close,children:w.jsx(Rr,{position:"relative",onClick:s})})]}),w.jsxs("div",{className:_t.description,children:[u?w.jsx(Qe,{width:300}):(r==null?void 0:r.full_address)||"{{ properties.point.location.full_address }}"," ",u?w.jsx(Qe,{width:300}):i||"{{ properties.point.location_name }}"]}),u?w.jsx(Qe,{width:150}):y&&w.jsx(wd,{what3words:d}),w.jsxs("div",{className:_t.actions,children:[w.jsx(ot,{id:yp,variant:"primary",className:_t.submit,disabled:u,onClick:c,children:t?"{ choose }":w.jsx(Bt,{keyName:"choose",ns:"common"})}),!n&&w.jsxs(ot,{id:af,as:"link",variant:"primary",className:_t.details,disabled:u,onClick:a,children:[t?"{ details }":w.jsx(Bt,{keyName:"details",ns:"common"}),w.jsx(Sh,{})]})]})]})},G5=({handleCloseClick:t,handleDetailsClick:e,handlePointClick:n,handleSubmitClick:r,point:i,setMarkerRef:o})=>{const[s,a]=p.useState(!1),{hideDetails:c,iconType:l,palette:u}=be(),f=p.useRef(null),{closeSamePoints:d}=Rt(),y=st(O=>O.location),m=(u==null?void 0:u.primary)||"#fc0",h=l==="omni-llama"?Ke.PinLlama:Ke.PinOmnic,_=!!i&&(y==null?void 0:y.uid)===i.uid,b=Fn("screenSm"),{isIdle:C}=Z(),v=_c({isSelectedPoint:_}),E=C&&_&&v&&s;p.useEffect(()=>{f.current&&a(f.current.checkVisibility()??!1)},[i]);const x=p.useMemo(()=>{let O;if(i.type===30)switch(l){case"omni-llama":{_?O=Ke.PinLlamaSelected:O=Ke.PinLlama;break}case"we-chip":{_?O=Ke.PinWeChipSelected:O=Ke.PinWeChip;break}default:{_?O=Ke.PinOmnicSelected:O=rr(h,m);break}}else _?O=rr(Ke.PinPvz,"--owl-color-black"):O=rr(Ke.PinPvz,"--owl-color-grey-80");return Tt(O,"Icon url is not defined"),O},[i.type,_,l,h,m]),g=p.useMemo(()=>({lat:i.location.latitude,lng:i.location.longitude}),[i.location.latitude,i.location.longitude]),S=()=>{d(),n(i)};return w.jsxs(w.Fragment,{children:[w.jsx(id,{ref:O=>{f.current=O,o(O)},position:g,zIndex:_?9999:void 0,onClick:S,children:w.jsx("span",{dangerouslySetInnerHTML:{__html:x}})},i.uid),E&&!b&&w.jsx(od,{anchor:f.current||void 0,onCloseClick:t,children:w.jsx(q5,{...i,hideDetails:c,className:Me.balloon,onCloseClick:t,onSubmit:()=>r(i),onDetails:()=>e(i)})})]})},W5=({handleCloseClick:t,points:e,...n})=>{const{setSamePoints:r}=Rt(),{onSamePointsClusterClick:i}=be(),o=Ni(),s=p.useMemo(()=>(y,m)=>{if(!m)return;t();const h=m.markers??[],_=h.map(E=>{const x=E.position;if(!x)return{lat:NaN,lng:NaN};const g=typeof x.lat=="number"?x.lat:x.lat(),S=typeof x.lng=="number"?x.lng:x.lng();return{lat:g,lng:S}});if(!_.length)return;const{lat:b,lng:C}=_[0];if(_.every(E=>E.lat===b&&E.lng===C)){const E=e.filter(({location:{latitude:x,longitude:g}})=>x===b&&g===C);r(E),i==null||i(E);return}if(o instanceof google.maps.Map){const E=new google.maps.LatLngBounds;for(const x of h){const g=x.position;if(!g)continue;const S=(typeof g.lat=="number",g);E.extend(S)}o.fitBounds(E,150)}},[o,e,t,i,r]),a=p.useMemo(()=>({render:({count:y,position:m})=>{const h=document.createElement("div");return h.className=Me.cluster,h.innerHTML=`<span class="${Me.number}">${y}</span>`,new google.maps.marker.AdvancedMarkerElement({position:m,content:h,zIndex:y})}}),[]),c=p.useRef(new k5({renderer:a,map:null,onClusterClick:s})),l=p.useRef([]),[u,f]=p.useState([]);p.useEffect(()=>{f([]),c.current.clearMarkers()},[e,o]),p.useEffect(()=>{c.current.setMap(null),o&&c.current.setMap(o)},[o]),p.useEffect(()=>{!o||!u.length||c.current.addMarkers(u)},[u,o]);function d(y){u.length||f(y)}return w.jsx(w.Fragment,{children:e.map((y,m)=>{const h=m===0,_=m===e.length-1;return h&&(l.current=[]),w.jsx(G5,{point:y,handleCloseClick:t,setMarkerRef:b=>{b&&(l.current.push(b),_&&d([...l.current]))},...n},y.uid)})})},Z5=p.memo(W5),K5=t=>{const e=Rt(Lm);return w.jsx(Z5,{points:e,...t})},Q5=p.memo(K5),Bh=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:42,height:42,fill:"none",viewBox:"0 0 42 42",...t},N.createElement("rect",{width:42,height:42,fill:"#fff",rx:21}),N.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M31.003 28V17.766a3 3 0 0 0-1.579-2.643l-7.003-3.765a3 3 0 0 0-2.842 0l-7.003 3.765a3 3 0 0 0-1.58 2.643V28a3 3 0 0 0 3 3h14.008a3 3 0 0 0 3-3Zm-5.919 1h2.92a1 1 0 0 0 1-1V17.766a1 1 0 0 0-.527-.881l-7.003-3.766a1 1 0 0 0-.948 0l-7.003 3.766a1 1 0 0 0-.527.88v10.237a1 1 0 0 0 1 1h2.92a2.513 2.513 0 0 1-.05-.5v-7.606a2.5 2.5 0 0 1 2.5-2.5h3.268a2.5 2.5 0 0 1 2.5 2.5V28.5c0 .171-.017.338-.05.5Zm-2.426 0a.5.5 0 0 0 .476-.499v-7.606a.5.5 0 0 0-.5-.5h-3.269a.5.5 0 0 0-.5.5V28.5a.5.5 0 0 0 .476.5h3.317Z",clipRule:"evenodd"}),N.createElement("rect",{width:41,height:41,x:.5,y:.5,stroke:"#1D3665",strokeOpacity:.1,rx:20.5})),J5="DeliveryBalloon-module__root__Nu90iy",X5="DeliveryBalloon-module__details__eqUTaI",Y5="DeliveryBalloon-module__wh__1lJtLN",e6="DeliveryBalloon-module__header__JVdyxN",t6="DeliveryBalloon-module__title__-zKKCt",n6="DeliveryBalloon-module__description__no5-ki",r6="DeliveryBalloon-module__actions__C-N0H-",i6="DeliveryBalloon-module__errorVariant__e6uhZl",o6="DeliveryBalloon-module__logo__62gC5h",Nt={root:J5,details:X5,wh:Y5,header:e6,title:t6,description:n6,actions:r6,errorVariant:i6,logo:o6},s6=({SSR:t,address:e,className:n,hasCloseButton:r,hideDetails:i,onClose:o,onDetails:s,variant:a})=>{const{onWarehouseSelect:c,warehouseSelection:l}=be(),{setWarehousePoint:u,warehousePoint:f}=Le(),d=a==="error",y=a==="default",m=function(){return l?t?"{ courier_balloon.warehouse_title }":w.jsx(Bt,{keyName:"warehouse_title",ns:"courier_balloon"}):t?"{ courier_balloon.title }":w.jsx(Bt,{keyName:"title",ns:"courier_balloon"})}(),h=t?"{ courier_balloon.error_title }":w.jsx(Bt,{keyName:"error_title",ns:"courier_balloon"}),_=t?"{ courier_balloon.error_description }":w.jsx(Bt,{keyName:"error_description",ns:"courier_balloon"});function b(){f&&(c==null||c(f),u(null))}const{label:C,onClick:v}=l?{onClick:b,label:t?"{ select }":w.jsx(Bt,{keyName:"select",ns:"common"})}:{onClick:s,label:t?"{ details }":w.jsx(Bt,{keyName:"details",ns:"common"})};return w.jsxs("div",{className:K(Nt.root,n,Nt[`${a}Variant`]),children:[w.jsxs("div",{className:Nt.header,children:[w.jsx(Bh,{className:Nt.logo}),w.jsx("span",{className:Nt.title,children:d?h:m}),r&&w.jsx(Rr,{onClick:o})]}),w.jsx("div",{className:Nt.description,children:d?_:e||"{{ properties.address }}"}),y&&(!i||l)&&w.jsx("div",{className:Nt.actions,children:w.jsx(ot,{id:af,as:"button",variant:"primary",className:K(Nt.details,l?Nt.wh:""),onClick:v,children:C})})]})},a6="Chip-module__root__zsoSyP",c6="Chip-module__active__BlTSFB",Vu={root:a6,active:c6},Hu=({active:t,children:e,className:n,...r})=>w.jsx("div",{...r,className:K(Vu.root,n,{[Vu.active]:t}),children:e}),l6="TextArea-module__root__8YFknR",u6={root:l6},$u=p.forwardRef(({className:t,inputRef:e,onBlur:n,onChange:r,onFocus:i,...o},s)=>{const a=p.useRef(null);p.useImperativeHandle(s,()=>({focus:()=>{var l,u;(l=a.current)==null||l.focus(),i&&i({target:{value:(u=a.current)==null?void 0:u.value}})},blur:()=>{var l,u;(l=a.current)==null||l.blur(),n&&n({target:{value:(u=a.current)==null?void 0:u.value}})},setValue:l=>{r&&r({target:{value:l}}),a.current&&(a.current.value=l)}}),[n,r,i]);const c=$h(e,a);return w.jsx("textarea",{...o,ref:c,className:K(u6.root,t),onBlur:n,onFocus:i,onChange:r})}),f6=({hideDeliveryTime:t,set:e})=>(n,r)=>{let i={...n};switch(r.type){case"SET_COMMENT":{i={...n,comment:r.payload};break}case"SET_DELIVERY_TIME":{i={...n,delivery_time:r.payload};break}case"SET_APARTMENT_NUMBER":{i={...n,apartment_number:r.payload};break}}return i.meta={...i.meta,valid:(t||!!i.delivery_time)&&!!i.apartment_number},e==null||e(i),i},d6="DeliveryDetailsView-module__title__azeoUr",h6="DeliveryDetailsView-module__logo__4zZtpM",p6="DeliveryDetailsView-module__header__oDE9He",m6="DeliveryDetailsView-module__content__6P27SY",g6="DeliveryDetailsView-module__section__2M3Qip",v6="DeliveryDetailsView-module__chips__KmYgha",y6="DeliveryDetailsView-module__actions__43XZ-V",b6="DeliveryDetailsView-module__submit__58LKBw",w6="DeliveryDetailsView-module__actionsHidden__SW-67b",_6="DeliveryDetailsView-module__commentSection__GlX1A2",S6="DeliveryDetailsView-module__comment__2pGG6h",$e={title:d6,logo:h6,header:p6,content:m6,section:g6,chips:v6,actions:y6,submit:b6,actionsHidden:w6,commentSection:_6,comment:S6},C6=p.forwardRef(({classes:t,hideActions:e,location:n,onChange:r,onClose:i,onSubmit:o},s)=>{var g;const{hideDeliveryTime:a,inputs:c,locale:l}=be(),{t:u}=vt(["details_modal","courier_balloon","common"]),f=p.useMemo(()=>f6({set:r,hideDeliveryTime:a}),[a,r]),[d,y]=p.useState(!1),[m,h]=p.useReducer(f,{comment:"",delivery_time:"",apartment_number:"",...n}),_=p.useCallback(async()=>{y(!0);try{Tt(n.address,"Address is required");const S=await rp({address:n.address,algorithm:10,service:10,language:l||cf});if(!Ff(S))return;const O=S==null?void 0:S.data.data,T={...m,address:O};return o==null||o(T),T}finally{y(!1)}},[l,n.address,o,m]);p.useImperativeHandle(s,()=>({submit:_}),[_]);const b=S=>()=>{h({payload:S,type:"SET_DELIVERY_TIME"})},C=S=>{h({payload:S.target.value,type:"SET_APARTMENT_NUMBER"})},v=S=>{h({payload:S.target.value,type:"SET_COMMENT"})},E=ls(c==null?void 0:c.apartment),x=ls(c==null?void 0:c.comment);return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:K($e.header,t==null?void 0:t.header),children:[w.jsx(Rr,{onClick:i}),w.jsxs("div",{className:$e.title,children:[w.jsx(Bh,{className:$e.logo}),w.jsx("span",{children:u("title",{ns:"courier_balloon"})})]})]}),w.jsxs("div",{className:K($e.content,t==null?void 0:t.content),children:[w.jsxs("section",{className:$e.section,children:[w.jsxs("span",{children:[u("address"),":"]}),w.jsx("p",{children:n.address})]}),!a&&w.jsxs("section",{className:$e.section,children:[w.jsxs("span",{children:[u("delivery_time"),":"]}),w.jsxs("div",{className:$e.chips,children:[w.jsx(Hu,{active:m.delivery_time==="8:00-13:00",onClick:b("8:00-13:00"),children:"8:00 - 13:00"}),w.jsx(Hu,{active:m.delivery_time==="14:00-22:00",onClick:b("14:00-22:00"),children:"14:00 - 22:00"})]})]}),w.jsxs("section",{className:$e.section,children:[w.jsxs("span",{children:[u("apartment_number"),":"]}),w.jsx($u,{...E,rows:1,onChange:C})]}),w.jsxs("section",{className:K($e.section,$e.commentSection),children:[w.jsxs("span",{children:[u("comment"),":"]}),w.jsx($u,{...x,className:$e.comment,onChange:v})]})]}),w.jsx("div",{className:K($e.actions,{[$e.actionsHidden]:e}),children:w.jsx(ot,{loading:d,disabled:!((g=m.meta)!=null&&g.valid)||d,variant:"primary",className:$e.submit,onClick:_,children:u("choose",{ns:"common"})})})]})}),Vh=p.memo(C6),E6={header:Me.deliveryDetailsViewHeader,content:Me.deliveryDetailsViewContent},x6=({hideDeliveryTime:t,hideDetails:e,onPointClick:n,point:r,setDeliveryPoint:i,setOpenDetails:o})=>{var L;const[s,a]=p.useState(!1),[c,l]=p.useState(!1),[u,f]=p.useState({...r,comment:"",delivery_time:"",apartment_number:""}),d=p.useRef(null),y=p.useRef(null),{warehouseSelection:m}=be(),{warehousePoint:h}=Le(),_=_c({isSelectedPoint:!0}),b=((L=d.current)==null?void 0:L.checkVisibility())??!1;p.useEffect(()=>{setTimeout(()=>{a(!0)},100)},[]),p.useEffect(()=>{f({...r,comment:"",delivery_time:"",apartment_number:""})},[r]);const C=Fn("screenSm"),v=p.useMemo(()=>({lat:u.coords[0],lng:u.coords[1]}),[u.coords]),E=()=>{o==null||o(!0)},x=()=>{i==null||i(null)},g=p.useMemo(()=>rr(Ke.PinHome,"--owl-color-success"),[]),S=async()=>{var A;try{l(!0);const D=await((A=y.current)==null?void 0:A.submit());if(!D)return;n==null||n(D),o==null||o(!1),i==null||i(null)}finally{l(!1)}},O=w.jsx(s6,{...u,hideDetails:e,hasCloseButton:C,variant:u.address?"default":"error",className:Me.balloon,onDetails:E,onClose:x}),T=m?!!h&&b:_&&!b,R=t?!!u.apartment_number:!!u.apartment_number&&!!u.delivery_time;return w.jsxs(w.Fragment,{children:[w.jsx(id,{ref:d,position:v,children:w.jsx("span",{dangerouslySetInnerHTML:{__html:g}})}),C&&w.jsxs(wh,{minSnapHeight:u.address?200:void 0,submitDisabled:!R||c,submitLoading:c,hideFooter:!u.address,open:T,onDismiss:x,onSubmitClick:S,children:[u.address&&w.jsx(Vh,{ref:y,hideActions:!0,classes:E6,location:r,onChange:f,onClose:x}),u.address?null:O]}),!C&&T&&w.jsx(od,{anchor:d.current||void 0,onCloseClick:x,children:O})]})},Fc=()=>w.jsx(_h,{children:w.jsx(Ko,{})});async function O6(){return(await Se.request({method:"GET",baseURL:"https://api.geo-data.omnic.solutions/api/1.0/",url:"/key-data",headers:{Authorization:"Token fa812020-3197-401a-9b39-345999046111"}})).data.data}function P6(t){return Dh({queryKey:["wl-map-key-wl"],queryFn:()=>O6(),refetchOnWindowFocus:!1,retry:2,enabled:t})}const Hh=p.createContext(null),T6=({children:t})=>{const{gMapId:e,gMapKey:n,mapTheme:r}=be(),i=!n||!e,{data:o,isFetching:s}=P6(i),a=o==null?void 0:o.key;function c(){var d,y,m;switch(r){case"omnic":return(d=o==null?void 0:o.additional_data)==null?void 0:d.map_id_omnic;case"llama":return(y=o==null?void 0:o.additional_data)==null?void 0:y.map_id_llama;case"chip":return(m=o==null?void 0:o.additional_data)==null?void 0:m.map_id_chip;default:return"e130cd87a3f1b9cbe3cb5de4"}}const l=n||a||"AIzaSyDsI0AO8VsUrTPoyR9fF7T31FKx1a9TLO0",u=e||c(),f=p.useMemo(()=>({mapKey:l,mapId:u}),[u,l]);return w.jsx(Hh.Provider,{value:f,children:s?w.jsx(Fc,{}):t})},xs=()=>{const t=p.useContext(Hh);if(!t)throw new Error("useMapKeyContext must be used within a MapKeyProvider");return t},A6={place:null,mapKey:""},R6=t=>{var e,n;return(n=(e=t.place)==null?void 0:e.address_components)==null?void 0:n.find(r=>r.types.includes("locality"))},Vi=Ut((t,e)=>({...A6,setMapKey(n){t({mapKey:n})},async setPlace(n,r,i){var c,l,u,f,d,y;const{map:o}=Z.getState();let s,a;if(console.debug("[OmnicWidgetLocations::setDeliveryAdressPlace]",{value:n,types:r}),ya(n)){const m=await ba(n,e().mapKey,r);s=(c=m==null?void 0:m.results)==null?void 0:c[0],i&&(s=(l=m==null?void 0:m.results)==null?void 0:l.find(h=>{var _;return(_=h.types)==null?void 0:_.includes(i)}))}else if(s=n,s!=null&&s.place_id){const{results:m}=await ba(s.place_id,e().mapKey);a=(f=(u=m==null?void 0:m[0])==null?void 0:u.geometry)==null?void 0:f.viewport}else(d=s==null?void 0:s.geometry)!=null&&d.viewport?a=s.geometry.viewport:(y=s==null?void 0:s.geometry)!=null&&y.location&&(a=new google.maps.LatLngBounds,a.extend(s.geometry.location));return a&&(console.debug("[OmnicWidgetLocations::fitMapBounds]",a.toJSON()),o==null||o.fitBounds(a)),Tt(s,"Place is not defined"),t({place:s}),s},async setPlaceAndPoint(n,r){var l;const i=r==null?void 0:r.types,o=ya(n)?await e().setPlace(n,i):await e().setPlace(n),s=(l=o.geometry)==null?void 0:l.location;Tt(s,"Location is not defined");const a=[s.lat(),s.lng()],c={address:o.formatted_address,coords:a};return r!=null&&r.warehouseSelection&&Le.getState().setWarehousePoint({...o,coords:{lat:s.lat(),lng:s.lng()}}),(!(r!=null&&r.ignoreSelection)||r!=null&&r.warehouseSelection)&&Le.getState().setDeliverPoint(c),o},setPlaceSimple(n,r){var i,o;if(r!=null&&r.withNavigation){const{map:s}=Z.getState();Tt(s,"Map is not defined");let a;(i=n==null?void 0:n.geometry)!=null&&i.viewport?a=n.geometry.viewport:(o=n==null?void 0:n.geometry)!=null&&o.location&&(a=new google.maps.LatLngBounds,a.extend(n.geometry.location)),a&&(s.fitBounds(a),s.setZoom(12))}t({place:n})}})),L6=({children:t,className:e,...n})=>{const{disableDelivery:r,map:i,warehouseSelection:o}=be(),{mapId:s}=xs(),a=p.useMemo(()=>{var l,u;return{lat:((l=i==null?void 0:i.center)==null?void 0:l[0])??ua[0],lng:((u=i==null?void 0:i.center)==null?void 0:u[1])??ua[1]}},[i==null?void 0:i.center]),c=p.useCallback(async l=>{const u=l.detail.latLng;if(!u||r&&!o)return;Z.getState().setDetailsOpen(!1),st.getState().setSelectedLocation(null);const f=[u.lat,u.lng];console.debug("[OmnicLocationsWidget::mapClick]",f);try{await Vi.getState().setPlaceAndPoint(f,{warehouseSelection:o})}catch{Le.getState().setDeliverPoint({address:null,coords:f})}},[r,o]);return w.jsx(nd,{disableDefaultUI:!0,mapId:s,defaultZoom:i==null?void 0:i.initialZoom,defaultCenter:a,className:K(Me.root,e),clickableIcons:!1,minZoom:4,maxZoom:20,restriction:{strictBounds:!0,latLngBounds:{north:85,south:-85,west:-179,east:179}},onClick:c,...n,children:t})},M6=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},N.createElement("rect",{width:2,height:20,x:9,fill:"#fff",rx:1}),N.createElement("rect",{width:2,height:20,x:20,y:9,fill:"#fff",rx:1,transform:"rotate(90 20 9)"}),N.createElement("circle",{cx:10,cy:10,r:8,fill:"#fff"}),N.createElement("circle",{cx:10,cy:10,r:6,fill:"currentcolor"}),N.createElement("circle",{cx:10,cy:10,r:4,fill:"#fff"})),k6=t=>{const e=document.createElement("div"),n=document.createElement("div");e.classList.add(Me.mapControl),n.classList.add(Me.mapControl),e.innerHTML="+",n.innerHTML="—",t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(n),t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e),e.addEventListener("click",()=>{const r=t.getZoom()||0;return t.setZoom(r+1)}),n.addEventListener("click",()=>{const r=t.getZoom()||0;return t.setZoom(r-1)})},D6=t=>{const e=document.createElement("div");e.classList.add(Me.mapControl),e.classList.add(Me.geolocationControl),e.innerHTML=cp.renderToString(w.jsx(M6,{})),t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e),e.addEventListener("click",()=>{bc()})},j6=({className:t})=>{const e=dn(),n=Z(Kp),r=Z(e0),i=Rt(Vf),o=Le(fc),s=Ni(),{lmsData:a}=bs(),{cityName:c,countryAbbreviation:l,disableGeolocation:u,hideDeliveryTime:f,hideDetails:d,hideMapControls:y,onPointClick:m,regionName:h,skipPointInfo:_}=be(),b=p.useCallback(V=>{console.debug("[OmnicLocationsWidget::loadMap]",V),Z.getState().setMap(V),Z.getState().setLoaded(),y||(k6(V),u||D6(V))},[u,y]),C=p.useCallback(()=>{console.debug("[OmnicLocationsWidget::unmountMap]"),Z.getState().setMap(null)},[]);p.useEffect(()=>{if(s)return b(s),()=>{C()}},[s,b,C]);const v=p.useCallback(V=>{const z=a==null?void 0:a.location.what3words,W=z!=null&&z.id?z:void 0;m==null||m(V,W)},[m,a]),E=p.useRef(null),x=p.useRef(null),g=p.useCallback(V=>{const z=V.getSouthWest(),W=V.getNorthEast(),ce=ne=>Math.round(ne*1e3)/1e3,le=`${ce(z.lat())}:${ce(z.lng())}:${ce(W.lat())}:${ce(W.lng())}`,ue=JSON.stringify(e??{});return`${le}|${ue}|${c??""}|${l??""}|${h??""}`},[c,l,e,h]),S=p.useCallback(()=>{Z.getState().setIdle(!0),n&&(E.current&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{const V=n.getBounds();if(!V)return;const z=g(V);x.current!==z&&(x.current=z,console.debug("[OmnicLocationsWidget::changeBounds]",V),Rt.getState().loadNext({bounds:[[V.getSouthWest().lat(),V.getNorthEast().lat()],[V.getSouthWest().lng(),V.getNorthEast().lng()]],filter:e,city_name:c,country_abbreviation:l,region_name:h}))},250))},[g,c,l,e,n,h]);p.useEffect(()=>()=>{E.current&&window.clearTimeout(E.current)},[]);const O=p.useCallback(async V=>{Le.getState().setDeliverPoint(null),st.getState().setSelectedLocation(V)},[]),T=p.useCallback(()=>{console.debug("[OmnicLocationsWidget::tilesLoaded]")},[]),R=Z.getState().setDetailsOpen,{getLMSData:L}=B4(),A=V=>{if(L(V.code),_){v(V);return}R(!1),O(V)},D=()=>{R(!1),O(null)},I=V=>{R(!0),O(V)},$=V=>{v(V),R(!1),O(null)};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:K(Me.mapContainer,t),children:[w.jsxs(L6,{onIdle:S,onTilesLoaded:T,onBoundsChanged:()=>{Z.getState().setIdle(!1)},children:[o&&w.jsx(x6,{hideDeliveryTime:f,hideDetails:d,point:o,setOpenDetails:Z.getState().setDetailsOpen,setDeliveryPoint:Le.getState().setDeliverPoint,onPointClick:v}),w.jsx(Q5,{handleCloseClick:D,handleDetailsClick:I,handlePointClick:A,handleSubmitClick:$})]}),(i||r)&&w.jsx(_h,{className:Me.overlay,children:w.jsx(Ko,{})})]}),w.jsx(r4,{handleDetailsClick:I,handlePointClick:A}),w.jsx(Lb,{handleCloseClick:D,handleSubmitClick:$})]})},N6=p.memo(j6),I6=t=>({google:N6})[t];function $h(...t){return p.useCallback(e=>{for(const n of t)typeof n=="function"?n(e):n&&typeof n=="object"&&(n.current=e)},t)}const ls=t=>{const e=p.useCallback(()=>{var n;(n=t==null?void 0:t.onClick)==null||n.call(t,t.name)},[t]);return{ref:t==null?void 0:t.ref,name:t==null?void 0:t.name,onClick:e}},F6=()=>{throw new Error("useMediaQuery is a client-only hook")};function B6(t){const e=p.useCallback(r=>{const i=window.matchMedia(t);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[t]),n=()=>window.matchMedia(t).matches;return p.useSyncExternalStore(e,n,F6)}const V6="768px",H6="1024px",$6="1280px",U6="1536px",z6={screenSm:V6,screenMd:H6,screenLg:$6,screenXl:U6};function Fn(t){return B6(`(max-width: calc(${z6[t]} - 1px))`)}const Uh=jv().use(Sv()).use(hv()).init({language:"en",defaultNs:"common",ns:["common","courier_balloon","current_location","details_modal","header","location_aside","location_selector","receive_filter","send_filter","type_filter"],apiUrl:"https://tms.omnic.solutions",apiKey:"tgpak_gfpwentkga2g4zdngbzwozdinvztezlknu4xmnlpnbrgc"}),q6=t=>{p.useEffect(()=>{t&&(Uh.changeLanguage(t),Wo.setLanguage(t))},[t])},G6=t=>{p.useEffect(()=>{if(t){const e=Object.keys(t);for(const n of e){const r=t[n];r&&Di(`--owl-color-${n}`,r)}}},[t])},W6=t=>{p.useEffect(()=>{t&&t!==void 0&&Di("--owl-button-radius",`${t}px`)},[t])},Z6=t=>{p.useEffect(()=>{t&&t!==void 0&&Di("--owl-font",t)},[t])},K6={open:!1},Q6=t=>t.open,Sn=Ut(t=>({...K6,toggle(e){t(n=>({open:e??!n.open}))}})),J6=t=>{const e=t==="selector";p.useEffect(()=>{e&&Sn.getState().toggle(!0)},[e])},X6=t=>{p.useEffect(()=>{t==="sharp"&&Di("--owl-radius","0")},[t])},Y6=({children:t})=>{const{cornersVariant:e,font:n,locale:r,palette:i,radius:o,startScreen:s}=be();return Z6(n),q6(r),G6(i),W6(o),J6(s),X6(e),w.jsx(w.Fragment,{children:t})},ew=({children:t})=>{const{disableGeolocation:e,map:n}=be(),[r,i]=p.useState(e),{loaded:o}=Z();return Tt(n==null?void 0:n.center,"Map center is required"),Tt(n==null?void 0:n.initialZoom,"Map initial zoom is required"),p.useEffect(()=>{!o||e||r||bc({success:s=>{n.center=[s.coords.latitude,s.coords.longitude],i(!0),st.getState().setIsTrackingEnabled(!0)},error:()=>{i(!0)}})},[e,r,o,n]),t},tw=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:28,fill:"none",viewBox:"0 0 24 28",...t},N.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M24 11.777C24 4.052 17.606 0 12 0S0 4.052 0 11.777C0 16.915 3.994 22.334 12 28c8.006-5.666 12-11.085 12-16.224ZM12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",clipRule:"evenodd"})),nw=()=>{Sn.getState().toggle(!0),Z.getState().setDetailsOpen(!1),Le.getState().setDeliverPoint(null),st.getState().setSelectedLocation(null)},rw="CurrentLocation-module__root__AeQCGT",iw="CurrentLocation-module__icon__459m9q",ow="CurrentLocation-module__text__w-9v28",oa={root:rw,icon:iw,text:ow},zh=({className:t})=>{const{t:e}=vt("current_location"),n=Vi(R6),{location:r}=st(),o=(r==null?void 0:r.location.full_address)??(n==null?void 0:n.long_name)??e("choose_from_map");return w.jsxs("div",{role:"presentation",className:K(oa.root,t),onClick:nw,children:[w.jsx(tw,{className:oa.icon}),w.jsx("span",{className:oa.text,children:o})]})},sw=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:123,height:32,fill:"none",viewBox:"0 0 123 32",...t},N.createElement("path",{fill:"currentcolor",d:"M6.698 32a6.579 6.579 0 0 1-3.35-.889 6.718 6.718 0 0 1-2.443-2.4A6.285 6.285 0 0 1 0 25.422V6.578c0-1.215.302-2.311.905-3.29A6.718 6.718 0 0 1 3.35.889 6.579 6.579 0 0 1 6.698 0h19.188c1.207 0 2.308.296 3.304.889a6.72 6.72 0 0 1 2.444 2.4c.633.978.95 2.074.95 3.289v18.844a6.061 6.061 0 0 1-.95 3.29 6.72 6.72 0 0 1-2.444 2.4c-.996.592-2.097.888-3.304.888H6.698Zm.317-6.933h18.464V6.933H7.015v18.134ZM37.568 32V0h7.24l11.043 12.933L66.848 0h7.287v32h-7.06V10.533L55.85 23.69 44.582 10.578V32h-7.014Zm41.985 0V0h7.241l18.238 21.333V0h7.105v32h-7.241L86.568 10.578V32h-7.015Zm36.523 0V0H123v32h-6.924Z"})),aw=t=>N.createElement("svg",{width:119,height:44,viewBox:"0 0 119 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},N.createElement("path",{d:"M4.70489 0.199253H0V13.4418H10.7452V10.0105H4.70489V0.199253Z",fill:"black"}),N.createElement("path",{d:"M16.9359 0.199253H12.2287V13.4418H22.974V10.0105H16.9359V0.199253Z",fill:"black"}),N.createElement("path",{d:"M27.9807 0.199253L23.6569 13.4418H28.3442L28.9701 10.913H32.5644L33.1703 13.4418H37.9766L33.6354 0.199253H27.9807ZM29.6775 8.00558L30.7881 3.41028L31.879 8.00558H29.6775Z",fill:"black"}),N.createElement("path",{d:"M48.1266 6.0777L47.5404 8.54701H47.5008L46.9146 6.0777L45.3786 0.199253H38.7936V13.4418H42.9146V8.84631L42.8551 4.39405H42.9345L45.48 13.4418H49.2373L51.8222 4.39405H51.8817L51.8222 8.84631V13.4418H55.9233V0.199253H49.6626L48.1266 6.0777Z",fill:"black"}),N.createElement("path",{d:"M61.057 0.199253L56.7333 13.4418H61.4206L62.0465 10.913H65.6429L66.2489 13.4418H71.0552L66.7139 0.199253H61.057ZM62.7539 8.00558L63.8645 3.41028L64.9553 8.00558H62.7539Z",fill:"black"}),N.createElement("path",{d:"M85.656 6.77975C86.6916 6.6323 87.4541 6.28455 87.9389 5.73657C88.4238 5.18853 88.6662 4.51949 88.6662 3.72939C88.6662 2.55195 88.2562 1.67601 87.4344 1.1016C86.6145 0.513972 85.3607 0.212458 83.677 0.199253H76.0413V13.4418H84.2015C85.8301 13.4418 87.0354 13.1533 87.8177 12.5789C88.611 11.9913 89.0099 11.1132 89.0099 9.95118C89.0099 9.09505 88.7411 8.38636 88.2011 7.82518C87.6612 7.26393 86.8151 6.9228 85.656 6.80175V6.77975ZM80.5455 3.41028H82.6457C83.4545 3.41028 83.8577 3.7316 83.8577 4.37425C83.8577 5.01689 83.4545 5.33822 82.6457 5.33822H80.5455V3.41028ZM83.8797 10.1492C83.677 10.312 83.3685 10.3913 82.952 10.3913H80.5499V8.46561H82.952C83.3685 8.46561 83.6792 8.54701 83.8797 8.70549C84.0957 8.86619 84.2015 9.09945 84.2015 9.40754C84.2015 9.71567 84.0935 9.97757 83.8797 10.1492Z",fill:"black"}),N.createElement("path",{d:"M114.374 6.72035L118.616 0.199253H113.485L111.91 3.51152L110.354 0.199253H104.801L109.063 6.8414L104.638 13.4418H109.951L111.566 10.0105L113.325 13.4418H118.999L114.374 6.72035Z",fill:"black"}),N.createElement("path",{d:"M102.472 0.378544C102.053 0.125449 101.59 0 101.086 0H93.0312C92.5242 0 92.0549 0.127649 91.6252 0.378544C91.1931 0.631642 90.8517 0.972769 90.5982 1.40194C90.3448 1.8201 90.217 2.28667 90.217 2.80386V10.8369C90.217 11.3432 90.3448 11.8097 90.5982 12.2388C90.8517 12.6681 91.1931 13.0092 91.6252 13.2622C92.0549 13.5152 92.5242 13.6407 93.0312 13.6407H101.086C101.593 13.6407 102.053 13.513 102.472 13.2622C102.902 13.0092 103.245 12.6681 103.497 12.2388C103.763 11.8097 103.895 11.341 103.895 10.8369V2.80606C103.895 2.28667 103.761 1.8201 103.497 1.40414C103.243 0.974969 102.902 0.633842 102.472 0.380745V0.378544ZM100.116 9.89279H93.9611V3.75243H100.116V9.89279Z",fill:"black"}),N.createElement("path",{d:"M43.3879 27.3704C42.6166 26.8512 41.7372 26.4993 40.7478 26.3145L44.9726 21.5605H40.8226L36.1199 26.794V30.7935C37.0917 30.4415 37.9887 30.2655 38.8107 30.2655C39.5644 30.2655 40.2101 30.4085 40.7478 30.6923C41.6204 31.1455 42.0569 31.8319 42.0569 32.7559V32.8307C42.0569 33.1827 41.973 33.4269 41.8056 33.5611C41.6558 33.6953 41.3692 33.7635 40.9505 33.7635H32.8715C32.2345 33.7635 31.7983 33.6469 31.5625 33.4115C31.3444 33.1607 31.2363 32.6987 31.2363 32.0277V26.3431L27.0866 28.532V32.6569C27.0866 33.0925 27.0117 33.3873 26.8595 33.5369C26.7075 33.6887 26.4144 33.7635 25.9803 33.7635H23.7412C23.305 33.7635 23.0118 33.6887 22.8619 33.5369C22.7121 33.3851 22.6349 33.0925 22.6349 32.6569V26.8468L18.4852 29.0357V32.6591C18.4852 33.0947 18.4103 33.3895 18.2583 33.5391C18.1084 33.6909 17.8131 33.7657 17.379 33.7657H15.1664C14.73 33.7657 14.4369 33.6909 14.2871 33.5391C14.1372 33.3873 14.06 33.0947 14.06 32.6591V27.3506L9.91037 29.5395V35.9282C9.91037 37.6727 8.92967 38.5439 6.96835 38.5439C6.02952 38.5439 5.28242 38.2073 4.72931 37.5386C4.17615 36.8522 3.89848 35.9458 3.89848 34.8216C3.89848 33.6975 4.18276 32.5161 4.75355 31.4249L0.830824 32.2543C0.277676 33.2113 0 34.3091 0 35.5498C0 37.2944 0.50246 38.8033 1.50958 40.0771C2.801 41.7381 4.61911 42.5674 6.96835 42.5674C8.6454 42.5674 10.0779 42.1736 11.2701 41.3861C12.5946 40.5149 13.4497 39.2895 13.8353 37.7123C14.1372 37.7629 14.4568 37.7871 14.7917 37.7871H18.0114C19.0009 37.7365 19.8559 37.4858 20.5767 37.0326C21.3655 37.5364 22.2956 37.7871 23.3689 37.7871H26.5885C27.7125 37.7365 28.6513 37.4352 29.405 36.8808C30.3262 37.4836 31.4259 37.7871 32.6996 37.7871H41.3581C42.7157 37.7871 43.8309 37.4022 44.7036 36.63C45.7107 35.7566 46.2132 34.5334 46.2132 32.9561V32.7053C46.2132 30.3909 45.2745 28.6134 43.3967 27.3726L43.3879 27.3704Z",fill:"#6A4A9D"}),N.createElement("path",{d:"M66.0266 39.8246C65.4051 39.8246 64.9026 40.0094 64.517 40.3789C64.1313 40.7639 63.9397 41.2677 63.9397 41.8881C63.9397 42.5084 64.1335 43.0123 64.517 43.3973C64.9026 43.7998 65.4051 44 66.0266 44C66.648 44 67.1416 43.8064 67.5097 43.4215C67.8953 43.0365 68.0869 42.5238 68.0869 41.8881C68.0869 41.2523 67.8931 40.7639 67.5097 40.3789C67.1416 40.0094 66.6458 39.8246 66.0266 39.8246Z",fill:"#6A4A9D"}),N.createElement("path",{d:"M65.0208 32.6578C65.0208 33.0933 64.9459 33.3881 64.7938 33.5377C64.6418 33.6896 64.3487 33.7644 63.9124 33.7644H59.5733V30.6954C59.5733 29.3205 59.1788 28.2051 58.3922 27.3495C57.4864 26.3441 56.2038 25.8403 54.5444 25.8403C53.002 25.8403 51.752 26.3353 50.7956 27.3253C49.74 28.4165 49.2111 29.9079 49.2111 31.802C49.2111 33.1109 49.6143 34.2835 50.4187 35.3241C51.3751 36.5494 52.6666 37.2862 54.2932 37.5372C54.745 37.6032 55.124 37.6472 55.4259 37.6626C55.3599 37.997 55.124 38.283 54.7207 38.5182C54.3351 38.769 53.9076 38.8946 53.4382 38.8946C52.532 38.8946 51.5339 38.5754 50.4452 37.9398V41.5366C51.5691 42.2229 52.6841 42.5683 53.7908 42.5683C55.1835 42.5683 56.3979 42.1987 57.438 41.4619C58.6962 40.5731 59.3993 39.3478 59.5513 37.788H64.2936C65.6691 37.788 66.793 37.3942 67.6635 36.6044C68.6684 35.6981 69.173 34.4485 69.173 32.8558V26.3397L65.0235 28.5285V32.6534L65.0208 32.6578ZM55.4259 33.6896C55.3599 33.672 55.2674 33.6654 55.1484 33.6654C54.864 33.6147 54.6612 33.573 54.5444 33.5399C53.707 33.3221 53.2861 32.693 53.2861 31.6524C53.2861 30.3787 53.7048 29.7407 54.5444 29.7407C55.1306 29.7407 55.4237 30.0597 55.4237 30.6977V33.6918L55.4259 33.6896Z",fill:"#6A4A9D"}),N.createElement("path",{d:"M95.419 25.837C94.0615 25.837 92.9465 26.2221 92.0734 26.9942C91.0839 27.883 90.5903 29.1149 90.5903 30.6923V32.6547C90.5903 33.0903 90.5155 33.3851 90.3633 33.5347C90.2135 33.6865 89.9182 33.7613 89.4839 33.7613H85.3124C84.8761 33.7613 84.583 33.6865 84.431 33.5347C84.2811 33.3829 84.204 33.0903 84.204 32.6547V21.5605L80.0544 23.7495V32.8571C80.0544 34.2497 80.4489 35.3892 81.2357 36.278C82.1237 37.2834 83.3556 37.7871 84.9334 37.7871H89.8587C90.8305 37.7871 91.6943 37.5782 92.4507 37.158C93.2726 37.5782 94.3282 37.7871 95.6196 37.7871C97.0608 37.7871 98.2354 37.2922 99.1411 36.3022C100.181 35.1956 100.701 33.6953 100.701 31.7989C100.701 30.1731 100.292 28.8224 99.4694 27.7489C98.513 26.4751 97.1644 25.837 95.419 25.837ZM95.3948 33.7613C94.9584 33.7613 94.7403 33.5853 94.7403 33.2333V30.5427C94.7403 30.0059 94.9673 29.7375 95.419 29.7375C96.2234 29.7375 96.6267 30.3755 96.6267 31.6493C96.6267 33.0573 96.2168 33.7635 95.3948 33.7635V33.7613Z",fill:"#6A4A9D"}),N.createElement("path",{d:"M114.85 32.0277C114.85 32.6987 114.734 33.1607 114.498 33.4115C114.28 33.6469 113.852 33.7635 113.215 33.7635H112.31V24.8317L108.159 27.0448V33.7613H105.167L103.08 37.7871H113.392C115.036 37.7871 116.36 37.2921 117.365 36.3021C118.456 35.2462 119 33.8295 119 32.0497V21.5605L114.85 23.7737V32.0277Z",fill:"#6A4A9D"})),cw="Header-module__root__Pe4MYp",lw="Header-module__nav__wtnkmT",uw="Header-module__navItem__-Fy63Z",fw="Header-module__logo__xO2bWO",ti={root:cw,nav:lw,navItem:uw,logo:fw},dw={llama:aw,default:sw},hw=()=>{const{hideLogo:t,logo:e="default"}=be();if(t)return null;const n=dw[e];return w.jsx("div",{className:ti.logo,children:w.jsx(n,{})})},pw=({className:t})=>{const{t:e}=vt("header"),{disableDelivery:n}=be(),r=Z(Qp),i=Le(fc);p.useEffect(()=>{i?Z.getState().setMode("location_delivery"):Z.getState().setMode("self_pickup")},[i]);const o=()=>{Le.getState().setDeliverPoint(null),Z.getState().setMode("self_pickup")},s=()=>{Le.getState().setDeliverPoint(null),Z.getState().setMode("location_delivery")},a=r==="self_pickup",c=r==="location_delivery";return w.jsxs("div",{className:K(ti.root,t),children:[w.jsx(hw,{}),w.jsxs("nav",{className:ti.nav,children:[!n&&w.jsx(ot,{as:"link",className:ti.navItem,variant:a?"primary":"secondary",onClick:o,children:e("self_pickup")}),!n&&w.jsx(ot,{as:"link",className:ti.navItem,variant:c?"primary":"secondary",onClick:s,children:e("courier_delivery")}),w.jsx(zh,{})]})]})},mw=p.memo(pw),gw={open:!1},Pr=Ut(t=>({...gw,toggle(e){Z.getState().setDetailsOpen(!1),Le.getState().setDeliverPoint(null),st.getState().setSelectedLocation(null),t(n=>({open:e??!n.open}))}})),vw="Layout-module__root__qzPL-f",yw="Layout-module__headerHidden__JEN-d0",bw="Layout-module__sidebarHidden__x017O3",ww="Layout-module__sidebarOpen__IZnIjs",Oo={root:vw,headerHidden:yw,sidebarHidden:bw,sidebarOpen:ww},_w=({children:t})=>{const{hideFilters:e,hideHeader:n}=be(),r=Pr(i=>i.open);return w.jsx("div",{className:K(Oo.root,{[Oo.sidebarOpen]:r,[Oo.headerHidden]:n,[Oo.sidebarHidden]:e}),children:t})},Sw=({children:t})=>{const e=Rt(Mm);return Rt(Vf)&&!e?w.jsx(Fc,{}):w.jsx(w.Fragment,{children:t})};var qh={},Os={},Gh={exports:{}},Cw="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Ew=Cw,xw=Ew;function Wh(){}function Zh(){}Zh.resetWarningCache=Wh;var Ow=function(){function t(r,i,o,s,a,c){if(c!==xw){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Zh,resetWarningCache:Wh};return n.PropTypes=n,n};Gh.exports=Ow();var Pw=Gh.exports,Ps={},Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.loadGoogleMapScript=Tr.isBrowser=void 0;var Kh=typeof window<"u"&&window.document;Tr.isBrowser=Kh;var Tw=function(e,n){if(!Kh||typeof google<"u"&&google.maps&&google.maps.api)return Promise.resolve();var r=document.querySelectorAll('script[src*="'.concat(e,'"]'));if(r&&r.length)return new Promise(function(s){if(typeof google<"u")return s();r[0].addEventListener("load",function(){return s()})});var i=new URL(n);i.searchParams.set("callback","__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__");var o=document.createElement("script");return o.src=i.toString(),new Promise(function(s){window.__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__=s,document.body.appendChild(o)})};Tr.loadGoogleMapScript=Tw;var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.GOOGLE_MAP_SCRIPT_BASE_URL=void 0;var Aw="https://maps.googleapis.com/maps/api/js";Ts.GOOGLE_MAP_SCRIPT_BASE_URL=Aw;function Uo(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uo=function(n){return typeof n}:Uo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Uo(t)}Object.defineProperty(Ps,"__esModule",{value:!0});Ps.default=jw;var Ue=Lw(p),sa=Tr,Rw=Ts;function Qh(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Qh=function(i){return i?n:e})(t)}function Lw(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||Uo(t)!=="object"&&typeof t!="function")return{default:t};var n=Qh(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function Uu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function zu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Uu(Object(n),!0).forEach(function(r){Mw(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Uu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Mw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kw(t,e){if(t==null)return{};var n=Dw(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Dw(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function jw(t){var e=t.ref,n=t.onPlaceSelected,r=t.apiKey,i=t.libraries,o=i===void 0?"places":i,s=t.inputAutocompleteValue,a=s===void 0?"new-password":s,c=t.options;c=c===void 0?{}:c;var l=c.types,u=l===void 0?["(cities)"]:l,f=c.componentRestrictions,d=c.fields,y=d===void 0?["address_components","geometry.location","place_id","formatted_address"]:d,m=c.bounds,h=kw(c,["types","componentRestrictions","fields","bounds"]),_=t.googleMapsScriptBaseUrl,b=_===void 0?Rw.GOOGLE_MAP_SCRIPT_BASE_URL:_,C=t.language,v=(0,Ue.useRef)(null),E=(0,Ue.useRef)(null),x=(0,Ue.useRef)(null),g=(0,Ue.useRef)(null),S=C?"&language=".concat(C):"",O="".concat(b,"?libraries=").concat(o,"&key=").concat(r).concat(S),T=(0,Ue.useCallback)(function(){return(0,sa.loadGoogleMapScript)(b,O)},[b,O]);return(0,Ue.useEffect)(function(){var R=zu(zu({},h),{},{fields:y,types:u,bounds:m});if(f&&(R.componentRestrictions=f),!(x.current||!v.current||!sa.isBrowser)){e&&!e.current&&(e.current=v.current);var L=function(){var D;if(typeof google>"u")return console.error("Google has not been found. Make sure your provide apiKey prop.");if(!((D=google.maps)!==null&&D!==void 0&&D.places))return console.error("Google maps places API must be loaded.");if(!v.current instanceof HTMLInputElement)return console.error("Input ref must be HTMLInputElement.");x.current=new google.maps.places.Autocomplete(v.current,R),x.current&&(E.current=x.current.addListener("place_changed",function(){n&&x&&x.current&&n(x.current.getPlace(),v.current,x.current)}))};return r?T().then(function(){return L()}):L(),function(){return E.current?E.current.remove():void 0}}},[]),(0,Ue.useEffect)(function(){var R;!(Ue.default!==null&&Ue.default!==void 0&&(R=Ue.default.version)!==null&&R!==void 0&&R.startsWith("18"))&&sa.isBrowser&&window.MutationObserver&&v.current&&v.current instanceof HTMLInputElement&&(g.current=new MutationObserver(function(){g.current.disconnect(),v.current&&(v.current.autocomplete=a)}),g.current.observe(v.current,{attributes:!0,attributeFilter:["autocomplete"]}))},[a]),(0,Ue.useEffect)(function(){x.current&&x.current.setFields(y)},[y]),(0,Ue.useEffect)(function(){x.current&&x.current.setBounds(m)},[m]),(0,Ue.useEffect)(function(){x.current&&x.current.setComponentRestrictions(f)},[f]),(0,Ue.useEffect)(function(){x.current&&x.current.setOptions(h)},[h]),{ref:v,autocompleteRef:x}}function zo(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zo=function(n){return typeof n}:zo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},zo(t)}Object.defineProperty(Os,"__esModule",{value:!0});Os.default=void 0;var cc=Iw(p),Ce=Jh(Pw),Nw=Jh(Ps);function Jh(t){return t&&t.__esModule?t:{default:t}}function Xh(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Xh=function(i){return i?n:e})(t)}function Iw(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||zo(t)!=="object"&&typeof t!="function")return{default:t};var n=Xh(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function us(){return us=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},us.apply(this,arguments)}function Fw(t,e){if(t==null)return{};var n=Bw(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Bw(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Yh(t){var e=t.onPlaceSelected,n=t.apiKey,r=t.libraries,i=t.inputAutocompleteValue,o=t.options,s=t.googleMapsScriptBaseUrl,a=t.refProp,c=t.language,l=Fw(t,["onPlaceSelected","apiKey","libraries","inputAutocompleteValue","options","googleMapsScriptBaseUrl","refProp","language"]),u=(0,Nw.default)({ref:a,googleMapsScriptBaseUrl:s,onPlaceSelected:e,apiKey:n,libraries:r,inputAutocompleteValue:i,options:o,language:c}),f=u.ref;return cc.default.createElement("input",us({ref:f},l))}Yh.propTypes={apiKey:Ce.default.string,libraries:Ce.default.arrayOf(Ce.default.string),ref:Ce.default.oneOfType([Ce.default.func,Ce.default.shape({current:Ce.default.any})]),googleMapsScriptBaseUrl:Ce.default.string,onPlaceSelected:Ce.default.func,inputAutocompleteValue:Ce.default.string,options:Ce.default.shape({componentRestrictions:Ce.default.object,bounds:Ce.default.object,location:Ce.default.object,offset:Ce.default.number,origin:Ce.default.object,radius:Ce.default.number,sessionToken:Ce.default.object,types:Ce.default.arrayOf(Ce.default.string)}),language:Ce.default.string};var Vw=(0,cc.forwardRef)(function(t,e){return cc.default.createElement(Yh,us({},t,{refProp:e}))});Os.default=Vw;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"usePlacesWidget",{enumerable:!0,get:function(){return n.default}});var e=r(Os),n=r(Ps);function r(i){return i&&i.__esModule?i:{default:i}}})(qh);var ep=qh;const Hw="Aside-module__root__EotK2f",$w="Aside-module__open__Zwmbs5",Uw="Aside-module__overlay__slLdHF",zw="Aside-module__container__28P4wq",Po={root:Hw,open:$w,overlay:Uw,container:zw},qw=({children:t,className:e,open:n})=>w.jsxs("div",{className:K(Po.root,e,{[Po.open]:n}),children:[w.jsx("div",{className:Po.overlay}),w.jsx("div",{className:Po.container,children:t})]}),Gw="Input-module__locationSearchRoot__svh-f9",Ww="Input-module__endAdornment__m40K5R",Zw="Input-module__input__505b7i",Kw="Input-module__startAdornment__D-sJ0N",Qw="Input-module__locationSearchInput__2YK1MG",Jw="Input-module__label__gmqtsf",Xw="Input-module__inputContainer__vubIa-",Yn={locationSearchRoot:Gw,endAdornment:Ww,input:Zw,startAdornment:Kw,locationSearchInput:Qw,label:Jw,inputContainer:Xw},lc=p.forwardRef(({className:t,endAdornment:e,inputRef:n,label:r,onBlur:i,onChange:o,startAdornment:s,...a},c)=>{const l=p.useId(),u=p.useRef(null);p.useImperativeHandle(c,()=>({focus:()=>{var d;(d=u.current)==null||d.focus()},blur:()=>{var d;(d=u.current)==null||d.blur()},setValue:d=>{if(o){o({target:{value:d}});return}if(i){i({target:{value:d}});return}u.current&&(u.current.value=d)}}),[i,o]);const f=$h(n,u);return w.jsxs("label",{htmlFor:a.id??l,className:K(Yn.locationSearchRoot,t),children:[r&&w.jsx("span",{className:Yn.label,children:r}),w.jsxs("div",{className:Yn.inputContainer,children:[s&&w.jsx("div",{className:Yn.startAdornment,children:s}),w.jsx("input",{...a,ref:f,id:a.id??l,className:Yn.locationSearchInput,onChange:o,onBlur:i}),e&&w.jsx("div",{className:Yn.endAdornment,children:e})]})]})}),Yw="LocationAside-module__submit__CSKcqi",e8="LocationAside-module__container__S1NejR",t8="LocationAside-module__selector__hl74ke",n8="LocationAside-module__label__0Zk8at",r8="LocationAside-module__header__N1wgyn",i8="LocationAside-module__close__VsE88z",To={submit:Yw,container:e8,selector:t8,label:n8,header:r8,close:i8},o8=p.forwardRef((t,e)=>{const{t:n}=vt(["location_aside","common"]),{mapKey:r}=xs(),i=Sn(Q6),{country:o,hideCloseButtonOnLocationScreen:s,inputs:a,onCloseLocationSelector:c,onLocationSelect:l}=be(),u=p.useRef(null),[f,d]=p.useState("");p.useImperativeHandle(e,()=>({open:()=>Sn.getState().toggle(!0),close:()=>Sn.getState().toggle(!1)}),[]);const y=v=>{Sn.getState().toggle(!1),Vi.getState().setPlaceSimple(v,{withNavigation:!0}),l==null||l(v),v!=null&&v.formatted_address&&d(v==null?void 0:v.formatted_address)},m=()=>{Sn.getState().toggle(!1),c==null||c()},h=o?{componentRestrictions:{country:o}}:void 0,_=v=>{d(v.target.value)},{ref:b}=ep.usePlacesWidget({libraries:["places"],options:h,onPlaceSelected:y,apiKey:r,inputAutocompleteValue:f}),C=ls(a==null?void 0:a.city);return w.jsx(qw,{open:i,children:w.jsx("div",{ref:u,className:To.container,children:w.jsxs("div",{className:To.selector,children:[w.jsxs("div",{className:To.header,children:[w.jsx("div",{className:To.label,children:n("choose_city")}),!s&&w.jsx(Rr,{position:"relative",onClick:m})]}),w.jsx(lc,{...C,inputRef:b,value:f,placeholder:n("placeholder"),onChange:_})]})})})}),s8=p.memo(o8),a8=({children:t})=>{const{locale:e}=be(),{mapKey:n}=xs(),r=p.useRef(e);return w.jsx(sg,{apiKey:n,language:r.current,libraries:wp,children:t})},c8=({children:t})=>{const{disableGoogleInit:e}=be(),{mapKey:n}=xs(),{setMapKey:r}=Vi();return p.useEffect(()=>{r(n)},[n,r]),e?w.jsx(w.Fragment,{children:t}):w.jsx(a8,{children:t})},qu=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},N.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M14.617 16.032a9 9 0 1 1 1.414-1.414l3.676 3.675a1 1 0 0 1-1.414 1.414l-3.676-3.675ZM2 9a7 7 0 1 1 12.04 4.858 1.005 1.005 0 0 0-.182.182A7 7 0 0 1 2 9Z",clipRule:"evenodd"})),l8="LocationSelector-module__option__WoAxrr",u8="LocationSelector-module__address__huDzWo",f8="LocationSelector-module__icon__90zfxv",d8="LocationSelector-module__inputGoogle__jtuw-y",h8={option:l8,address:u8,icon:f8,inputGoogle:d8},p8=({className:t})=>{const[e,n]=p.useState(""),{t:r}=vt("location_selector"),{country:i,inputs:o,onLocationSelect:s}=be(),[a,c]=p.useState(""),l=[],u=p.useRef(null),f=i?{componentRestrictions:{country:i},types:l}:{types:l},d=v=>{Vi.getState().setPlaceSimple(v,{withNavigation:!0}),s==null||s(v),c(""),n("")},{ref:y}=ep.usePlacesWidget({libraries:["places"],options:f,onPlaceSelected:d,inputAutocompleteValue:a});p.useEffect(()=>{const v=y.current;if(!v||!e)return;const E=setTimeout(()=>{var S;const x=(S=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:S.set;x==null||x.call(v,e),c(e);const g=new Event("input",{bubbles:!0});v.dispatchEvent(g),v.focus()},500);return()=>clearTimeout(E)},[e,y]);const m=()=>{a&&Z.getState().setBlurred(!0),Z.getState().setDetailsOpen(!1),Le.getState().setDeliverPoint(null),st.getState().setSelectedLocation(null)},h=()=>{Z.getState().setBlurred(!1)},_=v=>{v.preventDefault(),c(e)},b=v=>{var E;(E=u.current)==null||E.focus(),u.current&&v.key!=="Enter"&&u.current.dispatchEvent(new KeyboardEvent("keydown",{key:v.key}))},C=ls(o==null?void 0:o.address);return w.jsxs(w.Fragment,{children:[w.jsx(lc,{...C,value:a,className:K(t,h8.inputGoogle),endAdornment:w.jsx(qu,{}),placeholder:r("placeholder"),inputRef:y,onChange:_,onFocus:m,onBlur:h,onKeyDown:b}),w.jsx(lc,{inputRef:u,className:t,endAdornment:w.jsx(qu,{}),placeholder:r("placeholder"),value:e,onChange:v=>n(v.currentTarget.value)})]})},m8=({className:t})=>Z(Yp)?w.jsx(p8,{className:t}):null,g8=p.memo(m8),v8="DeliveryDetailsModal-module__root__qwKnjX",y8={root:v8},b8=({className:t,location:e,onClose:n,onSubmit:r})=>w.jsx("div",{className:K(y8.root,t),children:w.jsx(Vh,{location:e,onClose:n,onSubmit:r})}),w8="LocationDetailsModal-module__root__PyRnLM",_8={root:w8},S8=({className:t,location:e,onClose:n,onSubmit:r})=>{const i=()=>{r==null||r(e)};return w.jsx("div",{className:K(_8.root,t),children:w.jsx(_d,{location:e,onClose:n,onSubmit:i})})},C8="MapContainer-module__root__1Os6Q-",E8="MapContainer-module__mapWrapper__Cwe7qC",x8="MapContainer-module__wrapperBlurred__04NN2L",O8="MapContainer-module__locationSelector__Pr1zS-",P8="MapContainer-module__filterButton__CW3Qv7",T8="MapContainer-module__sidebarOpen__lGMVrJ",A8="MapContainer-module__filterIcon__T01XsJ",R8="MapContainer-module__details__gM8LWX",Pt={root:C8,mapWrapper:E8,wrapperBlurred:x8,locationSelector:O8,filterButton:P8,sidebarOpen:T8,filterIcon:A8,details:R8},L8=()=>{const{onPointClick:t}=be(),e=Z(dc),n=st(n0),r=Le(fc),i=p.useCallback(()=>{Z.getState().setDetailsOpen(!1)},[]),o=p.useCallback(s=>{t==null||t(s),Z.getState().setDetailsOpen(!1),st.getState().setSelectedLocation(null),Le.getState().setDeliverPoint(null)},[t]);return w.jsxs(w.Fragment,{children:[(r==null?void 0:r.address)&&e&&w.jsx(b8,{location:r,className:Pt.details,onClose:i,onSubmit:o}),n&&e&&w.jsx(S8,{location:n,className:Pt.details,onClose:i,onSubmit:o})]})},M8=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:60,height:40,fill:"none",viewBox:"0 0 60 40",...t},N.createElement("path",{d:"M0 0h52a8 8 0 0 1 8 8v24a8 8 0 0 1-8 8H0V0Z"}),N.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:1.5,d:"M32.093 10h13.814c1.151 0 2.093.91 2.093 2.02v2.223c0 .808-.523 1.818-1.047 2.324l-4.5 3.839c-.627.505-1.046 1.515-1.046 2.323v4.344c0 .607-.419 1.415-.942 1.718L39 29.7c-1.36.808-3.244-.101-3.244-1.717v-5.355c0-.707-.419-1.616-.837-2.121l-3.977-4.041c-.523-.506-.942-1.415-.942-2.02V12.12c0-1.21.942-2.12 2.093-2.12Z"})),k8=t=>N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",viewBox:"0 0 28 28",...t},N.createElement("rect",{width:28,height:28,fill:"#333",rx:4}),N.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.165 7h9.67c.806 0 1.465.636 1.465 1.414V9.97c0 .566-.366 1.273-.733 1.627l-3.15 2.687c-.44.353-.732 1.06-.732 1.627v3.04c0 .425-.293.99-.66 1.203L14 20.79c-.952.566-2.271-.07-2.271-1.202V15.84c0-.495-.293-1.132-.586-1.485l-2.784-2.83c-.366-.353-.659-.99-.659-1.413V8.485C7.7 7.636 8.36 7 9.165 7Z"})),D8=()=>{const t=Pr(i=>i.open),e=Pr(i=>i.toggle),n=Fn("screenSm"),r=()=>{e(!0)};return w.jsxs("div",{role:"presentation",className:K(Pt.filterButton,{[Pt.sidebarOpen]:t}),onClick:n?void 0:r,children:[n&&w.jsx(zh,{}),n?w.jsx(k8,{className:Pt.filterIcon,onClick:r}):w.jsx(M8,{className:Pt.filterIcon})]})},j8=({children:t,className:e})=>{const{hideFilters:n,hideSearchInput:r}=be(),i=Z(Xp),o=Z(dc);return w.jsxs("div",{className:K(Pt.root,e),children:[!r&&!o&&w.jsx(g8,{className:Pt.locationSelector}),!n&&w.jsx(D8,{}),w.jsx("div",{className:K(Pt.mapWrapper,{[Pt.wrapperBlurred]:i}),children:t}),w.jsx(L8,{})]})},N8=p.memo(j8),I8="Separator-module__root__eQtZey",F8={root:I8},aa=({className:t,...e})=>w.jsx("hr",{className:K(F8.root,t),...e}),B8="Sidebar-module__root__4j1MA3",V8="Sidebar-module__closeButton__HLXy1c",H8="Sidebar-module__open__mqQXF6",$8="Sidebar-module__header__Afp6uz",U8="Sidebar-module__typeFilter__GN46u9",z8="Sidebar-module__separator__6I4QoJ",q8="Sidebar-module__withRightPadding__2u1Ina",G8="Sidebar-module__sheetContent__SaoncI",W8="Sidebar-module__doneButton__4aeaSD",Vt={root:B8,closeButton:V8,open:H8,header:$8,typeFilter:U8,separator:z8,withRightPadding:q8,sheetContent:G8,doneButton:W8},Z8=()=>{const{t}=vt("common"),e=Fn("screenSm"),n=Pr(i=>i.toggle),r=()=>{n(!1)};return w.jsxs("div",{className:Vt.header,children:[e&&w.jsx("div",{role:"presentation",className:Vt.doneButton,onClick:r,children:t("done")}),!e&&w.jsx(Rr,{className:Vt.closeButton,onClick:r})]})},K8="Radio-module__root__7ElY2W",Q8="Radio-module__label__c-sYW3",Gu={root:K8,label:Q8},J8=({className:t,label:e,labelProps:n={},...r})=>{const i=p.useId(),{className:o,...s}=n;return w.jsxs("label",{htmlFor:i,className:K(Gu.label,o),...s,children:[w.jsx("input",{id:i,type:"radio",className:K(Gu.root,t),...r}),e]})},cr=t=>w.jsx(J8,{...t,type:"checkbox"}),X8="RadioGroup-module__root__ewZw-x",Y8="RadioGroup-module__body__k8BJAs",e9="RadioGroup-module__legend__tcfV7q",ca={root:X8,body:Y8,legend:e9},tp=({children:t,className:e,label:n,onChange:r,value:i,...o})=>w.jsxs("div",{className:K(ca.root,e),...o,children:[n&&w.jsx("span",{className:ca.legend,children:n}),w.jsx("div",{className:ca.body,children:p.Children.map(t,s=>p.isValidElement(s)?p.cloneElement(s,{checked:!!(i!=null&&i[s.props.value]),onChange:a=>r==null?void 0:r({...i,[a.target.value]:a.target.checked})}):null)})]}),t9=({className:t,onChange:e})=>{const{t:n}=vt("receive_filter"),r=dn(s0);return w.jsxs(tp,{value:r,label:n("title"),className:t,onChange:e,children:[w.jsx(cr,{name:"receive",value:mt.DressingRoom,label:n("dressing_room")}),w.jsx(cr,{name:"receive",value:mt.CheckOrder,label:n("check_order")}),w.jsx(cr,{name:"receive",value:mt.PayByCash,label:n("pay_by_cash")})]})},n9=p.memo(t9),r9=({className:t,onChange:e})=>{const{t:n}=vt("send_filter"),r=dn(o0);return w.jsxs(tp,{className:t,value:r,label:n("title"),onChange:e,children:[w.jsx(cr,{name:"send",value:gt.Return,label:n("sending_returns")}),w.jsx(cr,{name:"send",value:gt.Shipping,label:n("shipping")}),w.jsx(cr,{name:"send",value:gt.Payment,label:n("payment")})]})},i9=p.memo(r9),o9="TypeFilter-module__root__WH5EQV",s9="TypeFilter-module__button__f0mSfo",Ao={root:o9,button:s9},a9=({className:t,onChange:e,value:n})=>{const{t:r}=vt("type_filter"),i=o=>()=>e==null?void 0:e(o);return w.jsxs("div",{className:K(Ao.root,t),children:[w.jsx(ot,{className:Ao.button,variant:n===Ft.All?"primary":"secondary",onClick:i(Ft.All),children:r("all")}),w.jsx(ot,{className:Ao.button,variant:n===Ft.PostOffice?"primary":"secondary",onClick:i(Ft.PostOffice),children:r("post_office")}),w.jsx(ot,{className:Ao.button,variant:n===Ft.PickPoint?"primary":"secondary",onClick:i(Ft.PickPoint),children:r("pick_point")})]})},c9=({className:t,onChange:e})=>{const n=dn(i0);return w.jsx(a9,{value:n,className:t,onChange:e})},l9=p.memo(c9),u9=({className:t})=>{const e=Fn("screenSm"),n=Pr(c=>c.open),r=p.useCallback(c=>dn.getState().setFilter({type:c}),[]),i=p.useCallback(c=>dn.getState().setFilter({send:c}),[]),o=p.useCallback(c=>dn.getState().setFilter({receive:c}),[]),s=p.useCallback(()=>Pr.getState().toggle(!1),[]),a=w.jsxs(w.Fragment,{children:[w.jsx(Z8,{}),w.jsxs("div",{className:Vt.withRightPadding,children:[w.jsx(l9,{className:Vt.typeFilter,onChange:r}),w.jsx(aa,{className:Vt.separator}),w.jsx(n9,{onChange:o}),w.jsx(aa,{}),w.jsx(i9,{onChange:i}),w.jsx(aa,{})]})]});return e?w.jsx(yh,{initialFocusRef:!1,open:n,snapPoints:({maxHeight:c})=>c-bh,onDismiss:s,children:w.jsx("div",{className:Vt.sheetContent,children:a})}):w.jsx("div",{className:K(Vt.root,t,{[Vt.open]:n}),children:a})},f9="App-module__map__Kf-2JS",d9="App-module__sidebar__ORIzGk",h9="App-module__header__bgP9DA",la={map:f9,sidebar:d9,header:h9},p9=new b4,np=({config:t,options:e})=>{const n=Wm(t),{INN:r,cityName:i,countryAbbreviation:o,hideFilters:s,hideHeader:a,map:c,regionName:l}=n;Tt(r,"INN is required"),Zm(r,e),Tt(c==null?void 0:c.provider,"Map provider is required");const u=I6(c.provider);return km({cityName:i,countryAbbreviation:o,regionName:l}),w.jsx(fp,{baseColor:"#f3f3f3",highlightColor:"#ecebeb",children:w.jsx(E4,{client:p9,children:w.jsx(lf.Provider,{value:n,children:w.jsx(T6,{children:w.jsx(ew,{children:w.jsx(Y6,{children:w.jsx(Iv,{tolgee:Uh,fallback:w.jsx(Fc,{}),children:w.jsx(c8,{children:w.jsx(Sw,{children:w.jsxs(_w,{children:[!a&&w.jsx(mw,{className:la.header}),!s&&w.jsx(u9,{className:la.sidebar}),w.jsx(N8,{className:la.map,children:w.jsx(u,{})}),w.jsx(s8,{})]})})})})})})})})})})},rp=async t=>pi.request({baseURL:"https://api.geo-data.omnic.solutions/api/1.0/",method:"POST",url:"normalize/address",data:t,headers:{Authorization:"Token 9877f9631b2e30570cc1c5aa8c740b0c912efe99a8b6c45c21cf4bd394adc7e9"}}),ip=p.createContext(null),m9=(t,e)=>({...t,...e,palette:{...t.palette,...e==null?void 0:e.palette},inputs:e!=null&&e.inputs?{...t.inputs,...e.inputs}:t.inputs,handlers:e!=null&&e.handlers?{...t.handlers,...e.handlers}:t.handlers}),g9=({children:t})=>{const[e,n]=p.useState(),[r,i]=p.useState(),o=p.useRef(null),s=p.useRef(null),a=p.useRef(!1),c=p.useCallback(u=>{if(a.current){console.warn("Widget already launched");return}a.current=!0,n(u)},[]),l=p.useMemo(()=>({widgetOutHolderRef:o,widgetLocationsRef:s,launchWidget:c,setDynamicConfig:i}),[c]);return w.jsxs(ip.Provider,{value:l,children:[w.jsx("div",{ref:o,style:{position:"fixed",left:"-9999px",top:"-9999px"},children:w.jsx("div",{ref:s,id:"@omnic/widget-locations",style:{height:"100%",width:"100%"},children:e&&w.jsx(np,{options:e.options,config:m9(e.config,r)})})}),t]})};function op(){const t=p.useContext(ip);if(!t)throw new Error("Please use hook useWidgetLocationsContext inside WidgetLocationsProvider");return t}const Wu=t=>{if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},uc=(t,e,n=new WeakMap)=>{if(Object.is(t,e))return!0;if(!t||!e||typeof t!="object"&&typeof t!="function"||typeof e!="object"&&typeof e!="function")return!1;const r=t,i=e,o=n.get(r);if(o!=null&&o.has(i))return!0;if(o?o.add(i):n.set(r,new WeakSet([i])),Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((s,a)=>uc(s,e[a],n));if(Wu(t)&&Wu(e)){const s=Object.keys(t),a=Object.keys(e);return s.length!==a.length?!1:s.every(c=>uc(t[c],e[c],n))}return!1},v9=t=>{const{setDynamicConfig:e,widgetLocationsRef:n,widgetOutHolderRef:r}=op(),i=p.useRef(null),o=p.useRef(null);return p.useEffect(()=>{!t||uc(o.current,t)||(o.current=t,e(t))},[t,e]),p.useEffect(()=>{const s=r.current,a=n.current,c=i.current;return a&&c&&c.appendChild(a),()=>{a&&s&&s.appendChild(a)}},[n,r]),w.jsx("div",{ref:i,style:{width:"100%",height:"100%"}})};exports.EReceiveFilter=mt;exports.ESendFilter=gt;exports.ETypeFilter=Ft;exports.MapPlaceholder=v9;exports.Widget=np;exports.WidgetLocationsProvider=g9;exports.createPointsIterator=va;exports.fetchPointsRequest=ga;exports.fromHoursMinutesToMinutes=a0;exports.fromMinutesToHoursMinutes=c0;exports.getAddressFormGeocode=ba;exports.getBoundsFromPoint=l0;exports.getCurrentPosition=bc;exports.getNormalizedAddress=rp;exports.getPropertyValue=Bf;exports.isCoordinates=ya;exports.isDeliveryPoint=Am;exports.isHttpSuccess=Ff;exports.isPlaceId=If;exports.replaceSvgCurrentColor=rr;exports.setWidgetCSSProperty=Di;exports.useWidgetLocationsContext=op;