import{r as c,j as a}from"./vendor-react-C630P38J.js";import{f as se}from"./vendor-query-BjC2S-sR.js";const oe=()=>{},ie=()=>oe,ae=()=>!0,ue=()=>!1,ce=()=>c.useSyncExternalStore(ie,ae,ue);function _(e){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(e)}function le(e,t){if(_(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function he(e){var t=le(e,"string");return _(t)=="symbol"?t:t+""}function fe(e,t,r){return(t=he(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function d(e){for(var t=1;ta.jsx(a.Fragment,{children:ce()?e:t}),{displayName:"ClientOnly",with:(e,t)=>Object.assign(r=>a.jsx(R,d(d({},e),{},{children:a.jsx(t,d({},r))})),{displayName:`${R.displayName}.with(${t.displayName||t.name||"Component"})`})}),W=c.createContext({ms:void 0,fallback:void 0});W.displayName="DelayDefaultPropsContext";const G=c.createContext({fallback:void 0,clientOnly:void 0});G.displayName="SuspenseDefaultPropsContext";var F=class X extends Error{static assert(t,r){if(!t)throw new X(r)}};const de="useErrorBoundary: this hook should be called in ErrorBoundary.props.children",ye="useErrorBoundaryGroup: this hook should be called in ErrorBoundary.props.children";var Ve=class{constructor(e={}){this.Suspense=e.Suspense,this.Delay=e.Delay}};const qe=({defaultProps:e,children:t})=>{var r,n;return a.jsx(W.Provider,{value:(r=e.Delay)!==null&&r!==void 0?r:{},children:a.jsx(G.Provider,{value:(n=e.Suspense)!==null&&n!==void 0?n:{},children:t})})},pe=(e,t)=>{const r=c.useRef(e);r.current=e;const n=c.useCallback(()=>r.current(),[]);c.useEffect(()=>{const s=setTimeout(n,t);return()=>clearTimeout(s)},[n,t])},Q=Object.assign(e=>{var t,r;const n=c.useContext(W),s=(t=(r=e.ms)!==null&&r!==void 0?r:n.ms)!==null&&t!==void 0?t:0,[o,i]=c.useState(s<=0);return pe(()=>i(!0),s),typeof e.children=="function"?a.jsx(a.Fragment,{children:e.children({isDelayed:o})}):o?a.jsx(a.Fragment,{children:e.children}):e.fallback===void 0?a.jsx(a.Fragment,{children:n.fallback}):a.jsx(a.Fragment,{children:e.fallback})},{displayName:"Delay",with:(e,t)=>Object.assign(r=>a.jsx(Q,d(d({},e),{},{children:a.jsx(t,d({},r))})),{displayName:`${Q.displayName}.with(${t.displayName||t.name||"Component"})`})}),me=e=>{const t=c.useRef(e);return c.useEffect(()=>{t.current=e},[e]),t.current},ge=e=>me(e)!==e,ve=e=>e+1,$=c.createContext(void 0),U=Object.assign(({blockOutside:e=!1,children:t})=>{const[r,n]=c.useReducer(ve,0),s=c.useContext($),o=ge(s==null?void 0:s.resetKey);c.useEffect(()=>{!e&&o&&n()},[o,e]);const i=c.useMemo(()=>({reset:n,resetKey:r}),[r]);return a.jsx($.Provider,{value:i,children:t})},{displayName:"ErrorBoundaryGroup",with:(e,t)=>Object.assign(r=>a.jsx(U,d(d({},e),{},{children:a.jsx(t,d({},r))})),{displayName:`${U.displayName}.with(${t.displayName||t.name||"Component"})`}),Consumer:({children:e})=>a.jsx(a.Fragment,{children:e(be())})}),be=()=>{const e=c.useContext($);return F.assert(e!=null,ye),c.useMemo(()=>({reset:e.reset}),[e.reset])},je=(e=[],t=[])=>e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n])),H=(e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="function"){try{if(e===Error||e.prototype instanceof Error)return t instanceof e}catch{}try{if(t instanceof e)return!0}catch{}try{return e(t)}catch{return!1}}return!1},Ee=(e,t)=>Array.isArray(e)?e.some(r=>H(r,t)):H(e,t),J={isError:!1,error:null};var xe=class extends c.Component{constructor(...e){super(...e),this.state=J,this.reset=()=>{var t,r;(t=(r=this.props).onReset)===null||t===void 0||t.call(r),this.setState(J)}}static getDerivedStateFromError(e){return{isError:!0,error:e}}componentDidUpdate(e,t){const{isError:r}=this.state,{resetKeys:n}=this.props;r&&t.isError&&je(e.resetKeys,n)&&this.reset()}componentDidCatch(e,t){var r,n;(r=(n=this.props).onError)===null||r===void 0||r.call(n,e,t)}render(){const{children:e,fallback:t,shouldCatch:r=!0}=this.props,{isError:n,error:s}=this.state;let o=e;if(n){if(s instanceof F)throw s;if(s instanceof Y)throw s.originalError;if(!Ee(r,s)||typeof t>"u")throw s;const i=t;o=a.jsx(we,{children:typeof i=="function"?a.jsx(i,{error:s,reset:this.reset}):i})}return a.jsx(Z.Provider,{value:d(d({},this.state),{},{reset:this.reset}),children:o})}},Y=class extends Error{constructor(e){super(),this.originalError=e}},we=class extends c.Component{componentDidCatch(e){throw e instanceof F?e:new Y(e)}render(){return this.props.children}};const M=Object.assign(c.forwardRef(function(t,r){var n;const{fallback:s,children:o,onError:i,onReset:l,resetKeys:v,shouldCatch:g}=t,b=(n=c.useContext($))!==null&&n!==void 0?n:{resetKey:0},k=c.useRef(null);return c.useImperativeHandle(r,()=>({reset:()=>{var P;return(P=k.current)===null||P===void 0?void 0:P.reset()}})),a.jsx(xe,{shouldCatch:g,fallback:s,onError:i,onReset:l,resetKeys:[b.resetKey,...v||[]],ref:k,children:o})}),{displayName:"ErrorBoundary",with:(e,t)=>Object.assign(r=>a.jsx(M,d(d({},e),{},{children:a.jsx(t,d({},r))})),{displayName:`${M.displayName}.with(${t.displayName||t.name||"Component"})`}),Consumer:({children:e})=>a.jsx(a.Fragment,{children:e(Se())})}),Z=Object.assign(c.createContext(null),{displayName:"ErrorBoundaryContext"}),Se=()=>{const[e,t]=c.useState({isError:!1,error:null});if(e.isError)throw e.error;const r=c.useContext(Z);return F.assert(r!=null&&!r.isError,de),c.useMemo(()=>({setError:n=>t({isError:!0,error:n})}),[])},Oe=e=>a.jsx(R,{fallback:e.fallback,children:a.jsx(c.Suspense,d({},e))});function Pe({defaultPropsClientOnly:e,componentPropsClientOnly:t}){return t??e?Oe:c.Suspense}function _e(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}function Ne(e,t){if(e==null)return{};var r,n,s=_e(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{let{clientOnly:t,fallback:r,children:n,name:s}=e,o=Ne(e,Be);const i=c.useContext(G);return a.jsx(Pe({defaultPropsClientOnly:i.clientOnly,componentPropsClientOnly:t}),d(d({},o),{},{fallback:r===void 0?i.fallback:r,name:s,children:n}))},{displayName:"Suspense",with:(e,t)=>Object.assign(r=>a.jsx(V,d(d({},e),{},{children:a.jsx(t,d({},r))})),{displayName:`${V.displayName}.with(${t.displayName||t.name||"Component"})`})});function ke(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}function Ce(e,t){if(e==null)return{};var r,n,s=ke(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{let{children:t}=e;return a.jsx(a.Fragment,{children:t(se(Ce(e,$e)))})},m=Symbol.for("@ts-pattern/matcher"),ee=Symbol.for("@ts-pattern/isVariadic"),D="@ts-pattern/anonymous-select-key",A=e=>!!(e&&typeof e=="object"),C=e=>e&&!!e[m],f=(e,t,r)=>{if(C(e)){const n=e[m](),{matched:s,selections:o}=n.match(t);return s&&o&&Object.keys(o).forEach(i=>r(i,o[i])),s}if(A(e)){if(!A(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],s=[],o=[];for(const i of e.keys()){const l=e[i];C(l)&&l[ee]?o.push(l):o.length?s.push(l):n.push(l)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.lengthf(g,i[b],r))&&s.every((g,b)=>f(g,l[b],r))&&(o.length===0||f(o[0],v,r))}return e.length===t.length&&e.every((i,l)=>f(i,t[l],r))}return Reflect.ownKeys(e).every(n=>{const s=e[n];return(n in t||C(o=s)&&o[m]().matcherType==="optional")&&f(s,t[n],r);var o})}return Object.is(t,e)},p=e=>{var t,r,n;return A(e)?C(e)?(t=(r=(n=e[m]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?N(e,p):N(Object.values(e),p):[]},N=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function De(...e){if(e.length===1){const[t]=e;return r=>f(t,r,()=>{})}if(e.length===2){const[t,r]=e;return f(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function y(e){return Object.assign(e,{optional:()=>L(e),and:t=>h(e,t),or:t=>te(e,t),select:t=>t===void 0?B(e):B(t,e)})}function T(e){return Object.assign((t=>Object.assign(t,{[Symbol.iterator](){let r=0;const n=[{value:Object.assign(t,{[ee]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var s;return(s=n[r++])!=null?s:n.at(-1)}}}}))(e),{optional:()=>T(L(e)),select:t=>T(t===void 0?B(e):B(t,e))})}function L(e){return y({[m]:()=>({match:t=>{let r={};const n=(s,o)=>{r[s]=o};return t===void 0?(p(e).forEach(s=>n(s,void 0)),{matched:!0,selections:r}):{matched:f(e,t,n),selections:r}},getSelectionKeys:()=>p(e),matcherType:"optional"})})}const Ke=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},Fe=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0},Re=(e,t)=>{const r=Reflect.ownKeys(e);for(const n of r)if(!t(n,e[n]))return!1;return!0};function h(...e){return y({[m]:()=>({match:t=>{let r={};const n=(s,o)=>{r[s]=o};return{matched:e.every(s=>f(s,t,n)),selections:r}},getSelectionKeys:()=>N(e,p),matcherType:"and"})})}function te(...e){return y({[m]:()=>({match:t=>{let r={};const n=(s,o)=>{r[s]=o};return N(e,p).forEach(s=>n(s,void 0)),{matched:e.some(s=>f(s,t,n)),selections:r}},getSelectionKeys:()=>N(e,p),matcherType:"or"})})}function u(e){return{[m]:()=>({match:t=>({matched:!!e(t)})})}}function B(...e){const t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return y({[m]:()=>({match:n=>{let s={[t??D]:n};return{matched:r===void 0||f(r,n,(o,i)=>{s[o]=i}),selections:s}},getSelectionKeys:()=>[t??D].concat(r===void 0?[]:p(r))})})}function re(e){return!0}function j(e){return typeof e=="number"}function x(e){return typeof e=="string"}function w(e){return typeof e=="bigint"}const ne=y(u(re)),Ae=y(u(re)),Te=ne,S=e=>Object.assign(y(e),{startsWith:t=>{return S(h(e,(r=t,u(n=>x(n)&&n.startsWith(r)))));var r},endsWith:t=>{return S(h(e,(r=t,u(n=>x(n)&&n.endsWith(r)))));var r},minLength:t=>S(h(e,(r=>u(n=>x(n)&&n.length>=r))(t))),length:t=>S(h(e,(r=>u(n=>x(n)&&n.length===r))(t))),maxLength:t=>S(h(e,(r=>u(n=>x(n)&&n.length<=r))(t))),includes:t=>{return S(h(e,(r=t,u(n=>x(n)&&n.includes(r)))));var r},regex:t=>{return S(h(e,(r=t,u(n=>x(n)&&!!n.match(r)))));var r}}),q=S(u(x)),E=e=>Object.assign(y(e),{between:(t,r)=>E(h(e,((n,s)=>u(o=>j(o)&&n<=o&&s>=o))(t,r))),lt:t=>E(h(e,(r=>u(n=>j(n)&&nE(h(e,(r=>u(n=>j(n)&&n>r))(t))),lte:t=>E(h(e,(r=>u(n=>j(n)&&n<=r))(t))),gte:t=>E(h(e,(r=>u(n=>j(n)&&n>=r))(t))),int:()=>E(h(e,u(t=>j(t)&&Number.isInteger(t)))),finite:()=>E(h(e,u(t=>j(t)&&Number.isFinite(t)))),positive:()=>E(h(e,u(t=>j(t)&&t>0))),negative:()=>E(h(e,u(t=>j(t)&&t<0)))}),Ie=E(u(j)),O=e=>Object.assign(y(e),{between:(t,r)=>O(h(e,((n,s)=>u(o=>w(o)&&n<=o&&s>=o))(t,r))),lt:t=>O(h(e,(r=>u(n=>w(n)&&nO(h(e,(r=>u(n=>w(n)&&n>r))(t))),lte:t=>O(h(e,(r=>u(n=>w(n)&&n<=r))(t))),gte:t=>O(h(e,(r=>u(n=>w(n)&&n>=r))(t))),positive:()=>O(h(e,u(t=>w(t)&&t>0))),negative:()=>O(h(e,u(t=>w(t)&&t<0)))}),We=O(u(w)),Ge=y(u(function(e){return typeof e=="boolean"})),Le=y(u(function(e){return typeof e=="symbol"})),ze=y(u(function(e){return e==null})),Qe=y(u(function(e){return e!=null}));var Ye={__proto__:null,matcher:m,optional:L,array:function(...e){return T({[m]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const r=e[0];let n={};if(t.length===0)return p(r).forEach(o=>{n[o]=[]}),{matched:!0,selections:n};const s=(o,i)=>{n[o]=(n[o]||[]).concat([i])};return{matched:t.every(o=>f(r,o,s)),selections:n}},getSelectionKeys:()=>e.length===0?[]:p(e[0])})})},set:function(...e){return y({[m]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};if(e.length===0)return{matched:!0};const n=(o,i)=>{r[o]=(r[o]||[]).concat([i])},s=e[0];return{matched:Ke(t,o=>f(s,o,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:p(e[0])})})},map:function(...e){return y({[m]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const n=(l,v)=>{r[l]=(r[l]||[]).concat([v])};if(e.length===0)return{matched:!0};var s;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(s=e[0])==null?void 0:s.toString()}`);const[o,i]=e;return{matched:Fe(t,(l,v)=>{const g=f(o,v,n),b=f(i,l,n);return g&&b}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...p(e[0]),...p(e[1])]})})},record:function(...e){return y({[m]:()=>({match:t=>{if(t===null||typeof t!="object"||Array.isArray(t))return{matched:!1};var r;if(e.length===0)throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(r=e[0])==null?void 0:r.toString()}`);let n={};const s=(l,v)=>{n[l]=(n[l]||[]).concat([v])},[o,i]=e.length===1?[q,e[0]]:e;return{matched:Re(t,(l,v)=>{const g=typeof l!="string"||Number.isNaN(Number(l))?null:Number(l),b=g!==null&&f(o,g,s),k=f(o,l,s),P=f(i,v,s);return(k||b)&&P}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...p(e[0]),...p(e[1])]})})},intersection:h,union:te,not:function(e){return y({[m]:()=>({match:t=>({matched:!f(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:u,select:B,any:ne,unknown:Ae,_:Te,string:q,number:Ie,bigint:We,boolean:Ge,symbol:Le,nullish:ze,nonNullable:Qe,instanceOf:function(e){return y(u((function(t){return r=>r instanceof t})(e)))},shape:function(e){return y(u(De(e)))}};class Ue extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}}const I={matched:!1,value:void 0};function Ze(e){return new K(e,I)}class K{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;const r=t[t.length-1],n=[t[0]];let s;t.length===3&&typeof t[1]=="function"?s=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let o=!1,i={};const l=(g,b)=>{o=!0,i[g]=b},v=!n.some(g=>f(g,this.input,l))||s&&!s(this.input)?I:{matched:!0,value:r(o?D in i?i[D]:i:this.input,this.input)};return new K(this.input,v)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new K(this.input,n?{matched:!0,value:r(this.input,this.input)}:I)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(t=He){return this.state.matched?this.state.value:t(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}}function He(e){throw new Ue(e)}export{Q as D,M as E,Ze as M,V as S,Xe as a,Ve as b,qe as c,Ye as z};