@arenarium/maps 1.0.210 → 1.0.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +5 -2
- package/package.json +4 -4
package/dist/main.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ts=Object.defineProperty;var Qr=r=>{throw TypeError(r)};var Ms=(r,e,t)=>e in r?Ts(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var f=(r,e,t)=>Ms(r,typeof e!="symbol"?e+"":e,t),nr=(r,e,t)=>e.has(r)||Qr("Cannot "+t);var k=(r,e,t)=>(nr(r,e,"read from private field"),t?t.call(r):e.get(r)),D=(r,e,t)=>e.has(r)?Qr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Z=(r,e,t,n)=>(nr(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Ae=(r,e,t)=>(nr(r,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Mn=!1;var An=Array.isArray,As=Array.prototype.indexOf,Os=Array.from,lr=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,Ns=Object.prototype,Rs=Array.prototype,Is=Object.getPrototypeOf,en=Object.isExtensible;function Ps(r){for(var e=0;e<r.length;e++)r[e]()}function Ls(){var r,e,t=new Promise((n,s)=>{r=n,e=s});return{promise:t,resolve:r,reject:e}}const X=2,Ir=4,On=8,At=16,Te=32,Ze=64,Nn=128,K=256,zt=512,W=1024,se=2048,Me=4096,et=8192,it=16384,Pr=32768,Ds=65536,tn=1<<17,Zs=1<<18,Ot=1<<19,js=1<<20,ur=1<<21,Lr=1<<22,Ie=1<<23,Dt=Symbol("$state"),Dr=new class extends Error{constructor(){super(...arguments);f(this,"name","StaleReactionError");f(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Fs(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function zs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Vs(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Us(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Bs(r){throw new Error("https://svelte.dev/e/effect_orphan")}function $s(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function qs(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ws(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Hs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const Ys=2,j=Symbol();function Rn(r){return r===this.v}let Xs=!1,ae=null;function Vt(r){ae=r}function Zr(r,e=!1,t){ae={p:ae,c:null,e:null,s:r,x:null,l:null}}function jr(r){var e=ae,t=e.e;if(t!==null){e.e=null;for(var n of t)Yn(n)}return r!==void 0&&(e.x=r),ae=e.p,r??{}}function In(){return!0}const Gs=new WeakMap;function Js(r){var e=M;if(e===null)return S.f|=Ie,r;if((e.f&Pr)===0){if((e.f&Nn)===0)throw!e.parent&&r instanceof Error&&Pn(r),r;e.b.error(r)}else Fr(r,e)}function Fr(r,e){for(;e!==null;){if((e.f&Nn)!==0)try{e.b.error(r);return}catch(t){r=t}e=e.parent}throw r instanceof Error&&Pn(r),r}function Pn(r){const e=Gs.get(r);e&&(lr(r,"message",{value:e.message}),lr(r,"stack",{value:e.stack}))}let Ut=[];function Ks(){var r=Ut;Ut=[],Ps(r)}function Qs(r){Ut.length===0&&queueMicrotask(Ks),Ut.push(r)}function ea(){for(var r=M.b;r!==null&&!r.has_pending_snippet();)r=r.parent;return r===null&&Fs(),r}function ta(r){var e=X|se,t=S!==null&&(S.f&X)!==0?S:null;return M===null||t!==null&&(t.f&K)!==0?e|=K:M.f|=Ot,{ctx:ae,deps:null,effects:null,equals:Rn,f:e,fn:r,reactions:null,rv:0,v:j,wv:0,parent:t??M,ac:null}}function ra(r,e){let t=M;t===null&&zs();var n=t.b,s=void 0,a=zn(j),i=null,o=!S;return ma(()=>{try{var l=r();i&&Promise.resolve(l).catch(()=>{})}catch(m){l=Promise.reject(m)}var u=()=>l;s=(i==null?void 0:i.then(u,u))??Promise.resolve(l),i=s;var d=V,p=n.pending;o&&(n.update_pending_count(1),p||d.increment());const g=(m,y=void 0)=>{i=null,p||d.activate(),y?y!==Dr&&(a.f|=Ie,fr(a,y)):((a.f&Ie)!==0&&(a.f^=Ie),fr(a,m)),o&&(n.update_pending_count(-1),p||d.decrement()),Zn()};if(s.then(g,m=>g(null,m||"unknown")),d)return()=>{queueMicrotask(()=>d.neuter())}}),new Promise(l=>{function u(d){function p(){d===s?l(a):u(s)}d.then(p,p)}u(s)})}function Ln(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)De(e[t])}}function na(r){for(var e=r.parent;e!==null;){if((e.f&X)===0)return e;e=e.parent}return null}function zr(r){var e,t=M;Ee(na(r));try{Ln(r),e=ss(r)}finally{Ee(t)}return e}function Dn(r){var e=zr(r);if(r.equals(e)||(r.v=e,r.wv=rs()),!ot){var t=(we||(r.f&K)!==0)&&r.deps!==null?Me:W;Q(r,t)}}function sa(r,e,t){const n=ta;if(e.length===0){t(r.map(n));return}var s=V,a=M,i=aa(),o=ea();Promise.all(e.map(l=>ra(l))).then(l=>{s==null||s.activate(),i();try{t([...r.map(n),...l])}catch(u){(a.f&it)===0&&Fr(u,a)}s==null||s.deactivate(),Zn()}).catch(l=>{o.error(l)})}function aa(){var r=M,e=S,t=ae,n=V;return function(){Ee(r),de(e),Vt(t),n==null||n.activate()}}function Zn(){Ee(null),de(null),Vt(null)}const sr=new Set;let V=null,rn=new Set,Bt=[];function jn(){const r=Bt.shift();Bt.length>0&&queueMicrotask(jn),r()}let mt=[],Vr=null,dr=!1;var bt,Ge,ge,Et,St,Oe,Je,Ne,ye,Ke,Ct,Tt,ne,Fn,Zt,cr;const Gt=class Gt{constructor(){D(this,ne);f(this,"current",new Map);D(this,bt,new Map);D(this,Ge,new Set);D(this,ge,0);D(this,Et,null);D(this,St,!1);D(this,Oe,[]);D(this,Je,[]);D(this,Ne,[]);D(this,ye,[]);D(this,Ke,[]);D(this,Ct,[]);D(this,Tt,[]);f(this,"skipped_effects",new Set)}process(e){var s;mt=[];for(const a of e)Ae(this,ne,Fn).call(this,a);if(k(this,Oe).length===0&&k(this,ge)===0){Ae(this,ne,cr).call(this);var t=k(this,Ne),n=k(this,ye);Z(this,Ne,[]),Z(this,ye,[]),Z(this,Ke,[]),V=null,nn(t),nn(n),V===null?V=this:sr.delete(this),(s=k(this,Et))==null||s.resolve()}else Ae(this,ne,Zt).call(this,k(this,Ne)),Ae(this,ne,Zt).call(this,k(this,ye)),Ae(this,ne,Zt).call(this,k(this,Ke));for(const a of k(this,Oe))Ye(a);for(const a of k(this,Je))Ye(a);Z(this,Oe,[]),Z(this,Je,[])}capture(e,t){k(this,bt).has(e)||k(this,bt).set(e,t),this.current.set(e,e.v)}activate(){V=this}deactivate(){V=null;for(const e of rn)if(rn.delete(e),e(),V!==null)break}neuter(){Z(this,St,!0)}flush(){mt.length>0?ia():Ae(this,ne,cr).call(this),V===this&&(k(this,ge)===0&&sr.delete(this),this.deactivate())}increment(){Z(this,ge,k(this,ge)+1)}decrement(){if(Z(this,ge,k(this,ge)-1),k(this,ge)===0){for(const e of k(this,Ct))Q(e,se),_t(e);for(const e of k(this,Tt))Q(e,Me),_t(e);Z(this,Ne,[]),Z(this,ye,[]),this.flush()}else this.deactivate()}add_callback(e){k(this,Ge).add(e)}settled(){return(k(this,Et)??Z(this,Et,Ls())).promise}static ensure(){if(V===null){const e=V=new Gt;sr.add(V),Gt.enqueue(()=>{V===e&&e.flush()})}return V}static enqueue(e){Bt.length===0&&queueMicrotask(jn),Bt.unshift(e)}};bt=new WeakMap,Ge=new WeakMap,ge=new WeakMap,Et=new WeakMap,St=new WeakMap,Oe=new WeakMap,Je=new WeakMap,Ne=new WeakMap,ye=new WeakMap,Ke=new WeakMap,Ct=new WeakMap,Tt=new WeakMap,ne=new WeakSet,Fn=function(e){var d;e.f^=W;for(var t=e.first;t!==null;){var n=t.f,s=(n&(Te|Ze))!==0,a=s&&(n&W)!==0,i=a||(n&et)!==0||this.skipped_effects.has(t);if(!i&&t.fn!==null){if(s)t.f^=W;else if((n&Ir)!==0)k(this,ye).push(t);else if((n&W)===0)if((n&Lr)!==0){var o=(d=t.b)!=null&&d.pending?k(this,Je):k(this,Oe);o.push(t)}else Qt(t)&&((t.f&At)!==0&&k(this,Ke).push(t),Ye(t));var l=t.first;if(l!==null){t=l;continue}}var u=t.parent;for(t=t.next;t===null&&u!==null;)t=u.next,u=u.parent}},Zt=function(e){for(const t of e)((t.f&se)!==0?k(this,Ct):k(this,Tt)).push(t),Q(t,W);e.length=0},cr=function(){if(!k(this,St))for(const e of k(this,Ge))e();k(this,Ge).clear()};let vt=Gt;function ia(){var r=He;dr=!0;try{var e=0;for(an(!0);mt.length>0;){var t=vt.ensure();if(e++>1e3){var n,s;oa()}t.process(mt),ke.clear()}}finally{dr=!1,an(r),Vr=null}}function oa(){try{$s()}catch(r){Fr(r,Vr)}}let fe=null;function nn(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var n=r[t++];if((n.f&(it|et))===0&&Qt(n)&&(fe=[],Ye(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?Qn(n):n.fn=null),(fe==null?void 0:fe.length)>0)){ke.clear();for(const s of fe)Ye(s);fe=[]}}fe=null}}function _t(r){for(var e=Vr=r;e.parent!==null;){e=e.parent;var t=e.f;if(dr&&e===M&&(t&At)!==0)return;if((t&(Ze|Te))!==0){if((t&W)===0)return;e.f^=W}}mt.push(e)}const ke=new Map;function zn(r,e){var t={f:0,v:r,reactions:null,equals:Rn,rv:0,wv:0};return t}function U(r,e){const t=zn(r);return xa(t),t}function F(r,e,t=!1){S!==null&&(!oe||(S.f&tn)!==0)&&In()&&(S.f&(X|At|Lr|tn))!==0&&!($!=null&&$.includes(r))&&Hs();let n=t?dt(e):e;return fr(r,n)}function fr(r,e){if(!r.equals(e)){var t=r.v;ot?ke.set(r,e):ke.set(r,t),r.v=e;var n=vt.ensure();n.capture(r,t),(r.f&X)!==0&&((r.f&se)!==0&&zr(r),Q(r,(r.f&K)===0?W:Me)),r.wv=rs(),Vn(r,se),M!==null&&(M.f&W)!==0&&(M.f&(Te|Ze))===0&&(J===null?ka([r]):J.push(r))}return e}function ar(r){F(r,r.v+1)}function Vn(r,e){var t=r.reactions;if(t!==null)for(var n=t.length,s=0;s<n;s++){var a=t[s],i=a.f,o=(i&se)===0;o&&Q(a,e),(i&X)!==0?Vn(a,Me):o&&((i&At)!==0&&fe!==null&&fe.push(a),_t(a))}}function dt(r){if(typeof r!="object"||r===null||Dt in r)return r;const e=Is(r);if(e!==Ns&&e!==Rs)return r;var t=new Map,n=An(r),s=U(0),a=Pe,i=o=>{if(Pe===a)return o();var l=S,u=Pe;de(null),ln(a);var d=o();return de(l),ln(u),d};return n&&t.set("length",U(r.length)),new Proxy(r,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&qs();var d=t.get(l);return d===void 0?d=i(()=>{var p=U(u.value);return t.set(l,p),p}):F(d,u.value,!0),!0},deleteProperty(o,l){var u=t.get(l);if(u===void 0){if(l in o){const d=i(()=>U(j));t.set(l,d),ar(s)}}else F(u,j),ar(s);return!0},get(o,l,u){var m;if(l===Dt)return r;var d=t.get(l),p=l in o;if(d===void 0&&(!p||(m=ft(o,l))!=null&&m.writable)&&(d=i(()=>{var y=dt(p?o[l]:j),P=U(y);return P}),t.set(l,d)),d!==void 0){var g=R(d);return g===j?void 0:g}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var d=t.get(l);d&&(u.value=R(d))}else if(u===void 0){var p=t.get(l),g=p==null?void 0:p.v;if(p!==void 0&&g!==j)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return u},has(o,l){var g;if(l===Dt)return!0;var u=t.get(l),d=u!==void 0&&u.v!==j||Reflect.has(o,l);if(u!==void 0||M!==null&&(!d||(g=ft(o,l))!=null&&g.writable)){u===void 0&&(u=i(()=>{var m=d?dt(o[l]):j,y=U(m);return y}),t.set(l,u));var p=R(u);if(p===j)return!1}return d},set(o,l,u,d){var q;var p=t.get(l),g=l in o;if(n&&l==="length")for(var m=u;m<p.v;m+=1){var y=t.get(m+"");y!==void 0?F(y,j):m in o&&(y=i(()=>U(j)),t.set(m+"",y))}if(p===void 0)(!g||(q=ft(o,l))!=null&&q.writable)&&(p=i(()=>U(void 0)),F(p,dt(u)),t.set(l,p));else{g=p.v!==j;var P=i(()=>dt(u));F(p,P)}var z=Reflect.getOwnPropertyDescriptor(o,l);if(z!=null&&z.set&&z.set.call(d,u),!g){if(n&&typeof l=="string"){var te=t.get("length"),A=Number(l);Number.isInteger(A)&&A>=te.v&&F(te,A+1)}ar(s)}return!0},ownKeys(o){R(s);var l=Reflect.ownKeys(o).filter(p=>{var g=t.get(p);return g===void 0||g.v!==j});for(var[u,d]of t)d.v!==j&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Ws()}})}var sn,Un,Bn,$n;function la(){if(sn===void 0){sn=window,Un=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;Bn=ft(e,"firstChild").get,$n=ft(e,"nextSibling").get,en(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),en(t)&&(t.__t=void 0)}}function ua(r=""){return document.createTextNode(r)}function qn(r){return Bn.call(r)}function Wn(r){return $n.call(r)}function hr(r,e){return qn(r)}function da(r,e=1,t=!1){let n=r;for(;e--;)n=Wn(n);return n}function Hn(r){var e=S,t=M;de(null),Ee(null);try{return r()}finally{de(e),Ee(t)}}function ca(r){M===null&&S===null&&Bs(),S!==null&&(S.f&K)!==0&&M===null&&Us(),ot&&Vs()}function fa(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function je(r,e,t,n=!0){var s=M;s!==null&&(s.f&et)!==0&&(r|=et);var a={ctx:ae,deps:null,nodes_start:null,nodes_end:null,f:r|se,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{Ye(a),a.f|=Pr}catch(l){throw De(a),l}else e!==null&&_t(a);if(n){var i=a;if(t&&i.deps===null&&i.teardown===null&&i.nodes_start===null&&i.first===i.last&&(i.f&Ot)===0&&(i=i.first),i!==null&&(i.parent=s,s!==null&&fa(i,s),S!==null&&(S.f&X)!==0&&(r&Ze)===0)){var o=S;(o.effects??(o.effects=[])).push(i)}}return a}function ie(r){ca();var e=M.f,t=!S&&(e&Te)!==0&&(e&Pr)===0;if(t){var n=ae;(n.e??(n.e=[])).push(r)}else return Yn(r)}function Yn(r){return je(Ir|js,r,!1)}function ha(r){vt.ensure();const e=je(Ze|Ot,r,!0);return(t={})=>new Promise(n=>{t.outro?ya(e,()=>{De(e),n(void 0)}):(De(e),n(void 0))})}function pa(r){return je(Ir,r,!1)}function ma(r){return je(Lr|Ot,r,!0)}function Xn(r,e=0){return je(On|e,r,!0)}function Gn(r,e=[],t=[]){sa(e,t,n=>{je(On,()=>r(...n.map(R)),!0)})}function va(r,e=!0){return je(Te|Ot,r,!0,e)}function Jn(r){var e=r.teardown;if(e!==null){const t=ot,n=S;on(!0),de(null);try{e.call(null)}finally{on(t),de(n)}}}function Kn(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const s=t.ac;s!==null&&Hn(()=>{s.abort(Dr)});var n=t.next;(t.f&Ze)!==0?t.parent=null:De(t,e),t=n}}function _a(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&Te)===0&&De(e),e=t}}function De(r,e=!0){var t=!1;(e||(r.f&Zs)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(ga(r.nodes_start,r.nodes_end),t=!0),Kn(r,e&&!t),$t(r,0),Q(r,it);var n=r.transitions;if(n!==null)for(const a of n)a.stop();Jn(r);var s=r.parent;s!==null&&s.first!==null&&Qn(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function ga(r,e){for(;r!==null;){var t=r===e?null:Wn(r);r.remove(),r=t}}function Qn(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function ya(r,e){var t=[];es(r,t,!0),wa(t,()=>{De(r),e&&e()})}function wa(r,e){var t=r.length;if(t>0){var n=()=>--t||e();for(var s of r)s.out(n)}else e()}function es(r,e,t){if((r.f&et)===0){if(r.f^=et,r.transitions!==null)for(const i of r.transitions)(i.is_global||t)&&e.push(i);for(var n=r.first;n!==null;){var s=n.next,a=(n.f&Ds)!==0||(n.f&Te)!==0;es(n,e,a?t:!1),n=s}}}let He=!1;function an(r){He=r}let ot=!1;function on(r){ot=r}let S=null,oe=!1;function de(r){S=r}let M=null;function Ee(r){M=r}let $=null;function xa(r){S!==null&&($===null?$=[r]:$.push(r))}let B=null,Y=0,J=null;function ka(r){J=r}let ts=1,gt=0,Pe=gt;function ln(r){Pe=r}let we=!1;function rs(){return++ts}function Qt(r){var p;var e=r.f;if((e&se)!==0)return!0;if((e&Me)!==0){var t=r.deps,n=(e&K)!==0;if(t!==null){var s,a,i=(e&zt)!==0,o=n&&M!==null&&!we,l=t.length;if((i||o)&&(M===null||(M.f&it)===0)){var u=r,d=u.parent;for(s=0;s<l;s++)a=t[s],(i||!((p=a==null?void 0:a.reactions)!=null&&p.includes(u)))&&(a.reactions??(a.reactions=[])).push(u);i&&(u.f^=zt),o&&d!==null&&(d.f&K)===0&&(u.f^=K)}for(s=0;s<l;s++)if(a=t[s],Qt(a)&&Dn(a),a.wv>r.wv)return!0}(!n||M!==null&&!we)&&Q(r,W)}return!1}function ns(r,e,t=!0){var n=r.reactions;if(n!==null&&!($!=null&&$.includes(r)))for(var s=0;s<n.length;s++){var a=n[s];(a.f&X)!==0?ns(a,e,!1):e===a&&(t?Q(a,se):(a.f&W)!==0&&Q(a,Me),_t(a))}}function ss(r){var P;var e=B,t=Y,n=J,s=S,a=we,i=$,o=ae,l=oe,u=Pe,d=r.f;B=null,Y=0,J=null,we=(d&K)!==0&&(oe||!He||S===null),S=(d&(Te|Ze))===0?r:null,$=null,Vt(r.ctx),oe=!1,Pe=++gt,r.ac!==null&&(Hn(()=>{r.ac.abort(Dr)}),r.ac=null);try{r.f|=ur;var p=r.fn,g=p(),m=r.deps;if(B!==null){var y;if($t(r,Y),m!==null&&Y>0)for(m.length=Y+B.length,y=0;y<B.length;y++)m[Y+y]=B[y];else r.deps=m=B;if(!we||(d&X)!==0&&r.reactions!==null)for(y=Y;y<m.length;y++)((P=m[y]).reactions??(P.reactions=[])).push(r)}else m!==null&&Y<m.length&&($t(r,Y),m.length=Y);if(In()&&J!==null&&!oe&&m!==null&&(r.f&(X|Me|se))===0)for(y=0;y<J.length;y++)ns(J[y],r);return s!==null&&s!==r&&(gt++,J!==null&&(n===null?n=J:n.push(...J))),(r.f&Ie)!==0&&(r.f^=Ie),g}catch(z){return Js(z)}finally{r.f^=ur,B=e,Y=t,J=n,S=s,we=a,$=i,Vt(o),oe=l,Pe=u}}function ba(r,e){let t=e.reactions;if(t!==null){var n=As.call(t,r);if(n!==-1){var s=t.length-1;s===0?t=e.reactions=null:(t[n]=t[s],t.pop())}}t===null&&(e.f&X)!==0&&(B===null||!B.includes(e))&&(Q(e,Me),(e.f&(K|zt))===0&&(e.f^=zt),Ln(e),$t(e,0))}function $t(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)ba(r,t[n])}function Ye(r){var e=r.f;if((e&it)===0){Q(r,W);var t=M,n=He;M=r,He=!0;try{(e&At)!==0?_a(r):Kn(r),Jn(r);var s=ss(r);r.teardown=typeof s=="function"?s:null,r.wv=ts;var a;Mn&&Xs&&(r.f&se)!==0&&r.deps}finally{He=n,M=t}}}function R(r){var e=r.f,t=(e&X)!==0;if(S!==null&&!oe){var n=M!==null&&(M.f&it)!==0;if(!n&&!($!=null&&$.includes(r))){var s=S.deps;if((S.f&ur)!==0)r.rv<gt&&(r.rv=gt,B===null&&s!==null&&s[Y]===r?Y++:B===null?B=[r]:(!we||!B.includes(r))&&B.push(r));else{(S.deps??(S.deps=[])).push(r);var a=r.reactions;a===null?r.reactions=[S]:a.includes(S)||a.push(S)}}}else if(t&&r.deps===null&&r.effects===null){var i=r,o=i.parent;o!==null&&(o.f&K)===0&&(i.f^=K)}if(ot){if(ke.has(r))return ke.get(r);if(t){i=r;var l=i.v;return((i.f&W)===0&&i.reactions!==null||as(i))&&(l=zr(i)),ke.set(i,l),l}}else t&&(i=r,Qt(i)&&Dn(i));if((r.f&Ie)!==0)throw r.v;return r.v}function as(r){if(r.v===j)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(ke.has(e)||(e.f&X)!==0&&as(e))return!0;return!1}function Ea(r){var e=oe;try{return oe=!0,r()}finally{oe=e}}const Sa=-7169;function Q(r,e){r.f=r.f&Sa|e}const Ca=["touchstart","touchmove"];function Ta(r){return Ca.includes(r)}const Ma=new Set,un=new Set;let dn=null;function Lt(r){var A;var e=this,t=e.ownerDocument,n=r.type,s=((A=r.composedPath)==null?void 0:A.call(r))||[],a=s[0]||r.target;dn=r;var i=0,o=dn===r&&r.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var u=s.indexOf(e);if(u===-1)return;l<=u&&(i=l)}if(a=s[i]||r.target,a!==e){lr(r,"currentTarget",{configurable:!0,get(){return a||t}});var d=S,p=M;de(null),Ee(null);try{for(var g,m=[];a!==null;){var y=a.assignedSlot||a.parentNode||a.host||null;try{var P=a["__"+n];if(P!=null&&(!a.disabled||r.target===a))if(An(P)){var[z,...te]=P;z.apply(a,[r,...te])}else P.call(a,r)}catch(q){g?m.push(q):g=q}if(r.cancelBubble||y===e||y===null)break;a=y}if(g){for(let q of m)queueMicrotask(()=>{throw q});throw g}}finally{r.__root=e,delete r.currentTarget,de(d),Ee(p)}}}function Aa(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function Oa(r,e){var t=M;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function is(r,e){var t=(e&Ys)!==0,n,s=!r.startsWith("<!>");return()=>{n===void 0&&(n=Aa(s?r:"<!>"+r),n=qn(n));var a=t||Un?document.importNode(n,!0):n.cloneNode(!0);return Oa(a,a),a}}function os(r,e){r!==null&&r.before(e)}function Ur(r,e){return Na(r,e)}const Ve=new Map;function Na(r,{target:e,anchor:t,props:n={},events:s,context:a,intro:i=!0}){la();var o=new Set,l=p=>{for(var g=0;g<p.length;g++){var m=p[g];if(!o.has(m)){o.add(m);var y=Ta(m);e.addEventListener(m,Lt,{passive:y});var P=Ve.get(m);P===void 0?(document.addEventListener(m,Lt,{passive:y}),Ve.set(m,1)):Ve.set(m,P+1)}}};l(Os(Ma)),un.add(l);var u=void 0,d=ha(()=>{var p=t??e.appendChild(ua());return va(()=>{if(a){Zr({});var g=ae;g.c=a}s&&(n.$$events=s),u=r(p,n)||{},a&&jr()}),()=>{var y;for(var g of o){e.removeEventListener(g,Lt);var m=Ve.get(g);--m===0?(document.removeEventListener(g,Lt),Ve.delete(g)):Ve.set(g,m)}un.delete(l),p!==t&&((y=p.parentNode)==null||y.removeChild(p))}});return Ra.set(u,d),u}let Ra=new WeakMap;function ls(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(e=0;e<s;e++)r[e]&&(t=ls(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function Ia(){for(var r,e,t=0,n="",s=arguments.length;t<s;t++)(r=arguments[t])&&(e=ls(r))&&(n&&(n+=" "),n+=e);return n}function us(r){return typeof r=="object"?Ia(r):r??""}function Pa(r,e,t){var n=r==null?"":""+r;return e&&(n=n?n+" "+e:e),n===""?null:n}function La(r,e){return r==null?null:String(r)}function ds(r,e,t,n,s,a){var i=r.__className;if(i!==t||i===void 0){var o=Pa(t,n);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}return a}function qt(r,e,t,n){var s=r.__style;if(s!==e){var a=La(e);a==null?r.removeAttribute("style"):r.style.cssText=a,r.__style=e}return n}const Da=()=>performance.now(),le={tick:r=>requestAnimationFrame(r),now:()=>Da(),tasks:new Set};function cs(){const r=le.now();le.tasks.forEach(e=>{e.c(r)||(le.tasks.delete(e),e.f())}),le.tasks.size!==0&&le.tick(cs)}function Za(r){let e;return le.tasks.size===0&&le.tick(cs),{promise:new Promise(t=>{le.tasks.add(e={c:r,f:t})}),abort(){le.tasks.delete(e)}}}function cn(r,e){return r===e||(r==null?void 0:r[Dt])===e}function Be(r={},e,t,n){return pa(()=>{var s,a;return Xn(()=>{s=a,a=[],Ea(()=>{r!==t(...a)&&(e(r,...a),s&&cn(t(...s),r)&&e(null,...s))})}),()=>{Qs(()=>{a&&cn(t(...a),r)&&e(null,...a)})}}),r}const ja="5";var Tn;typeof window<"u"&&((Tn=window.__svelte??(window.__svelte={})).v??(Tn.v=new Set)).add(ja);function Fa(r){return r}function pr(r){return-.5*(Math.cos(Math.PI*r)-1)}function za(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Va(r){return Math.sin(r*Math.PI/2)}const Ua=128,Ba=0,$a=1,qa=2;class Wa{constructor(){f(this,"animationsStarted",!1);f(this,"animationsCount",0);f(this,"animationsLimit",Ua);f(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const t=this.layers[e];if(t==null)continue;const n=t.animations;if(n!=null)for(let s=0;s<n.length;s++){const a=n[s];if(a!=null){for(const i of a.values())if(!i.executed&&(i.executed=!0,i.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,n,s){let a=this.layers[e];a==null&&(a=this.layers[e]={animations:new Array});let i=a.animations[t];i==null&&(i=a.animations[t]=new Map);let o={id:n,priority:t,executed:!1,function:s};i.set(n,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let n=0;n<this.layers.length;n++){let s=this.layers[n];if(s==null)continue;let a=s.animations[e];if(a==null)return;let i=a.get(t);if(i==null||i.executed==!1)return;a.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const _e=new Wa;function fn(r){return Object.prototype.toString.call(r)==="[object Date]"}function mr(r,e){if(r===e||r!==r)return()=>r;const t=typeof r;if(t!==typeof e||Array.isArray(r)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(r)){const n=e.map((s,a)=>mr(r[a],s));return s=>n.map(a=>a(s))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(fn(r)&&fn(e)){const a=r.getTime(),o=e.getTime()-a;return l=>new Date(a+l*o)}const n=Object.keys(e),s={};return n.forEach(a=>{s[a]=mr(r[a],e[a])}),a=>{const i={};return n.forEach(o=>{i[o]=s[o](a)}),i}}if(t==="number"){const n=e-r;return s=>r+s*n}return()=>e}var he,Qe,Mt,Re;const Hr=class Hr{constructor(e,t={}){D(this,he);D(this,Qe);D(this,Mt);D(this,Re,null);Z(this,he,U(e)),Z(this,Qe,U(e)),Z(this,Mt,t)}static of(e,t){const n=new Hr(e(),t);return Xn(()=>{n.set(e())}),n}set(e,t){var p;F(k(this,Qe),e);let{delay:n=0,duration:s=400,easing:a=Fa,interpolate:i=mr}={...k(this,Mt),...t};if(s===0)return(p=k(this,Re))==null||p.abort(),F(k(this,he),e),Promise.resolve();const o=le.now()+n;let l,u=!1,d=k(this,Re);return Z(this,Re,Za(g=>{if(g<o)return!0;if(!u){u=!0;const y=k(this,he).v;l=i(y,e),typeof s=="function"&&(s=s(y,e)),d==null||d.abort()}const m=g-o;return m>s?(F(k(this,he),e),!1):(F(k(this,he),l(a(m/s))),!0)})),k(this,Re).promise}get current(){return R(k(this,he))}get target(){return R(k(this,Qe))}set target(e){this.set(e)}};he=new WeakMap,Qe=new WeakMap,Mt=new WeakMap,Re=new WeakMap;let vr=Hr;class jt{constructor(e,t){f(this,"value");f(this,"motion");this.value=e,this.motion=new vr(e,t)}set(e,t){this.value=e,this.motion.set(e,t)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Ha=is('<div><div class="body svelte-1nfn9j8"></div></div>');function Ya(r,e){Zr(e,!0);let t,n;function s(){return n}let a=U(!1);function i(N){F(a,N,!0)}function o(){return R(a)}let l=U(!0),u=0,d=150;function p(N){N!=R(l)&&(F(l,N,!0),u=performance.now())}function g(){return performance.now()-u<d?y.motion.current==0:y.value==0}let m=0,y=new jt(0,{easing:pr});ie(()=>{R(a)==!1&&(y.snap(),_e.clear(e.priority,e.id))}),ie(()=>{y.set(R(l)?0:m,{duration:75})}),ie(()=>{P(y.motion.current)});function P(N){t&&_e.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=N.toString(),t.style.filter=`brightness(${.25+.75*N})`,n.style.opacity=N.toString()})}function z(N){N!=m&&(m=N,y.set(N,{duration:75}))}function te(){return y.value}var A=Ha(),q=hr(A);return Be(q,N=>n=N,()=>n),Be(A,N=>t=N,()=>t),Gn(()=>{ds(A,1,us(["pin",R(a)&&"displayed"]),"svelte-1nfn9j8"),qt(A,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`),qt(q,`width: ${e.width-4}px; height: ${e.height-4}px; border-radius: ${e.radius-2}px`)}),os(r,A),jr({getBody:s,setDisplayed:i,getDisplayed:o,setCollapsed:p,getCollapsed:g,setScale:z,getScale:te})}var ht;(r=>{function e(t,n,s){const a=t/2,i=n/2,o=Math.sqrt(a*a+i*i),l=Math.atan(i/a)*(180/Math.PI),u=s*(Math.PI/180);return s<180?s<90?s<l?{x:0,y:o*Math.sin(u)-i}:{x:o*Math.cos(u)-a,y:0}:s<180-l?{x:o*Math.cos(u)-a,y:0}:{x:-t,y:o*Math.sin(u)-i}:s<270?s<180+l?{x:-t,y:o*Math.sin(u)-i}:{x:o*Math.cos(u)-a,y:-n}:s<360-l?{x:o*Math.cos(u)-a,y:-n}:{x:0,y:o*Math.sin(u)-i}}r.getOffsets=e})(ht||(ht={}));var Xa=is('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function fs(r,e){Zr(e,!0);let t,n,s,a;const i=e.width+2*e.margin,o=e.height+2*e.margin,l=()=>a;ie(()=>{s.style.width=`${e.margin*4}px`,s.style.height=`${e.margin*4}px`});let u=U(!0);function d(O){F(u,O,!0)}function p(){return R(u)}let g=U(!0),m=0,y=300;function P(O){O!=R(g)&&(F(g,O,!0),m=performance.now())}function z(){return performance.now()-m<y?A.motion.current==0:A.value==0}function te(){return performance.now()-m<y?A.motion.current==1:A.value==1}let A=new jt(0);ie(()=>{R(u)==!1&&(A.snap(),_e.clear(e.priority,e.id+"_scale"))}),ie(()=>{R(g)==!0&&A.value!=0&&(_e.stacked()?A.set(0,{duration:0}):A.set(0,{duration:150,easing:za})),R(g)==!1&&A.value!=1&&A.set(1,{duration:150,easing:Va})}),ie(()=>{q(A.motion.current)});function q(O){!t||!n||!s||_e.equeue(R(g)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${O}`,n.style.scale=`${O}`,s.style.scale=`${O}`})}let N=NaN,er=U(!1),me=new jt(-i/2,{easing:pr}),Nt=new jt(-o/2,{easing:pr});ie(()=>{R(u)==!1&&(me.snap(),me.snap(),_e.clear(e.priority,e.id+"_angle"))}),ie(()=>{R(g)==!0&&R(er)&&(me.update({duration:75}),me.update({duration:75}))}),ie(()=>{Yr(me.motion.current,Nt.motion.current)});function Yr(O,It){if(!t||!n||!s)return;const ce=O+i/2,Pt=It+o/2,Fe=o<i?ce*o/i:ce,ze=o>i?Pt*i/o:Pt,ks=Math.atan2(ze,Fe)/Math.PI*180-45,Jr=0,bs=30,rr=Math.sqrt(Fe*Fe+ze*ze),ut=Math.min(i,o)/2,Es=ut*Math.SQRT2,Ss=(rr-ut)/(Es-ut),Kr=Jr+Ss*(bs-Jr),Cs=rr<ut?rr/ut:1;_e.equeue(e.layer,e.priority,e.id+"_angle",()=>{n.style.transform=`translate(${Math.round(O)}px, ${Math.round(It)}px)`,s.style.transform=`scale(${Cs}) rotate(${ks}deg) skew(${Kr}deg, ${Kr}deg)`})}function ws(O,It){if(R(er)==!1||It==!0){let ce=ht.getOffsets(i,o,O);me.set(Math.round(ce.x),{duration:0}),Nt.set(Math.round(ce.y),{duration:0}),Yr(me.value,Nt.value),N=O,F(er,!0)}else if(O!=N){let ce=Math.abs(O-N),Pt=ce<180?ce:360-ce,Fe=Math.log(Pt)*75,ze=ht.getOffsets(i,o,O);me.set(Math.round(ze.x),{duration:Fe}),Nt.set(Math.round(ze.y),{duration:Fe}),N=O}}function xs(){return ht.getOffsets(i,o,N)}var Rt=Xa(),Xr=hr(Rt);Be(Xr,O=>s=O,()=>s);var tr=da(Xr,2),Gr=hr(tr);return Be(Gr,O=>a=O,()=>a),Be(tr,O=>n=O,()=>n),Be(Rt,O=>t=O,()=>t),Gn(()=>{ds(Rt,1,us(["anchor",R(u)&&"displayed"]),"svelte-j5igi2"),qt(tr,`margin: ${e.margin}px;`),qt(Gr,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)}),os(r,Rt),jr({getBody:l,setDisplayed:d,getDisplayed:p,setCollapsed:P,getCollapsed:z,getExpanded:te,setAngle:ws,getOffsets:xs})}var $e;(r=>{function e(o,l,u){return{x:n(l)*u,y:s(o)*u}}r.project=e;function t(o,l,u){return{lat:i(l/u),lng:a(o/u)}}r.unproject=t;function n(o){return(180+o)/360}function s(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function a(o){return o*360-180}function i(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})($e||($e={}));class hs{constructor(e,t,n,s,a){f(this,"swLat");f(this,"swLng");f(this,"neLat");f(this,"neLng");const i=n*Math.pow(2,t),o=$e.project(e.sw.lat,e.sw.lng,i),l=$e.project(e.ne.lat,e.ne.lng,i),u=o.x-s,d=o.y+a,p=l.x+s,g=l.y-a,m=$e.unproject(u,d,i),y=$e.unproject(p,g,i);this.swLat=m.lat,this.swLng=m.lng,this.neLat=y.lat,this.neLng=y.lng}contains(e,t){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1}}var T;(function(r){r.assertEqual=s=>{};function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},r.find=(s,a)=>{for(const i of s)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(T||(T={}));var hn;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(hn||(hn={}));const v=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ve=r=>{switch(typeof r){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(r)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(r)?v.array:r===null?v.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?v.promise:typeof Map<"u"&&r instanceof Map?v.map:typeof Set<"u"&&r instanceof Set?v.set:typeof Date<"u"&&r instanceof Date?v.date:v.object;default:return v.unknown}},c=T.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ee extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return s(this),n}static assert(e){if(!(e instanceof ee))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];t[a]=t[a]||[],t[a].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ee.create=r=>new ee(r);const yt=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===v.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,T.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${T.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${T.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${T.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:T.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,T.assertNever(r)}return{message:t}};let Ga=yt;function _r(){return Ga}const gr=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function h(r,e){const t=_r(),n=gr({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===yt?void 0:yt].filter(s=>!!s)});r.common.issues.push(n)}class G{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return w;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return G.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return w;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const w=Object.freeze({status:"aborted"}),ct=r=>({status:"dirty",value:r}),H=r=>({status:"valid",value:r}),pn=r=>r.status==="aborted",mn=r=>r.status==="dirty",tt=r=>r.status==="valid",Wt=r=>typeof Promise<"u"&&r instanceof Promise;var _;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(_||(_={}));class Se{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vn=(r,e)=>{if(tt(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ee(r.common.issues);return this._error=t,this._error}}};function E(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:l}=r;return i.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:s}}class C{get description(){return this._def.description}_getType(e){return ve(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new G,ctx:{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Wt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},s=this._parseSync({data:e,path:n.path,parent:n});return vn(n,s)}"~validate"(e){var n,s;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return tt(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(s=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>tt(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Wt(s)?s:Promise.resolve(s));return vn(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new st({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return be.create(this,this._def)}nullable(){return at.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ue.create(this)}promise(){return kt.create(this,this._def)}or(e){return Yt.create([this,e],this._def)}and(e){return Xt.create(this,e,this._def)}transform(e){return new st({...E(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new br({...E(this._def),innerType:this,defaultValue:t,typeName:x.ZodDefault})}brand(){return new yi({typeName:x.ZodBranded,type:this,...E(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Er({...E(this._def),innerType:this,catchValue:t,typeName:x.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Br.create(this,e)}readonly(){return Sr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ja=/^c[^\s-]{8,}$/i,Ka=/^[0-9a-z]+$/,Qa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ei=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ti=/^[a-z0-9_-]{21}$/i,ri=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ni=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,si=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ai="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ir;const ii=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,li=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ui=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,di=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ci=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ps="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fi=new RegExp(`^${ps}$`);function ms(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function hi(r){return new RegExp(`^${ms(r)}$`)}function pi(r){let e=`${ps}T${ms(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function mi(r,e){return!!((e==="v4"||!e)&&ii.test(r)||(e==="v6"||!e)&&li.test(r))}function vi(r,e){if(!ri.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function _i(r,e){return!!((e==="v4"||!e)&&oi.test(r)||(e==="v6"||!e)&&ui.test(r))}class xe extends C{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:v.string,received:a.parsedType}),w}const n=new G;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?h(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&h(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")si.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")ir||(ir=new RegExp(ai,"u")),ir.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")ei.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")ti.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ja.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Ka.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Qa.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),h(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?pi(a).test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?fi.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?hi(a).test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?ni.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?mi(e.data,a.version)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?vi(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"jwt",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?_i(e.data,a.version)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cidr",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?di.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?ci.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"base64url",code:c.invalid_string,message:a.message}),n.dirty()):T.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,..._.errToObj(n)})}_addCheck(e){return new xe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,..._.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,..._.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",..._.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,..._.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,..._.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,..._.errToObj(t)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new xe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}xe.create=r=>new xe({checks:[],typeName:x.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...E(r)});function gi(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=Number.parseInt(r.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class rt extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==v.number){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:v.number,received:a.parsedType}),w}let n;const s=new G;for(const a of this._def.checks)a.kind==="int"?T.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?gi(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.not_finite,message:a.message}),s.dirty()):T.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,n,s){return new rt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:_.toString(s)}]})}_addCheck(e){return new rt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&T.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}rt.create=r=>new rt({checks:[],typeName:x.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...E(r)});class wt extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==v.bigint)return this._getInvalidInput(e);let n;const s=new G;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):T.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return h(t,{code:c.invalid_type,expected:v.bigint,received:t.parsedType}),w}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,n,s){return new wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:_.toString(s)}]})}_addCheck(e){return new wt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}wt.create=r=>new wt({checks:[],typeName:x.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...E(r)});class yr extends C{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.boolean,received:n.parsedType}),w}return H(e.data)}}yr.create=r=>new yr({typeName:x.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...E(r)});class Ht extends C{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:v.date,received:a.parsedType}),w}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_date}),w}const n=new G;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):T.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ht({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Ht.create=r=>new Ht({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:x.ZodDate,...E(r)});class _n extends C{_parse(e){if(this._getType(e)!==v.symbol){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.symbol,received:n.parsedType}),w}return H(e.data)}}_n.create=r=>new _n({typeName:x.ZodSymbol,...E(r)});class gn extends C{_parse(e){if(this._getType(e)!==v.undefined){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.undefined,received:n.parsedType}),w}return H(e.data)}}gn.create=r=>new gn({typeName:x.ZodUndefined,...E(r)});class yn extends C{_parse(e){if(this._getType(e)!==v.null){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.null,received:n.parsedType}),w}return H(e.data)}}yn.create=r=>new yn({typeName:x.ZodNull,...E(r)});class wr extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return H(e.data)}}wr.create=r=>new wr({typeName:x.ZodAny,...E(r)});class Xe extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return H(e.data)}}Xe.create=r=>new Xe({typeName:x.ZodUnknown,...E(r)});class Ce extends C{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:c.invalid_type,expected:v.never,received:t.parsedType}),w}}Ce.create=r=>new Ce({typeName:x.ZodNever,...E(r)});class xr extends C{_parse(e){if(this._getType(e)!==v.undefined){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.void,received:n.parsedType}),w}return H(e.data)}}xr.create=r=>new xr({typeName:x.ZodVoid,...E(r)});class ue extends C{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==v.array)return h(t,{code:c.invalid_type,expected:v.array,received:t.parsedType}),w;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(h(t,{code:i?c.too_big:c.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(h(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(h(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new Se(t,i,t.path,o)))).then(i=>G.mergeArray(n,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new Se(t,i,t.path,o)));return G.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new ue({...this._def,minLength:{value:e,message:_.toString(t)}})}max(e,t){return new ue({...this._def,maxLength:{value:e,message:_.toString(t)}})}length(e,t){return new ue({...this._def,exactLength:{value:e,message:_.toString(t)}})}nonempty(e){return this.min(1,e)}}ue.create=(r,e)=>new ue({type:r,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...E(e)});function Ue(r){if(r instanceof L){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=be.create(Ue(n))}return new L({...r._def,shape:()=>e})}else return r instanceof ue?new ue({...r._def,type:Ue(r.element)}):r instanceof be?be.create(Ue(r.unwrap())):r instanceof at?at.create(Ue(r.unwrap())):r instanceof pe?pe.create(r.items.map(e=>Ue(e))):r}class L extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=T.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==v.object){const u=this._getOrReturnCtx(e);return h(u,{code:c.invalid_type,expected:v.object,received:u.parsedType}),w}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ce&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const l=[];for(const u of i){const d=a[u],p=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Se(s,p,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ce){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")o.length>0&&(h(s,{code:c.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const p=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Se(s,p,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const p=await d.key,g=await d.value;u.push({key:p,value:g,alwaysSet:d.alwaysSet})}return u}).then(u=>G.mergeObjectSync(n,u)):G.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return _.errToObj,new L({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var a,i;const s=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:_.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new L({...this._def,unknownKeys:"strip"})}passthrough(){return new L({...this._def,unknownKeys:"passthrough"})}extend(e){return new L({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new L({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new L({...this._def,catchall:e})}pick(e){const t={};for(const n of T.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new L({...this._def,shape:()=>t})}omit(e){const t={};for(const n of T.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new L({...this._def,shape:()=>t})}deepPartial(){return Ue(this)}partial(e){const t={};for(const n of T.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new L({...this._def,shape:()=>t})}required(e){const t={};for(const n of T.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof be;)a=a._def.innerType;t[n]=a}return new L({...this._def,shape:()=>t})}keyof(){return vs(T.objectKeys(this.shape))}}L.create=(r,e)=>new L({shape:()=>r,unknownKeys:"strip",catchall:Ce.create(),typeName:x.ZodObject,...E(e)});L.strictCreate=(r,e)=>new L({shape:()=>r,unknownKeys:"strict",catchall:Ce.create(),typeName:x.ZodObject,...E(e)});L.lazycreate=(r,e)=>new L({shape:r,unknownKeys:"strip",catchall:Ce.create(),typeName:x.ZodObject,...E(e)});class Yt extends C{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new ee(o.ctx.common.issues));return h(t,{code:c.invalid_union,unionErrors:i}),w}if(t.common.async)return Promise.all(n.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const l of n){const u={...t,common:{...t.common,issues:[]},parent:null},d=l._parseSync({data:t.data,path:t.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(l=>new ee(l));return h(t,{code:c.invalid_union,unionErrors:o}),w}}get options(){return this._def.options}}Yt.create=(r,e)=>new Yt({options:r,typeName:x.ZodUnion,...E(e)});function kr(r,e){const t=ve(r),n=ve(e);if(r===e)return{valid:!0,data:r};if(t===v.object&&n===v.object){const s=T.objectKeys(e),a=T.objectKeys(r).filter(o=>s.indexOf(o)!==-1),i={...r,...e};for(const o of a){const l=kr(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===v.array&&n===v.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],l=kr(i,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return t===v.date&&n===v.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class Xt extends C{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(pn(a)||pn(i))return w;const o=kr(a.value,i.value);return o.valid?((mn(a)||mn(i))&&t.dirty(),{status:t.value,value:o.data}):(h(n,{code:c.invalid_intersection_types}),w)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Xt.create=(r,e,t)=>new Xt({left:r,right:e,typeName:x.ZodIntersection,...E(t)});class pe extends C{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.array)return h(n,{code:c.invalid_type,expected:v.array,received:n.parsedType}),w;if(n.data.length<this._def.items.length)return h(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w;!this._def.rest&&n.data.length>this._def.items.length&&(h(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new Se(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>G.mergeArray(t,i)):G.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new pe({...this._def,rest:e})}}pe.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pe({items:r,typeName:x.ZodTuple,rest:null,...E(e)})};class wn extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.map)return h(n,{code:c.invalid_type,expected:v.map,received:n.parsedType}),w;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,l],u)=>({key:s._parse(new Se(n,o,n.path,[u,"key"])),value:a._parse(new Se(n,l,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return w;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return w;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}}}}wn.create=(r,e,t)=>new wn({valueType:e,keyType:r,typeName:x.ZodMap,...E(t)});class xt extends C{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.set)return h(n,{code:c.invalid_type,expected:v.set,received:n.parsedType}),w;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(h(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(h(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(l){const u=new Set;for(const d of l){if(d.status==="aborted")return w;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const o=[...n.data.values()].map((l,u)=>a._parse(new Se(n,l,n.path,u)));return n.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new xt({...this._def,minSize:{value:e,message:_.toString(t)}})}max(e,t){return new xt({...this._def,maxSize:{value:e,message:_.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}xt.create=(r,e)=>new xt({valueType:r,minSize:null,maxSize:null,typeName:x.ZodSet,...E(e)});class pt extends C{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.function)return h(t,{code:c.invalid_type,expected:v.function,received:t.parsedType}),w;function n(o,l){return gr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_r(),yt].filter(u=>!!u),issueData:{code:c.invalid_arguments,argumentsError:l}})}function s(o,l){return gr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_r(),yt].filter(u=>!!u),issueData:{code:c.invalid_return_type,returnTypeError:l}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof kt){const o=this;return H(async function(...l){const u=new ee([]),d=await o._def.args.parseAsync(l,a).catch(m=>{throw u.addIssue(n(l,m)),u}),p=await Reflect.apply(i,this,d);return await o._def.returns._def.type.parseAsync(p,a).catch(m=>{throw u.addIssue(s(p,m)),u})})}else{const o=this;return H(function(...l){const u=o._def.args.safeParse(l,a);if(!u.success)throw new ee([n(l,u.error)]);const d=Reflect.apply(i,this,u.data),p=o._def.returns.safeParse(d,a);if(!p.success)throw new ee([s(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new pt({...this._def,args:pe.create(e).rest(Xe.create())})}returns(e){return new pt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new pt({args:e||pe.create([]).rest(Xe.create()),returns:t||Xe.create(),typeName:x.ZodFunction,...E(n)})}}class xn extends C{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}xn.create=(r,e)=>new xn({getter:r,typeName:x.ZodLazy,...E(e)});class kn extends C{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),w}return{status:"valid",value:e.data}}get value(){return this._def.value}}kn.create=(r,e)=>new kn({value:r,typeName:x.ZodLiteral,...E(e)});function vs(r,e){return new nt({values:r,typeName:x.ZodEnum,...E(e)})}class nt extends C{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{expected:T.joinValues(n),received:t.parsedType,code:c.invalid_type}),w}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{received:t.data,code:c.invalid_enum_value,options:n}),w}return H(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return nt.create(e,{...this._def,...t})}exclude(e,t=this._def){return nt.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}nt.create=vs;class bn extends C{_parse(e){const t=T.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==v.string&&n.parsedType!==v.number){const s=T.objectValues(t);return h(n,{expected:T.joinValues(s),received:n.parsedType,code:c.invalid_type}),w}if(this._cache||(this._cache=new Set(T.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=T.objectValues(t);return h(n,{received:n.data,code:c.invalid_enum_value,options:s}),w}return H(e.data)}get enum(){return this._def.values}}bn.create=(r,e)=>new bn({values:r,typeName:x.ZodNativeEnum,...E(e)});class kt extends C{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.promise&&t.common.async===!1)return h(t,{code:c.invalid_type,expected:v.promise,received:t.parsedType}),w;const n=t.parsedType===v.promise?t.data:Promise.resolve(t.data);return H(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}kt.create=(r,e)=>new kt({type:r,typeName:x.ZodPromise,...E(e)});class st extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{h(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return w;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?w:l.status==="dirty"||t.value==="dirty"?ct(l.value):l});{if(t.value==="aborted")return w;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?w:o.status==="dirty"||t.value==="dirty"?ct(o.value):o}}if(s.type==="refinement"){const i=o=>{const l=s.refinement(o,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?w:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?w:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!tt(i))return w;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>tt(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):w);T.assertNever(s)}}st.create=(r,e,t)=>new st({schema:r,typeName:x.ZodEffects,effect:e,...E(t)});st.createWithPreprocess=(r,e,t)=>new st({schema:e,effect:{type:"preprocess",transform:r},typeName:x.ZodEffects,...E(t)});class be extends C{_parse(e){return this._getType(e)===v.undefined?H(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}be.create=(r,e)=>new be({innerType:r,typeName:x.ZodOptional,...E(e)});class at extends C{_parse(e){return this._getType(e)===v.null?H(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}at.create=(r,e)=>new at({innerType:r,typeName:x.ZodNullable,...E(e)});class br extends C{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===v.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}br.create=(r,e)=>new br({innerType:r,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...E(e)});class Er extends C{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Wt(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ee(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ee(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Er.create=(r,e)=>new Er({innerType:r,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...E(e)});class En extends C{_parse(e){if(this._getType(e)!==v.nan){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.nan,received:n.parsedType}),w}return{status:"valid",value:e.data}}}En.create=r=>new En({typeName:x.ZodNaN,...E(r)});class yi extends C{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Br extends C{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?w:a.status==="dirty"?(t.dirty(),ct(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?w:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new Br({in:e,out:t,typeName:x.ZodPipeline})}}class Sr extends C{_parse(e){const t=this._def.innerType._parse(e),n=s=>(tt(s)&&(s.value=Object.freeze(s.value)),s);return Wt(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}Sr.create=(r,e)=>new Sr({innerType:r,typeName:x.ZodReadonly,...E(e)});var x;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(x||(x={}));const lt=xe.create,b=rt.create,_s=yr.create,$r=wr.create;Xe.create;Ce.create;const Ft=xr.create,qr=ue.create,I=L.create;Yt.create;Xt.create;const Sn=pe.create,re=pt.create,wi=nt.create,xi=kt.create;be.create;at.create;I({pin:I({fade:_s().optional(),maxCount:b().optional(),maxZoom:b().optional()}).optional(),animation:I({queue:I({limit:b().optional()}).optional()}).optional(),api:I({states:I({url:lt()}).optional()}).optional()});const Cr=b().min(-90).max(90),Tr=b().min(-180).max(180),ki=I({sw:I({lat:Cr,lng:Tr}),ne:I({lat:Cr,lng:Tr})}),Mr=$r().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),bi=I({mapSize:b().min(1),zoomMin:b().min(0),zoomMax:b().min(0),zoomScale:b().min(1).max(10)}),Ei=I({instance:$r(),inserted:re().returns(_s()),insert:re().returns(Ft()),remove:re().returns(Ft()),update:re().args(b()).returns(Ft())}),Si=I({getParameters:re().args().returns(bi),getContainer:re().args().returns(Mr),getZoom:re().args().returns(b()),getBounds:re().args().returns(ki),panBy:re().args(b(),b()).returns(Ft()),createMarker:re().args(Mr,Cr,Tr,b()).returns(Ei)}),or=re().args(lt()).returns(xi(Mr)),Ci=I({id:lt().min(1),rank:b(),lat:b().min(-90).max(90),lng:b().min(-180).max(180),tooltip:I({style:I({width:b(),height:b(),margin:b(),radius:b()}).refine(r=>Math.min(r.width,r.height)/r.margin>=5,"Tooltip width and height must be at least 5 times the margin"),body:or}),pin:I({style:I({width:b(),height:b(),radius:b()}),body:or}).optional(),popup:I({style:I({width:b(),height:b(),radius:b(),margin:b()}),body:or}).optional()}),Ti=qr(Ci);var Le;(r=>{r.COUNT=12,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],r.DEGREES_DEFAULT=270})(Le||(Le={}));Sn([b(),qr(Sn([b(),b()]))]);const gs=I({mapSize:b().min(1),zoomMin:b().min(0).max(24),zoomMax:b().min(0).max(24),zoomScale:b().min(1).max(10)}),Mi=I({id:lt(),rank:b(),lat:b(),lng:b(),width:b(),height:b(),margin:b()});I({key:lt(),parameters:gs,input:qr(Mi)});const Ai=wi(["info","warn","error"]);I({title:lt(),level:Ai,content:$r()});const Cn="1.0.209",ys="https://maps.api.arenarium.dev",Oi=`${ys}/log`,Ni=`${ys}/tooltip/states`;class Ri{constructor(e,t,n){f(this,"apiKey");f(this,"apiStatesUrl");f(this,"apiDevEnvironment");f(this,"mapProvider");f(this,"markerDataArray",new Array);f(this,"markerDataMap",new Map);f(this,"markerDataUpdating",!1);f(this,"markerPinProcessor");f(this,"markerTooltipProcessor");f(this,"markerPopupProcessor");Si.parse(t),this.apiKey=e,this.apiDevEnvironment=(window==null?void 0:window.location.host.startsWith("localhost"))||(window==null?void 0:window.location.host.startsWith("127.0.0.1")),this.mapProvider=t,this.markerPinProcessor=new Or(t),this.markerTooltipProcessor=new Pi(t),this.markerPopupProcessor=new Li(t),this.setConfiguration(n),this.log("info","Loaded")}setConfiguration(e){var t,n,s,a;_e.setLimit(((n=(t=e==null?void 0:e.animation)==null?void 0:t.queue)==null?void 0:n.limit)??8*navigator.hardwareConcurrency),this.apiStatesUrl=((a=(s=e==null?void 0:e.api)==null?void 0:s.states)==null?void 0:a.url)??void 0,this.markerPinProcessor.setConfiguration(e)}async updateMarkers(e){Ti.parse(e);try{await this.updateMarkerData(e),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t instanceof Error&&this.log("error","Failed to update markers",t),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const t of this.markerDataArray)t.marker.id==e?this.markerPopupProcessor.show(t):this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n);throw t instanceof Error&&this.log("error","Failed to show popup",t),t}}hidePopup(e){try{if(e){const t=this.markerDataMap.get(e);if(t==null)return;this.markerPopupProcessor.hide(t)}else for(const t of this.markerDataArray)this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n);throw t instanceof Error&&this.log("error","Failed to hide popup",t),t}}async updateMarkerData(e){try{let t=this.markerDataArray.map(s=>s.marker);for(let s=0;s<e.length;s++){const a=e[s];this.markerDataMap.get(a.id)||t.push(a)}let n;if(e.length>1){const s=this.mapProvider.getParameters();gs.parse(s);const a=t.map(u=>({id:u.id,rank:u.rank,lat:u.lat,lng:u.lng,width:u.tooltip.style.width,height:u.tooltip.style.height,margin:u.tooltip.style.margin})),i={key:this.apiKey,parameters:s,input:a},o=this.apiStatesUrl??Ni,l=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json","Cache-Control":this.apiDevEnvironment?"no-cache":""},body:JSON.stringify(i)});if(!l.ok||!l.body)throw new Error("Failed to get marker states: "+l.statusText);n=await l.json()}else n=[[0,[[0,Le.DEGREES.indexOf(Le.DEGREES_DEFAULT)]]]];try{this.markerDataUpdating=!0;for(let s=0;s<t.length;s++){const a=t[s],i=n[s],o=this.markerDataMap.get(a.id);if(o)o.update(i);else{const l=new Ii(this.mapProvider,a,i);l.create(),this.markerDataMap.set(a.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((s,a)=>s.zoom-a.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(s=>s.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(s=>s.tooltip)),this.markerPopupProcessor.updateElements(this.markerDataArray.map(s=>s.popup).filter(s=>s!=null))}finally{this.markerDataUpdating=!1}}catch(t){throw console.error(t),this.markerDataArray.forEach(n=>n.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),t instanceof Error&&this.log("error","Failed to update marker data",t),t}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.removeElements(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.mapProvider.getBounds(),t=this.mapProvider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t,n){if(!this.apiDevEnvironment)try{const s={title:`[CLIENT:${Cn}] ${t}`,level:e,content:{version:Cn,...n}};await fetch(Oi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch(s){console.error(s)}}}class Ii{constructor(e,t,n){f(this,"marker");f(this,"zoom");f(this,"pin");f(this,"tooltip");f(this,"popup");this.marker=t,this.zoom=n[0],this.pin=new Ar(e,t,n),this.tooltip=new Nr(e,t,n),t.popup&&(this.popup=new Rr(e,t))}create(){var e;this.pin.create(),this.tooltip.create(),(e=this.popup)==null||e.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){var e;this.pin.remove(),this.tooltip.remove(),(e=this.popup)==null||e.remove()}}class Wr{constructor(e,t){f(this,"provider");f(this,"id");f(this,"lat");f(this,"lng");f(this,"shown");f(this,"element");f(this,"component");f(this,"marker");this.provider=e,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateZIndex(){if(this.marker==null)throw new Error("Failed to update provider marker z-index");this.marker.update(this.getZindex())}updateMap(e){const t=this.marker,n=this.component;if(t==null||n==null)throw new Error("Failed to update provider marker map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var e;(e=this.marker)==null||e.remove()}}const qe=class qe extends Wr{constructor(t,n,s){var a,i,o,l;super(t,n);f(this,"width");f(this,"height");f(this,"radius");f(this,"zoom");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=((a=n.pin)==null?void 0:a.style.width)??qe.DEFAULT_SIZE,this.height=((i=n.pin)==null?void 0:i.style.height)??qe.DEFAULT_SIZE,this.radius=((o=n.pin)==null?void 0:o.style.radius)??qe.DEFAULT_SIZE,this.zoom=s[0],this.bodyCallback=(l=n.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=Ur(Ya,{target:this.element,props:{id:this.id+"_pin",layer:qa,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateBody(){var n;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?t.appendChild(s):console.error("Failed to load pin body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setCollapsed(t)}setScale(t){if(this.component==null)throw new Error("Failed to set pin scale");this.component.setScale(t)}getScaleFromZoomDistance(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};f(qe,"DEFAULT_SIZE",16);let Ar=qe;const We=class We{constructor(e){f(this,"provider");f(this,"pinElements",new Array);f(this,"pinMaxWidth",0);f(this,"pinMaxHeight",0);f(this,"pinFade",!1);f(this,"pinMaxCount",0);f(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,n,s;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((n=e==null?void 0:e.pin)==null?void 0:n.maxCount)??Math.max(We.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((s=e==null?void 0:e.pin)==null?void 0:s.maxZoom)??We.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,n)=>Math.max(t,n.width),0),this.pinMaxHeight=e.reduce((t,n)=>Math.max(t,n.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const n=this.provider.getParameters().mapSize,s=new hs(e,t,n,this.pinMaxWidth*2,this.pinMaxHeight*2);let a=0;for(const i of this.pinElements)s.contains(i.lat,i.lng)?i.shown&&t<i.zoom&&i.zoom<t+this.pinMaxZoomDelta?(a<this.pinMaxCount&&(i.setCollapsed(!1),i.setScale(this.pinFade?i.getScaleFromZoomDistance(t):1),i.updateMap(!0),i.isBodyLoaded()==!1&&i.updateBody()),a++):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}};f(We,"MAP_PINS_MAX_ZOOM",2),f(We,"MAP_PINS_MAX_COUNT",128);let Or=We;const Jt=class Jt extends Wr{constructor(t,n,s){super(t,n);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"zoom");f(this,"angle");f(this,"states");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=n.tooltip.style.width,this.height=n.tooltip.style.height,this.margin=n.tooltip.style.margin,this.radius=n.tooltip.style.radius,this.zoom=s[0],this.angle=Le.DEGREES_DEFAULT,this.states=s[1].map(a=>[a[0],Le.DEGREES[a[1]]]),this.bodyCallback=n.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=Ur(fs,{target:this.element,props:{id:this.id+"_tooltip",layer:$a,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(n=>[n[0],Le.DEGREES[n[1]]]),this.updateZIndex()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(t),this.component.setAngle(this.angle)}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?t.appendChild(s):console.error("Failed to load tooltip body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const n=this.states.findLast(s=>s[0]<=t);if(!n)throw new Error("Angle not found");return n[1]}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)+Jt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(t)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(Jt,"Z_INDEX_OFFSET",1e6);let Nr=Jt;class Pi{constructor(e){f(this,"provider");f(this,"tooltipElements",new Array);f(this,"tooltipMaxWidth",0);f(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,n)=>Math.max(t,n.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,n)=>Math.max(t,n.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const n=this.provider.getParameters().mapSize,s=new hs(e,t,n,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const a of this.tooltipElements)s.contains(a.lat,a.lng)?a.shown&&a.zoom<=t?(a.updateState(t),a.setCollapsed(!1),a.updateMap(!0),a.isCollapsed()==!1&&a.isBodyLoaded()==!1&&a.updateBody()):(a.setCollapsed(!0),a.isCollapsed()&&a.updateMap(!1)):a.updateMap(!1)}}const Kt=class Kt extends Wr{constructor(t,n){if(n.popup==null)throw new Error("Failed to create popup");super(t,n);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.shown=!1,this.width=n.popup.style.width,this.height=n.popup.style.height,this.margin=n.popup.style.margin,this.radius=n.popup.style.radius,this.bodyCallback=n.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=Ur(fs,{target:this.element,props:{id:this.id+"_popup",layer:Ba,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?t.appendChild(s):console.error("Failed to load popup body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Kt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(t)}setAngle(t){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(t,!0)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(Kt,"Z_INDEX_OFFSET",2e6);let Rr=Kt;class Li{constructor(e){f(this,"provider");f(this,"popupElements",new Array);f(this,"popupPositioned",new Map);this.provider=e}show(e){e.popup&&(e.pin.shown=!1,e.tooltip.shown=!1,this.popupPositioned.set(e.marker.id,!1),e.popup.setAngle(e.tooltip.angle),e.popup.shown=!0)}hide(e){e.popup&&(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}updateElements(e){this.popupElements=e,this.popupPositioned=new Map(e.map(t=>[t.id,!1]))}removeElements(){this.popupElements.forEach(e=>e.remove()),this.popupElements.length=0,this.popupPositioned.clear()}process(){var e,t;for(const n of this.popupElements)if(n.shown){if(n.setCollapsed(!1),n.updateMap(!0),n.isExpanded()&&n.isBodyLoaded()==!1&&n.updateBody(),n.isCollapsed()==!1&&this.popupPositioned.get(n.id)==!1){const s=(e=n.component)==null?void 0:e.getBody();if(s==null)continue;const a=(t=n.component)==null?void 0:t.getOffsets();if(a==null)continue;const i=s.getBoundingClientRect();if(i.x==0&&i.y==0&&i.width==0&&i.height==0)continue;const o=i.x+i.width/2,l=i.y+i.height/2,u=o+a.x,d=l+a.y,p=u+n.width,g=d+n.height,m=this.provider.getContainer().getBoundingClientRect(),y=u-m.left,P=m.right-p,z=d-m.top,te=m.bottom-g,A=Math.min(n.width,n.height)/4,q=y<0?y-A:P<0?-P+A:0,N=z<0?z-A:te<0?-te+A:0;this.provider.panBy(q,N),this.popupPositioned.set(n.id,!0)}}else n.setCollapsed(!0),n.isCollapsed()&&n.updateMap(!1)}}exports.MapManager=Ri;
|
|
1
|
+
"use strict";var Ts=Object.defineProperty;var Qr=r=>{throw TypeError(r)};var Ms=(r,e,t)=>e in r?Ts(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var f=(r,e,t)=>Ms(r,typeof e!="symbol"?e+"":e,t),nr=(r,e,t)=>e.has(r)||Qr("Cannot "+t);var k=(r,e,t)=>(nr(r,e,"read from private field"),t?t.call(r):e.get(r)),D=(r,e,t)=>e.has(r)?Qr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Z=(r,e,t,n)=>(nr(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Ae=(r,e,t)=>(nr(r,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Mn=!1;var An=Array.isArray,As=Array.prototype.indexOf,Os=Array.from,lr=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,Ns=Object.prototype,Rs=Array.prototype,Is=Object.getPrototypeOf,en=Object.isExtensible;function Ps(r){for(var e=0;e<r.length;e++)r[e]()}function Ls(){var r,e,t=new Promise((n,s)=>{r=n,e=s});return{promise:t,resolve:r,reject:e}}const X=2,Ir=4,On=8,At=16,Te=32,Ze=64,Nn=128,K=256,zt=512,W=1024,se=2048,Me=4096,et=8192,it=16384,Pr=32768,Ds=65536,tn=1<<17,Zs=1<<18,Ot=1<<19,js=1<<20,ur=1<<21,Lr=1<<22,Ie=1<<23,Dt=Symbol("$state"),Dr=new class extends Error{constructor(){super(...arguments);f(this,"name","StaleReactionError");f(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Fs(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function zs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Vs(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Us(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Bs(r){throw new Error("https://svelte.dev/e/effect_orphan")}function $s(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function qs(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ws(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Hs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const Ys=2,j=Symbol();function Rn(r){return r===this.v}let Xs=!1,ae=null;function Vt(r){ae=r}function Zr(r,e=!1,t){ae={p:ae,c:null,e:null,s:r,x:null,l:null}}function jr(r){var e=ae,t=e.e;if(t!==null){e.e=null;for(var n of t)Yn(n)}return r!==void 0&&(e.x=r),ae=e.p,r??{}}function In(){return!0}const Gs=new WeakMap;function Js(r){var e=M;if(e===null)return S.f|=Ie,r;if((e.f&Pr)===0){if((e.f&Nn)===0)throw!e.parent&&r instanceof Error&&Pn(r),r;e.b.error(r)}else Fr(r,e)}function Fr(r,e){for(;e!==null;){if((e.f&Nn)!==0)try{e.b.error(r);return}catch(t){r=t}e=e.parent}throw r instanceof Error&&Pn(r),r}function Pn(r){const e=Gs.get(r);e&&(lr(r,"message",{value:e.message}),lr(r,"stack",{value:e.stack}))}let Ut=[];function Ks(){var r=Ut;Ut=[],Ps(r)}function Qs(r){Ut.length===0&&queueMicrotask(Ks),Ut.push(r)}function ea(){for(var r=M.b;r!==null&&!r.has_pending_snippet();)r=r.parent;return r===null&&Fs(),r}function ta(r){var e=X|se,t=S!==null&&(S.f&X)!==0?S:null;return M===null||t!==null&&(t.f&K)!==0?e|=K:M.f|=Ot,{ctx:ae,deps:null,effects:null,equals:Rn,f:e,fn:r,reactions:null,rv:0,v:j,wv:0,parent:t??M,ac:null}}function ra(r,e){let t=M;t===null&&zs();var n=t.b,s=void 0,a=zn(j),i=null,o=!S;return ma(()=>{try{var l=r();i&&Promise.resolve(l).catch(()=>{})}catch(m){l=Promise.reject(m)}var u=()=>l;s=(i==null?void 0:i.then(u,u))??Promise.resolve(l),i=s;var d=V,p=n.pending;o&&(n.update_pending_count(1),p||d.increment());const g=(m,y=void 0)=>{i=null,p||d.activate(),y?y!==Dr&&(a.f|=Ie,fr(a,y)):((a.f&Ie)!==0&&(a.f^=Ie),fr(a,m)),o&&(n.update_pending_count(-1),p||d.decrement()),Zn()};if(s.then(g,m=>g(null,m||"unknown")),d)return()=>{queueMicrotask(()=>d.neuter())}}),new Promise(l=>{function u(d){function p(){d===s?l(a):u(s)}d.then(p,p)}u(s)})}function Ln(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)De(e[t])}}function na(r){for(var e=r.parent;e!==null;){if((e.f&X)===0)return e;e=e.parent}return null}function zr(r){var e,t=M;Ee(na(r));try{Ln(r),e=ss(r)}finally{Ee(t)}return e}function Dn(r){var e=zr(r);if(r.equals(e)||(r.v=e,r.wv=rs()),!ot){var t=(we||(r.f&K)!==0)&&r.deps!==null?Me:W;Q(r,t)}}function sa(r,e,t){const n=ta;if(e.length===0){t(r.map(n));return}var s=V,a=M,i=aa(),o=ea();Promise.all(e.map(l=>ra(l))).then(l=>{s==null||s.activate(),i();try{t([...r.map(n),...l])}catch(u){(a.f&it)===0&&Fr(u,a)}s==null||s.deactivate(),Zn()}).catch(l=>{o.error(l)})}function aa(){var r=M,e=S,t=ae,n=V;return function(){Ee(r),de(e),Vt(t),n==null||n.activate()}}function Zn(){Ee(null),de(null),Vt(null)}const sr=new Set;let V=null,rn=new Set,Bt=[];function jn(){const r=Bt.shift();Bt.length>0&&queueMicrotask(jn),r()}let mt=[],Vr=null,dr=!1;var bt,Ge,ge,Et,St,Oe,Je,Ne,ye,Ke,Ct,Tt,ne,Fn,Zt,cr;const Gt=class Gt{constructor(){D(this,ne);f(this,"current",new Map);D(this,bt,new Map);D(this,Ge,new Set);D(this,ge,0);D(this,Et,null);D(this,St,!1);D(this,Oe,[]);D(this,Je,[]);D(this,Ne,[]);D(this,ye,[]);D(this,Ke,[]);D(this,Ct,[]);D(this,Tt,[]);f(this,"skipped_effects",new Set)}process(e){var s;mt=[];for(const a of e)Ae(this,ne,Fn).call(this,a);if(k(this,Oe).length===0&&k(this,ge)===0){Ae(this,ne,cr).call(this);var t=k(this,Ne),n=k(this,ye);Z(this,Ne,[]),Z(this,ye,[]),Z(this,Ke,[]),V=null,nn(t),nn(n),V===null?V=this:sr.delete(this),(s=k(this,Et))==null||s.resolve()}else Ae(this,ne,Zt).call(this,k(this,Ne)),Ae(this,ne,Zt).call(this,k(this,ye)),Ae(this,ne,Zt).call(this,k(this,Ke));for(const a of k(this,Oe))Ye(a);for(const a of k(this,Je))Ye(a);Z(this,Oe,[]),Z(this,Je,[])}capture(e,t){k(this,bt).has(e)||k(this,bt).set(e,t),this.current.set(e,e.v)}activate(){V=this}deactivate(){V=null;for(const e of rn)if(rn.delete(e),e(),V!==null)break}neuter(){Z(this,St,!0)}flush(){mt.length>0?ia():Ae(this,ne,cr).call(this),V===this&&(k(this,ge)===0&&sr.delete(this),this.deactivate())}increment(){Z(this,ge,k(this,ge)+1)}decrement(){if(Z(this,ge,k(this,ge)-1),k(this,ge)===0){for(const e of k(this,Ct))Q(e,se),_t(e);for(const e of k(this,Tt))Q(e,Me),_t(e);Z(this,Ne,[]),Z(this,ye,[]),this.flush()}else this.deactivate()}add_callback(e){k(this,Ge).add(e)}settled(){return(k(this,Et)??Z(this,Et,Ls())).promise}static ensure(){if(V===null){const e=V=new Gt;sr.add(V),Gt.enqueue(()=>{V===e&&e.flush()})}return V}static enqueue(e){Bt.length===0&&queueMicrotask(jn),Bt.unshift(e)}};bt=new WeakMap,Ge=new WeakMap,ge=new WeakMap,Et=new WeakMap,St=new WeakMap,Oe=new WeakMap,Je=new WeakMap,Ne=new WeakMap,ye=new WeakMap,Ke=new WeakMap,Ct=new WeakMap,Tt=new WeakMap,ne=new WeakSet,Fn=function(e){var d;e.f^=W;for(var t=e.first;t!==null;){var n=t.f,s=(n&(Te|Ze))!==0,a=s&&(n&W)!==0,i=a||(n&et)!==0||this.skipped_effects.has(t);if(!i&&t.fn!==null){if(s)t.f^=W;else if((n&Ir)!==0)k(this,ye).push(t);else if((n&W)===0)if((n&Lr)!==0){var o=(d=t.b)!=null&&d.pending?k(this,Je):k(this,Oe);o.push(t)}else Qt(t)&&((t.f&At)!==0&&k(this,Ke).push(t),Ye(t));var l=t.first;if(l!==null){t=l;continue}}var u=t.parent;for(t=t.next;t===null&&u!==null;)t=u.next,u=u.parent}},Zt=function(e){for(const t of e)((t.f&se)!==0?k(this,Ct):k(this,Tt)).push(t),Q(t,W);e.length=0},cr=function(){if(!k(this,St))for(const e of k(this,Ge))e();k(this,Ge).clear()};let vt=Gt;function ia(){var r=He;dr=!0;try{var e=0;for(an(!0);mt.length>0;){var t=vt.ensure();if(e++>1e3){var n,s;oa()}t.process(mt),ke.clear()}}finally{dr=!1,an(r),Vr=null}}function oa(){try{$s()}catch(r){Fr(r,Vr)}}let fe=null;function nn(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var n=r[t++];if((n.f&(it|et))===0&&Qt(n)&&(fe=[],Ye(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?Qn(n):n.fn=null),(fe==null?void 0:fe.length)>0)){ke.clear();for(const s of fe)Ye(s);fe=[]}}fe=null}}function _t(r){for(var e=Vr=r;e.parent!==null;){e=e.parent;var t=e.f;if(dr&&e===M&&(t&At)!==0)return;if((t&(Ze|Te))!==0){if((t&W)===0)return;e.f^=W}}mt.push(e)}const ke=new Map;function zn(r,e){var t={f:0,v:r,reactions:null,equals:Rn,rv:0,wv:0};return t}function U(r,e){const t=zn(r);return xa(t),t}function F(r,e,t=!1){S!==null&&(!oe||(S.f&tn)!==0)&&In()&&(S.f&(X|At|Lr|tn))!==0&&!($!=null&&$.includes(r))&&Hs();let n=t?dt(e):e;return fr(r,n)}function fr(r,e){if(!r.equals(e)){var t=r.v;ot?ke.set(r,e):ke.set(r,t),r.v=e;var n=vt.ensure();n.capture(r,t),(r.f&X)!==0&&((r.f&se)!==0&&zr(r),Q(r,(r.f&K)===0?W:Me)),r.wv=rs(),Vn(r,se),M!==null&&(M.f&W)!==0&&(M.f&(Te|Ze))===0&&(J===null?ka([r]):J.push(r))}return e}function ar(r){F(r,r.v+1)}function Vn(r,e){var t=r.reactions;if(t!==null)for(var n=t.length,s=0;s<n;s++){var a=t[s],i=a.f,o=(i&se)===0;o&&Q(a,e),(i&X)!==0?Vn(a,Me):o&&((i&At)!==0&&fe!==null&&fe.push(a),_t(a))}}function dt(r){if(typeof r!="object"||r===null||Dt in r)return r;const e=Is(r);if(e!==Ns&&e!==Rs)return r;var t=new Map,n=An(r),s=U(0),a=Pe,i=o=>{if(Pe===a)return o();var l=S,u=Pe;de(null),ln(a);var d=o();return de(l),ln(u),d};return n&&t.set("length",U(r.length)),new Proxy(r,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&qs();var d=t.get(l);return d===void 0?d=i(()=>{var p=U(u.value);return t.set(l,p),p}):F(d,u.value,!0),!0},deleteProperty(o,l){var u=t.get(l);if(u===void 0){if(l in o){const d=i(()=>U(j));t.set(l,d),ar(s)}}else F(u,j),ar(s);return!0},get(o,l,u){var m;if(l===Dt)return r;var d=t.get(l),p=l in o;if(d===void 0&&(!p||(m=ft(o,l))!=null&&m.writable)&&(d=i(()=>{var y=dt(p?o[l]:j),P=U(y);return P}),t.set(l,d)),d!==void 0){var g=R(d);return g===j?void 0:g}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var d=t.get(l);d&&(u.value=R(d))}else if(u===void 0){var p=t.get(l),g=p==null?void 0:p.v;if(p!==void 0&&g!==j)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return u},has(o,l){var g;if(l===Dt)return!0;var u=t.get(l),d=u!==void 0&&u.v!==j||Reflect.has(o,l);if(u!==void 0||M!==null&&(!d||(g=ft(o,l))!=null&&g.writable)){u===void 0&&(u=i(()=>{var m=d?dt(o[l]):j,y=U(m);return y}),t.set(l,u));var p=R(u);if(p===j)return!1}return d},set(o,l,u,d){var q;var p=t.get(l),g=l in o;if(n&&l==="length")for(var m=u;m<p.v;m+=1){var y=t.get(m+"");y!==void 0?F(y,j):m in o&&(y=i(()=>U(j)),t.set(m+"",y))}if(p===void 0)(!g||(q=ft(o,l))!=null&&q.writable)&&(p=i(()=>U(void 0)),F(p,dt(u)),t.set(l,p));else{g=p.v!==j;var P=i(()=>dt(u));F(p,P)}var z=Reflect.getOwnPropertyDescriptor(o,l);if(z!=null&&z.set&&z.set.call(d,u),!g){if(n&&typeof l=="string"){var te=t.get("length"),A=Number(l);Number.isInteger(A)&&A>=te.v&&F(te,A+1)}ar(s)}return!0},ownKeys(o){R(s);var l=Reflect.ownKeys(o).filter(p=>{var g=t.get(p);return g===void 0||g.v!==j});for(var[u,d]of t)d.v!==j&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Ws()}})}var sn,Un,Bn,$n;function la(){if(sn===void 0){sn=window,Un=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;Bn=ft(e,"firstChild").get,$n=ft(e,"nextSibling").get,en(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),en(t)&&(t.__t=void 0)}}function ua(r=""){return document.createTextNode(r)}function qn(r){return Bn.call(r)}function Wn(r){return $n.call(r)}function hr(r,e){return qn(r)}function da(r,e=1,t=!1){let n=r;for(;e--;)n=Wn(n);return n}function Hn(r){var e=S,t=M;de(null),Ee(null);try{return r()}finally{de(e),Ee(t)}}function ca(r){M===null&&S===null&&Bs(),S!==null&&(S.f&K)!==0&&M===null&&Us(),ot&&Vs()}function fa(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function je(r,e,t,n=!0){var s=M;s!==null&&(s.f&et)!==0&&(r|=et);var a={ctx:ae,deps:null,nodes_start:null,nodes_end:null,f:r|se,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{Ye(a),a.f|=Pr}catch(l){throw De(a),l}else e!==null&&_t(a);if(n){var i=a;if(t&&i.deps===null&&i.teardown===null&&i.nodes_start===null&&i.first===i.last&&(i.f&Ot)===0&&(i=i.first),i!==null&&(i.parent=s,s!==null&&fa(i,s),S!==null&&(S.f&X)!==0&&(r&Ze)===0)){var o=S;(o.effects??(o.effects=[])).push(i)}}return a}function ie(r){ca();var e=M.f,t=!S&&(e&Te)!==0&&(e&Pr)===0;if(t){var n=ae;(n.e??(n.e=[])).push(r)}else return Yn(r)}function Yn(r){return je(Ir|js,r,!1)}function ha(r){vt.ensure();const e=je(Ze|Ot,r,!0);return(t={})=>new Promise(n=>{t.outro?ya(e,()=>{De(e),n(void 0)}):(De(e),n(void 0))})}function pa(r){return je(Ir,r,!1)}function ma(r){return je(Lr|Ot,r,!0)}function Xn(r,e=0){return je(On|e,r,!0)}function Gn(r,e=[],t=[]){sa(e,t,n=>{je(On,()=>r(...n.map(R)),!0)})}function va(r,e=!0){return je(Te|Ot,r,!0,e)}function Jn(r){var e=r.teardown;if(e!==null){const t=ot,n=S;on(!0),de(null);try{e.call(null)}finally{on(t),de(n)}}}function Kn(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const s=t.ac;s!==null&&Hn(()=>{s.abort(Dr)});var n=t.next;(t.f&Ze)!==0?t.parent=null:De(t,e),t=n}}function _a(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&Te)===0&&De(e),e=t}}function De(r,e=!0){var t=!1;(e||(r.f&Zs)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(ga(r.nodes_start,r.nodes_end),t=!0),Kn(r,e&&!t),$t(r,0),Q(r,it);var n=r.transitions;if(n!==null)for(const a of n)a.stop();Jn(r);var s=r.parent;s!==null&&s.first!==null&&Qn(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function ga(r,e){for(;r!==null;){var t=r===e?null:Wn(r);r.remove(),r=t}}function Qn(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function ya(r,e){var t=[];es(r,t,!0),wa(t,()=>{De(r),e&&e()})}function wa(r,e){var t=r.length;if(t>0){var n=()=>--t||e();for(var s of r)s.out(n)}else e()}function es(r,e,t){if((r.f&et)===0){if(r.f^=et,r.transitions!==null)for(const i of r.transitions)(i.is_global||t)&&e.push(i);for(var n=r.first;n!==null;){var s=n.next,a=(n.f&Ds)!==0||(n.f&Te)!==0;es(n,e,a?t:!1),n=s}}}let He=!1;function an(r){He=r}let ot=!1;function on(r){ot=r}let S=null,oe=!1;function de(r){S=r}let M=null;function Ee(r){M=r}let $=null;function xa(r){S!==null&&($===null?$=[r]:$.push(r))}let B=null,Y=0,J=null;function ka(r){J=r}let ts=1,gt=0,Pe=gt;function ln(r){Pe=r}let we=!1;function rs(){return++ts}function Qt(r){var p;var e=r.f;if((e&se)!==0)return!0;if((e&Me)!==0){var t=r.deps,n=(e&K)!==0;if(t!==null){var s,a,i=(e&zt)!==0,o=n&&M!==null&&!we,l=t.length;if((i||o)&&(M===null||(M.f&it)===0)){var u=r,d=u.parent;for(s=0;s<l;s++)a=t[s],(i||!((p=a==null?void 0:a.reactions)!=null&&p.includes(u)))&&(a.reactions??(a.reactions=[])).push(u);i&&(u.f^=zt),o&&d!==null&&(d.f&K)===0&&(u.f^=K)}for(s=0;s<l;s++)if(a=t[s],Qt(a)&&Dn(a),a.wv>r.wv)return!0}(!n||M!==null&&!we)&&Q(r,W)}return!1}function ns(r,e,t=!0){var n=r.reactions;if(n!==null&&!($!=null&&$.includes(r)))for(var s=0;s<n.length;s++){var a=n[s];(a.f&X)!==0?ns(a,e,!1):e===a&&(t?Q(a,se):(a.f&W)!==0&&Q(a,Me),_t(a))}}function ss(r){var P;var e=B,t=Y,n=J,s=S,a=we,i=$,o=ae,l=oe,u=Pe,d=r.f;B=null,Y=0,J=null,we=(d&K)!==0&&(oe||!He||S===null),S=(d&(Te|Ze))===0?r:null,$=null,Vt(r.ctx),oe=!1,Pe=++gt,r.ac!==null&&(Hn(()=>{r.ac.abort(Dr)}),r.ac=null);try{r.f|=ur;var p=r.fn,g=p(),m=r.deps;if(B!==null){var y;if($t(r,Y),m!==null&&Y>0)for(m.length=Y+B.length,y=0;y<B.length;y++)m[Y+y]=B[y];else r.deps=m=B;if(!we||(d&X)!==0&&r.reactions!==null)for(y=Y;y<m.length;y++)((P=m[y]).reactions??(P.reactions=[])).push(r)}else m!==null&&Y<m.length&&($t(r,Y),m.length=Y);if(In()&&J!==null&&!oe&&m!==null&&(r.f&(X|Me|se))===0)for(y=0;y<J.length;y++)ns(J[y],r);return s!==null&&s!==r&&(gt++,J!==null&&(n===null?n=J:n.push(...J))),(r.f&Ie)!==0&&(r.f^=Ie),g}catch(z){return Js(z)}finally{r.f^=ur,B=e,Y=t,J=n,S=s,we=a,$=i,Vt(o),oe=l,Pe=u}}function ba(r,e){let t=e.reactions;if(t!==null){var n=As.call(t,r);if(n!==-1){var s=t.length-1;s===0?t=e.reactions=null:(t[n]=t[s],t.pop())}}t===null&&(e.f&X)!==0&&(B===null||!B.includes(e))&&(Q(e,Me),(e.f&(K|zt))===0&&(e.f^=zt),Ln(e),$t(e,0))}function $t(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)ba(r,t[n])}function Ye(r){var e=r.f;if((e&it)===0){Q(r,W);var t=M,n=He;M=r,He=!0;try{(e&At)!==0?_a(r):Kn(r),Jn(r);var s=ss(r);r.teardown=typeof s=="function"?s:null,r.wv=ts;var a;Mn&&Xs&&(r.f&se)!==0&&r.deps}finally{He=n,M=t}}}function R(r){var e=r.f,t=(e&X)!==0;if(S!==null&&!oe){var n=M!==null&&(M.f&it)!==0;if(!n&&!($!=null&&$.includes(r))){var s=S.deps;if((S.f&ur)!==0)r.rv<gt&&(r.rv=gt,B===null&&s!==null&&s[Y]===r?Y++:B===null?B=[r]:(!we||!B.includes(r))&&B.push(r));else{(S.deps??(S.deps=[])).push(r);var a=r.reactions;a===null?r.reactions=[S]:a.includes(S)||a.push(S)}}}else if(t&&r.deps===null&&r.effects===null){var i=r,o=i.parent;o!==null&&(o.f&K)===0&&(i.f^=K)}if(ot){if(ke.has(r))return ke.get(r);if(t){i=r;var l=i.v;return((i.f&W)===0&&i.reactions!==null||as(i))&&(l=zr(i)),ke.set(i,l),l}}else t&&(i=r,Qt(i)&&Dn(i));if((r.f&Ie)!==0)throw r.v;return r.v}function as(r){if(r.v===j)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(ke.has(e)||(e.f&X)!==0&&as(e))return!0;return!1}function Ea(r){var e=oe;try{return oe=!0,r()}finally{oe=e}}const Sa=-7169;function Q(r,e){r.f=r.f&Sa|e}const Ca=["touchstart","touchmove"];function Ta(r){return Ca.includes(r)}const Ma=new Set,un=new Set;let dn=null;function Lt(r){var A;var e=this,t=e.ownerDocument,n=r.type,s=((A=r.composedPath)==null?void 0:A.call(r))||[],a=s[0]||r.target;dn=r;var i=0,o=dn===r&&r.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var u=s.indexOf(e);if(u===-1)return;l<=u&&(i=l)}if(a=s[i]||r.target,a!==e){lr(r,"currentTarget",{configurable:!0,get(){return a||t}});var d=S,p=M;de(null),Ee(null);try{for(var g,m=[];a!==null;){var y=a.assignedSlot||a.parentNode||a.host||null;try{var P=a["__"+n];if(P!=null&&(!a.disabled||r.target===a))if(An(P)){var[z,...te]=P;z.apply(a,[r,...te])}else P.call(a,r)}catch(q){g?m.push(q):g=q}if(r.cancelBubble||y===e||y===null)break;a=y}if(g){for(let q of m)queueMicrotask(()=>{throw q});throw g}}finally{r.__root=e,delete r.currentTarget,de(d),Ee(p)}}}function Aa(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function Oa(r,e){var t=M;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function is(r,e){var t=(e&Ys)!==0,n,s=!r.startsWith("<!>");return()=>{n===void 0&&(n=Aa(s?r:"<!>"+r),n=qn(n));var a=t||Un?document.importNode(n,!0):n.cloneNode(!0);return Oa(a,a),a}}function os(r,e){r!==null&&r.before(e)}function Ur(r,e){return Na(r,e)}const Ve=new Map;function Na(r,{target:e,anchor:t,props:n={},events:s,context:a,intro:i=!0}){la();var o=new Set,l=p=>{for(var g=0;g<p.length;g++){var m=p[g];if(!o.has(m)){o.add(m);var y=Ta(m);e.addEventListener(m,Lt,{passive:y});var P=Ve.get(m);P===void 0?(document.addEventListener(m,Lt,{passive:y}),Ve.set(m,1)):Ve.set(m,P+1)}}};l(Os(Ma)),un.add(l);var u=void 0,d=ha(()=>{var p=t??e.appendChild(ua());return va(()=>{if(a){Zr({});var g=ae;g.c=a}s&&(n.$$events=s),u=r(p,n)||{},a&&jr()}),()=>{var y;for(var g of o){e.removeEventListener(g,Lt);var m=Ve.get(g);--m===0?(document.removeEventListener(g,Lt),Ve.delete(g)):Ve.set(g,m)}un.delete(l),p!==t&&((y=p.parentNode)==null||y.removeChild(p))}});return Ra.set(u,d),u}let Ra=new WeakMap;function ls(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(e=0;e<s;e++)r[e]&&(t=ls(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function Ia(){for(var r,e,t=0,n="",s=arguments.length;t<s;t++)(r=arguments[t])&&(e=ls(r))&&(n&&(n+=" "),n+=e);return n}function us(r){return typeof r=="object"?Ia(r):r??""}function Pa(r,e,t){var n=r==null?"":""+r;return e&&(n=n?n+" "+e:e),n===""?null:n}function La(r,e){return r==null?null:String(r)}function ds(r,e,t,n,s,a){var i=r.__className;if(i!==t||i===void 0){var o=Pa(t,n);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}return a}function qt(r,e,t,n){var s=r.__style;if(s!==e){var a=La(e);a==null?r.removeAttribute("style"):r.style.cssText=a,r.__style=e}return n}const Da=()=>performance.now(),le={tick:r=>requestAnimationFrame(r),now:()=>Da(),tasks:new Set};function cs(){const r=le.now();le.tasks.forEach(e=>{e.c(r)||(le.tasks.delete(e),e.f())}),le.tasks.size!==0&&le.tick(cs)}function Za(r){let e;return le.tasks.size===0&&le.tick(cs),{promise:new Promise(t=>{le.tasks.add(e={c:r,f:t})}),abort(){le.tasks.delete(e)}}}function cn(r,e){return r===e||(r==null?void 0:r[Dt])===e}function Be(r={},e,t,n){return pa(()=>{var s,a;return Xn(()=>{s=a,a=[],Ea(()=>{r!==t(...a)&&(e(r,...a),s&&cn(t(...s),r)&&e(null,...s))})}),()=>{Qs(()=>{a&&cn(t(...a),r)&&e(null,...a)})}}),r}const ja="5";var Tn;typeof window<"u"&&((Tn=window.__svelte??(window.__svelte={})).v??(Tn.v=new Set)).add(ja);function Fa(r){return r}function pr(r){return-.5*(Math.cos(Math.PI*r)-1)}function za(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Va(r){return Math.sin(r*Math.PI/2)}const Ua=128,Ba=0,$a=1,qa=2;class Wa{constructor(){f(this,"animationsStarted",!1);f(this,"animationsCount",0);f(this,"animationsLimit",Ua);f(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const t=this.layers[e];if(t==null)continue;const n=t.animations;if(n!=null)for(let s=0;s<n.length;s++){const a=n[s];if(a!=null){for(const i of a.values())if(!i.executed&&(i.executed=!0,i.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,n,s){let a=this.layers[e];a==null&&(a=this.layers[e]={animations:new Array});let i=a.animations[t];i==null&&(i=a.animations[t]=new Map);let o={id:n,priority:t,executed:!1,function:s};i.set(n,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let n=0;n<this.layers.length;n++){let s=this.layers[n];if(s==null)continue;let a=s.animations[e];if(a==null)return;let i=a.get(t);if(i==null||i.executed==!1)return;a.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const _e=new Wa;function fn(r){return Object.prototype.toString.call(r)==="[object Date]"}function mr(r,e){if(r===e||r!==r)return()=>r;const t=typeof r;if(t!==typeof e||Array.isArray(r)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(r)){const n=e.map((s,a)=>mr(r[a],s));return s=>n.map(a=>a(s))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(fn(r)&&fn(e)){const a=r.getTime(),o=e.getTime()-a;return l=>new Date(a+l*o)}const n=Object.keys(e),s={};return n.forEach(a=>{s[a]=mr(r[a],e[a])}),a=>{const i={};return n.forEach(o=>{i[o]=s[o](a)}),i}}if(t==="number"){const n=e-r;return s=>r+s*n}return()=>e}var he,Qe,Mt,Re;const Hr=class Hr{constructor(e,t={}){D(this,he);D(this,Qe);D(this,Mt);D(this,Re,null);Z(this,he,U(e)),Z(this,Qe,U(e)),Z(this,Mt,t)}static of(e,t){const n=new Hr(e(),t);return Xn(()=>{n.set(e())}),n}set(e,t){var p;F(k(this,Qe),e);let{delay:n=0,duration:s=400,easing:a=Fa,interpolate:i=mr}={...k(this,Mt),...t};if(s===0)return(p=k(this,Re))==null||p.abort(),F(k(this,he),e),Promise.resolve();const o=le.now()+n;let l,u=!1,d=k(this,Re);return Z(this,Re,Za(g=>{if(g<o)return!0;if(!u){u=!0;const y=k(this,he).v;l=i(y,e),typeof s=="function"&&(s=s(y,e)),d==null||d.abort()}const m=g-o;return m>s?(F(k(this,he),e),!1):(F(k(this,he),l(a(m/s))),!0)})),k(this,Re).promise}get current(){return R(k(this,he))}get target(){return R(k(this,Qe))}set target(e){this.set(e)}};he=new WeakMap,Qe=new WeakMap,Mt=new WeakMap,Re=new WeakMap;let vr=Hr;class jt{constructor(e,t){f(this,"value");f(this,"motion");this.value=e,this.motion=new vr(e,t)}set(e,t){this.value=e,this.motion.set(e,t)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Ha=is('<div><div class="body svelte-1nfn9j8"></div></div>');function Ya(r,e){Zr(e,!0);let t,n;function s(){return n}let a=U(!1);function i(N){F(a,N,!0)}function o(){return R(a)}let l=U(!0),u=0,d=150;function p(N){N!=R(l)&&(F(l,N,!0),u=performance.now())}function g(){return performance.now()-u<d?y.motion.current==0:y.value==0}let m=0,y=new jt(0,{easing:pr});ie(()=>{R(a)==!1&&(y.snap(),_e.clear(e.priority,e.id))}),ie(()=>{y.set(R(l)?0:m,{duration:75})}),ie(()=>{P(y.motion.current)});function P(N){t&&_e.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=N.toString(),t.style.filter=`brightness(${.25+.75*N})`,n.style.opacity=N.toString()})}function z(N){N!=m&&(m=N,y.set(N,{duration:75}))}function te(){return y.value}var A=Ha(),q=hr(A);return Be(q,N=>n=N,()=>n),Be(A,N=>t=N,()=>t),Gn(()=>{ds(A,1,us(["pin",R(a)&&"displayed"]),"svelte-1nfn9j8"),qt(A,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`),qt(q,`width: ${e.width-4}px; height: ${e.height-4}px; border-radius: ${e.radius-2}px`)}),os(r,A),jr({getBody:s,setDisplayed:i,getDisplayed:o,setCollapsed:p,getCollapsed:g,setScale:z,getScale:te})}var ht;(r=>{function e(t,n,s){const a=t/2,i=n/2,o=Math.sqrt(a*a+i*i),l=Math.atan(i/a)*(180/Math.PI),u=s*(Math.PI/180);return s<180?s<90?s<l?{x:0,y:o*Math.sin(u)-i}:{x:o*Math.cos(u)-a,y:0}:s<180-l?{x:o*Math.cos(u)-a,y:0}:{x:-t,y:o*Math.sin(u)-i}:s<270?s<180+l?{x:-t,y:o*Math.sin(u)-i}:{x:o*Math.cos(u)-a,y:-n}:s<360-l?{x:o*Math.cos(u)-a,y:-n}:{x:0,y:o*Math.sin(u)-i}}r.getOffsets=e})(ht||(ht={}));var Xa=is('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function fs(r,e){Zr(e,!0);let t,n,s,a;const i=e.width+2*e.margin,o=e.height+2*e.margin,l=()=>a;ie(()=>{s.style.width=`${e.margin*4}px`,s.style.height=`${e.margin*4}px`});let u=U(!0);function d(O){F(u,O,!0)}function p(){return R(u)}let g=U(!0),m=0,y=300;function P(O){O!=R(g)&&(F(g,O,!0),m=performance.now())}function z(){return performance.now()-m<y?A.motion.current==0:A.value==0}function te(){return performance.now()-m<y?A.motion.current==1:A.value==1}let A=new jt(0);ie(()=>{R(u)==!1&&(A.snap(),_e.clear(e.priority,e.id+"_scale"))}),ie(()=>{R(g)==!0&&A.value!=0&&(_e.stacked()?A.set(0,{duration:0}):A.set(0,{duration:150,easing:za})),R(g)==!1&&A.value!=1&&A.set(1,{duration:150,easing:Va})}),ie(()=>{q(A.motion.current)});function q(O){!t||!n||!s||_e.equeue(R(g)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${O}`,n.style.scale=`${O}`,s.style.scale=`${O}`})}let N=NaN,er=U(!1),me=new jt(-i/2,{easing:pr}),Nt=new jt(-o/2,{easing:pr});ie(()=>{R(u)==!1&&(me.snap(),me.snap(),_e.clear(e.priority,e.id+"_angle"))}),ie(()=>{R(g)==!0&&R(er)&&(me.update({duration:75}),me.update({duration:75}))}),ie(()=>{Yr(me.motion.current,Nt.motion.current)});function Yr(O,It){if(!t||!n||!s)return;const ce=O+i/2,Pt=It+o/2,Fe=o<i?ce*o/i:ce,ze=o>i?Pt*i/o:Pt,ks=Math.atan2(ze,Fe)/Math.PI*180-45,Jr=0,bs=30,rr=Math.sqrt(Fe*Fe+ze*ze),ut=Math.min(i,o)/2,Es=ut*Math.SQRT2,Ss=(rr-ut)/(Es-ut),Kr=Jr+Ss*(bs-Jr),Cs=rr<ut?rr/ut:1;_e.equeue(e.layer,e.priority,e.id+"_angle",()=>{n.style.transform=`translate(${Math.round(O)}px, ${Math.round(It)}px)`,s.style.transform=`scale(${Cs}) rotate(${ks}deg) skew(${Kr}deg, ${Kr}deg)`})}function ws(O,It){if(R(er)==!1||It==!0){let ce=ht.getOffsets(i,o,O);me.set(Math.round(ce.x),{duration:0}),Nt.set(Math.round(ce.y),{duration:0}),Yr(me.value,Nt.value),N=O,F(er,!0)}else if(O!=N){let ce=Math.abs(O-N),Pt=ce<180?ce:360-ce,Fe=Math.log(Pt)*75,ze=ht.getOffsets(i,o,O);me.set(Math.round(ze.x),{duration:Fe}),Nt.set(Math.round(ze.y),{duration:Fe}),N=O}}function xs(){return ht.getOffsets(i,o,N)}var Rt=Xa(),Xr=hr(Rt);Be(Xr,O=>s=O,()=>s);var tr=da(Xr,2),Gr=hr(tr);return Be(Gr,O=>a=O,()=>a),Be(tr,O=>n=O,()=>n),Be(Rt,O=>t=O,()=>t),Gn(()=>{ds(Rt,1,us(["anchor",R(u)&&"displayed"]),"svelte-j5igi2"),qt(tr,`margin: ${e.margin}px;`),qt(Gr,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)}),os(r,Rt),jr({getBody:l,setDisplayed:d,getDisplayed:p,setCollapsed:P,getCollapsed:z,getExpanded:te,setAngle:ws,getOffsets:xs})}var $e;(r=>{function e(o,l,u){return{x:n(l)*u,y:s(o)*u}}r.project=e;function t(o,l,u){return{lat:i(l/u),lng:a(o/u)}}r.unproject=t;function n(o){return(180+o)/360}function s(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function a(o){return o*360-180}function i(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})($e||($e={}));class hs{constructor(e,t,n,s,a){f(this,"swLat");f(this,"swLng");f(this,"neLat");f(this,"neLng");const i=n*Math.pow(2,t),o=$e.project(e.sw.lat,e.sw.lng,i),l=$e.project(e.ne.lat,e.ne.lng,i),u=o.x-s,d=o.y+a,p=l.x+s,g=l.y-a,m=$e.unproject(u,d,i),y=$e.unproject(p,g,i);this.swLat=m.lat,this.swLng=m.lng,this.neLat=y.lat,this.neLng=y.lng}contains(e,t){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1}}var T;(function(r){r.assertEqual=s=>{};function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},r.find=(s,a)=>{for(const i of s)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(T||(T={}));var hn;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(hn||(hn={}));const v=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ve=r=>{switch(typeof r){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(r)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(r)?v.array:r===null?v.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?v.promise:typeof Map<"u"&&r instanceof Map?v.map:typeof Set<"u"&&r instanceof Set?v.set:typeof Date<"u"&&r instanceof Date?v.date:v.object;default:return v.unknown}},c=T.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ee extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return s(this),n}static assert(e){if(!(e instanceof ee))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];t[a]=t[a]||[],t[a].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ee.create=r=>new ee(r);const yt=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===v.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,T.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${T.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${T.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${T.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:T.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,T.assertNever(r)}return{message:t}};let Ga=yt;function _r(){return Ga}const gr=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function h(r,e){const t=_r(),n=gr({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===yt?void 0:yt].filter(s=>!!s)});r.common.issues.push(n)}class G{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return w;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return G.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return w;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const w=Object.freeze({status:"aborted"}),ct=r=>({status:"dirty",value:r}),H=r=>({status:"valid",value:r}),pn=r=>r.status==="aborted",mn=r=>r.status==="dirty",tt=r=>r.status==="valid",Wt=r=>typeof Promise<"u"&&r instanceof Promise;var _;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(_||(_={}));class Se{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vn=(r,e)=>{if(tt(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ee(r.common.issues);return this._error=t,this._error}}};function E(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:l}=r;return i.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:s}}class C{get description(){return this._def.description}_getType(e){return ve(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new G,ctx:{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Wt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},s=this._parseSync({data:e,path:n.path,parent:n});return vn(n,s)}"~validate"(e){var n,s;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return tt(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(s=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>tt(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Wt(s)?s:Promise.resolve(s));return vn(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new st({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return be.create(this,this._def)}nullable(){return at.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ue.create(this)}promise(){return kt.create(this,this._def)}or(e){return Yt.create([this,e],this._def)}and(e){return Xt.create(this,e,this._def)}transform(e){return new st({...E(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new br({...E(this._def),innerType:this,defaultValue:t,typeName:x.ZodDefault})}brand(){return new yi({typeName:x.ZodBranded,type:this,...E(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Er({...E(this._def),innerType:this,catchValue:t,typeName:x.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Br.create(this,e)}readonly(){return Sr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ja=/^c[^\s-]{8,}$/i,Ka=/^[0-9a-z]+$/,Qa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ei=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ti=/^[a-z0-9_-]{21}$/i,ri=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ni=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,si=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ai="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ir;const ii=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,li=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ui=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,di=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ci=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ps="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fi=new RegExp(`^${ps}$`);function ms(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function hi(r){return new RegExp(`^${ms(r)}$`)}function pi(r){let e=`${ps}T${ms(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function mi(r,e){return!!((e==="v4"||!e)&&ii.test(r)||(e==="v6"||!e)&&li.test(r))}function vi(r,e){if(!ri.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function _i(r,e){return!!((e==="v4"||!e)&&oi.test(r)||(e==="v6"||!e)&&ui.test(r))}class xe extends C{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:v.string,received:a.parsedType}),w}const n=new G;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?h(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&h(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")si.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")ir||(ir=new RegExp(ai,"u")),ir.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")ei.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")ti.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ja.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Ka.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Qa.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),h(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?pi(a).test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?fi.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?hi(a).test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?ni.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?mi(e.data,a.version)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?vi(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"jwt",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?_i(e.data,a.version)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"cidr",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?di.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?ci.test(e.data)||(s=this._getOrReturnCtx(e,s),h(s,{validation:"base64url",code:c.invalid_string,message:a.message}),n.dirty()):T.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,..._.errToObj(n)})}_addCheck(e){return new xe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,..._.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,..._.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",..._.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,..._.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,..._.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,..._.errToObj(t)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new xe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}xe.create=r=>new xe({checks:[],typeName:x.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...E(r)});function gi(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=Number.parseInt(r.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class rt extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==v.number){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:v.number,received:a.parsedType}),w}let n;const s=new G;for(const a of this._def.checks)a.kind==="int"?T.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?gi(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.not_finite,message:a.message}),s.dirty()):T.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,n,s){return new rt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:_.toString(s)}]})}_addCheck(e){return new rt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&T.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}rt.create=r=>new rt({checks:[],typeName:x.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...E(r)});class wt extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==v.bigint)return this._getInvalidInput(e);let n;const s=new G;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):T.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return h(t,{code:c.invalid_type,expected:v.bigint,received:t.parsedType}),w}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,n,s){return new wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:_.toString(s)}]})}_addCheck(e){return new wt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}wt.create=r=>new wt({checks:[],typeName:x.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...E(r)});class yr extends C{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.boolean,received:n.parsedType}),w}return H(e.data)}}yr.create=r=>new yr({typeName:x.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...E(r)});class Ht extends C{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:v.date,received:a.parsedType}),w}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_date}),w}const n=new G;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),h(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):T.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ht({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Ht.create=r=>new Ht({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:x.ZodDate,...E(r)});class _n extends C{_parse(e){if(this._getType(e)!==v.symbol){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.symbol,received:n.parsedType}),w}return H(e.data)}}_n.create=r=>new _n({typeName:x.ZodSymbol,...E(r)});class gn extends C{_parse(e){if(this._getType(e)!==v.undefined){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.undefined,received:n.parsedType}),w}return H(e.data)}}gn.create=r=>new gn({typeName:x.ZodUndefined,...E(r)});class yn extends C{_parse(e){if(this._getType(e)!==v.null){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.null,received:n.parsedType}),w}return H(e.data)}}yn.create=r=>new yn({typeName:x.ZodNull,...E(r)});class wr extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return H(e.data)}}wr.create=r=>new wr({typeName:x.ZodAny,...E(r)});class Xe extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return H(e.data)}}Xe.create=r=>new Xe({typeName:x.ZodUnknown,...E(r)});class Ce extends C{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:c.invalid_type,expected:v.never,received:t.parsedType}),w}}Ce.create=r=>new Ce({typeName:x.ZodNever,...E(r)});class xr extends C{_parse(e){if(this._getType(e)!==v.undefined){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.void,received:n.parsedType}),w}return H(e.data)}}xr.create=r=>new xr({typeName:x.ZodVoid,...E(r)});class ue extends C{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==v.array)return h(t,{code:c.invalid_type,expected:v.array,received:t.parsedType}),w;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(h(t,{code:i?c.too_big:c.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(h(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(h(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new Se(t,i,t.path,o)))).then(i=>G.mergeArray(n,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new Se(t,i,t.path,o)));return G.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new ue({...this._def,minLength:{value:e,message:_.toString(t)}})}max(e,t){return new ue({...this._def,maxLength:{value:e,message:_.toString(t)}})}length(e,t){return new ue({...this._def,exactLength:{value:e,message:_.toString(t)}})}nonempty(e){return this.min(1,e)}}ue.create=(r,e)=>new ue({type:r,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...E(e)});function Ue(r){if(r instanceof L){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=be.create(Ue(n))}return new L({...r._def,shape:()=>e})}else return r instanceof ue?new ue({...r._def,type:Ue(r.element)}):r instanceof be?be.create(Ue(r.unwrap())):r instanceof at?at.create(Ue(r.unwrap())):r instanceof pe?pe.create(r.items.map(e=>Ue(e))):r}class L extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=T.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==v.object){const u=this._getOrReturnCtx(e);return h(u,{code:c.invalid_type,expected:v.object,received:u.parsedType}),w}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ce&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const l=[];for(const u of i){const d=a[u],p=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Se(s,p,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ce){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")o.length>0&&(h(s,{code:c.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const p=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Se(s,p,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const p=await d.key,g=await d.value;u.push({key:p,value:g,alwaysSet:d.alwaysSet})}return u}).then(u=>G.mergeObjectSync(n,u)):G.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return _.errToObj,new L({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var a,i;const s=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:_.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new L({...this._def,unknownKeys:"strip"})}passthrough(){return new L({...this._def,unknownKeys:"passthrough"})}extend(e){return new L({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new L({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new L({...this._def,catchall:e})}pick(e){const t={};for(const n of T.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new L({...this._def,shape:()=>t})}omit(e){const t={};for(const n of T.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new L({...this._def,shape:()=>t})}deepPartial(){return Ue(this)}partial(e){const t={};for(const n of T.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new L({...this._def,shape:()=>t})}required(e){const t={};for(const n of T.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof be;)a=a._def.innerType;t[n]=a}return new L({...this._def,shape:()=>t})}keyof(){return vs(T.objectKeys(this.shape))}}L.create=(r,e)=>new L({shape:()=>r,unknownKeys:"strip",catchall:Ce.create(),typeName:x.ZodObject,...E(e)});L.strictCreate=(r,e)=>new L({shape:()=>r,unknownKeys:"strict",catchall:Ce.create(),typeName:x.ZodObject,...E(e)});L.lazycreate=(r,e)=>new L({shape:r,unknownKeys:"strip",catchall:Ce.create(),typeName:x.ZodObject,...E(e)});class Yt extends C{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new ee(o.ctx.common.issues));return h(t,{code:c.invalid_union,unionErrors:i}),w}if(t.common.async)return Promise.all(n.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const l of n){const u={...t,common:{...t.common,issues:[]},parent:null},d=l._parseSync({data:t.data,path:t.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(l=>new ee(l));return h(t,{code:c.invalid_union,unionErrors:o}),w}}get options(){return this._def.options}}Yt.create=(r,e)=>new Yt({options:r,typeName:x.ZodUnion,...E(e)});function kr(r,e){const t=ve(r),n=ve(e);if(r===e)return{valid:!0,data:r};if(t===v.object&&n===v.object){const s=T.objectKeys(e),a=T.objectKeys(r).filter(o=>s.indexOf(o)!==-1),i={...r,...e};for(const o of a){const l=kr(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===v.array&&n===v.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],l=kr(i,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return t===v.date&&n===v.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class Xt extends C{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(pn(a)||pn(i))return w;const o=kr(a.value,i.value);return o.valid?((mn(a)||mn(i))&&t.dirty(),{status:t.value,value:o.data}):(h(n,{code:c.invalid_intersection_types}),w)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Xt.create=(r,e,t)=>new Xt({left:r,right:e,typeName:x.ZodIntersection,...E(t)});class pe extends C{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.array)return h(n,{code:c.invalid_type,expected:v.array,received:n.parsedType}),w;if(n.data.length<this._def.items.length)return h(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w;!this._def.rest&&n.data.length>this._def.items.length&&(h(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new Se(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>G.mergeArray(t,i)):G.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new pe({...this._def,rest:e})}}pe.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pe({items:r,typeName:x.ZodTuple,rest:null,...E(e)})};class wn extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.map)return h(n,{code:c.invalid_type,expected:v.map,received:n.parsedType}),w;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,l],u)=>({key:s._parse(new Se(n,o,n.path,[u,"key"])),value:a._parse(new Se(n,l,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return w;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return w;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}}}}wn.create=(r,e,t)=>new wn({valueType:e,keyType:r,typeName:x.ZodMap,...E(t)});class xt extends C{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.set)return h(n,{code:c.invalid_type,expected:v.set,received:n.parsedType}),w;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(h(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(h(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(l){const u=new Set;for(const d of l){if(d.status==="aborted")return w;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const o=[...n.data.values()].map((l,u)=>a._parse(new Se(n,l,n.path,u)));return n.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new xt({...this._def,minSize:{value:e,message:_.toString(t)}})}max(e,t){return new xt({...this._def,maxSize:{value:e,message:_.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}xt.create=(r,e)=>new xt({valueType:r,minSize:null,maxSize:null,typeName:x.ZodSet,...E(e)});class pt extends C{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.function)return h(t,{code:c.invalid_type,expected:v.function,received:t.parsedType}),w;function n(o,l){return gr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_r(),yt].filter(u=>!!u),issueData:{code:c.invalid_arguments,argumentsError:l}})}function s(o,l){return gr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_r(),yt].filter(u=>!!u),issueData:{code:c.invalid_return_type,returnTypeError:l}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof kt){const o=this;return H(async function(...l){const u=new ee([]),d=await o._def.args.parseAsync(l,a).catch(m=>{throw u.addIssue(n(l,m)),u}),p=await Reflect.apply(i,this,d);return await o._def.returns._def.type.parseAsync(p,a).catch(m=>{throw u.addIssue(s(p,m)),u})})}else{const o=this;return H(function(...l){const u=o._def.args.safeParse(l,a);if(!u.success)throw new ee([n(l,u.error)]);const d=Reflect.apply(i,this,u.data),p=o._def.returns.safeParse(d,a);if(!p.success)throw new ee([s(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new pt({...this._def,args:pe.create(e).rest(Xe.create())})}returns(e){return new pt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new pt({args:e||pe.create([]).rest(Xe.create()),returns:t||Xe.create(),typeName:x.ZodFunction,...E(n)})}}class xn extends C{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}xn.create=(r,e)=>new xn({getter:r,typeName:x.ZodLazy,...E(e)});class kn extends C{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),w}return{status:"valid",value:e.data}}get value(){return this._def.value}}kn.create=(r,e)=>new kn({value:r,typeName:x.ZodLiteral,...E(e)});function vs(r,e){return new nt({values:r,typeName:x.ZodEnum,...E(e)})}class nt extends C{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{expected:T.joinValues(n),received:t.parsedType,code:c.invalid_type}),w}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{received:t.data,code:c.invalid_enum_value,options:n}),w}return H(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return nt.create(e,{...this._def,...t})}exclude(e,t=this._def){return nt.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}nt.create=vs;class bn extends C{_parse(e){const t=T.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==v.string&&n.parsedType!==v.number){const s=T.objectValues(t);return h(n,{expected:T.joinValues(s),received:n.parsedType,code:c.invalid_type}),w}if(this._cache||(this._cache=new Set(T.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=T.objectValues(t);return h(n,{received:n.data,code:c.invalid_enum_value,options:s}),w}return H(e.data)}get enum(){return this._def.values}}bn.create=(r,e)=>new bn({values:r,typeName:x.ZodNativeEnum,...E(e)});class kt extends C{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.promise&&t.common.async===!1)return h(t,{code:c.invalid_type,expected:v.promise,received:t.parsedType}),w;const n=t.parsedType===v.promise?t.data:Promise.resolve(t.data);return H(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}kt.create=(r,e)=>new kt({type:r,typeName:x.ZodPromise,...E(e)});class st extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{h(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return w;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?w:l.status==="dirty"||t.value==="dirty"?ct(l.value):l});{if(t.value==="aborted")return w;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?w:o.status==="dirty"||t.value==="dirty"?ct(o.value):o}}if(s.type==="refinement"){const i=o=>{const l=s.refinement(o,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?w:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?w:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!tt(i))return w;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>tt(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):w);T.assertNever(s)}}st.create=(r,e,t)=>new st({schema:r,typeName:x.ZodEffects,effect:e,...E(t)});st.createWithPreprocess=(r,e,t)=>new st({schema:e,effect:{type:"preprocess",transform:r},typeName:x.ZodEffects,...E(t)});class be extends C{_parse(e){return this._getType(e)===v.undefined?H(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}be.create=(r,e)=>new be({innerType:r,typeName:x.ZodOptional,...E(e)});class at extends C{_parse(e){return this._getType(e)===v.null?H(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}at.create=(r,e)=>new at({innerType:r,typeName:x.ZodNullable,...E(e)});class br extends C{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===v.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}br.create=(r,e)=>new br({innerType:r,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...E(e)});class Er extends C{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Wt(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ee(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ee(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Er.create=(r,e)=>new Er({innerType:r,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...E(e)});class En extends C{_parse(e){if(this._getType(e)!==v.nan){const n=this._getOrReturnCtx(e);return h(n,{code:c.invalid_type,expected:v.nan,received:n.parsedType}),w}return{status:"valid",value:e.data}}}En.create=r=>new En({typeName:x.ZodNaN,...E(r)});class yi extends C{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Br extends C{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?w:a.status==="dirty"?(t.dirty(),ct(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?w:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new Br({in:e,out:t,typeName:x.ZodPipeline})}}class Sr extends C{_parse(e){const t=this._def.innerType._parse(e),n=s=>(tt(s)&&(s.value=Object.freeze(s.value)),s);return Wt(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}Sr.create=(r,e)=>new Sr({innerType:r,typeName:x.ZodReadonly,...E(e)});var x;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(x||(x={}));const lt=xe.create,b=rt.create,_s=yr.create,$r=wr.create;Xe.create;Ce.create;const Ft=xr.create,qr=ue.create,I=L.create;Yt.create;Xt.create;const Sn=pe.create,re=pt.create,wi=nt.create,xi=kt.create;be.create;at.create;I({pin:I({fade:_s().optional(),maxCount:b().optional(),maxZoom:b().optional()}).optional(),animation:I({queue:I({limit:b().optional()}).optional()}).optional(),api:I({states:I({url:lt()}).optional()}).optional()});const Cr=b().min(-90).max(90),Tr=b().min(-180).max(180),ki=I({sw:I({lat:Cr,lng:Tr}),ne:I({lat:Cr,lng:Tr})}),Mr=$r().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),bi=I({mapSize:b().min(1),zoomMin:b().min(0),zoomMax:b().min(0),zoomScale:b().min(1).max(10)}),Ei=I({instance:$r(),inserted:re().returns(_s()),insert:re().returns(Ft()),remove:re().returns(Ft()),update:re().args(b()).returns(Ft())}),Si=I({getParameters:re().args().returns(bi),getContainer:re().args().returns(Mr),getZoom:re().args().returns(b()),getBounds:re().args().returns(ki),panBy:re().args(b(),b()).returns(Ft()),createMarker:re().args(Mr,Cr,Tr,b()).returns(Ei)}),or=re().args(lt()).returns(xi(Mr)),Ci=I({id:lt().min(1),rank:b(),lat:b().min(-90).max(90),lng:b().min(-180).max(180),tooltip:I({style:I({width:b(),height:b(),margin:b(),radius:b()}).refine(r=>Math.min(r.width,r.height)/r.margin>=6,"Tooltip: minimum of width or height must be greater than or equal to 6 * margin"),body:or}),pin:I({style:I({width:b(),height:b(),radius:b()}),body:or}).optional(),popup:I({style:I({width:b(),height:b(),radius:b(),margin:b()}),body:or}).optional()}),Ti=qr(Ci);var Le;(r=>{r.COUNT=12,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],r.DEGREES_DEFAULT=270})(Le||(Le={}));Sn([b(),qr(Sn([b(),b()]))]);const gs=I({mapSize:b().min(1),zoomMin:b().min(0).max(24),zoomMax:b().min(0).max(24),zoomScale:b().min(1).max(10)}),Mi=I({id:lt(),rank:b(),lat:b(),lng:b(),width:b(),height:b(),margin:b()});I({key:lt(),parameters:gs,input:qr(Mi)});const Ai=wi(["info","warn","error"]);I({title:lt(),level:Ai,content:$r()});const Cn="1.0.210",ys="https://maps.api.arenarium.dev",Oi=`${ys}/log`,Ni=`${ys}/tooltip/states`;class Ri{constructor(e,t,n){f(this,"apiKey");f(this,"apiStatesUrl");f(this,"apiDevEnvironment");f(this,"mapProvider");f(this,"markerDataArray",new Array);f(this,"markerDataMap",new Map);f(this,"markerDataUpdating",!1);f(this,"markerPinProcessor");f(this,"markerTooltipProcessor");f(this,"markerPopupProcessor");Si.parse(t),this.apiKey=e,this.apiDevEnvironment=(window==null?void 0:window.location.host.startsWith("localhost"))||(window==null?void 0:window.location.host.startsWith("127.0.0.1")),this.mapProvider=t,this.markerPinProcessor=new Or(t),this.markerTooltipProcessor=new Pi(t),this.markerPopupProcessor=new Li(t),this.setConfiguration(n),this.log("info","Loaded")}setConfiguration(e){var t,n,s,a;_e.setLimit(((n=(t=e==null?void 0:e.animation)==null?void 0:t.queue)==null?void 0:n.limit)??8*navigator.hardwareConcurrency),this.apiStatesUrl=((a=(s=e==null?void 0:e.api)==null?void 0:s.states)==null?void 0:a.url)??void 0,this.markerPinProcessor.setConfiguration(e)}async updateMarkers(e){Ti.parse(e);try{await this.updateMarkerData(e),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t instanceof Error&&this.log("error","Failed to update markers",t),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const t of this.markerDataArray)t.marker.id==e?this.markerPopupProcessor.show(t):this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n);throw t instanceof Error&&this.log("error","Failed to show popup",t),t}}hidePopup(e){try{if(e){const t=this.markerDataMap.get(e);if(t==null)return;this.markerPopupProcessor.hide(t)}else for(const t of this.markerDataArray)this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n);throw t instanceof Error&&this.log("error","Failed to hide popup",t),t}}async updateMarkerData(e){try{let t=this.markerDataArray.map(s=>s.marker);for(let s=0;s<e.length;s++){const a=e[s];this.markerDataMap.get(a.id)||t.push(a)}let n;if(e.length>1){const s=this.mapProvider.getParameters();gs.parse(s);const a=t.map(u=>({id:u.id,rank:u.rank,lat:u.lat,lng:u.lng,width:u.tooltip.style.width,height:u.tooltip.style.height,margin:u.tooltip.style.margin})),i={key:this.apiKey,parameters:s,input:a},o=this.apiStatesUrl??Ni,l=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json","Cache-Control":this.apiDevEnvironment?"no-cache":""},body:JSON.stringify(i)});if(!l.ok||!l.body)throw new Error("Failed to get marker states: "+l.statusText);n=await l.json()}else n=[[0,[[0,Le.DEGREES.indexOf(Le.DEGREES_DEFAULT)]]]];try{this.markerDataUpdating=!0;for(let s=0;s<t.length;s++){const a=t[s],i=n[s],o=this.markerDataMap.get(a.id);if(o)o.update(i);else{const l=new Ii(this.mapProvider,a,i);l.create(),this.markerDataMap.set(a.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((s,a)=>s.zoom-a.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(s=>s.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(s=>s.tooltip)),this.markerPopupProcessor.updateElements(this.markerDataArray.map(s=>s.popup).filter(s=>s!=null))}finally{this.markerDataUpdating=!1}}catch(t){throw console.error(t),this.markerDataArray.forEach(n=>n.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),t instanceof Error&&this.log("error","Failed to update marker data",t),t}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.removeElements(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.mapProvider.getBounds(),t=this.mapProvider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t,n){if(!this.apiDevEnvironment)try{const s={title:`[CLIENT:${Cn}] ${t}`,level:e,content:{version:Cn,...n}};await fetch(Oi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch(s){console.error(s)}}}class Ii{constructor(e,t,n){f(this,"marker");f(this,"zoom");f(this,"pin");f(this,"tooltip");f(this,"popup");this.marker=t,this.zoom=n[0],this.pin=new Ar(e,t,n),this.tooltip=new Nr(e,t,n),t.popup&&(this.popup=new Rr(e,t))}create(){var e;this.pin.create(),this.tooltip.create(),(e=this.popup)==null||e.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){var e;this.pin.remove(),this.tooltip.remove(),(e=this.popup)==null||e.remove()}}class Wr{constructor(e,t){f(this,"provider");f(this,"id");f(this,"lat");f(this,"lng");f(this,"shown");f(this,"element");f(this,"component");f(this,"marker");this.provider=e,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateZIndex(){if(this.marker==null)throw new Error("Failed to update provider marker z-index");this.marker.update(this.getZindex())}updateMap(e){const t=this.marker,n=this.component;if(t==null||n==null)throw new Error("Failed to update provider marker map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var e;(e=this.marker)==null||e.remove()}}const qe=class qe extends Wr{constructor(t,n,s){var a,i,o,l;super(t,n);f(this,"width");f(this,"height");f(this,"radius");f(this,"zoom");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=((a=n.pin)==null?void 0:a.style.width)??qe.DEFAULT_SIZE,this.height=((i=n.pin)==null?void 0:i.style.height)??qe.DEFAULT_SIZE,this.radius=((o=n.pin)==null?void 0:o.style.radius)??qe.DEFAULT_SIZE,this.zoom=s[0],this.bodyCallback=(l=n.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=Ur(Ya,{target:this.element,props:{id:this.id+"_pin",layer:qa,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateBody(){var n;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?t.appendChild(s):console.error("Failed to load pin body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setCollapsed(t)}setScale(t){if(this.component==null)throw new Error("Failed to set pin scale");this.component.setScale(t)}getScaleFromZoomDistance(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};f(qe,"DEFAULT_SIZE",16);let Ar=qe;const We=class We{constructor(e){f(this,"provider");f(this,"pinElements",new Array);f(this,"pinMaxWidth",0);f(this,"pinMaxHeight",0);f(this,"pinFade",!1);f(this,"pinMaxCount",0);f(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,n,s;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((n=e==null?void 0:e.pin)==null?void 0:n.maxCount)??Math.max(We.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((s=e==null?void 0:e.pin)==null?void 0:s.maxZoom)??We.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,n)=>Math.max(t,n.width),0),this.pinMaxHeight=e.reduce((t,n)=>Math.max(t,n.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const n=this.provider.getParameters().mapSize,s=new hs(e,t,n,this.pinMaxWidth*2,this.pinMaxHeight*2);let a=0;for(const i of this.pinElements)s.contains(i.lat,i.lng)?i.shown&&t<i.zoom&&i.zoom<t+this.pinMaxZoomDelta?(a<this.pinMaxCount&&(i.setCollapsed(!1),i.setScale(this.pinFade?i.getScaleFromZoomDistance(t):1),i.updateMap(!0),i.isBodyLoaded()==!1&&i.updateBody()),a++):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}};f(We,"MAP_PINS_MAX_ZOOM",2),f(We,"MAP_PINS_MAX_COUNT",128);let Or=We;const Jt=class Jt extends Wr{constructor(t,n,s){super(t,n);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"zoom");f(this,"angle");f(this,"states");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=n.tooltip.style.width,this.height=n.tooltip.style.height,this.margin=n.tooltip.style.margin,this.radius=n.tooltip.style.radius,this.zoom=s[0],this.angle=Le.DEGREES_DEFAULT,this.states=s[1].map(a=>[a[0],Le.DEGREES[a[1]]]),this.bodyCallback=n.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=Ur(fs,{target:this.element,props:{id:this.id+"_tooltip",layer:$a,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(n=>[n[0],Le.DEGREES[n[1]]]),this.updateZIndex()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(t),this.component.setAngle(this.angle)}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?t.appendChild(s):console.error("Failed to load tooltip body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const n=this.states.findLast(s=>s[0]<=t);if(!n)throw new Error("Angle not found");return n[1]}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)+Jt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(t)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(Jt,"Z_INDEX_OFFSET",1e6);let Nr=Jt;class Pi{constructor(e){f(this,"provider");f(this,"tooltipElements",new Array);f(this,"tooltipMaxWidth",0);f(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,n)=>Math.max(t,n.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,n)=>Math.max(t,n.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const n=this.provider.getParameters().mapSize,s=new hs(e,t,n,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const a of this.tooltipElements)s.contains(a.lat,a.lng)?a.shown&&a.zoom<=t?(a.updateState(t),a.setCollapsed(!1),a.updateMap(!0),a.isCollapsed()==!1&&a.isBodyLoaded()==!1&&a.updateBody()):(a.setCollapsed(!0),a.isCollapsed()&&a.updateMap(!1)):a.updateMap(!1)}}const Kt=class Kt extends Wr{constructor(t,n){if(n.popup==null)throw new Error("Failed to create popup");super(t,n);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.shown=!1,this.width=n.popup.style.width,this.height=n.popup.style.height,this.margin=n.popup.style.margin,this.radius=n.popup.style.radius,this.bodyCallback=n.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=Ur(fs,{target:this.element,props:{id:this.id+"_popup",layer:Ba,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(s=>{s instanceof HTMLElement?t.appendChild(s):console.error("Failed to load popup body")}).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Kt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(t)}setAngle(t){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(t,!0)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(Kt,"Z_INDEX_OFFSET",2e6);let Rr=Kt;class Li{constructor(e){f(this,"provider");f(this,"popupElements",new Array);f(this,"popupPositioned",new Map);this.provider=e}show(e){e.popup&&(e.pin.shown=!1,e.tooltip.shown=!1,this.popupPositioned.set(e.marker.id,!1),e.popup.setAngle(e.tooltip.angle),e.popup.shown=!0)}hide(e){e.popup&&(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}updateElements(e){this.popupElements=e,this.popupPositioned=new Map(e.map(t=>[t.id,!1]))}removeElements(){this.popupElements.forEach(e=>e.remove()),this.popupElements.length=0,this.popupPositioned.clear()}process(){var e,t;for(const n of this.popupElements)if(n.shown){if(n.setCollapsed(!1),n.updateMap(!0),n.isExpanded()&&n.isBodyLoaded()==!1&&n.updateBody(),n.isCollapsed()==!1&&this.popupPositioned.get(n.id)==!1){const s=(e=n.component)==null?void 0:e.getBody();if(s==null)continue;const a=(t=n.component)==null?void 0:t.getOffsets();if(a==null)continue;const i=s.getBoundingClientRect();if(i.x==0&&i.y==0&&i.width==0&&i.height==0)continue;const o=i.x+i.width/2,l=i.y+i.height/2,u=o+a.x,d=l+a.y,p=u+n.width,g=d+n.height,m=this.provider.getContainer().getBoundingClientRect(),y=u-m.left,P=m.right-p,z=d-m.top,te=m.bottom-g,A=Math.min(n.width,n.height)/4,q=y<0?y-A:P<0?-P+A:0,N=z<0?z-A:te<0?-te+A:0;this.provider.panBy(q,N),this.popupPositioned.set(n.id,!0)}}else n.setCollapsed(!0),n.isCollapsed()&&n.updateMap(!1)}}exports.MapManager=Ri;
|
package/dist/main.es.js
CHANGED
|
@@ -4612,7 +4612,10 @@ const Sr = b().min(-90).max(90), Tr = b().min(-180).max(180), wi = I({
|
|
|
4612
4612
|
height: b(),
|
|
4613
4613
|
margin: b(),
|
|
4614
4614
|
radius: b()
|
|
4615
|
-
}).refine(
|
|
4615
|
+
}).refine(
|
|
4616
|
+
(r) => Math.min(r.width, r.height) / r.margin >= 6,
|
|
4617
|
+
"Tooltip: minimum of width or height must be greater than or equal to 6 * margin"
|
|
4618
|
+
),
|
|
4616
4619
|
body: or
|
|
4617
4620
|
}),
|
|
4618
4621
|
pin: I({
|
|
@@ -4663,7 +4666,7 @@ I({
|
|
|
4663
4666
|
level: Ti,
|
|
4664
4667
|
content: $r()
|
|
4665
4668
|
});
|
|
4666
|
-
const Sn = "1.0.
|
|
4669
|
+
const Sn = "1.0.210", gs = "https://maps.api.arenarium.dev", Mi = `${gs}/log`, Ai = `${gs}/tooltip/states`;
|
|
4667
4670
|
class Di {
|
|
4668
4671
|
constructor(e, t, n) {
|
|
4669
4672
|
f(this, "apiKey");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arenarium/maps",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.211",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "arenarium.dev",
|
|
6
6
|
"description": "Visualize complex map markers clearly. A JavaScript library for effective display of map markers, compatible with MapLibre, Mapbox, and Google Maps.",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"@sveltejs/kit": "^2.37.0",
|
|
62
62
|
"@sveltejs/package": "^2.5.0",
|
|
63
63
|
"@sveltejs/vite-plugin-svelte": "^5.1.1",
|
|
64
|
-
"@types/node": "^24.3.
|
|
64
|
+
"@types/node": "^24.3.1",
|
|
65
65
|
"dts-bundle-generator": "^9.5.1",
|
|
66
66
|
"eslint": "^9.34.0",
|
|
67
67
|
"eslint-config-prettier": "^10.1.8",
|
|
68
|
-
"eslint-plugin-svelte": "^3.
|
|
68
|
+
"eslint-plugin-svelte": "^3.12.1",
|
|
69
69
|
"globals": "^16.3.0",
|
|
70
70
|
"less": "^4.4.1",
|
|
71
71
|
"prettier": "^3.6.2",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"svelte": "^5.38.6",
|
|
75
75
|
"svelte-check": "^4.3.1",
|
|
76
76
|
"typescript": "^5.9.2",
|
|
77
|
-
"typescript-eslint": "^8.
|
|
77
|
+
"typescript-eslint": "^8.42.0",
|
|
78
78
|
"vite": "^6.3.5",
|
|
79
79
|
"vite-plugin-dts": "^4.5.4",
|
|
80
80
|
"arenarium-maps-shared": "1.0.0"
|