@espresso-lab/mantine-data-table 1.10.11 → 2.0.0
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/Context/DataTableContext.d.ts +4 -1
- package/dist/DataTable/DataTableInner.d.ts +2 -2
- package/dist/Hooks/useApi.d.ts +8 -108
- package/dist/index.d.ts +3 -2
- package/dist/index.es.js +3754 -7210
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -16
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -2
- /package/dist/Hooks/{usePersitentState.d.ts → usePersistentState.d.ts} +0 -0
package/dist/index.umd.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(oe,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("@mantine/core"),require("@mantine/form"),require("@mantine/hooks"),require("@tabler/icons-react")):typeof define=="function"&&define.amd?define(["exports","react","@mantine/core","@mantine/form","@mantine/hooks","@tabler/icons-react"],P):(oe=typeof globalThis<"u"?globalThis:oe||self,P(oe.MantineDataTable={},oe.React,oe.MantineCore,oe.MantineForm,oe.MantineHooks,oe.TablerIconsReact))})(this,(function(oe,P,u,Bn,De,Ve){"use strict";function ds(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const be=ds(P);function Vn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var It={exports:{}},pn={};var Hn;function hs(){if(Hn)return pn;Hn=1;var t=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return pn.c=function(e){return t.H.useMemoCache(e)},pn}var gn={};var Un;function fs(){return Un||(Un=1,process.env.NODE_ENV!=="production"&&(function(){var t=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;gn.c=function(e){var n=t.H;return n===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
2
2
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
3
3
|
2. You might be breaking the Rules of Hooks
|
|
4
4
|
3. You might have more than one copy of React in the same app
|
|
5
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),Fr}var Yn;function Hs(){return Yn||(Yn=1,process.env.NODE_ENV==="production"?sr.exports=qs():sr.exports=Vs()),sr.exports}var Fe=Hs(),ir=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Gs={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Qs=class{#t=Gs;#e=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#e&&t!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:t}),this.#t=t,process.env.NODE_ENV!=="production"&&(this.#e=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},ar=new Qs;function Ks(t){setTimeout(t,0)}var Ut=typeof window>"u"||"Deno"in globalThis;function lr(){}function zn(t){return typeof t=="number"&&t>=0&&t!==1/0}function Zs(t,e){return Math.max(t+(e||0)-Date.now(),0)}function qt(t,e){return typeof t=="function"?t(e):t}function rt(t,e){return typeof t=="function"?t(e):t}function Fn(t){return JSON.stringify(t,(e,r)=>Ur(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}var Js=Object.prototype.hasOwnProperty;function Wr(t,e){if(t===e)return t;const r=Wn(t)&&Wn(e);if(!r&&!(Ur(t)&&Ur(e)))return e;const s=(r?t:Object.keys(t)).length,c=r?e:Object.keys(e),d=c.length,i=r?new Array(d):{};let m=0;for(let b=0;b<d;b++){const _=r?b:c[b],M=t[_],C=e[_];if(M===C){i[_]=M,(r?b<s:Js.call(t,_))&&m++;continue}if(M===null||C===null||typeof M!="object"||typeof C!="object"){i[_]=C;continue}const S=Wr(M,C);i[_]=S,S===M&&m++}return s===d&&m===s?t:i}function ur(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function Wn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ur(t){if(!Un(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Un(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Un(t){return Object.prototype.toString.call(t)==="[object Object]"}function qn(t,e,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(t,e);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Wr(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Wr(t,e)}return e}function Vn(t,e){return typeof t=="function"?t(...e):!!t}var Xs=class extends ir{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!Ut&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},ei=new Xs;function Hn(){let t,e;const r=new Promise((s,c)=>{t=s,e=c});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}var ti=Ks;function ri(){let t=[],e=0,r=i=>{i()},n=i=>{i()},s=ti;const c=i=>{e?t.push(i):s(()=>{r(i)})},d=()=>{const i=t;t=[],i.length&&s(()=>{n(()=>{i.forEach(m=>{r(m)})})})};return{batch:i=>{let m;e++;try{m=i()}finally{e--,e||d()}return m},batchCalls:i=>(...m)=>{c(()=>{i(...m)})},schedule:c,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var cr=ri(),ni=class extends ir{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!Ut&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#t}},oi=new ni;function si(t){return(t??"online")==="online"?oi.isOnline():!0}function ii(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:si(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var ai=class extends ir{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=Hn(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#r=void 0;#n=void 0;#o;#s;#i;#a;#g;#h;#f;#u;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Gn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qr(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#_(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rt(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#e.setOptions(this.options),e._defaulted&&!ur(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&Qn(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||rt(this.options.enabled,this.#e)!==rt(e.enabled,this.#e)||qt(this.options.staleTime,this.#e)!==qt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||rt(this.options.enabled,this.#e)!==rt(e.enabled,this.#e)||s!==this.#l)&&this.#v(s)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),r=this.createResult(e,t);return ui(this,r)&&(this.#n=r,this.#s=this.options,this.#o=this.#e.state),r}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(r,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),r=this.#t.getQueryCache().build(this.#t,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(t){this.#x();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(lr)),e}#m(){this.#w();const t=qt(this.options.staleTime,this.#e);if(Ut||this.#n.isStale||!zn(t))return;const r=Zs(this.#n.dataUpdatedAt,t)+1;this.#u=ar.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(t){this.#_(),this.#l=t,!(Ut||rt(this.options.enabled,this.#e)===!1||!zn(this.#l)||this.#l===0)&&(this.#c=ar.setInterval(()=>{(this.options.refetchIntervalInBackground||ei.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(ar.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(ar.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,c=this.#o,d=this.#s,m=t!==r?t.state:this.#r,{state:b}=t;let _={...b},M=!1,C;if(e._optimisticResults){const J=this.hasListeners(),q=!J&&Gn(t,e),V=J&&Qn(t,r,e,n);(q||V)&&(_={..._,...ii(b.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:S,errorUpdatedAt:k,status:j}=_;C=_.data;let N=!1;if(e.placeholderData!==void 0&&C===void 0&&j==="pending"){let J;s?.isPlaceholderData&&e.placeholderData===d?.placeholderData?(J=s.data,N=!0):J=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,J!==void 0&&(j="success",C=qn(s?.data,J,e),M=!0)}if(e.select&&C!==void 0&&!N)if(s&&C===c?.data&&e.select===this.#g)C=this.#h;else try{this.#g=e.select,C=e.select(C),C=qn(s?.data,C,e),this.#h=C,this.#a=null}catch(J){this.#a=J}this.#a&&(S=this.#a,C=this.#h,k=Date.now(),j="error");const z=_.fetchStatus==="fetching",B=j==="pending",Q=j==="error",U=B&&z,te=C!==void 0,G={status:j,fetchStatus:_.fetchStatus,isPending:B,isSuccess:j==="success",isError:Q,isInitialLoading:U,isLoading:U,data:C,dataUpdatedAt:_.dataUpdatedAt,error:S,errorUpdatedAt:k,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>m.dataUpdateCount||_.errorUpdateCount>m.errorUpdateCount,isFetching:z,isRefetching:z&&!B,isLoadingError:Q&&!te,isPaused:_.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Q&&te,isStale:Vr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:rt(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const J=Z=>{G.status==="error"?Z.reject(G.error):G.data!==void 0&&Z.resolve(G.data)},q=()=>{const Z=this.#i=G.promise=Hn();J(Z)},V=this.#i;switch(V.status){case"pending":t.queryHash===r.queryHash&&J(V);break;case"fulfilled":(G.status==="error"||G.data!==V.value)&&q();break;case"rejected":(G.status!=="error"||G.error!==V.reason)&&q();break}}return G}updateResult(){const t=this.#n,e=this.createResult(this.#e,this.options);if(this.#o=this.#e.state,this.#s=this.options,this.#o.data!==void 0&&(this.#f=this.#e),ur(e,t))return;this.#n=e;const r=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#p.size)return!0;const c=new Set(s??this.#p);return this.options.throwOnError&&c.add("error"),Object.keys(this.#n).some(d=>{const i=d;return this.#n[i]!==t[i]&&c.has(i)})};this.#C({listeners:r()})}#x(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){cr.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function li(t,e){return rt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Gn(t,e){return li(t,e)||t.state.data!==void 0&&qr(t,e,e.refetchOnMount)}function qr(t,e,r){if(rt(e.enabled,t)!==!1&&qt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Vr(t,e)}return!1}function Qn(t,e,r,n){return(t!==e||rt(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Vr(t,r)}function Vr(t,e){return rt(e.enabled,t)!==!1&&t.isStaleByTime(qt(e.staleTime,t))}function ui(t,e){return!ur(t.getCurrentResult(),e)}function ci(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var di=class extends ir{#t;#e=void 0;#r;#n;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),ur(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&Fn(e.mutationKey)!==Fn(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#s(t)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#s()}mutate(t,e){return this.#n=e,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(t)}#o(){const t=this.#r?.state??ci();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){cr.batch(()=>{if(this.#n&&this.hasListeners()){const e=this.#e.variables,r=this.#e.context,n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#n.onSuccess?.(t.data,e,r,n),this.#n.onSettled?.(t.data,null,e,r,n)):t?.type==="error"&&(this.#n.onError?.(t.error,e,r,n),this.#n.onSettled?.(void 0,t.error,e,r,n))}this.listeners.forEach(e=>{e(this.#e)})})}},dr={exports:{}},Vt={};var Kn;function hi(){if(Kn)return Vt;Kn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,c){var d=null;if(c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),"key"in s){c={};for(var i in s)i!=="key"&&(c[i]=s[i])}else c=s;return s=c.ref,{$$typeof:t,type:n,key:d,ref:s!==void 0?s:null,props:c}}return Vt.Fragment=e,Vt.jsx=r,Vt.jsxs=r,Vt}var Ht={};var Zn;function fi(){return Zn||(Zn=1,process.env.NODE_ENV!=="production"&&(function(){function t(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===Z?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case N:return"Fragment";case B:return"Profiler";case z:return"StrictMode";case ne:return"Suspense";case G:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case j:return"Portal";case U:return a.displayName||"Context";case Q:return(a._context.displayName||"Context")+".Consumer";case te:var v=a.render;return a=a.displayName,a||(a=v.displayName||v.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case J:return v=a.displayName||null,v!==null?v:t(a.type)||"Memo";case q:v=a._payload,a=a._init;try{return t(a(v))}catch{}}return null}function e(a){return""+a}function r(a){try{e(a);var v=!1}catch{v=!0}if(v){v=console;var D=v.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return D.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),e(a)}}function n(a){if(a===N)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===q)return"<...>";try{var v=t(a);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var a=ae.A;return a===null?null:a.getOwner()}function c(){return Error("react-stack-top-frame")}function d(a){if(X.call(a,"key")){var v=Object.getOwnPropertyDescriptor(a,"key").get;if(v&&v.isReactWarning)return!1}return a.key!==void 0}function i(a,v){function D(){w||(w=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}D.isReactWarning=!0,Object.defineProperty(a,"key",{get:D,configurable:!0})}function m(){var a=t(this.type);return h[a]||(h[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function b(a,v,D,T,H,ee){var re=D.ref;return a={$$typeof:k,type:a,key:v,props:D,_owner:T},(re!==void 0?re:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:m}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function _(a,v,D,T,H,ee){var re=v.children;if(re!==void 0)if(T)if(P(re)){for(T=0;T<re.length;T++)M(re[T]);Object.freeze&&Object.freeze(re)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(re);if(X.call(v,"key")){re=t(a);var F=Object.keys(v).filter(function(ie){return ie!=="key"});T=0<F.length?"{key: someKey, "+F.join(": ..., ")+": ...}":"{key: someKey}",f[re+T]||(F=0<F.length?"{"+F.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
5
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),n.useMemoCache(e)}})()),gn}var qn;function ms(){return qn||(qn=1,process.env.NODE_ENV==="production"?It.exports=hs():It.exports=fs()),It.exports}var Me=ms(),Ft=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ps={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},gs=class{#t=ps;#e=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#e&&t!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:t}),this.#t=t,process.env.NODE_ENV!=="production"&&(this.#e=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Wt=new gs;function bs(t){setTimeout(t,0)}var Lt=typeof window>"u"||"Deno"in globalThis;function zt(){}function Gn(t){return typeof t=="number"&&t>=0&&t!==1/0}function ys(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Nt(t,e){return typeof t=="function"?t(e):t}function He(t,e){return typeof t=="function"?t(e):t}function Qn(t){return JSON.stringify(t,(e,n)=>yn(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}var vs=Object.prototype.hasOwnProperty;function bn(t,e){if(t===e)return t;const n=Kn(t)&&Kn(e);if(!n&&!(yn(t)&&yn(e)))return e;const s=(n?t:Object.keys(t)).length,l=n?e:Object.keys(e),i=l.length,a=n?new Array(i):{};let c=0;for(let h=0;h<i;h++){const f=n?h:l[h],p=t[f],m=e[f];if(p===m){a[f]=p,(n?h<s:vs.call(t,f))&&c++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){a[f]=m;continue}const y=bn(p,m);a[f]=y,y===p&&c++}return s===i&&c===s?t:a}function Bt(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Kn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function yn(t){if(!Jn(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Jn(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Jn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Zn(t,e,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(t,e);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bn(t,e)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return bn(t,e)}return e}function Xn(t,e){return typeof t=="function"?t(...e):!!t}var xs=class extends Ft{#t;#e;#n;constructor(){super(),this.#n=t=>{if(!Lt&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Cs=new xs;function er(){let t,e;const n=new Promise((s,l)=>{t=s,e=l});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var Ss=bs;function ws(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=Ss;const l=a=>{e?t.push(a):s(()=>{n(a)})},i=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||i()}return c},batchCalls:a=>(...c)=>{l(()=>{a(...c)})},schedule:l,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Vt=ws(),Ds=class extends Ft{#t=!0;#e;#n;constructor(){super(),this.#n=t=>{if(!Lt&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#t}},ks=new Ds;function _s(t){return(t??"online")==="online"?ks.isOnline():!0}function js(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_s(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var Ps=class extends Ft{constructor(t,e){super(),this.options=e,this.#t=t,this.#i=null,this.#a=er(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#n=void 0;#r=void 0;#s;#o;#a;#i;#p;#h;#f;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),tr(this.#e,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vn(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vn(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#C(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof He(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),e._defaulted&&!Bt(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&nr(this.#e,n,this.options,e)&&this.#d(),this.updateResult(),r&&(this.#e!==n||He(this.options.enabled,this.#e)!==He(e.enabled,this.#e)||Nt(this.options.staleTime,this.#e)!==Nt(e.staleTime,this.#e))&&this.#g();const s=this.#b();r&&(this.#e!==n||He(this.options.enabled,this.#e)!==He(e.enabled,this.#e)||s!==this.#l)&&this.#y(s)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),n=this.createResult(e,t);return Ts(this,n)&&(this.#r=n,this.#o=this.options,this.#s=this.#e.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(t){this.#m.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),n=this.#t.getQueryCache().build(this.#t,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(t){this.#S();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(zt)),e}#g(){this.#x();const t=Nt(this.options.staleTime,this.#e);if(Lt||this.#r.isStale||!Gn(t))return;const n=ys(this.#r.dataUpdatedAt,t)+1;this.#c=Wt.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(t){this.#C(),this.#l=t,!(Lt||He(this.options.enabled,this.#e)===!1||!Gn(this.#l)||this.#l===0)&&(this.#u=Wt.setInterval(()=>{(this.options.refetchIntervalInBackground||Cs.isFocused())&&this.#d()},this.#l))}#v(){this.#g(),this.#y(this.#b())}#x(){this.#c&&(Wt.clearTimeout(this.#c),this.#c=void 0)}#C(){this.#u&&(Wt.clearInterval(this.#u),this.#u=void 0)}createResult(t,e){const n=this.#e,r=this.options,s=this.#r,l=this.#s,i=this.#o,c=t!==n?t.state:this.#n,{state:h}=t;let f={...h},p=!1,m;if(e._optimisticResults){const E=this.hasListeners(),M=!E&&tr(t,e),_=E&&nr(t,n,e,r);(M||_)&&(f={...f,...js(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:k}=f;m=f.data;let A=!1;if(e.placeholderData!==void 0&&m===void 0&&k==="pending"){let E;s?.isPlaceholderData&&e.placeholderData===i?.placeholderData?(E=s.data,A=!0):E=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,E!==void 0&&(k="success",m=Zn(s?.data,E,e),p=!0)}if(e.select&&m!==void 0&&!A)if(s&&m===l?.data&&e.select===this.#p)m=this.#h;else try{this.#p=e.select,m=e.select(m),m=Zn(s?.data,m,e),this.#h=m,this.#i=null}catch(E){this.#i=E}this.#i&&(y=this.#i,m=this.#h,x=Date.now(),k="error");const I=f.fetchStatus==="fetching",F=k==="pending",W=k==="error",R=F&&I,Y=m!==void 0,T={status:k,fetchStatus:f.fetchStatus,isPending:F,isSuccess:k==="success",isError:W,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:I,isRefetching:I&&!F,isLoadingError:W&&!Y,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:W&&Y,isStale:xn(t,e),refetch:this.refetch,promise:this.#a,isEnabled:He(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=L=>{T.status==="error"?L.reject(T.error):T.data!==void 0&&L.resolve(T.data)},M=()=>{const L=this.#a=T.promise=er();E(L)},_=this.#a;switch(_.status){case"pending":t.queryHash===n.queryHash&&E(_);break;case"fulfilled":(T.status==="error"||T.data!==_.value)&&M();break;case"rejected":(T.status!=="error"||T.error!==_.reason)&&M();break}}return T}updateResult(){const t=this.#r,e=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#o=this.options,this.#s.data!==void 0&&(this.#f=this.#e),Bt(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#m.size)return!0;const l=new Set(s??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(i=>{const a=i;return this.#r[a]!==t[a]&&l.has(a)})};this.#w({listeners:n()})}#S(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#w(t){Vt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ms(t,e){return He(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function tr(t,e){return Ms(t,e)||t.state.data!==void 0&&vn(t,e,e.refetchOnMount)}function vn(t,e,n){if(He(e.enabled,t)!==!1&&Nt(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&xn(t,e)}return!1}function nr(t,e,n,r){return(t!==e||He(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&xn(t,n)}function xn(t,e){return He(e.enabled,t)!==!1&&t.isStaleByTime(Nt(e.staleTime,t))}function Ts(t,e){return!Bt(t.getCurrentResult(),e)}function Os(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Es=class extends Ft{#t;#e=void 0;#n;#r;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),Bt(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),e?.mutationKey&&this.options.mutationKey&&Qn(e.mutationKey)!==Qn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,e){return this.#r=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??Os();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Vt.batch(()=>{if(this.#r&&this.hasListeners()){const e=this.#e.variables,n=this.#e.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#r.onSuccess?.(t.data,e,n,r),this.#r.onSettled?.(t.data,null,e,n,r)):t?.type==="error"&&(this.#r.onError?.(t.error,e,n,r),this.#r.onSettled?.(void 0,t.error,e,n,r))}this.listeners.forEach(e=>{e(this.#e)})})}},Ht={exports:{}},At={};var rr;function Ls(){if(rr)return At;rr=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,l){var i=null;if(l!==void 0&&(i=""+l),s.key!==void 0&&(i=""+s.key),"key"in s){l={};for(var a in s)a!=="key"&&(l[a]=s[a])}else l=s;return s=l.ref,{$$typeof:t,type:r,key:i,ref:s!==void 0?s:null,props:l}}return At.Fragment=e,At.jsx=n,At.jsxs=n,At}var Rt={};var sr;function Ns(){return sr||(sr=1,process.env.NODE_ENV!=="production"&&(function(){function t(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===L?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case A:return"Fragment";case F:return"Profiler";case I:return"StrictMode";case $:return"Suspense";case T:return"SuspenseList";case _:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case k:return"Portal";case R:return d.displayName||"Context";case W:return(d._context.displayName||"Context")+".Consumer";case Y:var S=d.render;return d=d.displayName,d||(d=S.displayName||S.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case E:return S=d.displayName||null,S!==null?S:t(d.type)||"Memo";case M:S=d._payload,d=d._init;try{return t(d(S))}catch{}}return null}function e(d){return""+d}function n(d){try{e(d);var S=!1}catch{S=!0}if(S){S=console;var w=S.error,z=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return w.call(S,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",z),e(d)}}function r(d){if(d===A)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===M)return"<...>";try{var S=t(d);return S?"<"+S+">":"<...>"}catch{return"<...>"}}function s(){var d=B.A;return d===null?null:d.getOwner()}function l(){return Error("react-stack-top-frame")}function i(d){if(N.call(d,"key")){var S=Object.getOwnPropertyDescriptor(d,"key").get;if(S&&S.isReactWarning)return!1}return d.key!==void 0}function a(d,S){function w(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",S))}w.isReactWarning=!0,Object.defineProperty(d,"key",{get:w,configurable:!0})}function c(){var d=t(this.type);return j[d]||(j[d]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),d=this.props.ref,d!==void 0?d:null}function h(d,S,w,z,H,Q){var U=w.ref;return d={$$typeof:x,type:d,key:S,props:w,_owner:z},(U!==void 0?U:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:c}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function f(d,S,w,z,H,Q){var U=S.children;if(U!==void 0)if(z)if(D(U)){for(z=0;z<U.length;z++)p(U[z]);Object.freeze&&Object.freeze(U)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(U);if(N.call(S,"key")){U=t(d);var G=Object.keys(S).filter(function(q){return q!=="key"});z=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",O[U+z]||(G=0<G.length?"{"+G.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
6
6
|
let props = %s;
|
|
7
7
|
<%s {...props} />
|
|
8
8
|
React keys must be passed directly to JSX without using spread:
|
|
9
9
|
let props = %s;
|
|
10
|
-
<%s key={someKey} {...props} />`,T,re,F,re),f[re+T]=!0)}if(re=null,D!==void 0&&(r(D),re=""+D),d(v)&&(r(v.key),re=""+v.key),"key"in v){D={};for(var se in v)se!=="key"&&(D[se]=v[se])}else D=v;return re&&i(D,typeof a=="function"?a.displayName||a.name||"Unknown":a),b(a,re,D,s(),H,ee)}function M(a){C(a)?a._store&&(a._store.validated=1):typeof a=="object"&&a!==null&&a.$$typeof===q&&(a._payload.status==="fulfilled"?C(a._payload.value)&&a._payload.value._store&&(a._payload.value._store.validated=1):a._store&&(a._store.validated=1))}function C(a){return typeof a=="object"&&a!==null&&a.$$typeof===k}var S=K,k=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),U=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),ae=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,P=Array.isArray,x=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(a){return a()}};var w,h={},l=S.react_stack_bottom_frame.bind(S,c)(),p=x(n(c)),f={};Ht.Fragment=N,Ht.jsx=function(a,v,D){var T=1e4>ae.recentlyCreatedOwnerStacks++;return _(a,v,D,!1,T?Error("react-stack-top-frame"):l,T?x(n(a)):p)},Ht.jsxs=function(a,v,D){var T=1e4>ae.recentlyCreatedOwnerStacks++;return _(a,v,D,!0,T?Error("react-stack-top-frame"):l,T?x(n(a)):p)}})()),Ht}var Jn;function pi(){return Jn||(Jn=1,process.env.NODE_ENV==="production"?dr.exports=hi():dr.exports=fi()),dr.exports}var y=pi(),Xn=Ae.createContext(void 0),eo=t=>{const e=Ae.useContext(Xn);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},to=({client:t,children:e})=>(Ae.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),y.jsx(Xn.Provider,{value:t,children:e})),ro=Ae.createContext(!1),gi=()=>Ae.useContext(ro);ro.Provider;function mi(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var yi=Ae.createContext(mi()),vi=()=>Ae.useContext(yi),bi=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},wi=t=>{Ae.useEffect(()=>{t.clearReset()},[t])},_i=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||Vn(r,[t.error,n])),xi=t=>{if(t.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Ci=(t,e)=>t.isLoading&&t.isFetching&&!e,Si=(t,e)=>t?.suspense&&e.isPending,no=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function Di(t,e,r){if(process.env.NODE_ENV!=="production"&&(typeof t!="object"||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=gi(),s=vi(),c=eo(),d=c.defaultQueryOptions(t);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d),process.env.NODE_ENV!=="production"&&(d.queryFn||console.error(`[${d.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),d._optimisticResults=n?"isRestoring":"optimistic",xi(d),bi(d,s),wi(s);const i=!c.getQueryCache().get(d.queryHash),[m]=Ae.useState(()=>new e(c,d)),b=m.getOptimisticResult(d),_=!n&&t.subscribed!==!1;if(Ae.useSyncExternalStore(Ae.useCallback(M=>{const C=_?m.subscribe(cr.batchCalls(M)):lr;return m.updateResult(),C},[m,_]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),Ae.useEffect(()=>{m.setOptions(d)},[d,m]),Si(d,b))throw no(d,m,s);if(_i({result:b,errorResetBoundary:s,throwOnError:d.throwOnError,query:c.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw b.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,b),d.experimental_prefetchInRender&&!Ut&&Ci(b,n)&&(i?no(d,m,s):c.getQueryCache().get(d.queryHash)?.promise)?.catch(lr).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?b:m.trackResult(b)}function oo(t,e){return Di(t,ai)}function Hr(t,e){const r=eo(),[n]=Ae.useState(()=>new di(r,t));Ae.useEffect(()=>{n.setOptions(t)},[n,t]);const s=Ae.useSyncExternalStore(Ae.useCallback(d=>n.subscribe(cr.batchCalls(d)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),c=Ae.useCallback((d,i)=>{n.mutate(d,i).catch(lr)},[n]);if(s.error&&Vn(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}var so=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gr(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}var Qr={exports:{}},Gt={};var io;function ki(){if(io)return Gt;io=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,c){var d=null;if(c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),"key"in s){c={};for(var i in s)i!=="key"&&(c[i]=s[i])}else c=s;return s=c.ref,{$$typeof:t,type:n,key:d,ref:s!==void 0?s:null,props:c}}return Gt.Fragment=e,Gt.jsx=r,Gt.jsxs=r,Gt}var hr={};var ao;function Pi(){return ao||(ao=1,process.env.NODE_ENV!=="production"&&(function(){function t(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===V?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case j:return"Fragment";case z:return"Profiler";case N:return"StrictMode";case te:return"Suspense";case ne:return"SuspenseList";case q:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case k:return"Portal";case Q:return(f.displayName||"Context")+".Provider";case B:return(f._context.displayName||"Context")+".Consumer";case U:var a=f.render;return f=f.displayName,f||(f=a.displayName||a.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case G:return a=f.displayName||null,a!==null?a:t(f.type)||"Memo";case J:a=f._payload,f=f._init;try{return t(f(a))}catch{}}return null}function e(f){return""+f}function r(f){try{e(f);var a=!1}catch{a=!0}if(a){a=console;var v=a.error,D=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return v.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",D),e(f)}}function n(f){if(f===j)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===J)return"<...>";try{var a=t(f);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function s(){var f=Z.A;return f===null?null:f.getOwner()}function c(){return Error("react-stack-top-frame")}function d(f){if(ae.call(f,"key")){var a=Object.getOwnPropertyDescriptor(f,"key").get;if(a&&a.isReactWarning)return!1}return f.key!==void 0}function i(f,a){function v(){x||(x=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}v.isReactWarning=!0,Object.defineProperty(f,"key",{get:v,configurable:!0})}function m(){var f=t(this.type);return w[f]||(w[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function b(f,a,v,D,T,H,ee,re){return v=H.ref,f={$$typeof:S,type:f,key:a,props:H,_owner:T},(v!==void 0?v:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:m}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function _(f,a,v,D,T,H,ee,re){var F=a.children;if(F!==void 0)if(D)if(X(F)){for(D=0;D<F.length;D++)M(F[D]);Object.freeze&&Object.freeze(F)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(F);if(ae.call(a,"key")){F=t(f);var se=Object.keys(a).filter(function(ue){return ue!=="key"});D=0<se.length?"{key: someKey, "+se.join(": ..., ")+": ...}":"{key: someKey}",p[F+D]||(se=0<se.length?"{"+se.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
11
|
-
let props = %s;
|
|
12
|
-
<%s {...props} />
|
|
13
|
-
React keys must be passed directly to JSX without using spread:
|
|
14
|
-
let props = %s;
|
|
15
|
-
<%s key={someKey} {...props} />`,D,F,se,F),p[F+D]=!0)}if(F=null,v!==void 0&&(r(v),F=""+v),d(a)&&(r(a.key),F=""+a.key),"key"in a){v={};for(var ie in a)ie!=="key"&&(v[ie]=a[ie])}else v=a;return F&&i(v,typeof f=="function"?f.displayName||f.name||"Unknown":f),b(f,F,H,T,s(),v,ee,re)}function M(f){typeof f=="object"&&f!==null&&f.$$typeof===S&&f._store&&(f._store.validated=1)}var C=K,S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),Z=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=Object.prototype.hasOwnProperty,X=Array.isArray,P=console.createTask?console.createTask:function(){return null};C={react_stack_bottom_frame:function(f){return f()}};var x,w={},h=C.react_stack_bottom_frame.bind(C,c)(),l=P(n(c)),p={};hr.Fragment=j,hr.jsx=function(f,a,v,D,T){var H=1e4>Z.recentlyCreatedOwnerStacks++;return _(f,a,v,!1,D,T,H?Error("react-stack-top-frame"):h,H?P(n(f)):l)},hr.jsxs=function(f,a,v,D,T){var H=1e4>Z.recentlyCreatedOwnerStacks++;return _(f,a,v,!0,D,T,H?Error("react-stack-top-frame"):h,H?P(n(f)):l)}})()),hr}var lo;function Mi(){return lo||(lo=1,process.env.NODE_ENV==="production"?Qr.exports=ki():Qr.exports=Pi()),Qr.exports}Mi();var Kr={exports:{}},Zr={};var uo;function Oi(){if(uo)return Zr;uo=1;var t=K.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Zr.c=function(e){return t.H.useMemoCache(e)},Zr}var co={};var ho;function ji(){return ho||(ho=1,process.env.NODE_ENV!=="production"&&(function(){var t=K.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;co.c=function(e){var r=t.H;return r===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
16
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
17
|
-
2. You might be breaking the Rules of Hooks
|
|
18
|
-
3. You might have more than one copy of React in the same app
|
|
19
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),co}var fo;function Ai(){return fo||(fo=1,process.env.NODE_ENV==="production"?Kr.exports=Oi():Kr.exports=ji()),Kr.exports}Ai();var po={},Qt={},go;function Ei(){if(go)return Qt;go=1,Qt.byteLength=i,Qt.toByteArray=b,Qt.fromByteArray=C;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=n.length;s<c;++s)t[s]=n[s],e[n.charCodeAt(s)]=s;e[45]=62,e[95]=63;function d(S){var k=S.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var j=S.indexOf("=");j===-1&&(j=k);var N=j===k?0:4-j%4;return[j,N]}function i(S){var k=d(S),j=k[0],N=k[1];return(j+N)*3/4-N}function m(S,k,j){return(k+j)*3/4-j}function b(S){var k,j=d(S),N=j[0],z=j[1],B=new r(m(S,N,z)),Q=0,U=z>0?N-4:N,te;for(te=0;te<U;te+=4)k=e[S.charCodeAt(te)]<<18|e[S.charCodeAt(te+1)]<<12|e[S.charCodeAt(te+2)]<<6|e[S.charCodeAt(te+3)],B[Q++]=k>>16&255,B[Q++]=k>>8&255,B[Q++]=k&255;return z===2&&(k=e[S.charCodeAt(te)]<<2|e[S.charCodeAt(te+1)]>>4,B[Q++]=k&255),z===1&&(k=e[S.charCodeAt(te)]<<10|e[S.charCodeAt(te+1)]<<4|e[S.charCodeAt(te+2)]>>2,B[Q++]=k>>8&255,B[Q++]=k&255),B}function _(S){return t[S>>18&63]+t[S>>12&63]+t[S>>6&63]+t[S&63]}function M(S,k,j){for(var N,z=[],B=k;B<j;B+=3)N=(S[B]<<16&16711680)+(S[B+1]<<8&65280)+(S[B+2]&255),z.push(_(N));return z.join("")}function C(S){for(var k,j=S.length,N=j%3,z=[],B=16383,Q=0,U=j-N;Q<U;Q+=B)z.push(M(S,Q,Q+B>U?U:Q+B));return N===1?(k=S[j-1],z.push(t[k>>2]+t[k<<4&63]+"==")):N===2&&(k=(S[j-2]<<8)+S[j-1],z.push(t[k>>10]+t[k>>4&63]+t[k<<2&63]+"=")),z.join("")}return Qt}var Jr={};var mo;function Ti(){return mo||(mo=1,Jr.read=function(t,e,r,n,s){var c,d,i=s*8-n-1,m=(1<<i)-1,b=m>>1,_=-7,M=r?s-1:0,C=r?-1:1,S=t[e+M];for(M+=C,c=S&(1<<-_)-1,S>>=-_,_+=i;_>0;c=c*256+t[e+M],M+=C,_-=8);for(d=c&(1<<-_)-1,c>>=-_,_+=n;_>0;d=d*256+t[e+M],M+=C,_-=8);if(c===0)c=1-b;else{if(c===m)return d?NaN:(S?-1:1)*(1/0);d=d+Math.pow(2,n),c=c-b}return(S?-1:1)*d*Math.pow(2,c-n)},Jr.write=function(t,e,r,n,s,c){var d,i,m,b=c*8-s-1,_=(1<<b)-1,M=_>>1,C=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:c-1,k=n?1:-1,j=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,d=_):(d=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-d))<1&&(d--,m*=2),d+M>=1?e+=C/m:e+=C*Math.pow(2,1-M),e*m>=2&&(d++,m/=2),d+M>=_?(i=0,d=_):d+M>=1?(i=(e*m-1)*Math.pow(2,s),d=d+M):(i=e*Math.pow(2,M-1)*Math.pow(2,s),d=0));s>=8;t[r+S]=i&255,S+=k,i/=256,s-=8);for(d=d<<s|i,b+=s;b>0;t[r+S]=d&255,S+=k,d/=256,b-=8);t[r+S-k]|=j*128}),Jr}var Xr,yo;function $i(){if(yo)return Xr;yo=1;var t={}.toString;return Xr=Array.isArray||function(e){return t.call(e)=="[object Array]"},Xr}var vo;function Ri(){return vo||(vo=1,(function(t){var e=Ei(),r=Ti(),n=$i();t.Buffer=i,t.SlowBuffer=z,t.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=so.TYPED_ARRAY_SUPPORT!==void 0?so.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=c();function s(){try{var o=new Uint8Array(1);return o.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},o.foo()===42&&typeof o.subarray=="function"&&o.subarray(1,1).byteLength===0}catch{return!1}}function c(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(o,u){if(c()<u)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(u),o.__proto__=i.prototype):(o===null&&(o=new i(u)),o.length=u),o}function i(o,u,g){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(o,u,g);if(typeof o=="number"){if(typeof u=="string")throw new Error("If encoding is specified then the first argument must be a string");return M(this,o)}return m(this,o,u,g)}i.poolSize=8192,i._augment=function(o){return o.__proto__=i.prototype,o};function m(o,u,g,A){if(typeof u=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&u instanceof ArrayBuffer?k(o,u,g,A):typeof u=="string"?C(o,u,g):j(o,u)}i.from=function(o,u,g){return m(null,o,u,g)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0}));function b(o){if(typeof o!="number")throw new TypeError('"size" argument must be a number');if(o<0)throw new RangeError('"size" argument must not be negative')}function _(o,u,g,A){return b(u),u<=0?d(o,u):g!==void 0?typeof A=="string"?d(o,u).fill(g,A):d(o,u).fill(g):d(o,u)}i.alloc=function(o,u,g){return _(null,o,u,g)};function M(o,u){if(b(u),o=d(o,u<0?0:N(u)|0),!i.TYPED_ARRAY_SUPPORT)for(var g=0;g<u;++g)o[g]=0;return o}i.allocUnsafe=function(o){return M(null,o)},i.allocUnsafeSlow=function(o){return M(null,o)};function C(o,u,g){if((typeof g!="string"||g==="")&&(g="utf8"),!i.isEncoding(g))throw new TypeError('"encoding" must be a valid string encoding');var A=B(u,g)|0;o=d(o,A);var R=o.write(u,g);return R!==A&&(o=o.slice(0,R)),o}function S(o,u){var g=u.length<0?0:N(u.length)|0;o=d(o,g);for(var A=0;A<g;A+=1)o[A]=u[A]&255;return o}function k(o,u,g,A){if(u.byteLength,g<0||u.byteLength<g)throw new RangeError("'offset' is out of bounds");if(u.byteLength<g+(A||0))throw new RangeError("'length' is out of bounds");return g===void 0&&A===void 0?u=new Uint8Array(u):A===void 0?u=new Uint8Array(u,g):u=new Uint8Array(u,g,A),i.TYPED_ARRAY_SUPPORT?(o=u,o.__proto__=i.prototype):o=S(o,u),o}function j(o,u){if(i.isBuffer(u)){var g=N(u.length)|0;return o=d(o,g),o.length===0||u.copy(o,0,0,g),o}if(u){if(typeof ArrayBuffer<"u"&&u.buffer instanceof ArrayBuffer||"length"in u)return typeof u.length!="number"||ce(u.length)?d(o,0):S(o,u);if(u.type==="Buffer"&&n(u.data))return S(o,u.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function N(o){if(o>=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return o|0}function z(o){return+o!=o&&(o=0),i.alloc(+o)}i.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},i.compare=function(o,u){if(!i.isBuffer(o)||!i.isBuffer(u))throw new TypeError("Arguments must be Buffers");if(o===u)return 0;for(var g=o.length,A=u.length,R=0,W=Math.min(g,A);R<W;++R)if(o[R]!==u[R]){g=o[R],A=u[R];break}return g<A?-1:A<g?1:0},i.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(o,u){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return i.alloc(0);var g;if(u===void 0)for(u=0,g=0;g<o.length;++g)u+=o[g].length;var A=i.allocUnsafe(u),R=0;for(g=0;g<o.length;++g){var W=o[g];if(!i.isBuffer(W))throw new TypeError('"list" argument must be an Array of Buffers');W.copy(A,R),R+=W.length}return A};function B(o,u){if(i.isBuffer(o))return o.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(o)||o instanceof ArrayBuffer))return o.byteLength;typeof o!="string"&&(o=""+o);var g=o.length;if(g===0)return 0;for(var A=!1;;)switch(u){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":case void 0:return E(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return I(o).length;default:if(A)return E(o).length;u=(""+u).toLowerCase(),A=!0}}i.byteLength=B;function Q(o,u,g){var A=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,u>>>=0,g<=u))return"";for(o||(o="utf8");;)switch(o){case"hex":return p(this,u,g);case"utf8":case"utf-8":return P(this,u,g);case"ascii":return h(this,u,g);case"latin1":case"binary":return l(this,u,g);case"base64":return X(this,u,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,u,g);default:if(A)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),A=!0}}i.prototype._isBuffer=!0;function U(o,u,g){var A=o[u];o[u]=o[g],o[g]=A}i.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var u=0;u<o;u+=2)U(this,u,u+1);return this},i.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var u=0;u<o;u+=4)U(this,u,u+3),U(this,u+1,u+2);return this},i.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var u=0;u<o;u+=8)U(this,u,u+7),U(this,u+1,u+6),U(this,u+2,u+5),U(this,u+3,u+4);return this},i.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?P(this,0,o):Q.apply(this,arguments)},i.prototype.equals=function(o){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:i.compare(this,o)===0},i.prototype.inspect=function(){var o="",u=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,u).match(/.{2}/g).join(" "),this.length>u&&(o+=" ... ")),"<Buffer "+o+">"},i.prototype.compare=function(o,u,g,A,R){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(u===void 0&&(u=0),g===void 0&&(g=o?o.length:0),A===void 0&&(A=0),R===void 0&&(R=this.length),u<0||g>o.length||A<0||R>this.length)throw new RangeError("out of range index");if(A>=R&&u>=g)return 0;if(A>=R)return-1;if(u>=g)return 1;if(u>>>=0,g>>>=0,A>>>=0,R>>>=0,this===o)return 0;for(var W=R-A,le=g-u,he=Math.min(W,le),pe=this.slice(A,R),oe=o.slice(u,g),fe=0;fe<he;++fe)if(pe[fe]!==oe[fe]){W=pe[fe],le=oe[fe];break}return W<le?-1:le<W?1:0};function te(o,u,g,A,R){if(o.length===0)return-1;if(typeof g=="string"?(A=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,isNaN(g)&&(g=R?0:o.length-1),g<0&&(g=o.length+g),g>=o.length){if(R)return-1;g=o.length-1}else if(g<0)if(R)g=0;else return-1;if(typeof u=="string"&&(u=i.from(u,A)),i.isBuffer(u))return u.length===0?-1:ne(o,u,g,A,R);if(typeof u=="number")return u=u&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(o,u,g):Uint8Array.prototype.lastIndexOf.call(o,u,g):ne(o,[u],g,A,R);throw new TypeError("val must be string, number or Buffer")}function ne(o,u,g,A,R){var W=1,le=o.length,he=u.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(o.length<2||u.length<2)return-1;W=2,le/=2,he/=2,g/=2}function pe(ve,xe){return W===1?ve[xe]:ve.readUInt16BE(xe*W)}var oe;if(R){var fe=-1;for(oe=g;oe<le;oe++)if(pe(o,oe)===pe(u,fe===-1?0:oe-fe)){if(fe===-1&&(fe=oe),oe-fe+1===he)return fe*W}else fe!==-1&&(oe-=oe-fe),fe=-1}else for(g+he>le&&(g=le-he),oe=g;oe>=0;oe--){for(var ge=!0,me=0;me<he;me++)if(pe(o,oe+me)!==pe(u,me)){ge=!1;break}if(ge)return oe}return-1}i.prototype.includes=function(o,u,g){return this.indexOf(o,u,g)!==-1},i.prototype.indexOf=function(o,u,g){return te(this,o,u,g,!0)},i.prototype.lastIndexOf=function(o,u,g){return te(this,o,u,g,!1)};function G(o,u,g,A){g=Number(g)||0;var R=o.length-g;A?(A=Number(A),A>R&&(A=R)):A=R;var W=u.length;if(W%2!==0)throw new TypeError("Invalid hex string");A>W/2&&(A=W/2);for(var le=0;le<A;++le){var he=parseInt(u.substr(le*2,2),16);if(isNaN(he))return le;o[g+le]=he}return le}function J(o,u,g,A){return Y(E(u,o.length-g),o,g,A)}function q(o,u,g,A){return Y(L(u),o,g,A)}function V(o,u,g,A){return q(o,u,g,A)}function Z(o,u,g,A){return Y(I(u),o,g,A)}function ae(o,u,g,A){return Y($(u,o.length-g),o,g,A)}i.prototype.write=function(o,u,g,A){if(u===void 0)A="utf8",g=this.length,u=0;else if(g===void 0&&typeof u=="string")A=u,g=this.length,u=0;else if(isFinite(u))u=u|0,isFinite(g)?(g=g|0,A===void 0&&(A="utf8")):(A=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var R=this.length-u;if((g===void 0||g>R)&&(g=R),o.length>0&&(g<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");for(var W=!1;;)switch(A){case"hex":return G(this,o,u,g);case"utf8":case"utf-8":return J(this,o,u,g);case"ascii":return q(this,o,u,g);case"latin1":case"binary":return V(this,o,u,g);case"base64":return Z(this,o,u,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,o,u,g);default:if(W)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),W=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X(o,u,g){return u===0&&g===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(u,g))}function P(o,u,g){g=Math.min(o.length,g);for(var A=[],R=u;R<g;){var W=o[R],le=null,he=W>239?4:W>223?3:W>191?2:1;if(R+he<=g){var pe,oe,fe,ge;switch(he){case 1:W<128&&(le=W);break;case 2:pe=o[R+1],(pe&192)===128&&(ge=(W&31)<<6|pe&63,ge>127&&(le=ge));break;case 3:pe=o[R+1],oe=o[R+2],(pe&192)===128&&(oe&192)===128&&(ge=(W&15)<<12|(pe&63)<<6|oe&63,ge>2047&&(ge<55296||ge>57343)&&(le=ge));break;case 4:pe=o[R+1],oe=o[R+2],fe=o[R+3],(pe&192)===128&&(oe&192)===128&&(fe&192)===128&&(ge=(W&15)<<18|(pe&63)<<12|(oe&63)<<6|fe&63,ge>65535&&ge<1114112&&(le=ge))}}le===null?(le=65533,he=1):le>65535&&(le-=65536,A.push(le>>>10&1023|55296),le=56320|le&1023),A.push(le),R+=he}return w(A)}var x=4096;function w(o){var u=o.length;if(u<=x)return String.fromCharCode.apply(String,o);for(var g="",A=0;A<u;)g+=String.fromCharCode.apply(String,o.slice(A,A+=x));return g}function h(o,u,g){var A="";g=Math.min(o.length,g);for(var R=u;R<g;++R)A+=String.fromCharCode(o[R]&127);return A}function l(o,u,g){var A="";g=Math.min(o.length,g);for(var R=u;R<g;++R)A+=String.fromCharCode(o[R]);return A}function p(o,u,g){var A=o.length;(!u||u<0)&&(u=0),(!g||g<0||g>A)&&(g=A);for(var R="",W=u;W<g;++W)R+=ue(o[W]);return R}function f(o,u,g){for(var A=o.slice(u,g),R="",W=0;W<A.length;W+=2)R+=String.fromCharCode(A[W]+A[W+1]*256);return R}i.prototype.slice=function(o,u){var g=this.length;o=~~o,u=u===void 0?g:~~u,o<0?(o+=g,o<0&&(o=0)):o>g&&(o=g),u<0?(u+=g,u<0&&(u=0)):u>g&&(u=g),u<o&&(u=o);var A;if(i.TYPED_ARRAY_SUPPORT)A=this.subarray(o,u),A.__proto__=i.prototype;else{var R=u-o;A=new i(R,void 0);for(var W=0;W<R;++W)A[W]=this[W+o]}return A};function a(o,u,g){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+u>g)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(o,u,g){o=o|0,u=u|0,g||a(o,u,this.length);for(var A=this[o],R=1,W=0;++W<u&&(R*=256);)A+=this[o+W]*R;return A},i.prototype.readUIntBE=function(o,u,g){o=o|0,u=u|0,g||a(o,u,this.length);for(var A=this[o+--u],R=1;u>0&&(R*=256);)A+=this[o+--u]*R;return A},i.prototype.readUInt8=function(o,u){return u||a(o,1,this.length),this[o]},i.prototype.readUInt16LE=function(o,u){return u||a(o,2,this.length),this[o]|this[o+1]<<8},i.prototype.readUInt16BE=function(o,u){return u||a(o,2,this.length),this[o]<<8|this[o+1]},i.prototype.readUInt32LE=function(o,u){return u||a(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},i.prototype.readUInt32BE=function(o,u){return u||a(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},i.prototype.readIntLE=function(o,u,g){o=o|0,u=u|0,g||a(o,u,this.length);for(var A=this[o],R=1,W=0;++W<u&&(R*=256);)A+=this[o+W]*R;return R*=128,A>=R&&(A-=Math.pow(2,8*u)),A},i.prototype.readIntBE=function(o,u,g){o=o|0,u=u|0,g||a(o,u,this.length);for(var A=u,R=1,W=this[o+--A];A>0&&(R*=256);)W+=this[o+--A]*R;return R*=128,W>=R&&(W-=Math.pow(2,8*u)),W},i.prototype.readInt8=function(o,u){return u||a(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},i.prototype.readInt16LE=function(o,u){u||a(o,2,this.length);var g=this[o]|this[o+1]<<8;return g&32768?g|4294901760:g},i.prototype.readInt16BE=function(o,u){u||a(o,2,this.length);var g=this[o+1]|this[o]<<8;return g&32768?g|4294901760:g},i.prototype.readInt32LE=function(o,u){return u||a(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},i.prototype.readInt32BE=function(o,u){return u||a(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},i.prototype.readFloatLE=function(o,u){return u||a(o,4,this.length),r.read(this,o,!0,23,4)},i.prototype.readFloatBE=function(o,u){return u||a(o,4,this.length),r.read(this,o,!1,23,4)},i.prototype.readDoubleLE=function(o,u){return u||a(o,8,this.length),r.read(this,o,!0,52,8)},i.prototype.readDoubleBE=function(o,u){return u||a(o,8,this.length),r.read(this,o,!1,52,8)};function v(o,u,g,A,R,W){if(!i.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>R||u<W)throw new RangeError('"value" argument is out of bounds');if(g+A>o.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(o,u,g,A){if(o=+o,u=u|0,g=g|0,!A){var R=Math.pow(2,8*g)-1;v(this,o,u,g,R,0)}var W=1,le=0;for(this[u]=o&255;++le<g&&(W*=256);)this[u+le]=o/W&255;return u+g},i.prototype.writeUIntBE=function(o,u,g,A){if(o=+o,u=u|0,g=g|0,!A){var R=Math.pow(2,8*g)-1;v(this,o,u,g,R,0)}var W=g-1,le=1;for(this[u+W]=o&255;--W>=0&&(le*=256);)this[u+W]=o/le&255;return u+g},i.prototype.writeUInt8=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,1,255,0),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[u]=o&255,u+1};function D(o,u,g,A){u<0&&(u=65535+u+1);for(var R=0,W=Math.min(o.length-g,2);R<W;++R)o[g+R]=(u&255<<8*(A?R:1-R))>>>(A?R:1-R)*8}i.prototype.writeUInt16LE=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[u]=o&255,this[u+1]=o>>>8):D(this,o,u,!0),u+2},i.prototype.writeUInt16BE=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[u]=o>>>8,this[u+1]=o&255):D(this,o,u,!1),u+2};function T(o,u,g,A){u<0&&(u=4294967295+u+1);for(var R=0,W=Math.min(o.length-g,4);R<W;++R)o[g+R]=u>>>(A?R:3-R)*8&255}i.prototype.writeUInt32LE=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[u+3]=o>>>24,this[u+2]=o>>>16,this[u+1]=o>>>8,this[u]=o&255):T(this,o,u,!0),u+4},i.prototype.writeUInt32BE=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[u]=o>>>24,this[u+1]=o>>>16,this[u+2]=o>>>8,this[u+3]=o&255):T(this,o,u,!1),u+4},i.prototype.writeIntLE=function(o,u,g,A){if(o=+o,u=u|0,!A){var R=Math.pow(2,8*g-1);v(this,o,u,g,R-1,-R)}var W=0,le=1,he=0;for(this[u]=o&255;++W<g&&(le*=256);)o<0&&he===0&&this[u+W-1]!==0&&(he=1),this[u+W]=(o/le>>0)-he&255;return u+g},i.prototype.writeIntBE=function(o,u,g,A){if(o=+o,u=u|0,!A){var R=Math.pow(2,8*g-1);v(this,o,u,g,R-1,-R)}var W=g-1,le=1,he=0;for(this[u+W]=o&255;--W>=0&&(le*=256);)o<0&&he===0&&this[u+W+1]!==0&&(he=1),this[u+W]=(o/le>>0)-he&255;return u+g},i.prototype.writeInt8=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,1,127,-128),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[u]=o&255,u+1},i.prototype.writeInt16LE=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[u]=o&255,this[u+1]=o>>>8):D(this,o,u,!0),u+2},i.prototype.writeInt16BE=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[u]=o>>>8,this[u+1]=o&255):D(this,o,u,!1),u+2},i.prototype.writeInt32LE=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[u]=o&255,this[u+1]=o>>>8,this[u+2]=o>>>16,this[u+3]=o>>>24):T(this,o,u,!0),u+4},i.prototype.writeInt32BE=function(o,u,g){return o=+o,u=u|0,g||v(this,o,u,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),i.TYPED_ARRAY_SUPPORT?(this[u]=o>>>24,this[u+1]=o>>>16,this[u+2]=o>>>8,this[u+3]=o&255):T(this,o,u,!1),u+4};function H(o,u,g,A,R,W){if(g+A>o.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function ee(o,u,g,A,R){return R||H(o,u,g,4),r.write(o,u,g,A,23,4),g+4}i.prototype.writeFloatLE=function(o,u,g){return ee(this,o,u,!0,g)},i.prototype.writeFloatBE=function(o,u,g){return ee(this,o,u,!1,g)};function re(o,u,g,A,R){return R||H(o,u,g,8),r.write(o,u,g,A,52,8),g+8}i.prototype.writeDoubleLE=function(o,u,g){return re(this,o,u,!0,g)},i.prototype.writeDoubleBE=function(o,u,g){return re(this,o,u,!1,g)},i.prototype.copy=function(o,u,g,A){if(g||(g=0),!A&&A!==0&&(A=this.length),u>=o.length&&(u=o.length),u||(u=0),A>0&&A<g&&(A=g),A===g||o.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=this.length)throw new RangeError("sourceStart out of bounds");if(A<0)throw new RangeError("sourceEnd out of bounds");A>this.length&&(A=this.length),o.length-u<A-g&&(A=o.length-u+g);var R=A-g,W;if(this===o&&g<u&&u<A)for(W=R-1;W>=0;--W)o[W+u]=this[W+g];else if(R<1e3||!i.TYPED_ARRAY_SUPPORT)for(W=0;W<R;++W)o[W+u]=this[W+g];else Uint8Array.prototype.set.call(o,this.subarray(g,g+R),u);return R},i.prototype.fill=function(o,u,g,A){if(typeof o=="string"){if(typeof u=="string"?(A=u,u=0,g=this.length):typeof g=="string"&&(A=g,g=this.length),o.length===1){var R=o.charCodeAt(0);R<256&&(o=R)}if(A!==void 0&&typeof A!="string")throw new TypeError("encoding must be a string");if(typeof A=="string"&&!i.isEncoding(A))throw new TypeError("Unknown encoding: "+A)}else typeof o=="number"&&(o=o&255);if(u<0||this.length<u||this.length<g)throw new RangeError("Out of range index");if(g<=u)return this;u=u>>>0,g=g===void 0?this.length:g>>>0,o||(o=0);var W;if(typeof o=="number")for(W=u;W<g;++W)this[W]=o;else{var le=i.isBuffer(o)?o:E(new i(o,A).toString()),he=le.length;for(W=0;W<g-u;++W)this[W+u]=le[W%he]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function se(o){if(o=ie(o).replace(F,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function ie(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function ue(o){return o<16?"0"+o.toString(16):o.toString(16)}function E(o,u){u=u||1/0;for(var g,A=o.length,R=null,W=[],le=0;le<A;++le){if(g=o.charCodeAt(le),g>55295&&g<57344){if(!R){if(g>56319){(u-=3)>-1&&W.push(239,191,189);continue}else if(le+1===A){(u-=3)>-1&&W.push(239,191,189);continue}R=g;continue}if(g<56320){(u-=3)>-1&&W.push(239,191,189),R=g;continue}g=(R-55296<<10|g-56320)+65536}else R&&(u-=3)>-1&&W.push(239,191,189);if(R=null,g<128){if((u-=1)<0)break;W.push(g)}else if(g<2048){if((u-=2)<0)break;W.push(g>>6|192,g&63|128)}else if(g<65536){if((u-=3)<0)break;W.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((u-=4)<0)break;W.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return W}function L(o){for(var u=[],g=0;g<o.length;++g)u.push(o.charCodeAt(g)&255);return u}function $(o,u){for(var g,A,R,W=[],le=0;le<o.length&&!((u-=2)<0);++le)g=o.charCodeAt(le),A=g>>8,R=g%256,W.push(R),W.push(A);return W}function I(o){return e.toByteArray(se(o))}function Y(o,u,g,A){for(var R=0;R<A&&!(R+g>=u.length||R>=o.length);++R)u[R+g]=o[R];return R}function ce(o){return o!==o}})(po)),po}Ri();var kt;if(typeof window<"u"&&window.crypto&&(kt=window.crypto),!kt&&typeof window<"u"&&window.msCrypto&&(kt=window.msCrypto),!kt&&typeof global<"u"&&global.crypto&&(kt=global.crypto),!kt&&typeof require=="function")try{kt=require("crypto")}catch{}var bo={};var en=function(t,e){return en=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)n.hasOwnProperty(s)&&(r[s]=n[s])},en(t,e)};function Ni(t,e){en(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var tn=function(){return tn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},tn.apply(this,arguments)};function Li(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Bi(t,e,r,n){var s=arguments.length,c=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(t,e,r,n);else for(var i=t.length-1;i>=0;i--)(d=t[i])&&(c=(s<3?d(c):s>3?d(e,r,c):d(e,r))||c);return s>3&&c&&Object.defineProperty(e,r,c),c}function Ii(t,e){return function(r,n){e(r,n,t)}}function Yi(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function zi(t,e,r,n){function s(c){return c instanceof r?c:new r(function(d){d(c)})}return new(r||(r=Promise))(function(c,d){function i(_){try{b(n.next(_))}catch(M){d(M)}}function m(_){try{b(n.throw(_))}catch(M){d(M)}}function b(_){_.done?c(_.value):s(_.value).then(i,m)}b((n=n.apply(t,e||[])).next())})}function Fi(t,e){var r={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,d;return d={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function i(b){return function(_){return m([b,_])}}function m(b){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(c=b[0]&2?s.return:b[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,b[1])).done)return c;switch(s=0,c&&(b=[b[0]&2,c.value]),b[0]){case 0:case 1:c=b;break;case 4:return r.label++,{value:b[1],done:!1};case 5:r.label++,s=b[1],b=[0];continue;case 7:b=r.ops.pop(),r.trys.pop();continue;default:if(c=r.trys,!(c=c.length>0&&c[c.length-1])&&(b[0]===6||b[0]===2)){r=0;continue}if(b[0]===3&&(!c||b[1]>c[0]&&b[1]<c[3])){r.label=b[1];break}if(b[0]===6&&r.label<c[1]){r.label=c[1],c=b;break}if(c&&r.label<c[2]){r.label=c[2],r.ops.push(b);break}c[2]&&r.ops.pop(),r.trys.pop();continue}b=e.call(t,r)}catch(_){b=[6,_],s=0}finally{n=c=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}}function Wi(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Ui(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function rn(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,c=[],d;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)c.push(s.value)}catch(i){d={error:i}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(d)throw d.error}}return c}function qi(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(wo(arguments[e]));return t}function Vi(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var c=arguments[e],d=0,i=c.length;d<i;d++,s++)n[s]=c[d];return n}function Kt(t){return this instanceof Kt?(this.v=t,this):new Kt(t)}function Hi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,c=[];return s={},d("next"),d("throw"),d("return"),s[Symbol.asyncIterator]=function(){return this},s;function d(C){n[C]&&(s[C]=function(S){return new Promise(function(k,j){c.push([C,S,k,j])>1||i(C,S)})})}function i(C,S){try{m(n[C](S))}catch(k){M(c[0][3],k)}}function m(C){C.value instanceof Kt?Promise.resolve(C.value.v).then(b,_):M(c[0][2],C)}function b(C){i("next",C)}function _(C){i("throw",C)}function M(C,S){C(S),c.shift(),c.length&&i(c[0][0],c[0][1])}}function Gi(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,c){e[s]=t[s]?function(d){return(r=!r)?{value:Kt(t[s](d)),done:s==="return"}:c?c(d):d}:c}}function Qi(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof rn=="function"?rn(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(c){r[c]=t[c]&&function(d){return new Promise(function(i,m){d=t[c](d),s(i,m,d.done,d.value)})}}function s(c,d,i,m){Promise.resolve(m).then(function(b){c({value:b,done:i})},d)}}function Ki(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Zi(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Ji(t){return t&&t.__esModule?t:{default:t}}function Xi(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function ea(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const ta=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return tn},__asyncDelegator:Gi,__asyncGenerator:Hi,__asyncValues:Qi,__await:Kt,__awaiter:zi,__classPrivateFieldGet:Xi,__classPrivateFieldSet:ea,__createBinding:Wi,__decorate:Bi,__exportStar:Ui,__extends:Ni,__generator:Fi,__importDefault:Ji,__importStar:Zi,__makeTemplateObject:Ki,__metadata:Yi,__param:Ii,__read:wo,__rest:Li,__spread:qi,__spreadArrays:Vi,__values:rn},Symbol.toStringTag,{value:"Module"})),_o=Gr(ta);var Zt={},Ge={},xo;function Co(){return xo||(xo=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.MAX_HASHABLE_LENGTH=Ge.INIT=Ge.KEY=Ge.DIGEST_LENGTH=Ge.BLOCK_SIZE=void 0,Ge.BLOCK_SIZE=64,Ge.DIGEST_LENGTH=32,Ge.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ge.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Ge.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),Ge}var Jt={},So;function ra(){if(So)return Jt;So=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.RawSha256=void 0;var t=Co(),e=(function(){function r(){this.state=Int32Array.from(t.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(n){if(this.finished)throw new Error("Attempted to update an already finished hash.");var s=0,c=n.byteLength;if(this.bytesHashed+=c,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;c>0;)this.buffer[this.bufferLength++]=n[s++],c--,this.bufferLength===t.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var n=this.bytesHashed*8,s=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),c=this.bufferLength;if(s.setUint8(this.bufferLength++,128),c%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var d=this.bufferLength;d<t.BLOCK_SIZE;d++)s.setUint8(d,0);this.hashBuffer(),this.bufferLength=0}for(var d=this.bufferLength;d<t.BLOCK_SIZE-8;d++)s.setUint8(d,0);s.setUint32(t.BLOCK_SIZE-8,Math.floor(n/4294967296),!0),s.setUint32(t.BLOCK_SIZE-4,n),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(t.DIGEST_LENGTH),d=0;d<8;d++)i[d*4]=this.state[d]>>>24&255,i[d*4+1]=this.state[d]>>>16&255,i[d*4+2]=this.state[d]>>>8&255,i[d*4+3]=this.state[d]>>>0&255;return i},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,c=n.state,d=c[0],i=c[1],m=c[2],b=c[3],_=c[4],M=c[5],C=c[6],S=c[7],k=0;k<t.BLOCK_SIZE;k++){if(k<16)this.temp[k]=(s[k*4]&255)<<24|(s[k*4+1]&255)<<16|(s[k*4+2]&255)<<8|s[k*4+3]&255;else{var j=this.temp[k-2],N=(j>>>17|j<<15)^(j>>>19|j<<13)^j>>>10;j=this.temp[k-15];var z=(j>>>7|j<<25)^(j>>>18|j<<14)^j>>>3;this.temp[k]=(N+this.temp[k-7]|0)+(z+this.temp[k-16]|0)}var B=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&M^~_&C)|0)+(S+(t.KEY[k]+this.temp[k]|0)|0)|0,Q=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&i^d&m^i&m)|0;S=C,C=M,M=_,_=b+B|0,b=m,m=i,i=d,d=B+Q|0}c[0]+=d,c[1]+=i,c[2]+=m,c[3]+=b,c[4]+=_,c[5]+=M,c[6]+=C,c[7]+=S},r})();return Jt.RawSha256=e,Jt}var Do={},Xt={};const na=t=>{const e=[];for(let r=0,n=t.length;r<n;r++){const s=t.charCodeAt(r);if(s<128)e.push(s);else if(s<2048)e.push(s>>6|192,s&63|128);else if(r+1<t.length&&(s&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320){const c=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023);e.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},oa=t=>{let e="";for(let r=0,n=t.length;r<n;r++){const s=t[r];if(s<128)e+=String.fromCharCode(s);else if(192<=s&&s<224){const c=t[++r];e+=String.fromCharCode((s&31)<<6|c&63)}else if(240<=s&&s<365){const c="%"+[s,t[++r],t[++r],t[++r]].map(d=>d.toString(16)).join("%");e+=decodeURIComponent(c)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function sa(t){return new TextEncoder().encode(t)}function ia(t){return new TextDecoder("utf-8").decode(t)}const aa=t=>typeof TextEncoder=="function"?sa(t):na(t),la=t=>typeof TextDecoder=="function"?ia(t):oa(t),ua=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:aa,toUtf8:la},Symbol.toStringTag,{value:"Module"})),ca=Gr(ua);var ko;function da(){if(ko)return Xt;ko=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.convertToBuffer=void 0;var t=ca,e=typeof Buffer<"u"&&Buffer.from?function(n){return Buffer.from(n,"utf8")}:t.fromUtf8;function r(n){return n instanceof Uint8Array?n:typeof n=="string"?e(n):ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(n)}return Xt.convertToBuffer=r,Xt}var er={},Po;function ha(){if(Po)return er;Po=1,Object.defineProperty(er,"__esModule",{value:!0}),er.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return er.isEmptyData=t,er}var tr={},Mo;function fa(){if(Mo)return tr;Mo=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return tr.numToUint8=t,tr}var rr={},Oo;function pa(){if(Oo)return rr;Oo=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.uint32ArrayFrom=void 0;function t(e){if(!Array.from){for(var r=new Uint32Array(e.length),n=0;n<e.length;)r[n]=e[n];return r}return Uint32Array.from(e)}return rr.uint32ArrayFrom=t,rr}var jo;function ga(){return jo||(jo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=da();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=ha();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=fa();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=pa();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})})(Do)),Do}var Ao;function ma(){if(Ao)return Zt;Ao=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.Sha256=void 0;var t=_o,e=Co(),r=ra(),n=ga(),s=(function(){function d(i){if(this.hash=new r.RawSha256,i){this.outer=new r.RawSha256;var m=c(i),b=new Uint8Array(e.BLOCK_SIZE);b.set(m);for(var _=0;_<e.BLOCK_SIZE;_++)m[_]^=54,b[_]^=92;this.hash.update(m),this.outer.update(b);for(var _=0;_<m.byteLength;_++)m[_]=0}}return d.prototype.update=function(i){if(!((0,n.isEmptyData)(i)||this.error))try{this.hash.update((0,n.convertToBuffer)(i))}catch(m){this.error=m}},d.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},d.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(i){return[2,this.digestSync()]})})},d})();Zt.Sha256=s;function c(d){var i=(0,n.convertToBuffer)(d);if(i.byteLength>e.BLOCK_SIZE){var m=new r.RawSha256;m.update(i),i=m.digest()}var b=new Uint8Array(e.BLOCK_SIZE);return b.set(i),b}return Zt}var Eo;function ya(){return Eo||(Eo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_o;(0,e.__exportStar)(ma(),t)})(bo)),bo}ya();function ye(t,e){t!=null&&this.fromString(t,e)}function Ie(){return new ye(null)}var gt,va=0xdeadbeefcafe,To=(va&16777215)==15715070;function ba(t,e,r,n,s,c){for(;--c>=0;){var d=e*this[t++]+r[n]+s;s=Math.floor(d/67108864),r[n++]=d&67108863}return s}function wa(t,e,r,n,s,c){for(var d=e&32767,i=e>>15;--c>=0;){var m=this[t]&32767,b=this[t++]>>15,_=i*m+b*d;m=d*m+((_&32767)<<15)+r[n]+(s&1073741823),s=(m>>>30)+(_>>>15)+i*b+(s>>>30),r[n++]=m&1073741823}return s}function _a(t,e,r,n,s,c){for(var d=e&16383,i=e>>14;--c>=0;){var m=this[t]&16383,b=this[t++]>>14,_=i*m+b*d;m=d*m+((_&16383)<<14)+r[n]+s,s=(m>>28)+(_>>14)+i*b,r[n++]=m&268435455}return s}var $o=typeof navigator<"u";$o&&To&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=wa,gt=30):$o&&To&&navigator.appName!="Netscape"?(ye.prototype.am=ba,gt=26):(ye.prototype.am=_a,gt=28),ye.prototype.DB=gt,ye.prototype.DM=(1<<gt)-1,ye.prototype.DV=1<<gt;var nn=52;ye.prototype.FV=Math.pow(2,nn),ye.prototype.F1=nn-gt,ye.prototype.F2=2*gt-nn;var xa="0123456789abcdefghijklmnopqrstuvwxyz",fr=new Array,Rt,Qe;for(Rt=48,Qe=0;Qe<=9;++Qe)fr[Rt++]=Qe;for(Rt=97,Qe=10;Qe<36;++Qe)fr[Rt++]=Qe;for(Rt=65,Qe=10;Qe<36;++Qe)fr[Rt++]=Qe;function Ro(t){return xa.charAt(t)}function Ca(t,e){var r=fr[t.charCodeAt(e)];return r??-1}function Sa(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function Da(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function on(t){var e=Ie();return e.fromInt(t),e}function ka(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;for(var n=t.length,s=!1,c=0;--n>=0;){var d=Ca(t,n);if(d<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,c==0?this[this.t++]=d:c+r>this.DB?(this[this.t-1]|=(d&(1<<this.DB-c)-1)<<c,this[this.t++]=d>>this.DB-c):this[this.t-1]|=d<<c,c+=r,c>=this.DB&&(c-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function Pa(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function Ma(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");var r=(1<<e)-1,n,s=!1,c="",d=this.t,i=this.DB-d*this.DB%e;if(d-- >0)for(i<this.DB&&(n=this[d]>>i)>0&&(s=!0,c=Ro(n));d>=0;)i<e?(n=(this[d]&(1<<i)-1)<<e-i,n|=this[--d]>>(i+=this.DB-e)):(n=this[d]>>(i-=e)&r,i<=0&&(i+=this.DB,--d)),n>0&&(s=!0),s&&(c+=Ro(n));return s?c:"0"}function Oa(){var t=Ie();return ye.ZERO.subTo(this,t),t}function ja(){return this.s<0?this.negate():this}function Aa(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this[r]-t[r])!=0)return e;return 0}function sn(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Ea(){return this.t<=0?0:this.DB*(this.t-1)+sn(this[this.t-1]^this.s&this.DM)}function Ta(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}function $a(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}function Ra(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,c=Math.floor(t/this.DB),d=this.s<<r&this.DM,i;for(i=this.t-1;i>=0;--i)e[i+c+1]=this[i]>>n|d,d=(this[i]&s)<<r;for(i=c-1;i>=0;--i)e[i]=0;e[c]=d,e.t=this.t+c+1,e.s=this.s,e.clamp()}function Na(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,s=this.DB-n,c=(1<<n)-1;e[0]=this[r]>>n;for(var d=r+1;d<this.t;++d)e[d-r-1]|=(this[d]&c)<<s,e[d-r]=this[d]>>n;n>0&&(e[this.t-r-1]|=(this.s&c)<<s),e.t=this.t-r,e.clamp()}function La(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()}function Ba(t,e){var r=this.abs(),n=t.abs(),s=r.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s<n.t;++s)e[s+r.t]=r.am(0,n[s],e,s,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&ye.ZERO.subTo(e,e)}function Ia(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function Ya(t,e,r){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=Ie());var c=Ie(),d=this.s,i=t.s,m=this.DB-sn(n[n.t-1]);m>0?(n.lShiftTo(m,c),s.lShiftTo(m,r)):(n.copyTo(c),s.copyTo(r));var b=c.t,_=c[b-1];if(_!=0){var M=_*(1<<this.F1)+(b>1?c[b-2]>>this.F2:0),C=this.FV/M,S=(1<<this.F1)/M,k=1<<this.F2,j=r.t,N=j-b,z=e??Ie();for(c.dlShiftTo(N,z),r.compareTo(z)>=0&&(r[r.t++]=1,r.subTo(z,r)),ye.ONE.dlShiftTo(b,z),z.subTo(c,c);c.t<b;)c[c.t++]=0;for(;--N>=0;){var B=r[--j]==_?this.DM:Math.floor(r[j]*C+(r[j-1]+k)*S);if((r[j]+=c.am(0,B,r,N,0,b))<B)for(c.dlShiftTo(N,z),r.subTo(z,r);r[j]<--B;)r.subTo(z,r)}e!=null&&(r.drShiftTo(b,e),d!=i&&ye.ZERO.subTo(e,e)),r.t=b,r.clamp(),m>0&&r.rShiftTo(m,r),d<0&&ye.ZERO.subTo(r,r)}}}function za(t){var e=Ie();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function Fa(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Wa(t){return this.compareTo(t)==0}function Ua(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()}function qa(t){var e=Ie();return this.addTo(t,e),e}function Va(t){var e=Ie();return this.subTo(t,e),e}function Ha(t){var e=Ie();return this.multiplyTo(t,e),e}function Ga(t){var e=Ie();return this.divRemTo(t,e,null),e}function Nt(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function Qa(t){var e=Ie();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(ye.ZERO)>0&&this.m.subTo(e,e),e}function Ka(t){var e=Ie();return t.copyTo(e),this.reduce(e),e}function Za(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t[e]&32767,n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function Ja(t,e){t.squareTo(e),this.reduce(e)}function Xa(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Nt.prototype.convert=Qa,Nt.prototype.revert=Ka,Nt.prototype.reduce=Za,Nt.prototype.mulTo=Xa,Nt.prototype.sqrTo=Ja;function el(t,e,r){var n=t.bitLength(),s,c=on(1),d=new Nt(e);if(n<=0)return c;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6;var i=new Array,m=3,b=s-1,_=(1<<s)-1;if(i[1]=d.convert(this),s>1){var M=Ie();for(d.sqrTo(i[1],M);m<=_;)i[m]=Ie(),d.mulTo(M,i[m-2],i[m]),m+=2}var C=t.t-1,S,k=!0,j=Ie(),N;for(n=sn(t[C])-1;C>=0;){for(n>=b?S=t[C]>>n-b&_:(S=(t[C]&(1<<n+1)-1)<<b-n,C>0&&(S|=t[C-1]>>this.DB+n-b)),m=s;(S&1)==0;)S>>=1,--m;if((n-=m)<0&&(n+=this.DB,--C),k)i[S].copyTo(c),k=!1;else{for(;m>1;)d.sqrTo(c,j),d.sqrTo(j,c),m-=2;m>0?d.sqrTo(c,j):(N=c,c=j,j=N),d.mulTo(j,i[S],c)}for(;C>=0&&(t[C]&1<<n)==0;)d.sqrTo(c,j),N=c,c=j,j=N,--n<0&&(n=this.DB-1,--C)}var z=d.revert(c);return r(null,z),z}ye.prototype.copyTo=Sa,ye.prototype.fromInt=Da,ye.prototype.fromString=ka,ye.prototype.clamp=Pa,ye.prototype.dlShiftTo=Ta,ye.prototype.drShiftTo=$a,ye.prototype.lShiftTo=Ra,ye.prototype.rShiftTo=Na,ye.prototype.subTo=La,ye.prototype.multiplyTo=Ba,ye.prototype.squareTo=Ia,ye.prototype.divRemTo=Ya,ye.prototype.invDigit=Fa,ye.prototype.addTo=Ua,ye.prototype.toString=Ma,ye.prototype.negate=Oa,ye.prototype.abs=ja,ye.prototype.compareTo=Aa,ye.prototype.bitLength=Ea,ye.prototype.mod=za,ye.prototype.equals=Wa,ye.prototype.add=qa,ye.prototype.subtract=Va,ye.prototype.multiply=Ha,ye.prototype.divide=Ga,ye.prototype.modPow=el,ye.ZERO=on(0),ye.ONE=on(1);function tl(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,c=[],d=[],i={},m=function(){return{ok:(s.status/100|0)==2,statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:m,headers:{keys:function(){return c},entries:function(){return d},get:function(_){return i[_.toLowerCase()]},has:function(_){return _.toLowerCase()in i}}}};for(var b in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,M,C){c.push(M=M.toLowerCase()),d.push([M,C]),i[M]=i[M]?i[M]+","+C:C}),r(m())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(b,e.headers[b]);s.send(e.body||null)})}const rl=Object.freeze(Object.defineProperty({__proto__:null,default:tl},Symbol.toStringTag,{value:"Module"})),No=Gr(rl);var Lo,Bo;function nl(){return Bo||(Bo=1,Lo=self.fetch||(self.fetch=No.default||No)),Lo}nl();var Io={exports:{}};var Yo;function ol(){return Yo||(Yo=1,(function(t,e){(function(r){var n;if(t.exports=r(),n=!0,!n){var s=window.Cookies,c=window.Cookies=r();c.noConflict=function(){return window.Cookies=s,c}}})(function(){function r(){for(var c=0,d={};c<arguments.length;c++){var i=arguments[c];for(var m in i)d[m]=i[m]}return d}function n(c){return c.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(c){function d(){}function i(b,_,M){if(!(typeof document>"u")){M=r({path:"/"},d.defaults,M),typeof M.expires=="number"&&(M.expires=new Date(new Date*1+M.expires*864e5)),M.expires=M.expires?M.expires.toUTCString():"";try{var C=JSON.stringify(_);/^[\{\[]/.test(C)&&(_=C)}catch{}_=c.write?c.write(_,b):encodeURIComponent(String(_)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var S="";for(var k in M)M[k]&&(S+="; "+k,M[k]!==!0&&(S+="="+M[k].split(";")[0]));return document.cookie=b+"="+_+S}}function m(b,_){if(!(typeof document>"u")){for(var M={},C=document.cookie?document.cookie.split("; "):[],S=0;S<C.length;S++){var k=C[S].split("="),j=k.slice(1).join("=");!_&&j.charAt(0)==='"'&&(j=j.slice(1,-1));try{var N=n(k[0]);if(j=(c.read||c)(j,N)||n(j),_)try{j=JSON.parse(j)}catch{}if(M[N]=j,b===N)break}catch{}}return b?M[b]:M}}return d.set=i,d.get=function(b){return m(b,!1)},d.getJSON=function(b){return m(b,!0)},d.remove=function(b,_){i(b,"",r(_,{expires:-1}))},d.defaults={},d.withConverter=s,d}return s(function(){})})})(Io)),Io.exports}ol();function sl(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function il(){return sl().getCurrentUser()}function al(){return new Promise((t,e)=>{const r=il();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function ll(){const{session:t}=await al();return t?.getIdToken().getJwtToken()}K.createContext(void 0);var ul="undefined",cl="object",pr="browser",zo="cpu",Fo="device",an="engine",gr="os",mt="name",mr="type",ln="vendor",nt="version",un="architecture",cn="major",dn="model",dl="console",hl="mobile",fl="tablet",pl="smarttv",gl="wearable",ml="embedded",yl=typeof window!==ul,hn=yl&&window.navigator?window.navigator:void 0;hn&&hn.userAgentData&&hn.userAgentData;var yr=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},vr=function(t){for(var e in t){var r=t[e];typeof r==cl&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return vr.call(t.init,[[pr,[mt,nt,cn,mr]],[zo,[un]],[Fo,[mr,dn,ln]],[an,[mt,nt]],[gr,[mt,nt]]]),vr.call(t.isIgnore,[[pr,[nt,cn]],[an,[nt]],[gr,[nt]]]),vr.call(t.isIgnoreRgx,[[pr,/ ?browser$/i],[gr,/ ?os$/i]]),vr.call(t.toString,[[pr,[mt,nt]],[zo,[un]],[Fo,[ln,dn]],[an,[mt,nt]],[gr,[mt,nt]]]),t})(),yr([mt,nt,cn,mr]),yr([un]),yr([dn,ln,mr,dl,hl,pl,fl,gl,ml]),yr([mt,nt]);var fn={exports:{}},vl=fn.exports,Wo;function bl(){return Wo||(Wo=1,(function(t,e){(function(r,n){t.exports=n()})(vl,()=>(()=>{var r={873:(d,i)=>{var m,b,_=(function(){var M=function(P,x){var w=P,h=z[x],l=null,p=0,f=null,a=[],v={},D=function(E,L){l=(function($){for(var I=new Array($),Y=0;Y<$;Y+=1){I[Y]=new Array($);for(var ce=0;ce<$;ce+=1)I[Y][ce]=null}return I})(p=4*w+17),T(0,0),T(p-7,0),T(0,p-7),ee(),H(),F(E,L),w>=7&&re(E),f==null&&(f=ie(w,h,a)),se(f,L)},T=function(E,L){for(var $=-1;$<=7;$+=1)if(!(E+$<=-1||p<=E+$))for(var I=-1;I<=7;I+=1)L+I<=-1||p<=L+I||(l[E+$][L+I]=0<=$&&$<=6&&(I==0||I==6)||0<=I&&I<=6&&($==0||$==6)||2<=$&&$<=4&&2<=I&&I<=4)},H=function(){for(var E=8;E<p-8;E+=1)l[E][6]==null&&(l[E][6]=E%2==0);for(var L=8;L<p-8;L+=1)l[6][L]==null&&(l[6][L]=L%2==0)},ee=function(){for(var E=B.getPatternPosition(w),L=0;L<E.length;L+=1)for(var $=0;$<E.length;$+=1){var I=E[L],Y=E[$];if(l[I][Y]==null)for(var ce=-2;ce<=2;ce+=1)for(var o=-2;o<=2;o+=1)l[I+ce][Y+o]=ce==-2||ce==2||o==-2||o==2||ce==0&&o==0}},re=function(E){for(var L=B.getBCHTypeNumber(w),$=0;$<18;$+=1){var I=!E&&(L>>$&1)==1;l[Math.floor($/3)][$%3+p-8-3]=I}for($=0;$<18;$+=1)I=!E&&(L>>$&1)==1,l[$%3+p-8-3][Math.floor($/3)]=I},F=function(E,L){for(var $=h<<3|L,I=B.getBCHTypeInfo($),Y=0;Y<15;Y+=1){var ce=!E&&(I>>Y&1)==1;Y<6?l[Y][8]=ce:Y<8?l[Y+1][8]=ce:l[p-15+Y][8]=ce}for(Y=0;Y<15;Y+=1)ce=!E&&(I>>Y&1)==1,Y<8?l[8][p-Y-1]=ce:Y<9?l[8][15-Y-1+1]=ce:l[8][15-Y-1]=ce;l[p-8][8]=!E},se=function(E,L){for(var $=-1,I=p-1,Y=7,ce=0,o=B.getMaskFunction(L),u=p-1;u>0;u-=2)for(u==6&&(u-=1);;){for(var g=0;g<2;g+=1)if(l[I][u-g]==null){var A=!1;ce<E.length&&(A=(E[ce]>>>Y&1)==1),o(I,u-g)&&(A=!A),l[I][u-g]=A,(Y-=1)==-1&&(ce+=1,Y=7)}if((I+=$)<0||p<=I){I-=$,$=-$;break}}},ie=function(E,L,$){for(var I=te.getRSBlocks(E,L),Y=ne(),ce=0;ce<$.length;ce+=1){var o=$[ce];Y.put(o.getMode(),4),Y.put(o.getLength(),B.getLengthInBits(o.getMode(),E)),o.write(Y)}var u=0;for(ce=0;ce<I.length;ce+=1)u+=I[ce].dataCount;if(Y.getLengthInBits()>8*u)throw"code length overflow. ("+Y.getLengthInBits()+">"+8*u+")";for(Y.getLengthInBits()+4<=8*u&&Y.put(0,4);Y.getLengthInBits()%8!=0;)Y.putBit(!1);for(;!(Y.getLengthInBits()>=8*u||(Y.put(236,8),Y.getLengthInBits()>=8*u));)Y.put(17,8);return(function(g,A){for(var R=0,W=0,le=0,he=new Array(A.length),pe=new Array(A.length),oe=0;oe<A.length;oe+=1){var fe=A[oe].dataCount,ge=A[oe].totalCount-fe;W=Math.max(W,fe),le=Math.max(le,ge),he[oe]=new Array(fe);for(var me=0;me<he[oe].length;me+=1)he[oe][me]=255&g.getBuffer()[me+R];R+=fe;var ve=B.getErrorCorrectPolynomial(ge),xe=U(he[oe],ve.getLength()-1).mod(ve);for(pe[oe]=new Array(ve.getLength()-1),me=0;me<pe[oe].length;me+=1){var ke=me+xe.getLength()-pe[oe].length;pe[oe][me]=ke>=0?xe.getAt(ke):0}}var We=0;for(me=0;me<A.length;me+=1)We+=A[me].totalCount;var Ee=new Array(We),Pe=0;for(me=0;me<W;me+=1)for(oe=0;oe<A.length;oe+=1)me<he[oe].length&&(Ee[Pe]=he[oe][me],Pe+=1);for(me=0;me<le;me+=1)for(oe=0;oe<A.length;oe+=1)me<pe[oe].length&&(Ee[Pe]=pe[oe][me],Pe+=1);return Ee})(Y,I)};v.addData=function(E,L){var $=null;switch(L=L||"Byte"){case"Numeric":$=G(E);break;case"Alphanumeric":$=J(E);break;case"Byte":$=q(E);break;case"Kanji":$=V(E);break;default:throw"mode:"+L}a.push($),f=null},v.isDark=function(E,L){if(E<0||p<=E||L<0||p<=L)throw E+","+L;return l[E][L]},v.getModuleCount=function(){return p},v.make=function(){if(w<1){for(var E=1;E<40;E++){for(var L=te.getRSBlocks(E,h),$=ne(),I=0;I<a.length;I++){var Y=a[I];$.put(Y.getMode(),4),$.put(Y.getLength(),B.getLengthInBits(Y.getMode(),E)),Y.write($)}var ce=0;for(I=0;I<L.length;I++)ce+=L[I].dataCount;if($.getLengthInBits()<=8*ce)break}w=E}D(!1,(function(){for(var o=0,u=0,g=0;g<8;g+=1){D(!0,g);var A=B.getLostPoint(v);(g==0||o>A)&&(o=A,u=g)}return u})())},v.createTableTag=function(E,L){E=E||2;var $="";$+='<table style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: "+(L=L===void 0?4*E:L)+"px;",$+='">',$+="<tbody>";for(var I=0;I<v.getModuleCount();I+=1){$+="<tr>";for(var Y=0;Y<v.getModuleCount();Y+=1)$+='<td style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: 0px;",$+=" width: "+E+"px;",$+=" height: "+E+"px;",$+=" background-color: ",$+=v.isDark(I,Y)?"#000000":"#ffffff",$+=";",$+='"/>';$+="</tr>"}return($+="</tbody>")+"</table>"},v.createSvgTag=function(E,L,$,I){var Y={};typeof arguments[0]=="object"&&(E=(Y=arguments[0]).cellSize,L=Y.margin,$=Y.alt,I=Y.title),E=E||2,L=L===void 0?4*E:L,($=typeof $=="string"?{text:$}:$||{}).text=$.text||null,$.id=$.text?$.id||"qrcode-description":null,(I=typeof I=="string"?{text:I}:I||{}).text=I.text||null,I.id=I.text?I.id||"qrcode-title":null;var ce,o,u,g,A=v.getModuleCount()*E+2*L,R="";for(g="l"+E+",0 0,"+E+" -"+E+",0 0,-"+E+"z ",R+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',R+=Y.scalable?"":' width="'+A+'px" height="'+A+'px"',R+=' viewBox="0 0 '+A+" "+A+'" ',R+=' preserveAspectRatio="xMinYMin meet"',R+=I.text||$.text?' role="img" aria-labelledby="'+ue([I.id,$.id].join(" ").trim())+'"':"",R+=">",R+=I.text?'<title id="'+ue(I.id)+'">'+ue(I.text)+"</title>":"",R+=$.text?'<description id="'+ue($.id)+'">'+ue($.text)+"</description>":"",R+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',R+='<path d="',o=0;o<v.getModuleCount();o+=1)for(u=o*E+L,ce=0;ce<v.getModuleCount();ce+=1)v.isDark(o,ce)&&(R+="M"+(ce*E+L)+","+u+g);return(R+='" stroke="transparent" fill="black"/>')+"</svg>"},v.createDataURL=function(E,L){E=E||2,L=L===void 0?4*E:L;var $=v.getModuleCount()*E+2*L,I=L,Y=$-L;return X($,$,function(ce,o){if(I<=ce&&ce<Y&&I<=o&&o<Y){var u=Math.floor((ce-I)/E),g=Math.floor((o-I)/E);return v.isDark(g,u)?0:1}return 1})},v.createImgTag=function(E,L,$){E=E||2,L=L===void 0?4*E:L;var I=v.getModuleCount()*E+2*L,Y="";return Y+="<img",Y+=' src="',Y+=v.createDataURL(E,L),Y+='"',Y+=' width="',Y+=I,Y+='"',Y+=' height="',Y+=I,Y+='"',$&&(Y+=' alt="',Y+=ue($),Y+='"'),Y+"/>"};var ue=function(E){for(var L="",$=0;$<E.length;$+=1){var I=E.charAt($);switch(I){case"<":L+="<";break;case">":L+=">";break;case"&":L+="&";break;case'"':L+=""";break;default:L+=I}}return L};return v.createASCII=function(E,L){if((E=E||1)<2)return(function(he){he=he===void 0?2:he;var pe,oe,fe,ge,me,ve=1*v.getModuleCount()+2*he,xe=he,ke=ve-he,We={"██":"█","█ ":"▀"," █":"▄"," ":" "},Ee={"██":"▀","█ ":"▀"," █":" "," ":" "},Pe="";for(pe=0;pe<ve;pe+=2){for(fe=Math.floor((pe-xe)/1),ge=Math.floor((pe+1-xe)/1),oe=0;oe<ve;oe+=1)me="█",xe<=oe&&oe<ke&&xe<=pe&&pe<ke&&v.isDark(fe,Math.floor((oe-xe)/1))&&(me=" "),xe<=oe&&oe<ke&&xe<=pe+1&&pe+1<ke&&v.isDark(ge,Math.floor((oe-xe)/1))?me+=" ":me+="█",Pe+=he<1&&pe+1>=ke?Ee[me]:We[me];Pe+=`
|
|
20
|
-
`}return ve%2&&he>0?Pe.substring(0,Pe.length-ve-1)+Array(ve+1).join("▀"):Pe.substring(0,Pe.length-1)})(L);E-=1,L=L===void 0?2*E:L;var $,I,Y,ce,o=v.getModuleCount()*E+2*L,u=L,g=o-L,A=Array(E+1).join("██"),R=Array(E+1).join(" "),W="",le="";for($=0;$<o;$+=1){for(Y=Math.floor(($-u)/E),le="",I=0;I<o;I+=1)ce=1,u<=I&&I<g&&u<=$&&$<g&&v.isDark(Y,Math.floor((I-u)/E))&&(ce=0),le+=ce?A:R;for(Y=0;Y<E;Y+=1)W+=le+`
|
|
21
|
-
`}return W.substring(0,W.length-1)},v.renderTo2dContext=function(E,L){L=L||2;for(var $=v.getModuleCount(),I=0;I<$;I++)for(var Y=0;Y<$;Y++)E.fillStyle=v.isDark(I,Y)?"black":"white",E.fillRect(I*L,Y*L,L,L)},v};M.stringToBytes=(M.stringToBytesFuncs={default:function(P){for(var x=[],w=0;w<P.length;w+=1){var h=P.charCodeAt(w);x.push(255&h)}return x}}).default,M.createStringToBytes=function(P,x){var w=(function(){for(var l=ae(P),p=function(){var H=l.read();if(H==-1)throw"eof";return H},f=0,a={};;){var v=l.read();if(v==-1)break;var D=p(),T=p()<<8|p();a[String.fromCharCode(v<<8|D)]=T,f+=1}if(f!=x)throw f+" != "+x;return a})(),h=63;return function(l){for(var p=[],f=0;f<l.length;f+=1){var a=l.charCodeAt(f);if(a<128)p.push(a);else{var v=w[l.charAt(f)];typeof v=="number"?(255&v)==v?p.push(v):(p.push(v>>>8),p.push(255&v)):p.push(h)}}return p}};var C,S,k,j,N,z={L:1,M:0,Q:3,H:2},B=(C=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],S=1335,k=7973,N=function(P){for(var x=0;P!=0;)x+=1,P>>>=1;return x},(j={}).getBCHTypeInfo=function(P){for(var x=P<<10;N(x)-N(S)>=0;)x^=S<<N(x)-N(S);return 21522^(P<<10|x)},j.getBCHTypeNumber=function(P){for(var x=P<<12;N(x)-N(k)>=0;)x^=k<<N(x)-N(k);return P<<12|x},j.getPatternPosition=function(P){return C[P-1]},j.getMaskFunction=function(P){switch(P){case 0:return function(x,w){return(x+w)%2==0};case 1:return function(x,w){return x%2==0};case 2:return function(x,w){return w%3==0};case 3:return function(x,w){return(x+w)%3==0};case 4:return function(x,w){return(Math.floor(x/2)+Math.floor(w/3))%2==0};case 5:return function(x,w){return x*w%2+x*w%3==0};case 6:return function(x,w){return(x*w%2+x*w%3)%2==0};case 7:return function(x,w){return(x*w%3+(x+w)%2)%2==0};default:throw"bad maskPattern:"+P}},j.getErrorCorrectPolynomial=function(P){for(var x=U([1],0),w=0;w<P;w+=1)x=x.multiply(U([1,Q.gexp(w)],0));return x},j.getLengthInBits=function(P,x){if(1<=x&&x<10)switch(P){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+P}else if(x<27)switch(P){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+P}else{if(!(x<41))throw"type:"+x;switch(P){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+P}}},j.getLostPoint=function(P){for(var x=P.getModuleCount(),w=0,h=0;h<x;h+=1)for(var l=0;l<x;l+=1){for(var p=0,f=P.isDark(h,l),a=-1;a<=1;a+=1)if(!(h+a<0||x<=h+a))for(var v=-1;v<=1;v+=1)l+v<0||x<=l+v||a==0&&v==0||f==P.isDark(h+a,l+v)&&(p+=1);p>5&&(w+=3+p-5)}for(h=0;h<x-1;h+=1)for(l=0;l<x-1;l+=1){var D=0;P.isDark(h,l)&&(D+=1),P.isDark(h+1,l)&&(D+=1),P.isDark(h,l+1)&&(D+=1),P.isDark(h+1,l+1)&&(D+=1),D!=0&&D!=4||(w+=3)}for(h=0;h<x;h+=1)for(l=0;l<x-6;l+=1)P.isDark(h,l)&&!P.isDark(h,l+1)&&P.isDark(h,l+2)&&P.isDark(h,l+3)&&P.isDark(h,l+4)&&!P.isDark(h,l+5)&&P.isDark(h,l+6)&&(w+=40);for(l=0;l<x;l+=1)for(h=0;h<x-6;h+=1)P.isDark(h,l)&&!P.isDark(h+1,l)&&P.isDark(h+2,l)&&P.isDark(h+3,l)&&P.isDark(h+4,l)&&!P.isDark(h+5,l)&&P.isDark(h+6,l)&&(w+=40);var T=0;for(l=0;l<x;l+=1)for(h=0;h<x;h+=1)P.isDark(h,l)&&(T+=1);return w+Math.abs(100*T/x/x-50)/5*10},j),Q=(function(){for(var P=new Array(256),x=new Array(256),w=0;w<8;w+=1)P[w]=1<<w;for(w=8;w<256;w+=1)P[w]=P[w-4]^P[w-5]^P[w-6]^P[w-8];for(w=0;w<255;w+=1)x[P[w]]=w;return{glog:function(h){if(h<1)throw"glog("+h+")";return x[h]},gexp:function(h){for(;h<0;)h+=255;for(;h>=256;)h-=255;return P[h]}}})();function U(P,x){if(P.length===void 0)throw P.length+"/"+x;var w=(function(){for(var l=0;l<P.length&&P[l]==0;)l+=1;for(var p=new Array(P.length-l+x),f=0;f<P.length-l;f+=1)p[f]=P[f+l];return p})(),h={getAt:function(l){return w[l]},getLength:function(){return w.length},multiply:function(l){for(var p=new Array(h.getLength()+l.getLength()-1),f=0;f<h.getLength();f+=1)for(var a=0;a<l.getLength();a+=1)p[f+a]^=Q.gexp(Q.glog(h.getAt(f))+Q.glog(l.getAt(a)));return U(p,0)},mod:function(l){if(h.getLength()-l.getLength()<0)return h;for(var p=Q.glog(h.getAt(0))-Q.glog(l.getAt(0)),f=new Array(h.getLength()),a=0;a<h.getLength();a+=1)f[a]=h.getAt(a);for(a=0;a<l.getLength();a+=1)f[a]^=Q.gexp(Q.glog(l.getAt(a))+p);return U(f,0).mod(l)}};return h}var te=(function(){var P=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],x=function(h,l){var p={};return p.totalCount=h,p.dataCount=l,p},w={getRSBlocks:function(h,l){var p=(function(re,F){switch(F){case z.L:return P[4*(re-1)+0];case z.M:return P[4*(re-1)+1];case z.Q:return P[4*(re-1)+2];case z.H:return P[4*(re-1)+3];default:return}})(h,l);if(p===void 0)throw"bad rs block @ typeNumber:"+h+"/errorCorrectionLevel:"+l;for(var f=p.length/3,a=[],v=0;v<f;v+=1)for(var D=p[3*v+0],T=p[3*v+1],H=p[3*v+2],ee=0;ee<D;ee+=1)a.push(x(T,H));return a}};return w})(),ne=function(){var P=[],x=0,w={getBuffer:function(){return P},getAt:function(h){var l=Math.floor(h/8);return(P[l]>>>7-h%8&1)==1},put:function(h,l){for(var p=0;p<l;p+=1)w.putBit((h>>>l-p-1&1)==1)},getLengthInBits:function(){return x},putBit:function(h){var l=Math.floor(x/8);P.length<=l&&P.push(0),h&&(P[l]|=128>>>x%8),x+=1}};return w},G=function(P){var x=P,w={getMode:function(){return 1},getLength:function(p){return x.length},write:function(p){for(var f=x,a=0;a+2<f.length;)p.put(h(f.substring(a,a+3)),10),a+=3;a<f.length&&(f.length-a==1?p.put(h(f.substring(a,a+1)),4):f.length-a==2&&p.put(h(f.substring(a,a+2)),7))}},h=function(p){for(var f=0,a=0;a<p.length;a+=1)f=10*f+l(p.charAt(a));return f},l=function(p){if("0"<=p&&p<="9")return p.charCodeAt(0)-48;throw"illegal char :"+p};return w},J=function(P){var x=P,w={getMode:function(){return 2},getLength:function(l){return x.length},write:function(l){for(var p=x,f=0;f+1<p.length;)l.put(45*h(p.charAt(f))+h(p.charAt(f+1)),11),f+=2;f<p.length&&l.put(h(p.charAt(f)),6)}},h=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return w},q=function(P){var x=M.stringToBytes(P);return{getMode:function(){return 4},getLength:function(w){return x.length},write:function(w){for(var h=0;h<x.length;h+=1)w.put(x[h],8)}}},V=function(P){var x=M.stringToBytesFuncs.SJIS;if(!x)throw"sjis not supported.";(function(){var l=x("友");if(l.length!=2||(l[0]<<8|l[1])!=38726)throw"sjis not supported."})();var w=x(P),h={getMode:function(){return 8},getLength:function(l){return~~(w.length/2)},write:function(l){for(var p=w,f=0;f+1<p.length;){var a=(255&p[f])<<8|255&p[f+1];if(33088<=a&&a<=40956)a-=33088;else{if(!(57408<=a&&a<=60351))throw"illegal char at "+(f+1)+"/"+a;a-=49472}a=192*(a>>>8&255)+(255&a),l.put(a,13),f+=2}if(f<p.length)throw"illegal char at "+(f+1)}};return h},Z=function(){var P=[],x={writeByte:function(w){P.push(255&w)},writeShort:function(w){x.writeByte(w),x.writeByte(w>>>8)},writeBytes:function(w,h,l){h=h||0,l=l||w.length;for(var p=0;p<l;p+=1)x.writeByte(w[p+h])},writeString:function(w){for(var h=0;h<w.length;h+=1)x.writeByte(w.charCodeAt(h))},toByteArray:function(){return P},toString:function(){var w="";w+="[";for(var h=0;h<P.length;h+=1)h>0&&(w+=","),w+=P[h];return w+"]"}};return x},ae=function(P){var x=P,w=0,h=0,l=0,p={read:function(){for(;l<8;){if(w>=x.length){if(l==0)return-1;throw"unexpected end of file./"+l}var a=x.charAt(w);if(w+=1,a=="=")return l=0,-1;a.match(/^\s$/)||(h=h<<6|f(a.charCodeAt(0)),l+=6)}var v=h>>>l-8&255;return l-=8,v}},f=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return p},X=function(P,x,w){for(var h=(function(T,H){var ee=T,re=H,F=new Array(T*H),se={setPixel:function(E,L,$){F[L*ee+E]=$},write:function(E){E.writeString("GIF87a"),E.writeShort(ee),E.writeShort(re),E.writeByte(128),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(255),E.writeByte(255),E.writeByte(255),E.writeString(","),E.writeShort(0),E.writeShort(0),E.writeShort(ee),E.writeShort(re),E.writeByte(0);var L=ie(2);E.writeByte(2);for(var $=0;L.length-$>255;)E.writeByte(255),E.writeBytes(L,$,255),$+=255;E.writeByte(L.length-$),E.writeBytes(L,$,L.length-$),E.writeByte(0),E.writeString(";")}},ie=function(E){for(var L=1<<E,$=1+(1<<E),I=E+1,Y=ue(),ce=0;ce<L;ce+=1)Y.add(String.fromCharCode(ce));Y.add(String.fromCharCode(L)),Y.add(String.fromCharCode($));var o,u,g,A=Z(),R=(o=A,u=0,g=0,{write:function(pe,oe){if(pe>>>oe)throw"length over";for(;u+oe>=8;)o.writeByte(255&(pe<<u|g)),oe-=8-u,pe>>>=8-u,g=0,u=0;g|=pe<<u,u+=oe},flush:function(){u>0&&o.writeByte(g)}});R.write(L,I);var W=0,le=String.fromCharCode(F[W]);for(W+=1;W<F.length;){var he=String.fromCharCode(F[W]);W+=1,Y.contains(le+he)?le+=he:(R.write(Y.indexOf(le),I),Y.size()<4095&&(Y.size()==1<<I&&(I+=1),Y.add(le+he)),le=he)}return R.write(Y.indexOf(le),I),R.write($,I),R.flush(),A.toByteArray()},ue=function(){var E={},L=0,$={add:function(I){if($.contains(I))throw"dup key:"+I;E[I]=L,L+=1},size:function(){return L},indexOf:function(I){return E[I]},contains:function(I){return E[I]!==void 0}};return $};return se})(P,x),l=0;l<x;l+=1)for(var p=0;p<P;p+=1)h.setPixel(p,l,w(p,l));var f=Z();h.write(f);for(var a=(function(){var T=0,H=0,ee=0,re="",F={},se=function(ue){re+=String.fromCharCode(ie(63&ue))},ie=function(ue){if(!(ue<0)){if(ue<26)return 65+ue;if(ue<52)return ue-26+97;if(ue<62)return ue-52+48;if(ue==62)return 43;if(ue==63)return 47}throw"n:"+ue};return F.writeByte=function(ue){for(T=T<<8|255&ue,H+=8,ee+=1;H>=6;)se(T>>>H-6),H-=6},F.flush=function(){if(H>0&&(se(T<<6-H),T=0,H=0),ee%3!=0)for(var ue=3-ee%3,E=0;E<ue;E+=1)re+="="},F.toString=function(){return re},F})(),v=f.toByteArray(),D=0;D<v.length;D+=1)a.writeByte(v[D]);return a.flush(),"data:image/gif;base64,"+a};return M})();_.stringToBytesFuncs["UTF-8"]=function(M){return(function(C){for(var S=[],k=0;k<C.length;k++){var j=C.charCodeAt(k);j<128?S.push(j):j<2048?S.push(192|j>>6,128|63&j):j<55296||j>=57344?S.push(224|j>>12,128|j>>6&63,128|63&j):(k++,j=65536+((1023&j)<<10|1023&C.charCodeAt(k)),S.push(240|j>>18,128|j>>12&63,128|j>>6&63,128|63&j))}return S})(M)},(b=typeof(m=function(){return _})=="function"?m.apply(i,[]):m)===void 0||(d.exports=b)}},n={};function s(d){var i=n[d];if(i!==void 0)return i.exports;var m=n[d]={exports:{}};return r[d](m,m.exports,s),m.exports}s.n=d=>{var i=d&&d.__esModule?()=>d.default:()=>d;return s.d(i,{a:i}),i},s.d=(d,i)=>{for(var m in i)s.o(i,m)&&!s.o(d,m)&&Object.defineProperty(d,m,{enumerable:!0,get:i[m]})},s.o=(d,i)=>Object.prototype.hasOwnProperty.call(d,i);var c={};return(()=>{s.d(c,{default:()=>x});const d=w=>!!w&&typeof w=="object"&&!Array.isArray(w);function i(w,...h){if(!h.length)return w;const l=h.shift();return l!==void 0&&d(w)&&d(l)?(w=Object.assign({},w),Object.keys(l).forEach(p=>{const f=w[p],a=l[p];Array.isArray(f)&&Array.isArray(a)?w[p]=a:d(f)&&d(a)?w[p]=i(Object.assign({},f),a):w[p]=a}),i(w,...h)):w}function m(w,h){const l=document.createElement("a");l.download=h,l.href=w,document.body.appendChild(l),l.click(),document.body.removeChild(l)}const b={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;switch(this._type){case"dots":a=this._drawDot;break;case"classy":a=this._drawClassy;break;case"classy-rounded":a=this._drawClassyRounded;break;case"rounded":a=this._drawRounded;break;case"extra-rounded":a=this._drawExtraRounded;break;default:a=this._drawSquare}a.call(this,{x:h,y:l,size:p,getNeighbor:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+l/2)),this._element.setAttribute("cy",String(f+l/2)),this._element.setAttribute("r",String(l/2))}}))}_basicSquare(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(l)),this._element.setAttribute("height",String(l))}}))}_basicSideRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h `+l/2+`a ${l/2} ${l/2}, 0, 0, 0, 0 ${-l}`)}}))}_basicCornerRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}v `+-l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${-l/2} ${-l/2}`)}}))}_basicCornerExtraRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}a ${l} ${l}, 0, 0, 0, ${-l} ${-l}`)}}))}_basicCornersRounded(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v `+l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${l/2} ${l/2}h `+l/2+"v "+-l/2+`a ${l/2} ${l/2}, 0, 0, 0, ${-l/2} ${-l/2}`)}}))}_drawDot({x:h,y:l,size:p}){this._basicDot({x:h,y:l,size:p,rotation:0})}_drawSquare({x:h,y:l,size:p}){this._basicSquare({x:h,y:l,size:p,rotation:0})}_drawRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0,H=a+v+D+T;if(H!==0)if(H>2||a&&v||D&&T)this._basicSquare({x:h,y:l,size:p,rotation:0});else{if(H===2){let ee=0;return a&&D?ee=Math.PI/2:D&&v?ee=Math.PI:v&&T&&(ee=-Math.PI/2),void this._basicCornerRounded({x:h,y:l,size:p,rotation:ee})}if(H===1){let ee=0;return D?ee=Math.PI/2:v?ee=Math.PI:T&&(ee=-Math.PI/2),void this._basicSideRounded({x:h,y:l,size:p,rotation:ee})}}else this._basicDot({x:h,y:l,size:p,rotation:0})}_drawExtraRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0,H=a+v+D+T;if(H!==0)if(H>2||a&&v||D&&T)this._basicSquare({x:h,y:l,size:p,rotation:0});else{if(H===2){let ee=0;return a&&D?ee=Math.PI/2:D&&v?ee=Math.PI:v&&T&&(ee=-Math.PI/2),void this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:ee})}if(H===1){let ee=0;return D?ee=Math.PI/2:v?ee=Math.PI:T&&(ee=-Math.PI/2),void this._basicSideRounded({x:h,y:l,size:p,rotation:ee})}}else this._basicDot({x:h,y:l,size:p,rotation:0})}_drawClassy({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0;a+v+D+T!==0?a||D?v||T?this._basicSquare({x:h,y:l,size:p,rotation:0}):this._basicCornerRounded({x:h,y:l,size:p,rotation:Math.PI/2}):this._basicCornerRounded({x:h,y:l,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:l,size:p,rotation:Math.PI/2})}_drawClassyRounded({x:h,y:l,size:p,getNeighbor:f}){const a=f?+f(-1,0):0,v=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0;a+v+D+T!==0?a||D?v||T?this._basicSquare({x:h,y:l,size:p,rotation:0}):this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:h,y:l,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:l,size:p,rotation:Math.PI/2})}}const M={dot:"dot",square:"square",extraRounded:"extra-rounded"},C=Object.values(M);class S{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;switch(this._type){case M.square:a=this._drawSquare;break;case M.extraRounded:a=this._drawExtraRounded;break;default:a=this._drawDot}a.call(this,{x:h,y:l,size:p,rotation:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p+l/2} ${f}a ${l/2} ${l/2} 0 1 0 0.1 0zm 0 ${a}a ${l/2-a} ${l/2-a} 0 1 1 -0.1 0Z`)}}))}_basicSquare(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f}v ${l}h ${l}v `+-l+`zM ${p+a} ${f+a}h `+(l-2*a)+"v "+(l-2*a)+"h "+(2*a-l)+"z")}}))}_basicExtraRounded(h){const{size:l,x:p,y:f}=h,a=l/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f+2.5*a}v `+2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*a} ${2.5*a}h `+2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*a} ${2.5*-a}v `+-2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*-a} ${2.5*-a}h `+-2*a+`a ${2.5*a} ${2.5*a}, 0, 0, 0, ${2.5*-a} ${2.5*a}M ${p+2.5*a} ${f+a}h `+2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*a} ${1.5*a}v `+2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*-a} ${1.5*a}h `+-2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*-a} ${1.5*-a}v `+-2*a+`a ${1.5*a} ${1.5*a}, 0, 0, 1, ${1.5*a} ${1.5*-a}`)}}))}_drawDot({x:h,y:l,size:p,rotation:f}){this._basicDot({x:h,y:l,size:p,rotation:f})}_drawSquare({x:h,y:l,size:p,rotation:f}){this._basicSquare({x:h,y:l,size:p,rotation:f})}_drawExtraRounded({x:h,y:l,size:p,rotation:f}){this._basicExtraRounded({x:h,y:l,size:p,rotation:f})}}const k={dot:"dot",square:"square"},j=Object.values(k);class N{constructor({svg:h,type:l,window:p}){this._svg=h,this._type=l,this._window=p}draw(h,l,p,f){let a;a=this._type===k.square?this._drawSquare:this._drawDot,a.call(this,{x:h,y:l,size:p,rotation:f})}_rotateFigure({x:h,y:l,size:p,rotation:f=0,draw:a}){var v;const D=h+p/2,T=l+p/2;a(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+l/2)),this._element.setAttribute("cy",String(f+l/2)),this._element.setAttribute("r",String(l/2))}}))}_basicSquare(h){const{size:l,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(l)),this._element.setAttribute("height",String(l))}}))}_drawDot({x:h,y:l,size:p,rotation:f}){this._basicDot({x:h,y:l,size:p,rotation:f})}_drawSquare({x:h,y:l,size:p,rotation:f}){this._basicSquare({x:h,y:l,size:p,rotation:f})}}const z="circle",B=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],Q=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class U{constructor(h,l){this._roundSize=p=>this._options.dotsOptions.roundSize?Math.floor(p):p,this._window=l,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(h.width)),this._element.setAttribute("height",String(h.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),h.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${h.width} ${h.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=h.image,this._instanceId=U.instanceCount++,this._options=h}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(h){const l=h.getModuleCount(),p=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===z?p/Math.sqrt(2):p,a=this._roundSize(f/l);let v={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=h,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:D,qrOptions:T}=this._options,H=D.imageSize*b[T.errorCorrectionLevel],ee=Math.floor(H*l*l);v=(function({originalHeight:re,originalWidth:F,maxHiddenDots:se,maxHiddenAxisDots:ie,dotSize:ue}){const E={x:0,y:0},L={x:0,y:0};if(re<=0||F<=0||se<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=re/F;return E.x=Math.floor(Math.sqrt(se/$)),E.x<=0&&(E.x=1),ie&&ie<E.x&&(E.x=ie),E.x%2==0&&E.x--,L.x=E.x*ue,E.y=1+2*Math.ceil((E.x*$-1)/2),L.y=Math.round(L.x*$),(E.y*E.x>se||ie&&ie<E.y)&&(ie&&ie<E.y?(E.y=ie,E.y%2==0&&E.x--):E.y-=2,L.y=E.y*ue,E.x=1+2*Math.ceil((E.y/$-1)/2),L.x=Math.round(L.y/$)),{height:L.y,width:L.x,hideYDots:E.y,hideXDots:E.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:ee,maxHiddenAxisDots:l-14,dotSize:a})}this.drawBackground(),this.drawDots((D,T)=>{var H,ee,re,F,se,ie;return!(this._options.imageOptions.hideBackgroundDots&&D>=(l-v.hideYDots)/2&&D<(l+v.hideYDots)/2&&T>=(l-v.hideXDots)/2&&T<(l+v.hideXDots)/2||!((H=B[D])===null||H===void 0)&&H[T]||!((ee=B[D-l+7])===null||ee===void 0)&&ee[T]||!((re=B[D])===null||re===void 0)&&re[T-l+7]||!((F=Q[D])===null||F===void 0)&&F[T]||!((se=Q[D-l+7])===null||se===void 0)&&se[T]||!((ie=Q[D])===null||ie===void 0)&&ie[T-l+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:v.width,height:v.height,count:l,dotSize:a})}drawBackground(){var h,l,p;const f=this._element,a=this._options;if(f){const v=(h=a.backgroundOptions)===null||h===void 0?void 0:h.gradient,D=(l=a.backgroundOptions)===null||l===void 0?void 0:l.color;let T=a.height,H=a.width;if(v||D){const ee=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((p=a.backgroundOptions)===null||p===void 0)&&p.round&&(T=H=Math.min(a.width,a.height),ee.setAttribute("rx",String(T/2*a.backgroundOptions.round))),ee.setAttribute("x",String(this._roundSize((a.width-H)/2))),ee.setAttribute("y",String(this._roundSize((a.height-T)/2))),ee.setAttribute("width",String(H)),ee.setAttribute("height",String(T)),this._backgroundClipPath.appendChild(ee),this._createColor({options:v,color:D,additionalRotation:0,x:0,y:0,height:a.height,width:a.width,name:`background-color-${this._instanceId}`})}}}drawDots(h){var l,p;if(!this._qr)throw"QR code is not defined";const f=this._options,a=this._qr.getModuleCount();if(a>f.width||a>f.height)throw"The canvas is too small.";const v=Math.min(f.width,f.height)-2*f.margin,D=f.shape===z?v/Math.sqrt(2):v,T=this._roundSize(D/a),H=this._roundSize((f.width-a*T)/2),ee=this._roundSize((f.height-a*T)/2),re=new _({svg:this._element,type:f.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:(l=f.dotsOptions)===null||l===void 0?void 0:l.gradient,color:f.dotsOptions.color,additionalRotation:0,x:0,y:0,height:f.height,width:f.width,name:`dot-color-${this._instanceId}`});for(let F=0;F<a;F++)for(let se=0;se<a;se++)h&&!h(F,se)||!((p=this._qr)===null||p===void 0)&&p.isDark(F,se)&&(re.draw(H+se*T,ee+F*T,T,(ie,ue)=>!(se+ie<0||F+ue<0||se+ie>=a||F+ue>=a)&&!(h&&!h(F+ue,se+ie))&&!!this._qr&&this._qr.isDark(F+ue,se+ie)),re._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(re._element));if(f.shape===z){const F=this._roundSize((v/T-a)/2),se=a+2*F,ie=H-F*T,ue=ee-F*T,E=[],L=this._roundSize(se/2);for(let $=0;$<se;$++){E[$]=[];for(let I=0;I<se;I++)$>=F-1&&$<=se-F&&I>=F-1&&I<=se-F||Math.sqrt(($-L)*($-L)+(I-L)*(I-L))>L?E[$][I]=0:E[$][I]=this._qr.isDark(I-2*F<0?I:I>=a?I-2*F:I-F,$-2*F<0?$:$>=a?$-2*F:$-F)?1:0}for(let $=0;$<se;$++)for(let I=0;I<se;I++)E[$][I]&&(re.draw(ie+I*T,ue+$*T,T,(Y,ce)=>{var o;return!!(!((o=E[$+ce])===null||o===void 0)&&o[I+Y])}),re._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(re._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const h=this._element,l=this._options;if(!h)throw"Element code is not defined";const p=this._qr.getModuleCount(),f=Math.min(l.width,l.height)-2*l.margin,a=l.shape===z?f/Math.sqrt(2):f,v=this._roundSize(a/p),D=7*v,T=3*v,H=this._roundSize((l.width-p*v)/2),ee=this._roundSize((l.height-p*v)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([re,F,se])=>{var ie,ue,E,L,$,I,Y,ce,o,u,g,A,R,W;const le=H+re*v*(p-7),he=ee+F*v*(p-7);let pe=this._dotsClipPath,oe=this._dotsClipPath;if((!((ie=l.cornersSquareOptions)===null||ie===void 0)&&ie.gradient||!((ue=l.cornersSquareOptions)===null||ue===void 0)&&ue.color)&&(pe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),pe.setAttribute("id",`clip-path-corners-square-color-${re}-${F}-${this._instanceId}`),this._defs.appendChild(pe),this._cornersSquareClipPath=this._cornersDotClipPath=oe=pe,this._createColor({options:(E=l.cornersSquareOptions)===null||E===void 0?void 0:E.gradient,color:(L=l.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:se,x:le,y:he,height:D,width:D,name:`corners-square-color-${re}-${F}-${this._instanceId}`})),(($=l.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&C.includes(l.cornersSquareOptions.type)){const fe=new S({svg:this._element,type:l.cornersSquareOptions.type,window:this._window});fe.draw(le,he,D,se),fe._element&&pe&&pe.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((I=l.cornersSquareOptions)===null||I===void 0?void 0:I.type)||l.dotsOptions.type,window:this._window});for(let ge=0;ge<B.length;ge++)for(let me=0;me<B[ge].length;me++)!((Y=B[ge])===null||Y===void 0)&&Y[me]&&(fe.draw(le+me*v,he+ge*v,v,(ve,xe)=>{var ke;return!!(!((ke=B[ge+xe])===null||ke===void 0)&&ke[me+ve])}),fe._element&&pe&&pe.appendChild(fe._element))}if((!((ce=l.cornersDotOptions)===null||ce===void 0)&&ce.gradient||!((o=l.cornersDotOptions)===null||o===void 0)&&o.color)&&(oe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),oe.setAttribute("id",`clip-path-corners-dot-color-${re}-${F}-${this._instanceId}`),this._defs.appendChild(oe),this._cornersDotClipPath=oe,this._createColor({options:(u=l.cornersDotOptions)===null||u===void 0?void 0:u.gradient,color:(g=l.cornersDotOptions)===null||g===void 0?void 0:g.color,additionalRotation:se,x:le+2*v,y:he+2*v,height:T,width:T,name:`corners-dot-color-${re}-${F}-${this._instanceId}`})),((A=l.cornersDotOptions)===null||A===void 0?void 0:A.type)&&j.includes(l.cornersDotOptions.type)){const fe=new N({svg:this._element,type:l.cornersDotOptions.type,window:this._window});fe.draw(le+2*v,he+2*v,T,se),fe._element&&oe&&oe.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((R=l.cornersDotOptions)===null||R===void 0?void 0:R.type)||l.dotsOptions.type,window:this._window});for(let ge=0;ge<Q.length;ge++)for(let me=0;me<Q[ge].length;me++)!((W=Q[ge])===null||W===void 0)&&W[me]&&(fe.draw(le+me*v,he+ge*v,v,(ve,xe)=>{var ke;return!!(!((ke=Q[ge+xe])===null||ke===void 0)&&ke[me+ve])}),fe._element&&oe&&oe.appendChild(fe._element))}})}loadImage(){return new Promise((h,l)=>{var p;const f=this._options;if(!f.image)return l("Image is not defined");if(!((p=f.nodeCanvas)===null||p===void 0)&&p.loadImage)f.nodeCanvas.loadImage(f.image).then(a=>{var v,D;if(this._image=a,this._options.imageOptions.saveAsBlob){const T=(v=f.nodeCanvas)===null||v===void 0?void 0:v.createCanvas(this._image.width,this._image.height);(D=T?.getContext("2d"))===null||D===void 0||D.drawImage(a,0,0),this._imageUri=T?.toDataURL()}h()}).catch(l);else{const a=new this._window.Image;typeof f.imageOptions.crossOrigin=="string"&&(a.crossOrigin=f.imageOptions.crossOrigin),this._image=a,a.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await(async function(v,D){return new Promise(T=>{const H=new D.XMLHttpRequest;H.onload=function(){const ee=new D.FileReader;ee.onloadend=function(){T(ee.result)},ee.readAsDataURL(H.response)},H.open("GET",v),H.responseType="blob",H.send()})})(f.image||"",this._window)),h()},a.src=f.image}})}async drawImage({width:h,height:l,count:p,dotSize:f}){const a=this._options,v=this._roundSize((a.width-p*f)/2),D=this._roundSize((a.height-p*f)/2),T=v+this._roundSize(a.imageOptions.margin+(p*f-h)/2),H=D+this._roundSize(a.imageOptions.margin+(p*f-l)/2),ee=h-2*a.imageOptions.margin,re=l-2*a.imageOptions.margin,F=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");F.setAttribute("href",this._imageUri||""),F.setAttribute("xlink:href",this._imageUri||""),F.setAttribute("x",String(T)),F.setAttribute("y",String(H)),F.setAttribute("width",`${ee}px`),F.setAttribute("height",`${re}px`),this._element.appendChild(F)}_createColor({options:h,color:l,additionalRotation:p,x:f,y:a,height:v,width:D,name:T}){const H=D>v?D:v,ee=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(ee.setAttribute("x",String(f)),ee.setAttribute("y",String(a)),ee.setAttribute("height",String(v)),ee.setAttribute("width",String(D)),ee.setAttribute("clip-path",`url('#clip-path-${T}')`),h){let re;if(h.type==="radial")re=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),re.setAttribute("id",T),re.setAttribute("gradientUnits","userSpaceOnUse"),re.setAttribute("fx",String(f+D/2)),re.setAttribute("fy",String(a+v/2)),re.setAttribute("cx",String(f+D/2)),re.setAttribute("cy",String(a+v/2)),re.setAttribute("r",String(H/2));else{const F=((h.rotation||0)+p)%(2*Math.PI),se=(F+2*Math.PI)%(2*Math.PI);let ie=f+D/2,ue=a+v/2,E=f+D/2,L=a+v/2;se>=0&&se<=.25*Math.PI||se>1.75*Math.PI&&se<=2*Math.PI?(ie-=D/2,ue-=v/2*Math.tan(F),E+=D/2,L+=v/2*Math.tan(F)):se>.25*Math.PI&&se<=.75*Math.PI?(ue-=v/2,ie-=D/2/Math.tan(F),L+=v/2,E+=D/2/Math.tan(F)):se>.75*Math.PI&&se<=1.25*Math.PI?(ie+=D/2,ue+=v/2*Math.tan(F),E-=D/2,L-=v/2*Math.tan(F)):se>1.25*Math.PI&&se<=1.75*Math.PI&&(ue+=v/2,ie+=D/2/Math.tan(F),L-=v/2,E-=D/2/Math.tan(F)),re=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),re.setAttribute("id",T),re.setAttribute("gradientUnits","userSpaceOnUse"),re.setAttribute("x1",String(Math.round(ie))),re.setAttribute("y1",String(Math.round(ue))),re.setAttribute("x2",String(Math.round(E))),re.setAttribute("y2",String(Math.round(L)))}h.colorStops.forEach(({offset:F,color:se})=>{const ie=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");ie.setAttribute("offset",100*F+"%"),ie.setAttribute("stop-color",se),re.appendChild(ie)}),ee.setAttribute("fill",`url('#${T}')`),this._defs.appendChild(re)}else l&&ee.setAttribute("fill",l);this._element.appendChild(ee)}}U.instanceCount=0;const te=U,ne="canvas",G={};for(let w=0;w<=40;w++)G[w]=w;const J={type:ne,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:G[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function q(w){const h=Object.assign({},w);if(!h.colorStops||!h.colorStops.length)throw"Field 'colorStops' is required in gradient";return h.rotation?h.rotation=Number(h.rotation):h.rotation=0,h.colorStops=h.colorStops.map(l=>Object.assign(Object.assign({},l),{offset:Number(l.offset)})),h}function V(w){const h=Object.assign({},w);return h.width=Number(h.width),h.height=Number(h.height),h.margin=Number(h.margin),h.imageOptions=Object.assign(Object.assign({},h.imageOptions),{hideBackgroundDots:!!h.imageOptions.hideBackgroundDots,imageSize:Number(h.imageOptions.imageSize),margin:Number(h.imageOptions.margin)}),h.margin>Math.min(h.width,h.height)&&(h.margin=Math.min(h.width,h.height)),h.dotsOptions=Object.assign({},h.dotsOptions),h.dotsOptions.gradient&&(h.dotsOptions.gradient=q(h.dotsOptions.gradient)),h.cornersSquareOptions&&(h.cornersSquareOptions=Object.assign({},h.cornersSquareOptions),h.cornersSquareOptions.gradient&&(h.cornersSquareOptions.gradient=q(h.cornersSquareOptions.gradient))),h.cornersDotOptions&&(h.cornersDotOptions=Object.assign({},h.cornersDotOptions),h.cornersDotOptions.gradient&&(h.cornersDotOptions.gradient=q(h.cornersDotOptions.gradient))),h.backgroundOptions&&(h.backgroundOptions=Object.assign({},h.backgroundOptions),h.backgroundOptions.gradient&&(h.backgroundOptions.gradient=q(h.backgroundOptions.gradient))),h}var Z=s(873),ae=s.n(Z);function X(w){if(!w)throw new Error("Extension must be defined");w[0]==="."&&(w=w.substring(1));const h={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[w.toLowerCase()];if(!h)throw new Error(`Extension "${w}" is not supported`);return h}class P{constructor(h){h!=null&&h.jsdom?this._window=new h.jsdom("",{resources:"usable"}).window:this._window=window,this._options=h?V(i(J,h)):J,this.update()}static _clearContainer(h){h&&(h.innerHTML="")}_setupSvg(){if(!this._qr)return;const h=new te(this._options,this._window);this._svg=h.getElement(),this._svgDrawingPromise=h.drawQR(this._qr).then(()=>{var l;this._svg&&((l=this._extension)===null||l===void 0||l.call(this,h.getElement(),this._options))})}_setupCanvas(){var h,l;this._qr&&(!((h=this._options.nodeCanvas)===null||h===void 0)&&h.createCanvas?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=(l=this._svgDrawingPromise)===null||l===void 0?void 0:l.then(()=>{var p;if(!this._svg)return;const f=this._svg,a=new this._window.XMLSerializer().serializeToString(f),v=btoa(a),D=`data:${X("svg")};base64,${v}`;if(!((p=this._options.nodeCanvas)===null||p===void 0)&&p.loadImage)return this._options.nodeCanvas.loadImage(D).then(T=>{var H,ee;T.width=this._options.width,T.height=this._options.height,(ee=(H=this._nodeCanvas)===null||H===void 0?void 0:H.getContext("2d"))===null||ee===void 0||ee.drawImage(T,0,0)});{const T=new this._window.Image;return new Promise(H=>{T.onload=()=>{var ee,re;(re=(ee=this._domCanvas)===null||ee===void 0?void 0:ee.getContext("2d"))===null||re===void 0||re.drawImage(T,0,0),H()},T.src=D})}}))}async _getElement(h="png"){if(!this._qr)throw"QR code is empty";return h.toLowerCase()==="svg"?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(h){P._clearContainer(this._container),this._options=h?V(i(this._options,h)):this._options,this._options.data&&(this._qr=ae()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||(function(l){switch(!0){case/^[0-9]*$/.test(l):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(l):return"Alphanumeric";default:return"Byte"}})(this._options.data)),this._qr.make(),this._options.type===ne?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(h){if(h){if(typeof h.appendChild!="function")throw"Container should be a single DOM node";this._options.type===ne?this._domCanvas&&h.appendChild(this._domCanvas):this._svg&&h.appendChild(this._svg),this._container=h}}applyExtension(h){if(!h)throw"Extension function should be defined.";this._extension=h,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(h="png"){if(!this._qr)throw"QR code is empty";const l=await this._getElement(h),p=X(h);if(!l)return null;if(h.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
22
|
-
${new this._window.XMLSerializer().serializeToString(l)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(f):new Blob([f],{type:p})}return new Promise(f=>{const a=l;if("toBuffer"in a)if(p==="image/png")f(a.toBuffer(p));else if(p==="image/jpeg")f(a.toBuffer(p));else{if(p!=="application/pdf")throw Error("Unsupported extension");f(a.toBuffer(p))}else"toBlob"in a&&a.toBlob(f,p,1)})}async download(h){if(!this._qr)throw"QR code is empty";if(typeof Blob>"u")throw"Cannot download in Node.js, call getRawData instead.";let l="png",p="qr";typeof h=="string"?(l=h,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):typeof h=="object"&&h!==null&&(h.name&&(p=h.name),h.extension&&(l=h.extension));const f=await this._getElement(l);if(f)if(l.toLowerCase()==="svg"){let a=new XMLSerializer().serializeToString(f);a=`<?xml version="1.0" standalone="no"?>\r
|
|
23
|
-
`+a,m(`data:${X(l)};charset=utf-8,${encodeURIComponent(a)}`,`${p}.svg`)}else m(f.toDataURL(X(l)),`${p}.${l}`)}}const x=P})(),c.default})())})(fn)),fn.exports}bl();const Uo=K.createContext(void 0);function wl(t){const e=Fe.c(9),{children:r,baseUrl:n,queryClient:s}=t;let c;e[0]!==n||e[1]!==s?(c={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=c):c=e[2];let d;e[3]!==r||e[4]!==s?(d=y.jsx(to,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=d):d=e[5];let i;return e[6]!==c||e[7]!==d?(i=y.jsx(Uo.Provider,{value:c,children:d}),e[6]=c,e[7]=d,e[8]=i):i=e[8],i}function yt(){const t=K.useContext(Uo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function pn(t){if(typeof t=="string")try{const e=JSON.parse(t);return{message:e.message||t,code:e.code,details:e.details}}catch{return{message:t}}return t instanceof Error?{message:t.message}:{message:"Unbekannter Fehler"}}async function Lt(t){const e=await t.text();if(!e)throw new Error(`HTTP ${t.status}: ${t.statusText}`);let r=null;try{r=JSON.parse(e)}catch{throw new Error(e)}throw r?.message?new Error(r.message):r?.error?new Error(r.error):new Error(e)}function _l(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function Pt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await ll()??""}`,..._l()}}async function qo(t){return fetch(t,{method:"GET",headers:await Pt()}).then(async e=>(e.status>=400&&await Lt(e),e)).then(e=>e.json()).then(e=>e)}async function Vo(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await Pt()}).then(async r=>(r.status>=400&&await Lt(r),r)).then(r=>r.json()).then(r=>r)}async function Ho(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await Pt()});r.status>=400&&await Lt(r)}async function Go(t,e){return fetch(t,{method:"POST",headers:await Pt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Lt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function xl(t,e,r){return fetch(e,{method:t,headers:await Pt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Lt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Qo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await Pt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Lt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Ko(t,e,r){const n=Fe.c(13),{baseUrl:s}=yt();let c;if(n[0]!==r||n[1]!==e){let b;n[3]!==r?(b=r?.toString(),n[3]=r,n[4]=b):b=n[4],c=[...e.map(Cl),String(b)],n[0]=r,n[1]=e,n[2]=c}else c=n[2];let d;n[5]!==t||n[6]!==s||n[7]!==r?(d=()=>Vo(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=d):d=n[8];const i=!!r;let m;return n[9]!==c||n[10]!==d||n[11]!==i?(m={queryKey:c,queryFn:d,enabled:i},n[9]=c,n[10]=d,n[11]=i,n[12]=m):m=n[12],oo(m)}function Cl(t){return t.toString()}function Zo(t,e,r){const n=Fe.c(9),s=r===void 0?!0:r,{baseUrl:c}=yt();let d;n[0]!==e?(d=[...e.map(Sl)],n[0]=e,n[1]=d):d=n[1];let i;n[2]!==t||n[3]!==c?(i=()=>qo(`${c}${t}`),n[2]=t,n[3]=c,n[4]=i):i=n[4];let m;return n[5]!==s||n[6]!==d||n[7]!==i?(m={queryKey:d,queryFn:i,enabled:s},n[5]=s,n[6]=d,n[7]=i,n[8]=m):m=n[8],oo(m)}function Sl(t){return t.toString()}function Jo(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=yt();let c;r[0]!==e?(c=[...e.map(kl)],r[0]=e,r[1]=c):c=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Go(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==d?(i={mutationKey:c,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Dl)]})},onError(m){pn(m)}},r[5]=s,r[6]=e,r[7]=c,r[8]=d,r[9]=i):i=r[9],Hr(i)}function Dl(t){return t.toString()}function kl(t){return t.toString()}function gn(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=yt();let c;r[0]!==e?(c=[...e.map(Ml)],r[0]=e,r[1]=c):c=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Qo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==d?(i={mutationKey:c,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Pl)]})},onError(m){pn(m)}},r[5]=s,r[6]=e,r[7]=c,r[8]=d,r[9]=i):i=r[9],Hr(i)}function Pl(t){return t.toString()}function Ml(t){return t.toString()}function Xo(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=yt();let c;r[0]!==e?(c=[...e.map(jl)],r[0]=e,r[1]=c):c=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Ho(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==d?(i={mutationKey:c,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Ol)]})},onError(m){pn(m)}},r[5]=s,r[6]=e,r[7]=c,r[8]=d,r[9]=i):i=r[9],Hr(i)}function Ol(t){return t.toString()}function jl(t){return t.toString()}var br={exports:{}},Al=br.exports,es;function El(){return es||(es=1,(function(t,e){(function(r,n){t.exports=n()})(Al,(function(){var r=1e3,n=6e4,s=36e5,c="millisecond",d="second",i="minute",m="hour",b="day",_="week",M="month",C="quarter",S="year",k="date",j="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var x=["th","st","nd","rd"],w=P%100;return"["+P+(x[(w-20)%10]||x[w]||x[0])+"]"}},Q=function(P,x,w){var h=String(P);return!h||h.length>=x?P:""+Array(x+1-h.length).join(w)+P},U={s:Q,z:function(P){var x=-P.utcOffset(),w=Math.abs(x),h=Math.floor(w/60),l=w%60;return(x<=0?"+":"-")+Q(h,2,"0")+":"+Q(l,2,"0")},m:function P(x,w){if(x.date()<w.date())return-P(w,x);var h=12*(w.year()-x.year())+(w.month()-x.month()),l=x.clone().add(h,M),p=w-l<0,f=x.clone().add(h+(p?-1:1),M);return+(-(h+(w-l)/(p?l-f:f-l))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M,y:S,w:_,d:b,D:k,h:m,m:i,s:d,ms:c,Q:C}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},te="en",ne={};ne[te]=B;var G="$isDayjsObject",J=function(P){return P instanceof ae||!(!P||!P[G])},q=function P(x,w,h){var l;if(!x)return te;if(typeof x=="string"){var p=x.toLowerCase();ne[p]&&(l=p),w&&(ne[p]=w,l=p);var f=x.split("-");if(!l&&f.length>1)return P(f[0])}else{var a=x.name;ne[a]=x,l=a}return!h&&l&&(te=l),l||!h&&te},V=function(P,x){if(J(P))return P.clone();var w=typeof x=="object"?x:{};return w.date=P,w.args=arguments,new ae(w)},Z=U;Z.l=q,Z.i=J,Z.w=function(P,x){return V(P,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var ae=(function(){function P(w){this.$L=q(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[G]=!0}var x=P.prototype;return x.parse=function(w){this.$d=(function(h){var l=h.date,p=h.utc;if(l===null)return new Date(NaN);if(Z.u(l))return new Date;if(l instanceof Date)return new Date(l);if(typeof l=="string"&&!/Z$/i.test(l)){var f=l.match(N);if(f){var a=f[2]-1||0,v=(f[7]||"0").substring(0,3);return p?new Date(Date.UTC(f[1],a,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)):new Date(f[1],a,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)}}return new Date(l)})(w),this.init()},x.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},x.$utils=function(){return Z},x.isValid=function(){return this.$d.toString()!==j},x.isSame=function(w,h){var l=V(w);return this.startOf(h)<=l&&l<=this.endOf(h)},x.isAfter=function(w,h){return V(w)<this.startOf(h)},x.isBefore=function(w,h){return this.endOf(h)<V(w)},x.$g=function(w,h,l){return Z.u(w)?this[h]:this.set(l,w)},x.unix=function(){return Math.floor(this.valueOf()/1e3)},x.valueOf=function(){return this.$d.getTime()},x.startOf=function(w,h){var l=this,p=!!Z.u(h)||h,f=Z.p(w),a=function(se,ie){var ue=Z.w(l.$u?Date.UTC(l.$y,ie,se):new Date(l.$y,ie,se),l);return p?ue:ue.endOf(b)},v=function(se,ie){return Z.w(l.toDate()[se].apply(l.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(ie)),l)},D=this.$W,T=this.$M,H=this.$D,ee="set"+(this.$u?"UTC":"");switch(f){case S:return p?a(1,0):a(31,11);case M:return p?a(1,T):a(0,T+1);case _:var re=this.$locale().weekStart||0,F=(D<re?D+7:D)-re;return a(p?H-F:H+(6-F),T);case b:case k:return v(ee+"Hours",0);case m:return v(ee+"Minutes",1);case i:return v(ee+"Seconds",2);case d:return v(ee+"Milliseconds",3);default:return this.clone()}},x.endOf=function(w){return this.startOf(w,!1)},x.$set=function(w,h){var l,p=Z.p(w),f="set"+(this.$u?"UTC":""),a=(l={},l[b]=f+"Date",l[k]=f+"Date",l[M]=f+"Month",l[S]=f+"FullYear",l[m]=f+"Hours",l[i]=f+"Minutes",l[d]=f+"Seconds",l[c]=f+"Milliseconds",l)[p],v=p===b?this.$D+(h-this.$W):h;if(p===M||p===S){var D=this.clone().set(k,1);D.$d[a](v),D.init(),this.$d=D.set(k,Math.min(this.$D,D.daysInMonth())).$d}else a&&this.$d[a](v);return this.init(),this},x.set=function(w,h){return this.clone().$set(w,h)},x.get=function(w){return this[Z.p(w)]()},x.add=function(w,h){var l,p=this;w=Number(w);var f=Z.p(h),a=function(T){var H=V(p);return Z.w(H.date(H.date()+Math.round(T*w)),p)};if(f===M)return this.set(M,this.$M+w);if(f===S)return this.set(S,this.$y+w);if(f===b)return a(1);if(f===_)return a(7);var v=(l={},l[i]=n,l[m]=s,l[d]=r,l)[f]||1,D=this.$d.getTime()+w*v;return Z.w(D,this)},x.subtract=function(w,h){return this.add(-1*w,h)},x.format=function(w){var h=this,l=this.$locale();if(!this.isValid())return l.invalidDate||j;var p=w||"YYYY-MM-DDTHH:mm:ssZ",f=Z.z(this),a=this.$H,v=this.$m,D=this.$M,T=l.weekdays,H=l.months,ee=l.meridiem,re=function(ie,ue,E,L){return ie&&(ie[ue]||ie(h,p))||E[ue].slice(0,L)},F=function(ie){return Z.s(a%12||12,ie,"0")},se=ee||function(ie,ue,E){var L=ie<12?"AM":"PM";return E?L.toLowerCase():L};return p.replace(z,(function(ie,ue){return ue||(function(E){switch(E){case"YY":return String(h.$y).slice(-2);case"YYYY":return Z.s(h.$y,4,"0");case"M":return D+1;case"MM":return Z.s(D+1,2,"0");case"MMM":return re(l.monthsShort,D,H,3);case"MMMM":return re(H,D);case"D":return h.$D;case"DD":return Z.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return re(l.weekdaysMin,h.$W,T,2);case"ddd":return re(l.weekdaysShort,h.$W,T,3);case"dddd":return T[h.$W];case"H":return String(a);case"HH":return Z.s(a,2,"0");case"h":return F(1);case"hh":return F(2);case"a":return se(a,v,!0);case"A":return se(a,v,!1);case"m":return String(v);case"mm":return Z.s(v,2,"0");case"s":return String(h.$s);case"ss":return Z.s(h.$s,2,"0");case"SSS":return Z.s(h.$ms,3,"0");case"Z":return f}return null})(ie)||f.replace(":","")}))},x.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},x.diff=function(w,h,l){var p,f=this,a=Z.p(h),v=V(w),D=(v.utcOffset()-this.utcOffset())*n,T=this-v,H=function(){return Z.m(f,v)};switch(a){case S:p=H()/12;break;case M:p=H();break;case C:p=H()/3;break;case _:p=(T-D)/6048e5;break;case b:p=(T-D)/864e5;break;case m:p=T/s;break;case i:p=T/n;break;case d:p=T/r;break;default:p=T}return l?p:Z.a(p)},x.daysInMonth=function(){return this.endOf(M).$D},x.$locale=function(){return ne[this.$L]},x.locale=function(w,h){if(!w)return this.$L;var l=this.clone(),p=q(w,h,!0);return p&&(l.$L=p),l},x.clone=function(){return Z.w(this.$d,this)},x.toDate=function(){return new Date(this.valueOf())},x.toJSON=function(){return this.isValid()?this.toISOString():null},x.toISOString=function(){return this.$d.toISOString()},x.toString=function(){return this.$d.toUTCString()},P})(),X=ae.prototype;return V.prototype=X,[["$ms",c],["$s",d],["$m",i],["$H",m],["$W",b],["$M",M],["$y",S],["$D",k]].forEach((function(P){X[P[1]]=function(x){return this.$g(x,P[0],P[1])}})),V.extend=function(P,x){return P.$i||(P(x,ae,V),P.$i=!0),V},V.locale=q,V.isDayjs=J,V.unix=function(P){return V(1e3*P)},V.en=ne[te],V.Ls=ne,V.p={},V}))})(br)),br.exports}var Tl=El();const de=Ln(Tl);function $l({direction:t,levelIndex:e,rowIndex:r,cellIndex:n,size:s}){switch(t){case"up":return e===0&&r===0?null:r===0?{levelIndex:e-1,rowIndex:n<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:n}:{levelIndex:e,rowIndex:r-1,cellIndex:n};case"down":return r===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:n}:r===s[e].length-2&&n>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:n}:{levelIndex:e,rowIndex:r+1,cellIndex:n};case"left":return e===0&&r===0&&n===0?null:r===0&&n===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:n===0?{levelIndex:e,rowIndex:r-1,cellIndex:s[e][r-1]-1}:{levelIndex:e,rowIndex:r,cellIndex:n-1};case"right":return r===s[e].length-1&&n===s[e][r]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:n===s[e][r]-1?{levelIndex:e,rowIndex:r+1,cellIndex:0}:{levelIndex:e,rowIndex:r,cellIndex:n+1};default:return{levelIndex:e,rowIndex:r,cellIndex:n}}}function ts({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:c}){const d=$l({direction:e,size:c,rowIndex:n,cellIndex:s,levelIndex:r});if(!d)return;const i=t.current?.[d.levelIndex]?.[d.rowIndex]?.[d.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?ts({controlsRef:t,direction:e,levelIndex:d.levelIndex,cellIndex:d.cellIndex,rowIndex:d.rowIndex,size:c}):i.focus())}function Rl(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Nl(t){return t.current?.map(e=>e.map(r=>r.length))}function mn({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const c=Rl(s.key);if(c){s.preventDefault();const d=Nl(t);ts({controlsRef:t,direction:c,levelIndex:e,rowIndex:r,cellIndex:n,size:d})}}function Ke(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD")}function rs(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD HH:mm:ss")}const Ll={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Bl=K.createContext(Ll);function vt(){const t=K.useContext(Bl),e=K.useCallback(c=>c||t.locale,[t.locale]),r=K.useCallback(c=>typeof c=="number"?c:t.firstDayOfWeek,[t.firstDayOfWeek]),n=K.useCallback(c=>Array.isArray(c)?c:t.weekendDays,[t.weekendDays]),s=K.useCallback(c=>typeof c=="string"?c:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function Il({value:t,type:e,withTime:r}){const n=r?rs:Ke;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),c=n(t[1]);return s?c?`${s} – ${c}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function ns({value:t,type:e,name:r,form:n,withTime:s=!1}){return y.jsx("input",{type:"hidden",value:Il({value:t,type:e,withTime:s}),name:r,form:n})}ns.displayName="@mantine/dates/HiddenDatesInput";function os(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=os(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Oe(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=os(t))&&(n&&(n+=" "),n+=e);return n}var ss={day:"m_396ce5cb"};const Yl=O.createVarsResolver((t,{size:e})=>({day:{"--day-size":O.getSize(e,"day-size")}})),yn=O.factory((t,e)=>{const r=O.useProps("Day",null,t),{classNames:n,className:s,style:c,styles:d,unstyled:i,vars:m,date:b,disabled:_,__staticSelector:M,weekend:C,outside:S,selected:k,renderDay:j,inRange:N,firstInRange:z,lastInRange:B,hidden:Q,static:U,highlightToday:te,attributes:ne,...G}=r,J=O.useStyles({name:M||"Day",classes:ss,props:r,className:s,style:c,classNames:n,styles:d,unstyled:i,attributes:ne,vars:m,varsResolver:Yl,rootSelector:"day"});return y.jsx(O.UnstyledButton,{...J("day",{style:Q?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":de(b).isSame(new Date,"day")||void 0,"data-hidden":Q||void 0,"data-highlight-today":te||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!S&&C||void 0,"data-outside":!_&&S||void 0,"data-selected":!_&&k||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":z&&!_||void 0,"data-last-in-range":B&&!_||void 0,"data-static":U||void 0,unstyled:i,...G,children:j?.(b)||de(b).date()})});yn.classes=ss,yn.displayName="@mantine/dates/Day";function zl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=de().day(r),s=[];for(let c=0;c<7;c+=1)typeof e=="string"?s.push(de(n).add(c,"days").locale(t).format(e)):s.push(e(de(n).add(c,"days").format("YYYY-MM-DD")));return s}var is={weekday:"m_18a3eca"};const Fl=O.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":O.getFontSize(e),"--wr-spacing":O.getSpacing(e)}})),vn=O.factory((t,e)=>{const r=O.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:c,styles:d,unstyled:i,vars:m,locale:b,firstDayOfWeek:_,weekdayFormat:M,cellComponent:C="th",__staticSelector:S,withWeekNumbers:k,attributes:j,...N}=r,z=O.useStyles({name:S||"WeekdaysRow",classes:is,props:r,className:s,style:c,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:Fl,rootSelector:"weekdaysRow"}),B=vt(),Q=zl({locale:B.getLocale(b),format:M,firstDayOfWeek:B.getFirstDayOfWeek(_)}).map((U,te)=>y.jsx(C,{...z("weekday"),children:U},te));return y.jsxs(O.Box,{component:"tr",ref:e,...z("weekdaysRow"),...N,children:[k&&y.jsx(C,{...z("weekday"),children:"#"}),Q]})});vn.classes=is,vn.displayName="@mantine/dates/WeekdaysRow";function Wl(t,e=1){let r=de(t);if(!r.isValid())return r;const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function Ul(t,e=1){let r=de(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function ql({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=de(t).subtract(de(t).date()-1,"day"),s=de(n.format("YYYY-M-D")),c=s.format("YYYY-MM-DD"),d=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),i=Wl(d,e),m=[];let b=de(Ul(c,e));for(;de(b).isBefore(i,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(b.format("YYYY-MM-DD")),b=b.add(1,"day");m.push(_)}if(r&&m.length<6){const _=m[m.length-1],M=_[_.length-1];let C=de(M).add(1,"day");for(;m.length<6;){const S=[];for(let k=0;k<7;k+=1)S.push(C.format("YYYY-MM-DD")),C=C.add(1,"day");m.push(S)}}return m}function bn(t,e){return de(t).format("YYYY-MM")===de(e).format("YYYY-MM")}function as(t,e){return e?de(t).isAfter(de(e).subtract(1,"day"),"day"):!0}function ls(t,e){return e?de(t).isBefore(de(e).add(1,"day"),"day"):!0}function Vl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:c,month:d}){const i=t.flat().filter(_=>ls(_,r)&&as(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!c||bn(_,d))),m=i.find(_=>n?.(_)?.selected);if(m)return m;const b=i.find(_=>de().isSame(_,"date"));return b||i[0]}var wr={exports:{}},Hl=wr.exports,us;function Gl(){return us||(us=1,(function(t,e){(function(r,n){t.exports=n()})(Hl,(function(){var r="day";return function(n,s,c){var d=function(b){return b.add(4-b.isoWeekday(),r)},i=s.prototype;i.isoWeekYear=function(){return d(this).year()},i.isoWeek=function(b){if(!this.$utils().u(b))return this.add(7*(b-this.isoWeek()),r);var _,M,C,S,k=d(this),j=(_=this.isoWeekYear(),M=this.$u,C=(M?c.utc:c)().year(_).startOf("year"),S=4-C.isoWeekday(),C.isoWeekday()>4&&(S+=7),C.add(S,r));return k.diff(j,"week")+1},i.isoWeekday=function(b){return this.$utils().u(b)?this.day()||7:this.day(this.day()%7?b:b-7)};var m=i.startOf;i.startOf=function(b,_){var M=this.$utils(),C=!!M.u(_)||_;return M.p(b)==="isoweek"?C?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):m.bind(this)(b,_)}}}))})(wr)),wr.exports}var Ql=Gl();const Kl=Ln(Ql);de.extend(Kl);function Zl(t){const e=t.find(r=>de(r).day()===1);return de(e).isoWeek()}var cs={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Jl={withCellSpacing:!0},Xl=O.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":O.getFontSize(e),"--wn-size":O.getSize(e,"wn-size")}})),_r=O.factory((t,e)=>{const r=O.useProps("Month",Jl,t),{classNames:n,className:s,style:c,styles:d,unstyled:i,vars:m,__staticSelector:b,locale:_,firstDayOfWeek:M,weekdayFormat:C,month:S,weekendDays:k,getDayProps:j,excludeDate:N,minDate:z,maxDate:B,renderDay:Q,hideOutsideDates:U,hideWeekdays:te,getDayAriaLabel:ne,static:G,__getDayRef:J,__onDayKeyDown:q,__onDayClick:V,__onDayMouseEnter:Z,__preventFocus:ae,__stopPropagation:X,withCellSpacing:P,size:x,highlightToday:w,withWeekNumbers:h,attributes:l,...p}=r,f=O.useStyles({name:b||"Month",classes:cs,props:r,className:s,style:c,classNames:n,styles:d,unstyled:i,attributes:l,vars:m,varsResolver:Xl,rootSelector:"month"}),a=vt(),v=ql({month:S,firstDayOfWeek:a.getFirstDayOfWeek(M),consistentWeeks:a.consistentWeeks}),D=Vl({dates:v,minDate:Ke(z),maxDate:Ke(B),getDayProps:j,excludeDate:N,hideOutsideDates:U,month:S}),{resolvedClassNames:T,resolvedStyles:H}=O.useResolvedStylesApi({classNames:n,styles:d,props:r}),ee=v.map((re,F)=>{const se=re.map((ie,ue)=>{const E=!bn(ie,S),L=ne?.(ie)||de(ie).locale(_||a.locale).format("D MMMM YYYY"),$=j?.(ie),I=de(ie).isSame(D,"date");return y.jsx("td",{...f("monthCell"),"data-with-spacing":P||void 0,children:y.jsx(yn,{__staticSelector:b||"Month",classNames:T,styles:H,unstyled:i,"data-mantine-stop-propagation":X||void 0,highlightToday:w,renderDay:Q,date:ie,size:x,weekend:a.getWeekendDays(k).includes(de(ie).get("day")),outside:E,hidden:U?E:!1,"aria-label":L,static:G,disabled:N?.(ie)||!ls(ie,Ke(B))||!as(ie,Ke(z)),ref:Y=>{Y&&J?.(F,ue,Y)},...$,onKeyDown:Y=>{$?.onKeyDown?.(Y),q?.(Y,{rowIndex:F,cellIndex:ue,date:ie})},onMouseEnter:Y=>{$?.onMouseEnter?.(Y),Z?.(Y,ie)},onClick:Y=>{$?.onClick?.(Y),V?.(Y,ie)},onMouseDown:Y=>{$?.onMouseDown?.(Y),ae&&Y.preventDefault()},tabIndex:ae||!I?-1:0})},ie.toString())});return y.jsxs("tr",{...f("monthRow"),children:[h&&y.jsx("td",{...f("weekNumber"),children:Zl(re)}),se]},F)});return y.jsxs(O.Box,{component:"table",...f("month"),size:x,ref:e,...p,children:[!te&&y.jsx("thead",{...f("monthThead"),children:y.jsx(vn,{__staticSelector:b||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:C,size:x,classNames:T,styles:H,unstyled:i,withWeekNumbers:h})}),y.jsx("tbody",{...f("monthTbody"),children:ee})]})});_r.classes=cs,_r.displayName="@mantine/dates/Month";var ds={pickerControl:"m_dc6a3c71"};const eu=O.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":O.getFontSize(e),"--dpc-size":O.getSize(e,"dpc-size")}})),xr=O.factory((t,e)=>{const r=O.useProps("PickerControl",null,t),{classNames:n,className:s,style:c,styles:d,unstyled:i,vars:m,firstInRange:b,lastInRange:_,inRange:M,__staticSelector:C,selected:S,disabled:k,attributes:j,...N}=r,z=O.useStyles({name:C||"PickerControl",classes:ds,props:r,className:s,style:c,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:eu,rootSelector:"pickerControl"});return y.jsx(O.UnstyledButton,{...z("pickerControl"),ref:e,unstyled:i,"data-picker-control":!0,"data-selected":S&&!k||void 0,"data-disabled":k||void 0,"data-in-range":M&&!k&&!S||void 0,"data-first-in-range":b&&!k||void 0,"data-last-in-range":_&&!k||void 0,disabled:k,...N})});xr.classes=ds,xr.displayName="@mantine/dates/PickerControl";function hs({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"year")||r&&de(t).isAfter(r,"year"))}function tu({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(i=>!hs({year:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),c=s.find(i=>n?.(i)?.selected);if(c)return c;const d=s.find(i=>de().isSame(i,"year"));return d||s[0]}function fs(t){const e=de(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let c=0;c<4;c+=1){const d=c===3?1:3;for(let i=0;i<d;i+=1)s[c].push(de(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var ps={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const ru={yearsListFormat:"YYYY",withCellSpacing:!0},Cr=O.factory((t,e)=>{const r=O.useProps("YearsList",ru,t),{classNames:n,className:s,style:c,styles:d,unstyled:i,vars:m,decade:b,yearsListFormat:_,locale:M,minDate:C,maxDate:S,getYearControlProps:k,__staticSelector:j,__getControlRef:N,__onControlKeyDown:z,__onControlClick:B,__onControlMouseEnter:Q,__preventFocus:U,__stopPropagation:te,withCellSpacing:ne,size:G,attributes:J,...q}=r,V=O.useStyles({name:j||"YearsList",classes:ps,props:r,className:s,style:c,classNames:n,styles:d,unstyled:i,attributes:J,vars:m,rootSelector:"yearsList"}),Z=vt(),ae=fs(b),X=tu({years:ae,minDate:C,maxDate:S,getYearControlProps:k}),P=ae.map((x,w)=>{const h=x.map((l,p)=>{const f=k?.(l),a=de(l).isSame(X,"year");return y.jsx("td",{...V("yearsListCell"),"data-with-spacing":ne||void 0,children:y.jsx(xr,{...V("yearsListControl"),size:G,unstyled:i,"data-mantine-stop-propagation":te||void 0,disabled:hs({year:l,minDate:C,maxDate:S}),ref:v=>{v&&N?.(w,p,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),z?.(v,{rowIndex:w,cellIndex:p,date:l})},onClick:v=>{f?.onClick?.(v),B?.(v,l)},onMouseEnter:v=>{f?.onMouseEnter?.(v),Q?.(v,l)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!a?-1:0,children:de(l).locale(Z.getLocale(M)).format(_)})},p)});return y.jsx("tr",{...V("yearsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:G,...V("yearsList"),...q,children:y.jsx("tbody",{children:P})})});Cr.classes=ps,Cr.displayName="@mantine/dates/YearsList";function gs({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"month")||r&&de(t).isAfter(r,"month"))}function nu({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(i=>!gs({month:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),c=s.find(i=>n?.(i)?.selected);if(c)return c;const d=s.find(i=>de().isSame(i,"month"));return d||s[0]}function ou(t){const e=de(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let c=0;c<3;c+=1)r[s].push(de(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var ms={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const su={monthsListFormat:"MMM",withCellSpacing:!0},Sr=O.factory((t,e)=>{const r=O.useProps("MonthsList",su,t),{classNames:n,className:s,style:c,styles:d,unstyled:i,vars:m,__staticSelector:b,year:_,monthsListFormat:M,locale:C,minDate:S,maxDate:k,getMonthControlProps:j,__getControlRef:N,__onControlKeyDown:z,__onControlClick:B,__onControlMouseEnter:Q,__preventFocus:U,__stopPropagation:te,withCellSpacing:ne,size:G,attributes:J,...q}=r,V=O.useStyles({name:b||"MonthsList",classes:ms,props:r,className:s,style:c,classNames:n,styles:d,unstyled:i,attributes:J,vars:m,rootSelector:"monthsList"}),Z=vt(),ae=ou(_),X=nu({months:ae,minDate:Ke(S),maxDate:Ke(k),getMonthControlProps:j}),P=ae.map((x,w)=>{const h=x.map((l,p)=>{const f=j?.(l),a=de(l).isSame(X,"month");return y.jsx("td",{...V("monthsListCell"),"data-with-spacing":ne||void 0,children:y.jsx(xr,{...V("monthsListControl"),size:G,unstyled:i,__staticSelector:b||"MonthsList","data-mantine-stop-propagation":te||void 0,disabled:gs({month:l,minDate:Ke(S),maxDate:Ke(k)}),ref:v=>{v&&N?.(w,p,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),z?.(v,{rowIndex:w,cellIndex:p,date:l})},onClick:v=>{f?.onClick?.(v),B?.(v,l)},onMouseEnter:v=>{f?.onMouseEnter?.(v),Q?.(v,l)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!a?-1:0,children:de(l).locale(Z.getLocale(C)).format(M)})},p)});return y.jsx("tr",{...V("monthsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:G,...V("monthsList"),...q,children:y.jsx("tbody",{children:P})})});Sr.classes=ms,Sr.displayName="@mantine/dates/MonthsList";var ys={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const iu={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},au=O.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":O.getSize(e,"dch-control-size"),"--dch-fz":O.getFontSize(e)}})),bt=O.factory((t,e)=>{const r=O.useProps("CalendarHeader",iu,t),{classNames:n,className:s,style:c,styles:d,unstyled:i,vars:m,nextIcon:b,previousIcon:_,nextLabel:M,previousLabel:C,onNext:S,onPrevious:k,onLevelClick:j,label:N,nextDisabled:z,previousDisabled:B,hasNextLevel:Q,levelControlAriaLabel:U,withNext:te,withPrevious:ne,headerControlsOrder:G,__staticSelector:J,__preventFocus:q,__stopPropagation:V,attributes:Z,...ae}=r,X=O.useStyles({name:J||"CalendarHeader",classes:ys,props:r,className:s,style:c,classNames:n,styles:d,unstyled:i,attributes:Z,vars:m,varsResolver:au,rootSelector:"calendarHeader"}),P=q?p=>p.preventDefault():void 0,x=ne&&K.createElement(O.UnstyledButton,{...X("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":C,onClick:k,unstyled:i,onMouseDown:P,disabled:B,"data-disabled":B||void 0,tabIndex:q||B?-1:0,"data-mantine-stop-propagation":V||void 0},_||y.jsx(O.AccordionChevron,{...X("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),w=K.createElement(O.UnstyledButton,{component:Q?"button":"div",...X("calendarHeaderLevel"),key:"level",onClick:Q?j:void 0,unstyled:i,onMouseDown:Q?P:void 0,disabled:!Q,"data-static":!Q||void 0,"aria-label":U,tabIndex:q||!Q?-1:0,"data-mantine-stop-propagation":V||void 0},N),h=te&&K.createElement(O.UnstyledButton,{...X("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:S,unstyled:i,onMouseDown:P,disabled:z,"data-disabled":z||void 0,tabIndex:q||z?-1:0,"data-mantine-stop-propagation":V||void 0},b||y.jsx(O.AccordionChevron,{...X("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),l=G.map(p=>p==="previous"?x:p==="level"?w:p==="next"?h:null);return y.jsx(O.Box,{...X("calendarHeader"),ref:e,...ae,children:l})});bt.classes=ys,bt.displayName="@mantine/dates/CalendarHeader";function lu(t){const e=fs(t);return[e[0][0],e[3][0]]}const uu={decadeLabelFormat:"YYYY"},Dr=O.factory((t,e)=>{const r=O.useProps("DecadeLevel",uu,t),{decade:n,locale:s,minDate:c,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,withCellSpacing:S,__preventFocus:k,nextIcon:j,previousIcon:N,nextLabel:z,previousLabel:B,onNext:Q,onPrevious:U,nextDisabled:te,previousDisabled:ne,levelControlAriaLabel:G,withNext:J,withPrevious:q,headerControlsOrder:V,decadeLabelFormat:Z,classNames:ae,styles:X,unstyled:P,__staticSelector:x,__stopPropagation:w,size:h,attributes:l,...p}=r,f=vt(),[a,v]=lu(n),D={__staticSelector:x||"DecadeLevel",classNames:ae,styles:X,unstyled:P,size:h,attributes:l},T=typeof te=="boolean"?te:d?!de(v).endOf("year").isBefore(d):!1,H=typeof ne=="boolean"?ne:c?!de(a).startOf("year").isAfter(c):!1,ee=(re,F)=>de(re).locale(s||f.locale).format(F);return y.jsxs(O.Box,{"data-decade-level":!0,size:h,ref:e,...p,children:[y.jsx(bt,{label:typeof Z=="function"?Z(a,v):`${ee(a,Z)} – ${ee(v,Z)}`,__preventFocus:k,__stopPropagation:w,nextIcon:j,previousIcon:N,nextLabel:z,previousLabel:B,onNext:Q,onPrevious:U,nextDisabled:T,previousDisabled:H,hasNextLevel:!1,levelControlAriaLabel:G,withNext:J,withPrevious:q,headerControlsOrder:V,...D}),y.jsx(Cr,{decade:n,locale:s,minDate:c,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,__preventFocus:k,__stopPropagation:w,withCellSpacing:S,...D})]})});Dr.classes={...Cr.classes,...bt.classes},Dr.displayName="@mantine/dates/DecadeLevel";const cu={yearLabelFormat:"YYYY"},kr=O.factory((t,e)=>{const r=O.useProps("YearLevel",cu,t),{year:n,locale:s,minDate:c,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,withCellSpacing:S,__preventFocus:k,nextIcon:j,previousIcon:N,nextLabel:z,previousLabel:B,onNext:Q,onPrevious:U,onLevelClick:te,nextDisabled:ne,previousDisabled:G,hasNextLevel:J,levelControlAriaLabel:q,withNext:V,withPrevious:Z,headerControlsOrder:ae,yearLabelFormat:X,__staticSelector:P,__stopPropagation:x,size:w,classNames:h,styles:l,unstyled:p,attributes:f,...a}=r,v=vt(),D={__staticSelector:P||"YearLevel",classNames:h,styles:l,unstyled:p,size:w,attributes:f},T=typeof ne=="boolean"?ne:d?!de(n).endOf("year").isBefore(d):!1,H=typeof G=="boolean"?G:c?!de(n).startOf("year").isAfter(c):!1;return y.jsxs(O.Box,{"data-year-level":!0,size:w,ref:e,...a,children:[y.jsx(bt,{label:typeof X=="function"?X(n):de(n).locale(s||v.locale).format(X),__preventFocus:k,__stopPropagation:x,nextIcon:j,previousIcon:N,nextLabel:z,previousLabel:B,onNext:Q,onPrevious:U,onLevelClick:te,nextDisabled:T,previousDisabled:H,hasNextLevel:J,levelControlAriaLabel:q,withNext:V,withPrevious:Z,headerControlsOrder:ae,...D}),y.jsx(Sr,{year:n,locale:s,minDate:c,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:b,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:C,__preventFocus:k,__stopPropagation:x,withCellSpacing:S,...D})]})});kr.classes={...bt.classes,...Sr.classes},kr.displayName="@mantine/dates/YearLevel";const du={monthLabelFormat:"MMMM YYYY"},Pr=O.factory((t,e)=>{const r=O.useProps("MonthLevel",du,t),{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:z,__onDayClick:B,__onDayMouseEnter:Q,withCellSpacing:U,highlightToday:te,withWeekNumbers:ne,__preventFocus:G,__stopPropagation:J,nextIcon:q,previousIcon:V,nextLabel:Z,previousLabel:ae,onNext:X,onPrevious:P,onLevelClick:x,nextDisabled:w,previousDisabled:h,hasNextLevel:l,levelControlAriaLabel:p,withNext:f,withPrevious:a,headerControlsOrder:v,monthLabelFormat:D,classNames:T,styles:H,unstyled:ee,__staticSelector:re,size:F,static:se,attributes:ie,...ue}=r,E=vt(),L={__staticSelector:re||"MonthLevel",classNames:T,styles:H,unstyled:ee,size:F,attributes:ie},$=typeof w=="boolean"?w:M?!de(n).endOf("month").isBefore(M):!1,I=typeof h=="boolean"?h:_?!de(n).startOf("month").isAfter(_):!1;return y.jsxs(O.Box,{"data-month-level":!0,size:F,ref:e,...ue,children:[y.jsx(bt,{label:typeof D=="function"?D(n):de(n).locale(s||E.locale).format(D),__preventFocus:G,__stopPropagation:J,nextIcon:q,previousIcon:V,nextLabel:Z,previousLabel:ae,onNext:X,onPrevious:P,onLevelClick:x,nextDisabled:$,previousDisabled:I,hasNextLevel:l,levelControlAriaLabel:p,withNext:f,withPrevious:a,headerControlsOrder:v,...L}),y.jsx(_r,{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:z,__onDayClick:B,__onDayMouseEnter:Q,__preventFocus:G,__stopPropagation:J,static:se,withCellSpacing:U,highlightToday:te,withWeekNumbers:ne,...L})]})});Pr.classes={..._r.classes,...bt.classes},Pr.displayName="@mantine/dates/MonthLevel";var vs={levelsGroup:"m_30b26e33"};const wt=O.factory((t,e)=>{const r=O.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:c,styles:d,unstyled:i,vars:m,__staticSelector:b,attributes:_,...M}=r,C=O.useStyles({name:b||"LevelsGroup",classes:vs,props:r,className:s,style:c,classNames:n,styles:d,unstyled:i,attributes:_,vars:m,rootSelector:"levelsGroup"});return y.jsx(O.Box,{ref:e,...C("levelsGroup"),...M})});wt.classes=vs,wt.displayName="@mantine/dates/LevelsGroup";const hu={numberOfColumns:1},Mr=O.factory((t,e)=>{const r=O.useProps("DecadeLevelGroup",hu,t),{decade:n,locale:s,minDate:c,maxDate:d,yearsListFormat:i,getYearControlProps:m,__onControlClick:b,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:C,nextIcon:S,previousIcon:k,nextLabel:j,previousLabel:N,onNext:z,onPrevious:B,nextDisabled:Q,previousDisabled:U,headerControlsOrder:te,classNames:ne,styles:G,unstyled:J,__staticSelector:q,__stopPropagation:V,numberOfColumns:Z,levelControlAriaLabel:ae,decadeLabelFormat:X,size:P,vars:x,attributes:w,...h}=r,l=K.useRef([]),p=Array(Z).fill(0).map((f,a)=>{const v=de(n).add(a*10,"years").format("YYYY-MM-DD");return y.jsx(Dr,{size:P,yearsListFormat:i,decade:v,withNext:a===Z-1,withPrevious:a===0,decadeLabelFormat:X,__onControlClick:b,__onControlMouseEnter:_,__onControlKeyDown:(D,T)=>mn({levelIndex:a,rowIndex:T.rowIndex,cellIndex:T.cellIndex,event:D,controlsRef:l}),__getControlRef:(D,T,H)=>{Array.isArray(l.current[a])||(l.current[a]=[]),Array.isArray(l.current[a][D])||(l.current[a][D]=[]),l.current[a][D][T]=H},levelControlAriaLabel:typeof ae=="function"?ae(v):ae,locale:s,minDate:c,maxDate:d,__preventFocus:C,__stopPropagation:V,nextIcon:S,previousIcon:k,nextLabel:j,previousLabel:N,onNext:z,onPrevious:B,nextDisabled:Q,previousDisabled:U,getYearControlProps:m,__staticSelector:q||"DecadeLevelGroup",classNames:ne,styles:G,unstyled:J,withCellSpacing:M,headerControlsOrder:te,attributes:w},a)});return y.jsx(wt,{classNames:ne,styles:G,__staticSelector:q||"DecadeLevelGroup",ref:e,size:P,unstyled:J,attributes:w,...h,children:p})});Mr.classes={...wt.classes,...Dr.classes},Mr.displayName="@mantine/dates/DecadeLevelGroup";const fu={numberOfColumns:1},Or=O.factory((t,e)=>{const r=O.useProps("YearLevelGroup",fu,t),{year:n,locale:s,minDate:c,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__onControlClick:b,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:C,nextIcon:S,previousIcon:k,nextLabel:j,previousLabel:N,onNext:z,onPrevious:B,onLevelClick:Q,nextDisabled:U,previousDisabled:te,hasNextLevel:ne,headerControlsOrder:G,classNames:J,styles:q,unstyled:V,__staticSelector:Z,__stopPropagation:ae,numberOfColumns:X,levelControlAriaLabel:P,yearLabelFormat:x,size:w,vars:h,attributes:l,...p}=r,f=K.useRef([]),a=Array(X).fill(0).map((v,D)=>{const T=de(n).add(D,"years").format("YYYY-MM-DD");return y.jsx(kr,{size:w,monthsListFormat:i,year:T,withNext:D===X-1,withPrevious:D===0,yearLabelFormat:x,__stopPropagation:ae,__onControlClick:b,__onControlMouseEnter:_,__onControlKeyDown:(H,ee)=>mn({levelIndex:D,rowIndex:ee.rowIndex,cellIndex:ee.cellIndex,event:H,controlsRef:f}),__getControlRef:(H,ee,re)=>{Array.isArray(f.current[D])||(f.current[D]=[]),Array.isArray(f.current[D][H])||(f.current[D][H]=[]),f.current[D][H][ee]=re},levelControlAriaLabel:typeof P=="function"?P(T):P,locale:s,minDate:c,maxDate:d,__preventFocus:C,nextIcon:S,previousIcon:k,nextLabel:j,previousLabel:N,onNext:z,onPrevious:B,onLevelClick:Q,nextDisabled:U,previousDisabled:te,hasNextLevel:ne,getMonthControlProps:m,classNames:J,styles:q,unstyled:V,__staticSelector:Z||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:G,attributes:l},D)});return y.jsx(wt,{classNames:J,styles:q,__staticSelector:Z||"YearLevelGroup",ref:e,size:w,unstyled:V,attributes:l,...p,children:a})});Or.classes={...kr.classes,...wt.classes},Or.displayName="@mantine/dates/YearLevelGroup";const pu={numberOfColumns:1},jr=O.factory((t,e)=>{const r=O.useProps("MonthLevelGroup",pu,t),{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:j,__onDayClick:N,__onDayMouseEnter:z,withCellSpacing:B,highlightToday:Q,withWeekNumbers:U,__preventFocus:te,nextIcon:ne,previousIcon:G,nextLabel:J,previousLabel:q,onNext:V,onPrevious:Z,onLevelClick:ae,nextDisabled:X,previousDisabled:P,hasNextLevel:x,headerControlsOrder:w,classNames:h,styles:l,unstyled:p,numberOfColumns:f,levelControlAriaLabel:a,monthLabelFormat:v,__staticSelector:D,__stopPropagation:T,size:H,static:ee,vars:re,attributes:F,...se}=r,ie=K.useRef([]),ue=Array(f).fill(0).map((E,L)=>{const $=de(n).add(L,"months").format("YYYY-MM-DD");return y.jsx(Pr,{month:$,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:v,__stopPropagation:T,__onDayClick:N,__onDayMouseEnter:z,__onDayKeyDown:(I,Y)=>mn({levelIndex:L,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:I,controlsRef:ie}),__getDayRef:(I,Y,ce)=>{Array.isArray(ie.current[L])||(ie.current[L]=[]),Array.isArray(ie.current[L][I])||(ie.current[L][I]=[]),ie.current[L][I][Y]=ce},levelControlAriaLabel:typeof a=="function"?a($):a,locale:s,firstDayOfWeek:c,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:b,minDate:_,maxDate:M,renderDay:C,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:j,__preventFocus:te,nextIcon:ne,previousIcon:G,nextLabel:J,previousLabel:q,onNext:V,onPrevious:Z,onLevelClick:ae,nextDisabled:X,previousDisabled:P,hasNextLevel:x,classNames:h,styles:l,unstyled:p,__staticSelector:D||"MonthLevelGroup",size:H,static:ee,withCellSpacing:B,highlightToday:Q,withWeekNumbers:U,headerControlsOrder:w,attributes:F},L)});return y.jsx(wt,{classNames:h,styles:l,__staticSelector:D||"MonthLevelGroup",ref:e,size:H,attributes:F,...se,children:ue})});jr.classes={...wt.classes,...Pr.classes},jr.displayName="@mantine/dates/MonthLevelGroup";const bs=t=>t==="range"?[null,null]:t==="multiple"?[]:null,ws=(t,e)=>{const r=e?rs:Ke;return Array.isArray(t)?t.map(r):r(t)};function wn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const c=K.useRef(t),[d,i,m]=Be.useUncontrolled({value:ws(e,s),defaultValue:ws(r,s),finalValue:bs(t),onChange:n});let b=d;return c.current!==t&&(c.current=t,e===void 0&&(b=r!==void 0?r:bs(t),i(b))),[b,i,m]}function _n(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function gu(t){return t===0?"month":t===1?"year":"decade"}function nr(t,e,r){return gu(Be.clamp(_n(t,0),_n(e,0),_n(r,2)))}const mu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Ar=O.factory((t,e)=>{const r=O.useProps("Calendar",mu,t),{vars:n,maxLevel:s,minLevel:c,defaultLevel:d,level:i,onLevelChange:m,date:b,defaultDate:_,onDateChange:M,numberOfColumns:C,columnsToScroll:S,ariaLabels:k,nextLabel:j,previousLabel:N,onYearSelect:z,onMonthSelect:B,onYearMouseEnter:Q,onMonthMouseEnter:U,headerControlsOrder:te,__updateDateOnYearSelect:ne,__updateDateOnMonthSelect:G,__setDateRef:J,__setLevelRef:q,firstDayOfWeek:V,weekdayFormat:Z,weekendDays:ae,getDayProps:X,excludeDate:P,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:l,monthLabelFormat:p,nextIcon:f,previousIcon:a,__onDayClick:v,__onDayMouseEnter:D,withCellSpacing:T,highlightToday:H,withWeekNumbers:ee,monthsListFormat:re,getMonthControlProps:F,yearLabelFormat:se,yearsListFormat:ie,getYearControlProps:ue,decadeLabelFormat:E,classNames:L,styles:$,unstyled:I,minDate:Y,maxDate:ce,locale:o,__staticSelector:u,size:g,__preventFocus:A,__stopPropagation:R,onNextDecade:W,onPreviousDecade:le,onNextYear:he,onPreviousYear:pe,onNextMonth:oe,onPreviousMonth:fe,static:ge,enableKeyboardNavigation:me,attributes:ve,...xe}=r,{resolvedClassNames:ke,resolvedStyles:We}=O.useResolvedStylesApi({classNames:L,styles:$,props:r}),[Ee,Pe]=Be.useUncontrolled({value:i?nr(i,c,s):void 0,defaultValue:d?nr(d,c,s):void 0,finalValue:nr(void 0,c,s),onChange:m}),[Mt,$e]=wn({type:"default",value:Ke(b),defaultValue:Ke(_),onChange:M});K.useImperativeHandle(J,()=>be=>{$e(be)}),K.useImperativeHandle(q,()=>be=>{Pe(be)});const dt={__staticSelector:u||"Calendar",styles:We,classNames:ke,unstyled:I,size:g,attributes:ve},Ue=S||C||1,ht=new Date,Ot=Y&&de(ht).isAfter(Y)?Y:de(ht).format("YYYY-MM-DD"),Re=Mt||Ot,jt=()=>{const be=de(Re).add(Ue,"month").format("YYYY-MM-DD");oe?.(be),$e(be)},ze=()=>{const be=de(Re).subtract(Ue,"month").format("YYYY-MM-DD");fe?.(be),$e(be)},ft=()=>{const be=de(Re).add(Ue,"year").format("YYYY-MM-DD");he?.(be),$e(be)},Ze=()=>{const be=de(Re).subtract(Ue,"year").format("YYYY-MM-DD");pe?.(be),$e(be)},lt=()=>{const be=de(Re).add(10*Ue,"year").format("YYYY-MM-DD");W?.(be),$e(be)},Je=()=>{const be=de(Re).subtract(10*Ue,"year").format("YYYY-MM-DD");le?.(be),$e(be)},st=K.useRef(null);K.useEffect(()=>{if(!me||ge)return;const be=Me=>{if(!st.current?.contains(document.activeElement))return;const qe=Me.ctrlKey||Me.metaKey,it=Me.shiftKey;switch(Me.key){case"ArrowUp":qe&&it?(Me.preventDefault(),Je()):qe&&(Me.preventDefault(),Ze());break;case"ArrowDown":qe&&it?(Me.preventDefault(),lt()):qe&&(Me.preventDefault(),ft());break;case"y":case"Y":Ee==="month"&&(Me.preventDefault(),Pe("year"));break}};return document.addEventListener("keydown",be),()=>{document.removeEventListener("keydown",be)}},[me,ge,Ee,ft,Ze,lt,Je]);const ut=be=>{st.current=be,typeof e=="function"?e(be):e&&(e.current=be)};return y.jsxs(O.Box,{ref:ut,size:g,"data-calendar":!0,...xe,children:[Ee==="month"&&y.jsx(jr,{month:Re,minDate:Y,maxDate:ce,firstDayOfWeek:V,weekdayFormat:Z,weekendDays:ae,getDayProps:X,excludeDate:P,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:l,onNext:jt,onPrevious:ze,hasNextLevel:s!=="month",onLevelClick:()=>Pe("year"),numberOfColumns:C,locale:o,levelControlAriaLabel:k?.monthLevelControl,nextLabel:k?.nextMonth??j,nextIcon:f,previousLabel:k?.previousMonth??N,previousIcon:a,monthLabelFormat:p,__onDayClick:v,__onDayMouseEnter:D,__preventFocus:A,__stopPropagation:R,static:ge,withCellSpacing:T,highlightToday:H,withWeekNumbers:ee,headerControlsOrder:te,...dt}),Ee==="year"&&y.jsx(Or,{year:Re,numberOfColumns:C,minDate:Y,maxDate:ce,monthsListFormat:re,getMonthControlProps:F,locale:o,onNext:ft,onPrevious:Ze,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Pe("decade"),levelControlAriaLabel:k?.yearLevelControl,nextLabel:k?.nextYear??j,nextIcon:f,previousLabel:k?.previousYear??N,previousIcon:a,yearLabelFormat:se,__onControlMouseEnter:U,__onControlClick:(be,Me)=>{G&&$e(Me),Pe(nr("month",c,s)),B?.(Me)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:te,...dt}),Ee==="decade"&&y.jsx(Mr,{decade:Re,minDate:Y,maxDate:ce,yearsListFormat:ie,getYearControlProps:ue,locale:o,onNext:lt,onPrevious:Je,numberOfColumns:C,nextLabel:k?.nextDecade??j,nextIcon:f,previousLabel:k?.previousDecade??N,previousIcon:a,decadeLabelFormat:E,__onControlMouseEnter:Q,__onControlClick:(be,Me)=>{ne&&$e(Me),Pe(nr("year",c,s)),z?.(Me)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:te,...dt})]})});Ar.classes={...Mr.classes,...Or.classes,...jr.classes},Ar.displayName="@mantine/dates/Calendar";function yu(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:c,nextIcon:d,previousIcon:i,date:m,defaultDate:b,onDateChange:_,numberOfColumns:M,columnsToScroll:C,ariaLabels:S,nextLabel:k,previousLabel:j,onYearSelect:N,onMonthSelect:z,onYearMouseEnter:B,onMonthMouseEnter:Q,onNextMonth:U,onPreviousMonth:te,onNextYear:ne,onPreviousYear:G,onNextDecade:J,onPreviousDecade:q,withCellSpacing:V,highlightToday:Z,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:X,__setDateRef:P,__setLevelRef:x,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:l,weekdayFormat:p,weekendDays:f,getDayProps:a,excludeDate:v,renderDay:D,hideOutsideDates:T,hideWeekdays:H,getDayAriaLabel:ee,monthLabelFormat:re,monthsListFormat:F,getMonthControlProps:se,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:I,minDate:Y,maxDate:ce,locale:o,...u}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:c,nextIcon:d,previousIcon:i,date:m,defaultDate:b,onDateChange:_,numberOfColumns:M,columnsToScroll:C,ariaLabels:S,nextLabel:k,previousLabel:j,onYearSelect:N,onMonthSelect:z,onYearMouseEnter:B,onMonthMouseEnter:Q,onNextMonth:U,onPreviousMonth:te,onNextYear:ne,onPreviousYear:G,onNextDecade:J,onPreviousDecade:q,withCellSpacing:V,highlightToday:Z,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:X,__setDateRef:P,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:l,weekdayFormat:p,weekendDays:f,getDayProps:a,excludeDate:v,renderDay:D,hideOutsideDates:T,hideWeekdays:H,getDayAriaLabel:ee,monthLabelFormat:re,monthsListFormat:F,getMonthControlProps:se,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:I,minDate:Y,maxDate:ce,locale:o},others:u}}function vu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:de(e).format("YYYY-MM-DD")}function bu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&de(t).isAfter(e,"date")||r&&de(t).isBefore(r,"date"))}const wu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},Er=O.factory((t,e)=>{const r=O.useInputProps("DateInput",wu,t),{inputProps:n,wrapperProps:s,value:c,defaultValue:d,onChange:i,clearable:m,clearButtonProps:b,popoverProps:_,getDayProps:M,locale:C,valueFormat:S,dateParser:k,minDate:j,maxDate:N,fixOnBlur:z,onFocus:B,onBlur:Q,onClick:U,onKeyDown:te,readOnly:ne,name:G,form:J,rightSection:q,unstyled:V,classNames:Z,styles:ae,allowDeselect:X,date:P,defaultDate:x,onDateChange:w,getMonthControlProps:h,getYearControlProps:l,disabled:p,...f}=r,a=K.useRef(null),v=K.useRef(null),[D,T]=K.useState(!1),{calendarProps:H,others:ee}=yu(f),re=vt(),se=k||(oe=>{const fe=de(oe,S,re.getLocale(C)).toDate();return Number.isNaN(fe.getTime())?vu(oe):de(fe).format("YYYY-MM-DD")}),ie=X!==void 0?X:m,ue=oe=>oe?de(oe).locale(re.getLocale(C)).format(S):"",[E,L,$]=wn({type:"default",value:c,defaultValue:d,onChange:i}),[I,Y]=wn({type:"default",value:P,defaultValue:d||x,onChange:w});K.useEffect(()=>{$&&c!==null&&Y(c)},[$,c]);const[ce,o]=K.useState(ue(E));K.useEffect(()=>{o(ue(E))},[re.getLocale(C)]);const u=oe=>{const fe=oe.currentTarget.value;if(o(fe),T(!0),fe.trim()===""&&(X||m))L(null);else{const ge=se(fe);ge&&bu({date:ge,minDate:j,maxDate:N})&&(L(ge),Y(ge))}},g=oe=>{Q?.(oe),T(!1),z&&o(ue(E))},A=oe=>{B?.(oe),T(!0)},R=oe=>{U?.(oe),T(!0)},W=oe=>{oe.key==="Escape"&&T(!1),te?.(oe)},le=oe=>({...M?.(oe),selected:de(E).isSame(oe,"day"),onClick:fe=>{M?.(oe).onClick?.(fe);const ge=ie&&de(E).isSame(oe,"day")?null:oe;L(ge),!$&&ge&&o(ue(ge)),T(!1)}}),he=y.jsx(O.Input.ClearButton,{onClick:()=>{L(null),!$&&o(""),T(!1)},unstyled:V,...b}),pe=m&&!!E&&!ne&&!p;return Be.useDidUpdate(()=>{E!==void 0&&!D&&o(ue(E))},[E]),Be.useClickOutside(()=>T(!1),void 0,[a.current,v.current]),y.jsxs(y.Fragment,{children:[y.jsx(O.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:a,children:y.jsxs(O.Popover,{opened:D,trapFocus:!1,position:"bottom-start",disabled:ne||p,withRoles:!1,unstyled:V,..._,children:[y.jsx(O.Popover.Target,{children:y.jsx(O.Input,{"data-dates-input":!0,"data-read-only":ne||void 0,autoComplete:"off",ref:e,value:ce,onChange:u,onBlur:g,onFocus:A,onClick:R,onKeyDown:W,readOnly:ne,rightSection:q,__clearSection:he,__clearable:pe,...n,...ee,disabled:p,__staticSelector:"DateInput"})}),y.jsx(O.Popover.Dropdown,{onMouseDown:oe=>oe.preventDefault(),"data-dates-dropdown":!0,ref:v,children:y.jsx(Ar,{__staticSelector:"DateInput",...H,classNames:Z,styles:ae,unstyled:V,__preventFocus:!0,minDate:j,maxDate:N,locale:C,getDayProps:le,size:n.size,date:I,onDateChange:Y,getMonthControlProps:oe=>({selected:typeof E=="string"?bn(oe,E):!1,...h?.(oe)}),getYearControlProps:oe=>({selected:typeof E=="string"?de(oe).isSame(E,"year"):!1,...l?.(oe)}),attributes:s.attributes})})]})}),y.jsx(ns,{name:G,form:J,value:E,type:"default"})]})});Er.classes={...O.Input.classes,...Ar.classes},Er.displayName="@mantine/dates/DateInput";function _s(t){const e=Fe.c(49),{fields:r,onClose:n,queryKey:s,apiPath:c,steps:d,onCreated:i}=t,[m,b]=K.useState(0),[_,M]=K.useState(!1),[C,S]=K.useState(),{mutateAsync:k,isError:j,error:N,isPending:z}=Jo(c,s),{mutateAsync:B,isPending:Q}=gn(c,s),U=z||Q;let te;e[0]!==r?(te=new Set(r.filter(Su).map(Cu)),e[0]=r,e[1]=te):te=e[1];let ne;e[2]!==te?(ne=[...te],e[2]=te,e[3]=ne):ne=e[3];const G=ne;let J;e[4]===Symbol.for("react.memo_cache_sentinel")?(J=function(D,T){return typeof D.required=="function"?D.required(T??{}):!!D.required},e[4]=J):J=e[4];const q=J;let V;e[5]!==r?(V=r.reduce(xu,{}),e[5]=r,e[6]=V):V=e[6];let Z;if(e[7]!==r){let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(D,T)=>(D[T.id]=(H,ee)=>T.conditional&&!T.conditional(ee)||!q(T,ee)||H?null:"Pflichtfeld",D),e[9]=v):v=e[9],Z=r.filter(_u).reduce(v,{}),e[7]=r,e[8]=Z}else Z=e[8];let ae;e[10]!==V||e[11]!==Z?(ae={mode:"uncontrolled",initialValues:V,validate:Z},e[10]=V,e[11]=Z,e[12]=ae):ae=e[12];const X=Nn.useForm(ae);let P;e[13]!==X||e[14]!==C?(P=function(D){const T=X.getValues();if(D.conditional&&!D.conditional(T))return null;const H=q(D,T);return y.jsxs(K.Fragment,{children:[(D.type===void 0||D.type=="text")&&y.jsx(O.TextInput,{label:D.column.title,placeholder:D.placeholder??"",...X.getInputProps(D.id),type:D.id.includes("email")?"email":void 0,required:H},X.key(D.id)),D.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:D.column.title,placeholder:D.placeholder??"",...X.getInputProps(D.id),required:H},X.key(D.id)),D.type==="date"&&y.jsx(Er,{label:D.column.title,placeholder:D.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...X.getInputProps(D.id),required:H},X.key(D.id)),D.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:D.column.title,...X.getInputProps(D.id,{type:"checkbox"}),required:H},X.key(D.id)),D.type==="textarea"&&y.jsx(O.Textarea,{label:D.column.title,placeholder:D.placeholder??"",...X.getInputProps(D.id),minRows:3,autosize:!0,required:H},X.key(D.id)),D.type==="custom"&&D.render&&D.render({...X.getValues(),...C&&{id:C}},X.setValues,M,{error:X.getInputProps(D.id).error,required:H})]},D.id)},e[13]=X,e[14]=C,e[15]=P):P=e[15];const x=P;let w;e[16]!==N?.message||e[17]!==N?.name||e[18]!==j?(w=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[16]=N?.message,e[17]=N?.name,e[18]=j,e[19]=w):w=e[19];let h;e[20]!==m||e[21]!==k||e[22]!==X||e[23]!==j||e[24]!==n||e[25]!==i||e[26]!==C||e[27]!==G.length||e[28]!==B?(h=X.onSubmit(async v=>{if(C)await B({...v,id:C});else{const D=await k(v);S(D.id),i?.(D.id)}G.length&&m<G.length-1?j||b(m+1):j||(X.setInitialValues(v),X.reset(),n())}),e[20]=m,e[21]=k,e[22]=X,e[23]=j,e[24]=n,e[25]=i,e[26]=C,e[27]=G.length,e[28]=B,e[29]=h):h=e[29];let l;e[30]!==m||e[31]!==r||e[32]!==x||e[33]!==d||e[34]!==G?(l=G.length?y.jsx(O.Stepper,{active:m,size:"sm",children:G.map(v=>y.jsx(O.Stepper.Step,{...d&&d[v-1]?{label:d[v-1].label}:{},children:r.filter(D=>D.step===v).map(D=>x(D))},v))}):r.map(v=>x(v)),e[30]=m,e[31]=r,e[32]=x,e[33]=d,e[34]=G,e[35]=l):l=e[35];let p;e[36]!==m||e[37]!==_||e[38]!==U||e[39]!==n||e[40]!==G.length?(p=!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>G.length?m===0?n():b(m-1):n(),variant:"outline",children:G.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:U,children:G.length?m===G.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=m,e[37]=_,e[38]=U,e[39]=n,e[40]=G.length,e[41]=p):p=e[41];let f;e[42]!==l||e[43]!==p||e[44]!==h?(f=y.jsxs("form",{onSubmit:h,children:[l,p]}),e[42]=l,e[43]=p,e[44]=h,e[45]=f):f=e[45];let a;return e[46]!==f||e[47]!==w?(a=y.jsxs(y.Fragment,{children:[w,f]}),e[46]=f,e[47]=w,e[48]=a):a=e[48],a}function _u(t){return t.required}function xu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function Cu(t){return t.step}function Su(t){return typeof t.step=="number"}var[Du,xn]=O.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),xs=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:c,resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:b,resetColumnsWidth:_}=t,[M,C]=K.useState(""),[S,k]=K.useState("");return y.jsx(Du,{value:{sourceColumn:M,setSourceColumn:C,targetColumn:S,setTargetColumn:k,columnsToggle:s,setColumnsToggle:c,swapColumns:()=>{if(!r||!n||!M||!S)return;let j=r.indexOf(M),N=r.indexOf(S);if(j!==-1&&N!==-1){let z=r.splice(j,1)[0];r.splice(N,0,z),n([...r])}},resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:b,resetColumnsWidth:_},children:e})};function ku(){return y.jsx("tr",{className:"mantine-datatable-empty-row",children:y.jsx("td",{})})}function Pu(){return y.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),y.jsx("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),y.jsx("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),y.jsx("path",{d:"M3 3l18 18"})]})}function Mu({icon:t,text:e,active:r,children:n}){return y.jsx(O.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||y.jsxs(y.Fragment,{children:[t||y.jsx("div",{className:"mantine-datatable-empty-state-icon",children:y.jsx(Pu,{})}),y.jsx(O.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function Ou({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,C){let S=[];return M.forEach(k=>{C.find(j=>j.accessor===k)&&S.push(k)}),C.forEach(k=>{S.includes(k.accessor)||S.push(k.accessor)}),S}let s=e&&e.map(M=>M.accessor)||[],[c,d]=Be.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsOrder:c,setColumnsOrder:i,resetColumnsOrder:m};let b=n(c,e),_=JSON.stringify(c);return JSON.stringify(b)!==_&&i(b),{columnsOrder:b,setColumnsOrder:i,resetColumnsOrder:m}}function ju({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let c=K.useRef(!1),d=K.useRef({}),[i,m]=K.useState(!0),b=K.useMemo(()=>e.some(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),_=K.useMemo(()=>e.filter(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),M=K.useMemo(()=>_.some(q=>q.width===void 0||q.width===""||q.width==="initial"),[_]),C=K.useCallback(()=>e.filter(q=>q.accessor!=="__selection__").map(q=>({[q.accessor]:q.width??"auto"})),[e]),[S,k]=Be.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?C():void 0,getInitialValueInEffect:!1}),[j,N]=K.useState(()=>C());K.useEffect(()=>{m(!1)},[]);let z=K.useCallback(()=>{if(!n?.current||i)return{};let q=n.current,V=Array.from(q.querySelectorAll("th[data-accessor]")),Z={};return V.forEach(ae=>{let X=ae.getAttribute("data-accessor");if(!X||X==="__selection__")return;let P=_.find(x=>x.accessor===X);if(P&&(P.width===void 0||P.width===""||P.width==="initial")){let x=ae.getBoundingClientRect();Z[X]=Math.round(x.width)}}),Z},[n,_,i]),B=K.useCallback(q=>{let V=q.filter(ae=>ae.accessor!=="__selection__"),Z=j.map(ae=>{let X=Object.keys(ae)[0],P=V.find(x=>x.accessor===X);return P?{[X]:P.width}:ae});N(Z),t&&k(Z)},[j,t,k]),Q=K.useCallback(q=>{B(q)},[B]),U=K.useCallback(()=>{if(!(!n?.current||!s||i))if(M)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let q=z();d.current={...d.current,...q};let V=e.filter(Z=>Z.accessor!=="__selection__").map(Z=>{let ae=Z.accessor,X=S?.find(x=>Object.keys(x)[0]===ae);if(X&&X[ae]!=="auto")return{[ae]:X[ae]};let P=q[ae];return P?{[ae]:`${P}px`}:{[ae]:Z.width??"auto"}});N(V),setTimeout(()=>{s(!0),c.current=!0},10)})});else{let q=e.filter(V=>V.accessor!=="__selection__").map(V=>({[V.accessor]:V.width??"auto"}));N(q),s(!0),c.current=!0}},[n,s,i,M,z,e,S]),te=U;K.useEffect(()=>{if(!b||!s||i){s?.(!1);return}c.current=!1;let q=setTimeout(()=>{U()},50);return()=>clearTimeout(q)},[b,s,i,U]),K.useEffect(()=>{i||!t||!r||S&&S.length>0&&N(S)},[i,t,r,S]);let ne=K.useCallback(()=>{t&&k(C()),d.current={},c.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,k,C,s,U]),G=K.useCallback((q,V)=>{B([{accessor:q,width:V}])},[B]),J=K.useMemo(()=>b?j.filter(q=>{let V=Object.keys(q)[0];return _.some(Z=>Z.accessor===V)}).every(q=>{let V=Object.values(q)[0];return V==="auto"||V==="initial"}):!1,[b,j,_]);return{columnsWidth:j,setColumnsWidth:B,setColumnWidth:G,setMultipleColumnWidths:Q,resetColumnsWidth:ne,hasResizableColumns:b,allResizableWidthsInitial:J,measureAndSetColumnWidths:te}}function Au({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,C){let S=[];return M.forEach(k=>{C.find(j=>j.accessor===k.accessor)&&S.push(k)}),C.forEach(k=>{S.find(j=>j.accessor===k.accessor)||S.push({accessor:k.accessor,defaultToggle:k.defaultToggle||!0,toggleable:k.toggleable,toggled:k.defaultToggle===void 0?!0:k.defaultToggle})}),S}let s=e&&e.map(M=>({accessor:M.accessor,defaultToggle:M.defaultToggle||!0,toggleable:M.toggleable,toggled:M.defaultToggle===void 0?!0:M.defaultToggle})),[c,d]=Be.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsToggle:c,setColumnsToggle:i,resetColumnsToggle:m};let b=n(c,e),_=JSON.stringify(c);return JSON.stringify(b)!==_&&i(b),{columnsToggle:b,setColumnsToggle:i,resetColumnsToggle:m}}var Eu=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:c})=>{let{columnsOrder:d,setColumnsOrder:i,resetColumnsOrder:m}=Ou({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:b,setColumnsToggle:_,resetColumnsToggle:M}=Au({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:C,setColumnsWidth:S,setColumnWidth:k,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:z,allResizableWidthsInitial:B,measureAndSetColumnWidths:Q}=ju({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:c});return{effectiveColumns:K.useMemo(()=>d?d.map(U=>e.find(te=>te.accessor===U)).map(U=>({...U,hidden:U?.hidden||!b.find(te=>te.accessor===U?.accessor)?.toggled})).map(U=>U?.accessor==="__selection__"?U:{...U,width:C.find(te=>te[U?.accessor])?.[U?.accessor]}):e,[e,d,b,C]),setColumnsOrder:i,columnsOrder:d,resetColumnsOrder:m,columnsToggle:b,setColumnsToggle:_,resetColumnsToggle:M,columnsWidth:C,setColumnsWidth:S,setColumnWidth:k,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:z,allResizableWidthsInitial:B,measureAndSetColumnWidths:Q}},Cs=typeof window<"u"?K.useLayoutEffect:K.useEffect;function Ss(t){let e=K.useRef(t);return e.current=t,e}var Ds="--mantine-datatable-header-height",ks="--mantine-datatable-footer-height",Ps="--mantine-datatable-selection-column-width",Ms="--mantine-datatable-last-row-border-bottom";function ot(t,e,r){t?.style.setProperty(e,r)}function Cn(t){let e=t.borderBoxSize?.[0]||t.contentBoxSize?.[0];return e?{width:e.inlineSize,height:e.blockSize}:{width:t.contentRect.width,height:t.contentRect.height}}function Sn(t,e,r){if(t){let n=new ResizeObserver(s=>{let c=s[0];c&&e(Cn(c))});return n.observe(t),()=>{n.disconnect(),r()}}}function Tu({scrollCallbacks:t,withRowBorders:e}){let r={root:K.useRef(null),table:K.useRef(null),scrollViewport:K.useRef(null),header:K.useRef(null),footer:K.useRef(null),selectionColumnHeader:K.useRef(null)},{root:n,table:s,scrollViewport:c,header:d,footer:i,selectionColumnHeader:m}=r,b=Ss({withRowBorders:e}),_=Ss(t),M=K.useRef(()=>{}),C=K.useRef(()=>{}),S=K.useCallback(k=>{_.current.onScroll?.(k),M.current()},[]);return K.useEffect(()=>Sn(d.current,k=>{ot(n.current,Ds,`${k.height}px`)},()=>ot(n.current,Ds,"0")),[d.current]),K.useEffect(()=>Sn(i.current,k=>{ot(n.current,ks,`${k.height}px`)},()=>ot(n.current,ks,"0")),[i.current]),K.useEffect(()=>Sn(m.current,k=>{ot(n.current,Ps,`${k.width}px`)},()=>ot(n.current,Ps,"0")),[m.current]),Cs(()=>{if(typeof window===void 0)return;let k={top:!0,bottom:!0,left:!0,right:!0},j={width:0,height:0},N={width:0,height:0};function z(ne,G){let J=k[ne];return k[ne]=G,ot(n.current,`--mantine-datatable-${ne}-shadow-opacity`,G?"0":"1"),J}function B(){let ne=j.height-N.height,G=ne<0;ot(n.current,"--mantine-datatable-footer-position",G?"relative":"sticky"),ot(n.current,"--mantine-datatable-footer-bottom",G?`${ne}px`:"0")}function Q(){b.current.withRowBorders&&j.height<N.height?ot(n.current,Ms,`${O.rem("1px")} solid var(--mantine-datatable-border-color)`):ot(n.current,Ms,"unset")}C.current=Q;function U(){let ne=_.current,G=c.current,J=G?.scrollTop??0,q=G?.scrollLeft??0,V=J===0,Z=j.height-J-N.height<1,ae=z("top",V),X=z("bottom",Z);V&&V!==ae&&ne.onScrollToTop?.(),Z&&Z!==X&&ne.onScrollToBottom?.();let P=G?getComputedStyle(G).direction==="rtl":!1,x=(G?.scrollWidth??0)-N.width,w,h;if(P){let f=Math.abs(q);h=f<1,w=x-f<1}else w=q<1,h=j.width-q-N.width<1;let l=z("left",w),p=z("right",h);w&&w!==l&&ne.onScrollToLeft?.(),h&&h!==p&&ne.onScrollToRight?.()}M.current=U;let te=new ResizeObserver(ne=>{for(let G of ne)switch(G.target.tagName){case"TABLE":{j=Cn(G);break}case"DIV":{N=Cn(G);break}}U(),B(),Q()});return te.observe(s.current),te.observe(c.current),()=>{te.disconnect()}},[]),Cs(()=>{C.current()},[e]),{refs:r,onScroll:S}}function $u(t){let[e,r]=K.useState(null),n=t?.join(":")||"";return K.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Ru(t,e){let r=()=>{e(t.map(s=>s.matches))},n=t.map(s=>{try{return s.addEventListener("change",r),()=>s.removeEventListener("change",r)}catch{return s.addListener(r),()=>s.removeListener(r)}});return()=>{n.forEach(s=>s())}}function Nu(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Lu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=K.useState(r?e:Nu(t,e)),c=K.useRef(null);return K.useEffect(()=>{if("matchMedia"in window)return c.current=t.map(d=>window.matchMedia(d)),s(c.current.map(d=>d.matches)),Ru(c.current,d=>{s(d)})},[t]),n}function Bu(t){let e=O.useMantineTheme(),r=K.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=K.useMemo(()=>t.map(()=>!0),[t]);return Lu(r,n)}function Tr(t){let e=O.useMantineTheme(),r=typeof t=="function"?t(e):t;return Be.useMediaQuery(r||"",!0)}function Dn(t){let e=t.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Iu(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function kn(t,e){return t.filter((r,n,s)=>n===s.findIndex(c=>e(r)===e(c)))}function Os(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Ye(t,e){return typeof e=="string"?Os(t,e):e(t)}function js(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+js(e.groups):1))}function Pn(t){let e=[];for(let r of t)r.columns&&r.columns.length>0?e.push(...r.columns.filter(n=>n!=null)):r.groups&&r.groups.length>0&&e.push(...Pn(r.groups));return e.filter(r=>r!=null)}function Mn(t,e){return t.columns&&t.columns.length>0?t.columns.filter((r,n)=>r.hidden?!1:e?e[n]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((r,n)=>r+Mn(n,e),0):0}function As(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...As(s.groups,e,r+1));return n}function Yu(t,e,r){return r?!t||e:!1}function zu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:i,allowMultiple:m,initiallyExpanded:b}=t;e&&i==="always"?n=e.map(_=>Ye(_,r)):b&&(n=e.filter((_,M)=>b({record:_,index:M})).map(_=>Ye(_,r)),m||(n=[n[0]]))}let s,c,d=K.useState(n);if(t){let{expandable:i,trigger:m,allowMultiple:b,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:c}=t.expanded:[s,c]=d;let C=S=>c?.(s.filter(k=>k!==Ye(S,r)));return{expandOnClick:m!=="always"&&m!=="never",isRowExpanded:S=>m==="always"?!0:s.includes(Ye(S,r)),isExpandable:({record:S,index:k})=>i?i({record:S,index:k}):!0,expandRow:S=>{let k=Ye(S,r);c?.(b?[...s,k]:[k])},collapseRow:C,collapseProps:_,content:({record:S,index:k})=>()=>M({record:S,index:k,collapse:()=>C(S)})}}}function Fu(t,e){let[r,n]=K.useState(t),[s,c]=K.useState(t),d=Be.useTimeout(()=>n(!0),0),i=Be.useTimeout(()=>c(!1),e||200);return K.useEffect(()=>{t?(i.clear(),c(!0),d.start()):(d.clear(),n(!1),i.start())},[d,i,t]),{expanded:r,visible:s}}var On="mantine-datatable-nowrap",jn="mantine-datatable-ellipsis",Bt="mantine-datatable-pointer-cursor",Es="mantine-datatable-context-menu-cursor",Wu="mantine-datatable-text-selection-disabled",$r="mantine-datatable-text-align-left",Rr="mantine-datatable-text-align-center",Nr="mantine-datatable-text-align-right";function Uu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:c,textAlign:d,width:i}){return Tr(r)?y.jsx(O.TableTh,{className:Oe({[On]:s||c,[jn]:c,[$r]:d==="left",[Rr]:d==="center",[Nr]:d==="right"},t),style:[{width:i,minWidth:i,maxWidth:i},e],children:n}):null}function qu({shadowVisible:t}){return y.jsx(O.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function Vu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:c,ref:d}){return y.jsx(O.TableTfoot,{ref:d,className:Oe("mantine-datatable-footer",t),style:e,children:y.jsxs(O.TableTr,{children:[s&&y.jsx(qu,{shadowVisible:c}),r.map(({hidden:i,...m})=>{if(i)return null;let{accessor:b,visibleMediaQuery:_,textAlign:M,width:C,footer:S,footerClassName:k,footerStyle:j,noWrap:N,ellipsis:z}={...n,...m};return y.jsx(Uu,{className:k,style:j,visibleMediaQuery:_,textAlign:M,width:C,title:S,noWrap:N,ellipsis:z},b)})]})})}function Hu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:c,style:d},maxDepth:i,currentDepth:m,previousGroups:b,isLastGroup:_,withColumnBorders:M=!1,totalTableColumns:C}){let S=K.useMemo(()=>e&&e.length>0?e:r&&r.length>0?Pn([{id:t,columns:e,groups:r}]):[],[e,r,t]),k=K.useMemo(()=>S.map(({visibleMediaQuery:te})=>te),[S]),j=Bu(k),N=K.useMemo(()=>Mn({columns:e,groups:r},j),[t,e,r,j]),z=K.useMemo(()=>b.reduce((te,ne)=>te+Mn(ne,j),0),[b,j]),B=r&&r.length>0?1:i-m,Q=z+N<C,U=Yu(_,Q,M);return N>0?y.jsx(O.TableTh,{colSpan:N,rowSpan:B>1?B:void 0,className:Oe("mantine-datatable-column-group-header-cell",{[$r]:s==="left",[Rr]:s==="center",[Nr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":U},c),style:d,children:n??Dn(t)}):null}function Gu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}function Qu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}function Ku({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:c,toggle:d}]=Be.useDisclosure(!1),i=e?Qu:Gu,m=Be.useClickOutside(c);return n&&(m=void 0),y.jsxs(O.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:c,trapFocus:!0,...r,children:[y.jsx(O.PopoverTarget,{children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:b=>{b.preventDefault(),d()},onKeyDown:b=>b.stopPropagation(),children:y.jsx(i,{})})}),y.jsx(O.PopoverDropdown,{ref:m,onClick:b=>b.stopPropagation(),onKeyDown:b=>b.stopPropagation(),children:typeof t=="function"?t({close:c}):t})]})}var Zu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=K.useState(!1),c=K.useRef(0),d=K.useRef({current:0,next:0}),{dir:i}=O.useDirection(),m=i==="rtl",{setMultipleColumnWidths:b}=xn(),_=K.useCallback(C=>{if(C.preventDefault(),C.stopPropagation(),!r.current)return;let S=r.current,k=S.nextElementSibling;for(;k;){let te=k.getAttribute("data-accessor");if(te&&te!=="__selection__")break;k=k.nextElementSibling}if(!k)return;let j=k.getAttribute("data-accessor");if(!j)return;let N=j==="__selection__";s(!0),c.current=C.clientX;let z=S.offsetWidth,B=k.offsetWidth;d.current={current:z,next:B};let Q=te=>{if(!r.current)return;let ne=r.current,G=ne.nextElementSibling;if(!G)return;let J=te.clientX-c.current;m&&(J=-J);let q=50,V=d.current.current-q,Z=d.current.next-q,ae=Math.max(-V,Math.min(J,Z)),X=d.current.current+ae,P=d.current.next-ae;ne.style.width=`${X}px`,G.style.width=`${P}px`,ne.style.minWidth=`${X}px`,ne.style.maxWidth=`${X}px`,G.style.minWidth=`${P}px`,G.style.maxWidth=`${P}px`},U=()=>{if(!r.current)return;let te=r.current,ne=te.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let G=parseInt(te.style.width)||te.offsetWidth,J=ne?parseInt(ne.style.width)||ne.offsetWidth:0,q=[{accessor:e,width:`${G}px`}];if(ne&&!N){let V=ne.getAttribute("data-accessor");V&&q.push({accessor:V,width:`${J}px`})}setTimeout(()=>{b(q)},0),document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",U)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Q),document.addEventListener("mouseup",U)},[e,r,m,b]),M=K.useCallback(()=>{if(!r.current)return;let C=r.current,S=C.nextElementSibling;C.style.width="",C.style.minWidth="",C.style.maxWidth="";let k=[{accessor:e,width:"auto"}];if(S){S.style.width="",S.style.minWidth="",S.style.maxWidth="";let j=S.getAttribute("data-accessor");j&&j!=="__selection__"&&k.push({accessor:j,width:"auto"})}setTimeout(()=>{b(k)},0)},[e,r,b]);return y.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:M,onClick:C=>C.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Ju(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M12 5l0 14"}),y.jsx("path",{d:"M16 9l-4 -4"}),y.jsx("path",{d:"M8 9l4 -4"})]})}function Xu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 7l4 -4l4 4"}),y.jsx("path",{d:"M8 17l4 4l4 -4"}),y.jsx("path",{d:"M12 3l0 18"})]})}function ec(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function tc(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M18 6l-12 12"}),y.jsx("path",{d:"M6 6l12 12"})]})}function rc({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:c,draggable:d,toggleable:i,resizable:m,sortIcons:b,textAlign:_,width:M,sortStatus:C,onSortStatusChange:S,filter:k,filterPopoverProps:j,filterPopoverDisableClickOutside:N,filtering:z,sortKey:B}){let{setSourceColumn:Q,setTargetColumn:U,swapColumns:te,setColumnsToggle:ne}=xn(),[G,J]=K.useState(!1),q=K.useRef(null);if(!Tr(n))return null;let V=s??Dn(r),Z=typeof V=="string"?V:void 0,ae=c&&S?p=>{p?.defaultPrevented||S({sortKey:B,columnAccessor:r,direction:C?.columnAccessor===r?C.direction==="asc"?"desc":"asc":C?.direction??"asc"})}:void 0,X=p=>{p.stopPropagation(),Q(r),J(!1)},P=p=>{p.preventDefault(),U(r),J(!0)},x=()=>{U(r),J(!1),te()},w=()=>{J(!0)},h=()=>{J(!1)},l=p=>{p.stopPropagation(),ne(f=>f.map(a=>a.accessor===r?{...a,toggled:!1}:a))};return y.jsxs(O.TableTh,{"data-accessor":r,className:Oe({"mantine-datatable-header-cell-sortable":c,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":m},t),style:[{width:M,...m?{}:{minWidth:M,maxWidth:M}},e],role:c?"button":void 0,tabIndex:c?0:void 0,onClick:ae,onKeyDown:p=>p.key==="Enter"&&ae?.(),ref:q,children:[y.jsxs(O.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[y.jsxs(O.Flex,{align:"center",w:"100%",className:Oe({"mantine-datatable-header-cell-draggable":d,"mantine-datatable-header-cell-drag-over":G}),draggable:d,onDragStart:d?X:void 0,onDragEnter:d?w:void 0,onDragOver:d?P:void 0,onDrop:d?x:void 0,onDragLeave:d?h:void 0,children:[d?y.jsx(O.Center,{role:"img","aria-label":"Drag column",children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:p=>{p.stopPropagation()},children:y.jsx(ec,{})})}):null,y.jsx(O.Box,{className:Oe("mantine-datatable-header-cell-sortable-text",{[$r]:_==="left",[Rr]:_==="center",[Nr]:_==="right"},On,jn),title:Z,children:V})]}),i?y.jsx(O.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:y.jsx(O.ActionIcon,{size:"xs",variant:"light",onClick:l,children:y.jsx(tc,{})})}):null,c||C?.columnAccessor===r?y.jsx(y.Fragment,{children:C?.columnAccessor===r?y.jsx(O.Center,{className:Oe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":C.direction==="desc"}),role:"img","aria-label":`Sorted ${C.direction==="desc"?"descending":"ascending"}`,children:b?.sorted||y.jsx(Ju,{})}):y.jsx(O.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:b?.unsorted||y.jsx(Xu,{})})}):null,k?y.jsx(Ku,{filterPopoverProps:j,isActive:!!z,filterPopoverDisableClickOutside:N,children:k}):null]}),m&&r!=="__selection__"?y.jsx(Zu,{accessor:r,columnRef:q}):null]})}function nc({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:c,checkboxProps:d,onChange:i,rowSpan:m,ref:b}){let _=!d.disabled;return y.jsx(O.TableTh,{ref:b,className:Oe("mantine-datatable-header-selector-cell",{[Bt]:r==="cell"&&_},t),style:e,rowSpan:m,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?i:void 0,children:y.jsx(O.Checkbox,{classNames:_?{input:Bt}:void 0,checked:s,indeterminate:c,onChange:i,...d,disabled:!(i||d.onChange)||d.disabled})})}function oc({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:c,columns:d,defaultColumnProps:i,groups:m,selectionTrigger:b,selectionVisible:_,selectionChecked:M,selectionIndeterminate:C,onSelectionChange:S,selectionCheckboxProps:k,selectorCellShadowVisible:j,selectionColumnClassName:N,selectionColumnStyle:z,withColumnBorders:B=!1,ref:Q}){let U=m?js(m):0,te=U>0?U+1:1,ne=_?y.jsx(nc,{ref:t,className:N,style:z,trigger:b,shadowVisible:j,checked:M,indeterminate:C,checkboxProps:k,onChange:S,rowSpan:m?te:void 0}):null,{columnsToggle:G,setColumnsToggle:J}=xn(),[q,V]=K.useState(!1),Z=d.some(P=>P.toggleable),ae=Z?Object.fromEntries(d.map(({accessor:P,title:x})=>[P,x??Dn(String(P))])):void 0,X=y.jsxs(O.TableThead,{className:Oe("mantine-datatable-header",e),style:r,ref:Q,onContextMenu:Z?P=>{P.preventDefault(),V(x=>!x)}:void 0,children:[m&&Array.from({length:U},(P,x)=>{let w=As(m,x);return y.jsxs(O.TableTr,{children:[x===0&&ne,w.map((h,l)=>y.jsx(Hu,{group:h,maxDepth:U,currentDepth:x,previousGroups:w.slice(0,l),isLastGroup:l===w.length-1,withColumnBorders:B,totalTableColumns:d.length},h.id))]},`group-depth-${x}`)}),y.jsxs(O.TableTr,{children:[!m&&ne,d.map(({hidden:P,...x},w)=>{if(P)return null;let{accessor:h,visibleMediaQuery:l,textAlign:p,width:f,title:a,sortable:v,draggable:D,toggleable:T,resizable:H,titleClassName:ee,titleStyle:re,filter:F,filterPopoverProps:se,filterPopoverDisableClickOutside:ie,filtering:ue,sortKey:E}={...i,...x};return y.jsx(rc,{accessor:h,className:ee,style:re,visibleMediaQuery:l,textAlign:p,width:f,title:a,sortable:v,draggable:D,toggleable:T,resizable:H&&w<d.length-1,sortStatus:n,sortIcons:s,sortKey:E,onSortStatusChange:c,filter:F,filterPopoverProps:se,filterPopoverDisableClickOutside:ie,filtering:ue},h)})]})]});return Z?y.jsxs(O.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:q,onChange:V,children:[y.jsx(O.PopoverTarget,{children:X}),y.jsx(O.PopoverDropdown,{children:y.jsx(O.Stack,{children:G.filter(P=>P.toggleable).map(P=>y.jsx(O.Group,{children:y.jsx(O.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:ae[P.accessor],checked:P.toggled,onChange:x=>{J(G.map(w=>w.accessor===P.accessor?{...w,toggled:x.currentTarget.checked}:w))}})},P.accessor))})})]}):X}function sc({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:c}){return y.jsx(O.Center,{className:Oe("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||y.jsx(O.Loader,{size:n,type:s,color:c}))})}function je(t,e,r){return t?O.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function ic({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:c,highlightOnHoverColor:d}){return{"--mantine-datatable-color-light":je(e,t,"light"),"--mantine-datatable-color-dark":je(e,t,"dark"),"--mantine-datatable-background-color-light":je(r,t,"light"),"--mantine-datatable-background-color-dark":je(r,t,"dark"),"--mantine-datatable-border-color-light":je(n,t,"light"),"--mantine-datatable-border-color-dark":je(n,t,"dark"),"--mantine-datatable-row-border-color-light":je(s,t,"light"),"--mantine-datatable-row-border-color-dark":je(s,t,"dark"),"--mantine-datatable-striped-color-light":je(c,t,"light"),"--mantine-datatable-striped-color-dark":je(c,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":je(d,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":je(d,t,"dark")}}function Ts({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":je(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":je(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":je(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":je(r,t,"dark")}}function ac({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":je(e,t,"light"),"--mantine-datatable-row-color-dark":je(e,t,"dark"),"--mantine-datatable-row-background-color-light":je(r,t,"light"),"--mantine-datatable-row-background-color-dark":je(r,t,"dark")}}function lc(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 9l4 -4l4 4"}),y.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var $s={xs:O.rem(22),sm:O.rem(26),md:O.rem(32),lg:O.rem(38),xl:O.rem(44)};function uc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:c,onChange:d}){return y.jsxs(O.Group,{gap:"xs",children:[y.jsx(O.Text,{component:"div",size:t,children:e}),y.jsxs(O.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[y.jsx(O.MenuTarget,{children:y.jsx(O.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:y.jsx(lc,{}),style:[{fontWeight:"normal"},i=>({height:$s[t],paddingLeft:i.spacing[t],paddingRight:i.spacing[t]})],children:n})}),y.jsx(O.MenuDropdown,{children:r.map(i=>{let m=i===n;return y.jsx(O.MenuItem,{className:Oe({"mantine-datatable-page-size-selector-active":m}),style:[{height:$s[t]},m&&(s||c)?b=>Ts({theme:b,paginationActiveTextColor:s,paginationActiveBackgroundColor:c}):void 0],disabled:m,onClick:()=>d(i),children:y.jsx(O.Text,{component:"div",size:t,children:i})},i)})})]})]})}function cc({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:c,paginationWithControls:d,paginationActiveTextColor:i,paginationActiveBackgroundColor:m,paginationSize:b,loadingText:_,noRecordsText:M,paginationText:C,totalRecords:S,recordsPerPage:k,onRecordsPerPageChange:j,recordsPerPageLabel:N,recordsPerPageOptions:z,recordsLength:B,horizontalSpacing:Q,paginationWrapBreakpoint:U,getPaginationControlProps:te,getPaginationItemProps:ne,renderPagination:G}){let J;if(S){let x=(n-1)*k+1,w=x+(B||0)-1;J=C({from:x,to:w,totalRecords:S})}else J=r?_:M;let q=S&&k?Math.max(1,Math.ceil(S/k)):1,V=S?(n-1)*(k??0)+1:void 0,Z=S?(V??1)+(B??0)-1:void 0,ae=!Tr(({breakpoints:x})=>`(min-width: ${typeof U=="number"?`${O.rem(U)}rem`:x[U]||U})`),X={Text:x=>y.jsx(O.Text,{component:"div",className:"mantine-datatable-pagination-text",size:b,...x,children:J}),PageSizeSelector:x=>z?y.jsx(uc,{activeTextColor:i,activeBackgroundColor:m,size:b,label:N,values:z,value:k,onChange:j,...x}):y.jsx(y.Fragment,{}),Pagination:x=>y.jsx(O.Pagination,{classNames:{root:Oe("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!B}),control:"mantine-datatable-pagination-pages-control"},style:i||m?w=>Ts({theme:w,paginationActiveTextColor:i,paginationActiveBackgroundColor:m}):void 0,withEdges:c,withControls:d,value:n,onChange:s,size:b,total:q,getControlProps:te,getItemProps:ne,...x})},P={state:{paginationSize:b,page:n,totalPages:q,totalRecords:S,recordsPerPage:k,recordsLength:B,fetching:r,from:V,to:Z,isWrapped:ae},actions:{setPage:x=>s?.(x),setRecordsPerPage:j?x=>j(x):void 0},Controls:X};return y.jsx(O.Box,{px:Q??"xs",py:"xs",className:Oe("mantine-datatable-pagination",t),style:[{flexDirection:ae?"column":"row"},e],children:typeof G=="function"?G(P):y.jsxs(y.Fragment,{children:[y.jsx(X.Text,{}),y.jsx(X.PageSizeSelector,{}),y.jsx(X.Pagination,{})]})})}function dc({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:c,onDoubleClick:d,onContextMenu:i,noWrap:m,ellipsis:b,textAlign:_,width:M,accessor:C,render:S,defaultRender:k,customCellAttributes:j}){return Tr(r)?y.jsx(O.TableTd,{className:Oe({[On]:m||b,[jn]:b,[Bt]:c||d,[Es]:i,[$r]:_==="left",[Rr]:_==="center",[Nr]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:c,onDoubleClick:d,onContextMenu:i,...j?.(n,s),children:S?S(n,s):k?k(n,s,C):Os(n,C)}):null}function hc({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:c}=Fu(t,n?.transitionDuration);return c?y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{}),y.jsx(O.TableTr,{children:y.jsx(O.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:y.jsx(O.Collapse,{in:s,...n,children:y.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function fc({className:t,style:e,record:r,index:n,trigger:s,onChange:c,withRightShadow:d,checkboxProps:i,getCheckboxProps:m,...b}){let _={...i,...m(r,n)},M=!b.disabled&&!_.disabled,C=S=>{S.stopPropagation(),s==="cell"&&M&&c?.(S)};return y.jsx(O.TableTd,{className:Oe("mantine-datatable-row-selector-cell",{[Bt]:s==="cell"&&M},t),style:e,"data-shadow-visible":d||void 0,onClick:C,children:y.jsx(O.Checkbox,{classNames:M?{input:Bt}:void 0,onChange:c,...b,..._})})}function pc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:c,selectionVisible:d,selectionChecked:i,onSelectionChange:m,isRecordSelectable:b,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:C,onDoubleClick:S,onContextMenu:k,onCellClick:j,onCellDoubleClick:N,onCellContextMenu:z,expansion:B,customAttributes:Q,color:U,backgroundColor:te,className:ne,style:G,selectorCellShadowVisible:J,selectionColumnClassName:q,selectionColumnStyle:V,rowFactory:Z}){let ae=y.jsxs(y.Fragment,{children:[d&&y.jsx(fc,{className:q,style:V,record:t,index:e,trigger:c,withRightShadow:J,checked:i,disabled:!m||(b?!b(t,e):!1),onChange:m,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:x,hiddenContent:w,...h},l)=>{if(x||w)return null;let{accessor:p,visibleMediaQuery:f,textAlign:a,noWrap:v,ellipsis:D,width:T,render:H,cellsClassName:ee,cellsStyle:re,customCellAttributes:F}={...n,...h};return y.jsx(dc,{className:typeof ee=="function"?ee(t,e):ee,style:re?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:j?se=>j({event:se,record:t,index:e,column:h,columnIndex:l}):void 0,onDoubleClick:N?se=>N({event:se,record:t,index:e,column:h,columnIndex:l}):void 0,onContextMenu:z?se=>z({event:se,record:t,index:e,column:h,columnIndex:l}):void 0,accessor:p,textAlign:a,noWrap:v,ellipsis:D,width:T,render:H,defaultRender:s,customCellAttributes:F},p)})]}),X=B&&y.jsx(hc,{colSpan:r.filter(({hidden:x})=>!x).length+(d?1:0),open:B.isRowExpanded(t),content:B.content({record:t,index:e}),collapseProps:B.collapseProps}),P=gc({record:t,index:e,selectionChecked:i,onClick:C,onDoubleClick:S,onContextMenu:k,expansion:B,customAttributes:Q,color:U,backgroundColor:te,className:ne,style:G});return Z?Z({record:t,index:e,rowProps:P,children:ae,expandedElement:X}):y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{...P,children:ae}),X]})}function gc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:c,expansion:d,customAttributes:i,color:m,backgroundColor:b,className:_,style:M}){return{className:Oe("mantine-datatable-row",{[Bt]:n||s||d?.isExpandable({record:t,index:e})&&d?.expandOnClick},{[Es]:c},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:C=>{if(d){let{isExpandable:S,isRowExpanded:k,expandOnClick:j,expandRow:N,collapseRow:z}=d;S({record:t,index:e})&&j&&(k(t)?z(t):N(t))}n?.({event:C,record:t,index:e})},onDoubleClick:s?C=>s({event:C,record:t,index:e}):void 0,onContextMenu:c?C=>c({event:C,record:t,index:e}):void 0,style:[m||b?C=>{let S=m?.(t,e),k=b?.(t,e);return ac({theme:C,color:S,backgroundColor:k})}:void 0,M?.(t,e)],...i?.(t,e)??{}}}function mc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:c}){return y.jsxs(O.ScrollArea,{...c,viewportRef:s,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:r,children:[n,y.jsx(O.Box,{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),y.jsx("div",{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),y.jsx("div",{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),y.jsx(O.Box,{className:Oe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function yc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:c,shadow:d,verticalAlign:i="center",fetching:m,columns:b,storeColumnsKey:_,groups:M,pinFirstColumn:C,pinLastColumn:S,defaultColumnProps:k,defaultColumnRender:j,idAccessor:N="id",records:z,selectionTrigger:B="checkbox",selectedRecords:Q,onSelectedRecordsChange:U,selectionColumnClassName:te,selectionColumnStyle:ne,isRecordSelectable:G,selectionCheckboxProps:J,allRecordsSelectionCheckboxProps:q={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:V=(Ne,et)=>({"aria-label":`Select record ${et+1}`}),sortStatus:Z,sortIcons:ae,onSortStatusChange:X,horizontalSpacing:P,page:x,onPageChange:w,totalRecords:h,recordsPerPage:l,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:a="Records per page",paginationWithEdges:v,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:H,paginationSize:ee="sm",paginationText:re=({from:Ne,to:et,totalRecords:ct})=>`${Ne} - ${et} / ${ct}`,paginationWrapBreakpoint:F="sm",getPaginationControlProps:se=Ne=>Ne==="previous"?{"aria-label":"Previous page"}:Ne==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:ie,renderPagination:ue,loaderBackgroundBlur:E,customLoader:L,loaderSize:$,loaderType:I,loaderColor:Y,loadingText:ce="...",emptyState:o,noRecordsText:u="No records",noRecordsIcon:g,highlightOnHover:A,striped:R,noHeader:W,onRowClick:le,onRowDoubleClick:he,onRowContextMenu:pe,onCellClick:oe,onCellDoubleClick:fe,onCellContextMenu:ge,onScroll:me,onScrollToTop:ve,onScrollToBottom:xe,onScrollToLeft:ke,onScrollToRight:We,c:Ee,backgroundColor:Pe,borderColor:Mt,rowBorderColor:$e,stripedColor:dt,highlightOnHoverColor:Ue,rowColor:ht,rowBackgroundColor:Ot,rowExpansion:Re,rowClassName:jt,rowStyle:ze,customRowAttributes:ft,scrollViewportRef:Ze,scrollAreaProps:lt,tableRef:Je,bodyRef:st,m:ut,my:be,mx:Me,mt:qe,mb:it,ml:_t,mr:xt,className:It,classNames:pt,style:Ct,styles:Xe,rowFactory:St,tableWrapper:Dt,...At}){let Ne=K.useMemo(()=>M?Pn(M):b,[b,M]),[et,ct]=K.useState(!1),{refs:Te,onScroll:Yt}=Tu({scrollCallbacks:{onScroll:me,onScrollToTop:ve,onScrollToBottom:xe,onScrollToLeft:ke,onScrollToRight:We},withRowBorders:At.withRowBorders}),we=Eu({key:_,columns:Ne,headerRef:Te.header,scrollViewportRef:Te.scrollViewport,onFixedLayoutChange:ct}),_e=Be.useMergedRef(Te.table,Je),at=Be.useMergedRef(Te.scrollViewport,Ze),Le=zu({rowExpansion:Re,records:z,idAccessor:N}),De=K.useRef(!1),Ve=K.useRef(x),He=K.useRef(z),zt=K.useCallback(Se=>{De.current=!0,He.current=z,w(Se)},[w,z]);K.useEffect(()=>{Ve.current!==x&&(De.current=!0,He.current=z,Ve.current=x)},[x,z]);let Lr=z?.length;K.useLayoutEffect(()=>{if(!De.current||m||z===He.current)return;let Se=Te.scrollViewport.current;if(!Se)return;let Et=requestAnimationFrame(()=>{Se.scrollTo({top:0,left:0}),De.current=!1});return()=>cancelAnimationFrame(Et)},[m,z,Te.scrollViewport]);let zs=z?.map(Se=>Ye(Se,N)),Ft=!!Q,or=Q?.map(Se=>Ye(Se,N)),Fs=zs!==void 0&&or!==void 0&&or.length>0,En=G?z?.filter(G):z,Br=En?.map(Se=>Ye(Se,N)),Ir=Fs&&Br.every(Se=>or.includes(Se)),Qc=Fs&&Br.some(Se=>or.includes(Se)),Kc=K.useCallback(()=>{Q&&U&&U(Ir?Q.filter(Se=>!Br.includes(Ye(Se,N))):kn([...Q,...En],Se=>Ye(Se,N)))},[Ir,N,U,Br,En,Q]),{lastSelectionChangeIndex:Yr,setLastSelectionChangeIndex:Zc}=$u(zs),Tn=Ft&&!C,Jc={m:ut,my:be,mx:Me,mt:qe,mb:it,ml:_t,mr:xt},Xc=K.useCallback(({children:Se})=>Dt?Dt({children:Se}):Se,[Dt]);return y.jsx(xs,{...we,children:y.jsxs(O.Box,{ref:Te.root,...Jc,className:Oe("mantine-datatable",{"mantine-datatable-with-border":t},It,pt?.root),style:[Se=>({...ic({theme:Se,c:Ee,backgroundColor:Pe,borderColor:Mt,rowBorderColor:$e,stripedColor:dt,highlightOnHoverColor:Ue}),borderRadius:Se.radius[e]||e,boxShadow:Se.shadows[d]||d,height:n,minHeight:s,maxHeight:c}),Ct,Xe?.root,{position:"relative"}],children:[y.jsx(mc,{viewportRef:at,leftShadowBehind:Ft||!!C,rightShadowBehind:S,onScrollPositionChange:Yt,scrollAreaProps:lt,children:y.jsx(Xc,{children:y.jsxs(O.Table,{ref:_e,horizontalSpacing:P,className:Oe("mantine-datatable-table",{[Wu]:r,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-pin-last-column":S,"mantine-datatable-selection-column-visible":Ft,"mantine-datatable-pin-first-column":C,"mantine-datatable-resizable-columns":we.hasResizableColumns&&et},pt?.table),style:{...Xe?.table},"data-striped":Lr&&R||void 0,"data-highlight-on-hover":A||void 0,...At,children:[W?null:y.jsx(xs,{...we,children:y.jsx(oc,{ref:Te.header,selectionColumnHeaderRef:Te.selectionColumnHeader,className:pt?.header,style:Xe?.header,columns:Ne,defaultColumnProps:k,groups:M,sortStatus:Z,sortIcons:ae,onSortStatusChange:X,selectionTrigger:B,selectionVisible:Ft,selectionChecked:Ir,selectionIndeterminate:Qc&&!Ir,onSelectionChange:Kc,selectionCheckboxProps:{...J,...q},selectorCellShadowVisible:Tn,selectionColumnClassName:te,selectionColumnStyle:ne,withColumnBorders:At.withColumnBorders})}),y.jsx("tbody",{ref:st,children:Lr?z.map((Se,Et)=>{let $n=Ye(Se,N),Rn=or?.includes($n)||!1,Ws;return U&&Q&&(Ws=ed=>{if(ed.nativeEvent.shiftKey&&Yr!==null){let Wt=z.filter(Et>Yr?(Tt,$t)=>$t>=Yr&&$t<=Et&&(G?G(Tt,$t):!0):(Tt,$t)=>$t>=Et&&$t<=Yr&&(G?G(Tt,$t):!0));U(Rn?Iu(Q,Wt,Tt=>Ye(Tt,N)):kn([...Q,...Wt],Tt=>Ye(Tt,N)))}else U(Rn?Q.filter(Wt=>Ye(Wt,N)!==$n):kn([...Q,Se],Wt=>Ye(Wt,N)));Zc(Et)}),y.jsx(pc,{record:Se,index:Et,columns:Ne,defaultColumnProps:k,defaultColumnRender:j,selectionTrigger:B,selectionVisible:Ft,selectionChecked:Rn,onSelectionChange:Ws,isRecordSelectable:G,selectionCheckboxProps:J,getSelectionCheckboxProps:V,onClick:le,onDoubleClick:he,onCellClick:oe,onCellDoubleClick:fe,onContextMenu:pe,onCellContextMenu:ge,expansion:Le,color:ht,backgroundColor:Ot,className:jt,style:ze,customAttributes:ft,selectorCellShadowVisible:Tn,selectionColumnClassName:te,selectionColumnStyle:ne,idAccessor:N,rowFactory:St},$n)}):y.jsx(ku,{})}),Ne.some(({footer:Se})=>Se)&&y.jsx(Vu,{ref:Te.footer,className:pt?.footer,style:Xe?.footer,columns:Ne,defaultColumnProps:k,selectionVisible:Ft,selectorCellShadowVisible:Tn})]})})}),x&&y.jsx(cc,{className:pt?.pagination,style:Xe?.pagination,horizontalSpacing:P,fetching:m,page:x,onPageChange:zt,totalRecords:h,recordsPerPage:l,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:a,paginationWithEdges:v,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:H,paginationSize:ee,paginationText:re,paginationWrapBreakpoint:F,getPaginationControlProps:se,getPaginationItemProps:ie,noRecordsText:u,loadingText:ce,recordsLength:Lr,renderPagination:ue}),y.jsx(sc,{fetching:m,backgroundBlur:E,customContent:L,size:$,type:I,color:Y}),y.jsx(Mu,{icon:g,text:u,active:!m&&!Lr,children:o})]})})}function Rs(t){const e=Fe.c(42),{fields:r,onClose:n,queryKey:s,apiPath:c,id:d,steps:i}=t,[m,b]=K.useState(0),[_,M]=K.useState(!1),{data:C,isLoading:S}=Ko(c,s,d),{mutateAsync:k,isError:j,error:N,isPending:z}=gn(c,s);let B;e[0]!==r?(B=new Set(r.filter(Cc).map(xc)),e[0]=r,e[1]=B):B=e[1];let Q;e[2]!==B?(Q=[...B],e[2]=B,e[3]=Q):Q=e[3];const U=Q;let te;e[4]!==r?(te=r.reduce(_c,{}),e[4]=r,e[5]=te):te=e[5];let ne;e[6]!==r?(ne=r.filter(wc).reduce(bc,{}),e[6]=r,e[7]=ne):ne=e[7];let G;e[8]!==te||e[9]!==ne?(G={mode:"uncontrolled",initialValues:te,validate:ne},e[8]=te,e[9]=ne,e[10]=G):G=e[10];const J=Nn.useForm(G);let q;e[11]!==C||e[12]!==r||e[13]!==J?(q=()=>{if(C){const l={...C};r.forEach(p=>{const f=p.id;p.type==="boolean"&&l[f]===null?l[f]=!1:p.type==="date"&&l[f]?l[f]=new Date(l[f]):l[f]===null&&(l[f]="")}),J.initialize(l),J.setValues(l)}},e[11]=C,e[12]=r,e[13]=J,e[14]=q):q=e[14];let V;e[15]!==C?(V=[C],e[15]=C,e[16]=V):V=e[16],K.useEffect(q,V);let Z;e[17]===Symbol.for("react.memo_cache_sentinel")?(Z=function(p,f){return typeof p.required=="function"?p.required(f??{}):!!p.required},e[17]=Z):Z=e[17];const ae=Z;let X;e[18]!==J||e[19]!==d?(X=function(p){const f=J.getValues();if(p.conditional&&!p.conditional(f))return null;const a=ae(p,f);return y.jsxs(K.Fragment,{children:[(p.type===void 0||p.type=="text")&&y.jsx(O.TextInput,{label:p.column.title,placeholder:p.placeholder??"",...J.getInputProps(p.id),type:p.id.includes("email")?"email":void 0,required:a},J.key(p.id)),p.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:p.column.title,placeholder:p.placeholder??"",...J.getInputProps(p.id),required:a},J.key(p.id)),p.type==="date"&&y.jsx(Er,{label:p.column.title,placeholder:p.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...J.getInputProps(p.id),required:a},J.key(p.id)),p.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:p.column.title,...J.getInputProps(p.id,{type:"checkbox"}),required:a},J.key(p.id)),p.type==="textarea"&&y.jsx(O.Textarea,{label:p.column.title,placeholder:p.placeholder??"",...J.getInputProps(p.id),minRows:3,autosize:!0,required:a},J.key(p.id)),p.type==="custom"&&p.render&&p.render({...J.getValues(),id:d},J.setValues,M,{error:J.getInputProps(p.id).error,required:a})]},p.id)},e[18]=J,e[19]=d,e[20]=X):X=e[20];const P=X;let x;e[21]!==j||e[22]!==N?.message||e[23]!==N?.name?(x=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[21]=j,e[22]=N?.message,e[23]=N?.name,e[24]=x):x=e[24];let w;e[25]!==m||e[26]!==r||e[27]!==J||e[28]!==_||e[29]!==d||e[30]!==S||e[31]!==z||e[32]!==j||e[33]!==n||e[34]!==P||e[35]!==i||e[36]!==U||e[37]!==k?(w=S?y.jsxs(O.Stack,{gap:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(r.length).fill(0).map(vc),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Skeleton,{width:100,height:36}),y.jsx(O.Skeleton,{width:100,height:36})]})]}):y.jsxs("form",{onSubmit:J.onSubmit(async l=>{await k({...l,id:d}),U.length&&m<U.length-1?j||b(m+1):j||(J.setInitialValues(l),J.reset(),n())}),children:[U.length?y.jsx(O.Stepper,{active:m,size:"sm",children:U.map(l=>y.jsx(O.Stepper.Step,{...i&&i[l-1]?{label:i[l-1].label}:{},children:r.filter(p=>p.step===l).map(p=>P(p))},l))}):r.map(l=>P(l)),!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>U.length?m===0?n():b(m-1):n(),variant:"outline",children:U.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:z,children:U.length?m===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=m,e[26]=r,e[27]=J,e[28]=_,e[29]=d,e[30]=S,e[31]=z,e[32]=j,e[33]=n,e[34]=P,e[35]=i,e[36]=U,e[37]=k,e[38]=w):w=e[38];let h;return e[39]!==x||e[40]!==w?(h=y.jsxs(y.Fragment,{children:[x,w]}),e[39]=x,e[40]=w,e[41]=h):h=e[41],h}function vc(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-field-${e}`)}function bc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||!(typeof e.required=="function"?e.required(n):!!e.required)||r?null:"Pflichtfeld",t}function wc(t){return t.required}function _c(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function xc(t){return t.step}function Cc(t){return typeof t.step=="number"}function Ns({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:c,error:d,isPending:i}=Xo(e,t),[m,b]=K.useState(n),[_,M]=K.useState(!1),C=_||i;return K.useEffect(()=>{m.length||r()},[r,m]),m.length?y.jsxs(y.Fragment,{children:[c&&d.message&&y.jsx(O.Alert,{variant:"outline",color:"red",title:d.name,children:d.message}),y.jsx(O.Text,{children:m.length===1?`Soll ${m.length} Eintrag wirklich gelöscht werden?`:`Sollen ${m.length} Einträge wirklich gelöscht werden?`}),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:r,variant:"outline",disabled:C,children:"Abbrechen"}),y.jsx(O.Button,{color:"red",loading:C,onClick:async()=>{M(!0);try{await Promise.all(m.map(S=>s(S.id))),b([])}finally{M(!1)}},children:"Löschen"})]})]}):y.jsx(y.Fragment,{})}function Ls(t,e){const r=Fe.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const b=localStorage.getItem(`use_persistent_storage_${e}`);return b?JSON.parse(b):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,c]=K.useState(n);let d;r[3]!==e?(d=b=>{c(b),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(b))},r[3]=e,r[4]=d):d=r[4];const i=d;let m;return r[5]!==i||r[6]!==s?(m=[s,i],r[5]=i,r[6]=s,r[7]=m):m=r[7],m}const Sc=(t,e)=>{const r=t.map(m=>m[e]).filter(m=>m!=null&&m!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),c={string:0,number:0,date:0},d=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(m=>{if(typeof m=="number")c.number++;else if(typeof m=="string"){const b=m.trim();if(b!==""&&!isNaN(Number(b))&&!isNaN(parseFloat(b))){c.number++;return}if(d.some(_=>_.test(b))){const _=new Date(b);if(!isNaN(_.getTime())){c.date++;return}}c.string++}else m instanceof Date?c.date++:c.string++});const i=c.string+c.number+c.date;return c.date/i>=.6?"date":c.number/i>=.6?"number":c.string/i>=.6?"string":"mixed"},Bs=new Map,Is=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Bs.get(n);return s||(s=Sc(t,e),Bs.set(n,s)),[...t].sort((d,i)=>{const m=d[e],b=i[e],_=m==null||m==="",M=b==null||b==="";if(_&&M)return 0;if(_)return r==="asc"?-1:1;if(M)return r==="asc"?1:-1;let C,S;switch(s){case"date":if(typeof m=="string"){const B=new Date(m.trim());C=isNaN(B.getTime())?null:B.getTime()}else m instanceof Date?C=m.getTime():C=null;if(typeof b=="string"){const B=new Date(b.trim());S=isNaN(B.getTime())?null:B.getTime()}else b instanceof Date?S=b.getTime():S=null;break;case"number":if(typeof m=="number")C=m;else{const B=String(m).trim(),Q=parseFloat(B);C=isNaN(Q)?null:Q}if(typeof b=="number")S=b;else{const B=String(b).trim(),Q=parseFloat(B);S=isNaN(Q)?null:Q}break;case"string":const k=typeof m=="string"?m:String(m),j=typeof b=="string"?b:String(b);C=k.toLowerCase().trim(),S=j.toLowerCase().trim();break;case"mixed":default:const N=String(m),z=String(b);C=N.toLowerCase().trim(),S=z.toLowerCase().trim();break}return C===null&&S===null?0:C===null?r==="asc"?1:-1:S===null||C<S?r==="asc"?-1:1:C>S?r==="asc"?1:-1:0})};function Dc(t,e){return e.split(".").reduce((r,n)=>{if(r&&typeof r=="object"&&n in r)return r[n]},t)}function kc(t,e){const r=e.column;if(r.render)return r.render(t,0);const n=r.accessor??e.id,s=Dc(t,n);return s==null?y.jsx(O.Text,{c:"dimmed",children:"–"}):typeof s=="boolean"?y.jsx(O.Text,{fz:"sm",children:s?"Ja":"Nein"}):y.jsx(O.Text,{fz:"sm",children:String(s)})}function Pc(t){const e=Fe.c(10),{field:r,record:n}=t,s=r.column.title??r.id;let c;e[0]!==s?(c=y.jsx(O.Text,{fw:700,fz:"sm",children:s}),e[0]=s,e[1]=c):c=e[1];let d;e[2]!==r||e[3]!==n?(d=kc(n,r),e[2]=r,e[3]=n,e[4]=d):d=e[4];let i;e[5]!==d?(i=y.jsx(O.Box,{ta:"right",fz:"sm",children:d}),e[5]=d,e[6]=i):i=e[6];let m;return e[7]!==c||e[8]!==i?(m=y.jsxs(O.Group,{wrap:"nowrap",justify:"space-between",align:"center",py:"xs",px:"sm",children:[c,i]}),e[7]=c,e[8]=i,e[9]=m):m=e[9],m}function Ys(t){const e=Fe.c(42),{records:r,fields:n,selection:s,selectedRecords:c,onSelectedRecordsChange:d,onRowClick:i,actions:m,canUpdate:b,canDelete:_,pagination:M,sort:C,rowExpansion:S}=t;let k;e[0]!==c?(k=c===void 0?[]:c,e[0]=c,e[1]=k):k=e[1];const j=k;let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[2]=N):N=e[2];const[z,B]=K.useState(N);let Q;e[3]===Symbol.for("react.memo_cache_sentinel")?(Q=X=>{B(P=>{const x=new Set(P);return x.has(X)?x.delete(X):x.add(X),x})},e[3]=Q):Q=e[3];const U=Q;let te,ne,G,J,q,V;if(e[4]!==m||e[5]!==_||e[6]!==b||e[7]!==z||e[8]!==n||e[9]!==i||e[10]!==d||e[11]!==r||e[12]!==S||e[13]!==j||e[14]!==s||e[15]!==C){V=Symbol.for("react.early_return_sentinel");e:{const X=n.filter(Tc),P=X.filter(Ec).reduce(Ac,[]);let x;e[22]!==j?(x=a=>j.some(v=>v.id===a.id),e[22]=j,e[23]=x):x=e[23];const w=x;let h;e[24]!==w||e[25]!==d||e[26]!==j?(h=a=>{d&&(w(a)?d(j.filter(v=>v.id!==a.id)):d([...j,a]))},e[24]=w,e[25]=d,e[26]=j,e[27]=h):h=e[27];const l=h;let p;e[28]!==i||e[29]!==s||e[30]!==l?(p=(a,v,D)=>{i?i({record:a,index:v,event:D}):s&&l(a)},e[28]=i,e[29]=s,e[30]=l,e[31]=p):p=e[31];const f=p;if(r.length===0){let a;e[32]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(O.Text,{c:"dimmed",ta:"center",py:"xl",children:"Keine Einträge gefunden"}),e[32]=a):a=e[32],V=a;break e}te=O.Stack,ne="sm",G="md",J=C&&P.length>0&&y.jsxs(O.Group,{gap:"xs",wrap:"nowrap",children:[y.jsx(O.Select,{data:P,value:C.field,onChange:a=>a&&C.onSortChange(a,C.direction),allowDeselect:!1,style:{flex:1}}),y.jsx(O.ActionIcon,{variant:"filled",size:"input-sm",onClick:()=>C.onSortChange(C.field,C.direction==="asc"?"desc":"asc"),children:C.direction==="asc"?y.jsx(tt.IconSortAscending,{size:18}):y.jsx(tt.IconSortDescending,{size:18})})]}),q=r.map((a,v)=>{const D=w(a),T=!!i||!!s,H=a.id??v,ee=z.has(H);return y.jsx(K.Fragment,{children:y.jsxs(O.Box,{bg:D?"var(--mantine-primary-color-light)":v%2===0?"var(--mantine-color-gray-0)":"white",bd:D?void 0:"1px solid var(--mantine-color-gray-2)",style:{borderRadius:"var(--mantine-radius-md)",overflow:"hidden"},children:[y.jsxs(O.Box,{w:"100%",style:{cursor:T||S?"pointer":"default"},onClick:re=>{S&&!i?U(H):f(a,v,re)},children:[(s||S||m&&m.length>0)&&y.jsxs(O.Group,{px:"sm",pt:"sm",justify:"space-between",children:[y.jsxs(O.Group,{gap:"xs",children:[S&&y.jsx(O.Box,{c:"var(--mantine-primary-color-filled)",style:{cursor:"pointer",display:"flex",alignItems:"center"},onClick:re=>{re.stopPropagation(),U(H)},children:y.jsx(tt.IconChevronDown,{size:16,style:{transform:ee?"rotate(0deg)":"rotate(-90deg)",transition:"transform 200ms"}})}),s&&y.jsx(O.Checkbox,{checked:D,onChange:()=>l(a),onClick:jc})]}),m&&m.length>0&&(()=>{const re=m.filter(F=>!(F.label==="Bearbeiten"&&b&&!b(a)||F.label==="Löschen"&&_&&!_(a)));return re.length===0?null:y.jsxs(O.Menu,{shadow:"md",position:"bottom-end",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.ActionIcon,{variant:"subtle",color:"gray",size:"sm",onClick:Oc,children:y.jsx(tt.IconDotsVertical,{size:16})})}),y.jsx(O.Menu.Dropdown,{children:re.map((F,se)=>y.jsx(O.Menu.Item,{leftSection:F.icon,onClick:ie=>{ie.stopPropagation(),F.onClick([a])},children:F.label},`card_action_${se}`))})]})})()]}),X.map((re,F)=>y.jsxs(K.Fragment,{children:[F>0&&y.jsx(O.Divider,{}),y.jsx(Pc,{field:re,record:a})]},re.id))]}),S&&y.jsxs(O.Collapse,{in:ee,children:[y.jsx(O.Divider,{}),y.jsx(O.Box,{px:"sm",py:"sm",children:S.content(a)})]})]})},H)})}e[4]=m,e[5]=_,e[6]=b,e[7]=z,e[8]=n,e[9]=i,e[10]=d,e[11]=r,e[12]=S,e[13]=j,e[14]=s,e[15]=C,e[16]=te,e[17]=ne,e[18]=G,e[19]=J,e[20]=q,e[21]=V}else te=e[16],ne=e[17],G=e[18],J=e[19],q=e[20],V=e[21];if(V!==Symbol.for("react.early_return_sentinel"))return V;let Z;e[33]!==M?(Z=M&&M.totalRecords>M.recordsPerPage&&y.jsxs(O.Stack,{gap:"xs",mt:"sm",children:[y.jsx(O.Group,{justify:"center",children:y.jsx(O.Pagination,{total:Math.ceil(M.totalRecords/M.recordsPerPage),value:M.page,onChange:M.onPageChange,size:"sm"})}),M.recordsPerPageOptions&&M.onRecordsPerPageChange&&y.jsxs(O.Group,{justify:"center",gap:"xs",children:[y.jsx(O.Text,{fz:"xs",c:"dimmed",children:"Einträge pro Seite:"}),y.jsx(O.Select,{data:M.recordsPerPageOptions.map(Mc),value:String(M.recordsPerPage),onChange:X=>X&&M.onRecordsPerPageChange(Number(X)),allowDeselect:!1,size:"xs",w:70})]})]}),e[33]=M,e[34]=Z):Z=e[34];let ae;return e[35]!==te||e[36]!==Z||e[37]!==ne||e[38]!==G||e[39]!==J||e[40]!==q?(ae=y.jsxs(te,{gap:ne,my:G,children:[J,q,Z]}),e[35]=te,e[36]=Z,e[37]=ne,e[38]=G,e[39]=J,e[40]=q,e[41]=ae):ae=e[41],ae}function Mc(t){return{value:String(t),label:String(t)}}function Oc(t){return t.stopPropagation()}function jc(t){return t.stopPropagation()}function Ac(t,e){const r=e.column.accessor??e.id;return t.some(n=>n.value===r)||t.push({value:r,label:e.column.title??e.id}),t}function Ec(t){return t.column.sortable!==!1}function Tc(t){return t.list&&t.column}const An=[10,15,50,100,500];function $c(t){const e=Fe.c(133),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:c,mutationApiPath:d,buttons:i,fields:m,selection:b,pagination:_,filters:M,actions:C,steps:S,defaultSort:k,onSortChange:j,createButtonText:N,queryParams:z,tabs:B,defaultTab:Q,activeTab:U,onActiveTabChange:te,canUpdate:ne,canDelete:G,showRefresh:J,rowExpansion:q,onRowClick:V,mobileCards:Z}=t,ae=J===void 0?!0:J,X=Z===void 0?!1:Z,[P,x]=K.useState(Q||(B&&B.length>0?B[0].value:null)),w=U!==void 0?U:P;let h;e[0]!==U||e[1]!==te?(h=we=>{U===void 0&&x(we),te&&te(we)},e[0]=U,e[1]=te,e[2]=h):h=e[2];const l=h;let p;e[3]!==w||e[4]!==B?(p=B?.find(we=>we.value===w),e[3]=w,e[4]=B,e[5]=p):p=e[5];const f=p,a=f?.queryParams||{},v=f?.apiPath??c,D=f?.mutationApiPath??d??v,T={...z,...a},H=T?"?"+Object.entries(T).filter(Hc).map(Vc).join("&"):"";let ee;e[6]!==w||e[7]!==n?(ee=w?[...n,w]:n,e[6]=w,e[7]=n,e[8]=ee):ee=e[8];const re=ee,{data:F,isLoading:se,isError:ie,isRefetching:ue,refetch:E}=Zo(v+H,re),{queryClient:L}=yt();let $,I;e[9]!==F||e[10]!==s||e[11]!==L?($=()=>{!F||!Array.isArray(F)||s?.forEach(we=>L.invalidateQueries({queryKey:we}))},I=[F,s,L],e[9]=F,e[10]=s,e[11]=L,e[12]=$,e[13]=I):($=e[12],I=e[13]),K.useEffect($,I);const Y=!F||!Array.isArray(F)?[]:!M||M.length===0?F:F.filter(we=>M.every(_e=>{if(_e.value===void 0)return!0;const at=_e.id;if(_e.type==="query"){const Le=we[at];return Array.isArray(_e.value)?Array.isArray(Le)?Le.some(De=>{if(typeof De=="string"||typeof De=="number")return _e.value.includes(String(De));if(De&&typeof De=="object"){if("id"in De&&_e.value.includes(De.id))return!0;for(const Ve in De){const He=De[Ve];if(typeof He=="string"&&_e.value.includes(He)||He&&typeof He=="object"&&"id"in He&&_e.value.includes(He.id))return!0}}return!1}):Le&&typeof Le=="object"&&"id"in Le?_e.value.includes(Le.id):!1:typeof Le=="string"&&Le.includes(_e.value)}else if(_e.type==="date"){const Le=_e.value;if(!Le)return!0;const[De,Ve]=Le;if(!De&&!Ve)return!0;const He=we[at];if(typeof He=="string"){const zt=He.split(" ")[0];if(De&&Ve)return zt>=De&&zt<=Ve;if(De&&!Ve)return zt>=De;if(!De&&Ve)return zt<=Ve}return!0}else if(_e.type==="boolean")return we[at]===_e.value;return!0})),ce=k?.field??m[0].id,o=k?.direction??"desc";let u;e[14]!==ce||e[15]!==o?(u={columnAccessor:ce,direction:o},e[14]=ce,e[15]=o,e[16]=u):u=e[16];const[g,A]=K.useState(u);let R;e[17]!==j?(R=we=>{A(we),j&&j(String(we.columnAccessor),we.direction)},e[17]=j,e[18]=R):R=e[18];const W=R,le=Is(Y,g.columnAccessor,g.direction),[he,pe]=Ls(An[1],"mantine-table-page-size"),[oe,fe]=K.useState(1),ge=_?le.slice((oe-1)*he,oe*he):le;let me;e[19]===Symbol.for("react.memo_cache_sentinel")?(me=[],e[19]=me):me=e[19];const[ve,xe]=K.useState(me);let ke;e[20]===Symbol.for("react.memo_cache_sentinel")?(ke=()=>{xe([])},e[20]=ke):ke=e[20];let We;e[21]!==w?(We=[w],e[21]=w,e[22]=We):We=e[22],K.useEffect(ke,We);const[Ee,Pe]=K.useState(!1),[Mt,$e]=K.useState(!1),[dt,Ue]=K.useState(!1);let ht;e[23]!==m?(ht=m.some(qc),e[23]=m,e[24]=ht):ht=e[24];const Ot=ht;let Re;e[25]!==m?(Re=m.some(Uc),e[25]=m,e[26]=Re):Re=e[26];const jt=Re;let ze;if(e[27]!==C||e[28]!==jt||e[29]!==Ot){if(ze=[],Ot){let we;e[31]===Symbol.for("react.memo_cache_sentinel")?(we=y.jsx(tt.IconPencil,{size:14}),e[31]=we):we=e[31];let _e;e[32]===Symbol.for("react.memo_cache_sentinel")?(_e={icon:we,label:"Bearbeiten",onClick:at=>{xe(at),$e(!0)}},e[32]=_e):_e=e[32],ze.push(_e)}if(C&&ze.push(...C),jt){let we;e[33]===Symbol.for("react.memo_cache_sentinel")?(we=y.jsx(tt.IconTrash,{size:14}),e[33]=we):we=e[33];let _e;e[34]===Symbol.for("react.memo_cache_sentinel")?(_e={icon:we,label:"Löschen",onClick:at=>{xe(at),Ue(!0)}},e[34]=_e):_e=e[34],ze.push(_e)}e[27]=C,e[28]=jt,e[29]=Ot,e[30]=ze}else ze=e[30];const ft=r?"space-between":"end";let Ze;e[35]!==r?(Ze=r&&(typeof r=="string"?y.jsx(O.Title,{order:4,children:r}):r),e[35]=r,e[36]=Ze):Ze=e[36];let lt;e[37]===Symbol.for("react.memo_cache_sentinel")?(lt={marginLeft:"auto"},e[37]=lt):lt=e[37];let Je;e[38]!==E||e[39]!==ae?(Je=ae&&y.jsx(O.ActionIcon,{variant:"subtle",onClick:()=>E(),"aria-label":"Neuladen",children:y.jsx(tt.IconRefresh,{})}),e[38]=E,e[39]=ae,e[40]=Je):Je=e[40];let st;e[41]!==C||e[42]!==G||e[43]!==ne||e[44]!==m||e[45]!==X||e[46]!==ve||e[47]!==b?(st=(m.some(Wc)||b)&&(()=>{const we=m.find(Fc)&&(!ne||ve.length>0&&ne(ve[0])),_e=m.find(zc)&&(!G||ve.length>0&&G(ve[0])),at=(C??[]).length>0,Le=we||_e||at;return y.jsx(O.Box,{...X?{visibleFrom:"sm"}:{},children:y.jsxs(O.Menu,{shadow:"md",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.Button,{variant:"outline",rightSection:y.jsx(tt.IconCaretDownFilled,{size:14}),disabled:!ve.length||!Le,children:"Aktionen"})}),y.jsxs(O.Menu.Dropdown,{children:[we&&y.jsx(O.Menu.Item,{leftSection:y.jsx(tt.IconPencil,{size:14}),onClick:()=>$e(!0),disabled:ve.length!==1,children:"Bearbeiten"}),(C??[]).map((De,Ve)=>K.createElement(O.Menu.Item,{...De.icon&&{leftSection:De.icon},key:`custom_action_${Ve}`,onClick:()=>De.onClick(ve),disabled:De.disabled?.(ve)??!1},De.label)),_e&&y.jsx(O.Menu.Item,{leftSection:y.jsx(tt.IconTrash,{size:14}),onClick:()=>Ue(!0),color:"red",children:"Löschen"})]})]})})})(),e[41]=C,e[42]=G,e[43]=ne,e[44]=m,e[45]=X,e[46]=ve,e[47]=b,e[48]=st):st=e[48];let ut;e[49]!==N||e[50]!==m||e[51]!==se?(ut=m.find(Yc)&&y.jsx(O.Button,{onClick:()=>Pe(!0),disabled:se,children:N??"Erstellen"}),e[49]=N,e[50]=m,e[51]=se,e[52]=ut):ut=e[52];let be;e[53]!==i||e[54]!==Je||e[55]!==st||e[56]!==ut?(be=y.jsxs(O.Group,{align:"center",gap:"xs",wrap:"wrap",justify:"end",style:lt,children:[Je,st,ut,i]}),e[53]=i,e[54]=Je,e[55]=st,e[56]=ut,e[57]=be):be=e[57];let Me;e[58]!==ft||e[59]!==Ze||e[60]!==be?(Me=y.jsxs(O.Group,{gap:"xs",justify:ft,align:"center",wrap:"wrap",children:[Ze,be]}),e[58]=ft,e[59]=Ze,e[60]=be,e[61]=Me):Me=e[61];let qe;e[62]!==w||e[63]!==l||e[64]!==B?(qe=B&&B.length>0&&y.jsx(O.Tabs,{value:w,onChange:l,mt:"md",children:y.jsx(O.Tabs.List,{children:B.map(Ic)})}),e[62]=w,e[63]=l,e[64]=B,e[65]=qe):qe=e[65];let it;e[66]!==ie?(it=ie&&y.jsx(O.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:y.jsx(tt.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[66]=ie,e[67]=it):it=e[67];let _t;e[68]!==se||e[69]!==ue?(_t=(se||ue)&&y.jsxs(O.Stack,{my:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(5).fill(0).map(Bc)]}),e[68]=se,e[69]=ue,e[70]=_t):_t=e[70];let xt;e[71]!==G||e[72]!==ne||e[73]!==m||e[74]!==W||e[75]!==ie||e[76]!==se||e[77]!==ue||e[78]!==ze||e[79]!==X||e[80]!==V||e[81]!==oe||e[82]!==he||e[83]!==_||e[84]!==ge||e[85]!==q||e[86]!==ve||e[87]!==b||e[88]!==fe||e[89]!==pe||e[90]!==g||e[91]!==le?(xt=!se&&!ue&&y.jsxs(y.Fragment,{children:[y.jsx(O.Box,{...X?{visibleFrom:"sm"}:{},children:y.jsx(yc,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:ie,records:ge,sortStatus:g,onSortStatusChange:W,...b&&{selectedRecords:ve,onSelectedRecordsChange:xe},..._&&ge.length&&{totalRecords:le.length,recordsPerPage:he,onPageChange:fe,page:oe,recordsPerPageOptions:An,onRecordsPerPageChange:pe,recordsPerPageLabel:"Einträge pro Seite"},...q&&{rowExpansion:{allowMultiple:q.allowMultiple??!1,content:we=>{const{record:_e}=we;return q.content(_e)},...q.expanded&&{expanded:q.expanded}}},columns:m.map(Lc),noRecordsText:"Keine Einträge gefunden",onRowClick:V,...V&&{style:{cursor:"pointer"}}})}),X&&y.jsx(O.Box,{hiddenFrom:"sm",children:y.jsx(Ys,{records:ge,fields:m,selection:b,selectedRecords:ve,onSelectedRecordsChange:xe,onRowClick:V,sort:{field:String(g.columnAccessor),direction:g.direction,onSortChange:(we,_e)=>{W({columnAccessor:we,direction:_e})}},..._&&ge.length&&{pagination:{totalRecords:le.length,recordsPerPage:he,page:oe,onPageChange:fe,recordsPerPageOptions:An,onRecordsPerPageChange:we=>{pe(we),fe(1)}}},...q&&{rowExpansion:{content:q.content}},...ze.length>0&&{actions:ze,canUpdate:ne,canDelete:G}})})]}),e[71]=G,e[72]=ne,e[73]=m,e[74]=W,e[75]=ie,e[76]=se,e[77]=ue,e[78]=ze,e[79]=X,e[80]=V,e[81]=oe,e[82]=he,e[83]=_,e[84]=ge,e[85]=q,e[86]=ve,e[87]=b,e[88]=fe,e[89]=pe,e[90]=g,e[91]=le,e[92]=xt):xt=e[92];let It;e[93]===Symbol.for("react.memo_cache_sentinel")?(It=()=>{$e(!1),xe([])},e[93]=It):It=e[93];const pt=r??"Bearbeiten";let Ct;e[94]!==D||e[95]!==m||e[96]!==n||e[97]!==ve[0]||e[98]!==ve.length||e[99]!==S?(Ct=ve.length>0&&y.jsx(Rs,{fields:m.filter(Nc),queryKey:n,apiPath:D,id:ve[0].id,onClose:()=>{$e(!1),xe([])},steps:S}),e[94]=D,e[95]=m,e[96]=n,e[97]=ve[0],e[98]=ve.length,e[99]=S,e[100]=Ct):Ct=e[100];let Xe;e[101]!==pt||e[102]!==Ct||e[103]!==Mt?(Xe=y.jsx(O.Modal,{opened:Mt,onClose:It,title:pt,children:Ct}),e[101]=pt,e[102]=Ct,e[103]=Mt,e[104]=Xe):Xe=e[104];let St;e[105]!==dt||e[106]!==D||e[107]!==n||e[108]!==ve||e[109]!==r?(St=ve.length>0&&y.jsx(O.Modal,{opened:dt,onClose:()=>{Ue(!1),xe([])},title:r??"Löschen",children:y.jsx(Ns,{onClose:()=>{Ue(!1),xe([])},queryKey:n,apiPath:D,selectedRecords:ve})}),e[105]=dt,e[106]=D,e[107]=n,e[108]=ve,e[109]=r,e[110]=St):St=e[110];let Dt;e[111]===Symbol.for("react.memo_cache_sentinel")?(Dt=()=>{Pe(!1)},e[111]=Dt):Dt=e[111];const At=r??"Anlegen";let Ne;e[112]===Symbol.for("react.memo_cache_sentinel")?(Ne=()=>{Pe(!1)},e[112]=Ne):Ne=e[112];let et;e[113]!==m?(et=m.filter(Rc),e[113]=m,e[114]=et):et=e[114];let ct;e[115]!==D||e[116]!==n||e[117]!==S||e[118]!==et?(ct=y.jsx(_s,{queryKey:n,apiPath:D,onClose:Ne,fields:et,steps:S}),e[115]=D,e[116]=n,e[117]=S,e[118]=et,e[119]=ct):ct=e[119];let Te;e[120]!==Ee||e[121]!==At||e[122]!==ct?(Te=y.jsx(O.Modal,{opened:Ee,onClose:Dt,title:At,children:ct}),e[120]=Ee,e[121]=At,e[122]=ct,e[123]=Te):Te=e[123];let Yt;return e[124]!==Me||e[125]!==qe||e[126]!==it||e[127]!==_t||e[128]!==xt||e[129]!==Xe||e[130]!==St||e[131]!==Te?(Yt=y.jsxs(y.Fragment,{children:[Me,qe,it,_t,xt,Xe,St,Te]}),e[124]=Me,e[125]=qe,e[126]=it,e[127]=_t,e[128]=xt,e[129]=Xe,e[130]=St,e[131]=Te,e[132]=Yt):Yt=e[132],Yt}function Rc(t){return t.create}function Nc(t){return t.update}function Lc(t){return t.column}function Bc(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-${e}`)}function Ic(t){return y.jsx(O.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function Yc(t){return t.create}function zc(t){return t.delete}function Fc(t){return t.update}function Wc(t){return t.update}function Uc(t){return t.delete}function qc(t){return t.update}function Vc(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function Hc(t){const[,e]=t;return e!=null}function Gc(t){const e=Fe.c(5),{queryClient:r}=yt();let n;e[0]!==t?(n=y.jsx($c,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=y.jsx(to,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}Ce.CreateModal=_s,Ce.DataTable=Gc,Ce.DataTableProvider=wl,Ce.DeleteModal=Ns,Ce.MobileCardList=Ys,Ce.UpdateModal=Rs,Ce.api=xl,Ce.createOne=Go,Ce.deleteOne=Ho,Ce.getAll=qo,Ce.getApiHeaders=Pt,Ce.getOne=Vo,Ce.sortData=Is,Ce.updateOne=Qo,Ce.useAddOne=Jo,Ce.useDataTable=yt,Ce.useDeleteOne=Xo,Ce.useGetAll=Zo,Ce.useGetOne=Ko,Ce.usePersistentState=Ls,Ce.useUpdateOne=gn,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})}));
|
|
10
|
+
<%s key={someKey} {...props} />`,z,U,G,U),O[U+z]=!0)}if(U=null,w!==void 0&&(n(w),U=""+w),i(S)&&(n(S.key),U=""+S.key),"key"in S){w={};for(var K in S)K!=="key"&&(w[K]=S[K])}else w=S;return U&&a(w,typeof d=="function"?d.displayName||d.name||"Unknown":d),h(d,U,w,s(),H,Q)}function p(d){m(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===M&&(d._payload.status==="fulfilled"?m(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function m(d){return typeof d=="object"&&d!==null&&d.$$typeof===x}var y=P,x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),R=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),B=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,D=Array.isArray,g=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(d){return d()}};var b,j={},v=y.react_stack_bottom_frame.bind(y,l)(),C=g(r(l)),O={};Rt.Fragment=A,Rt.jsx=function(d,S,w){var z=1e4>B.recentlyCreatedOwnerStacks++;return f(d,S,w,!1,z?Error("react-stack-top-frame"):v,z?g(r(d)):C)},Rt.jsxs=function(d,S,w){var z=1e4>B.recentlyCreatedOwnerStacks++;return f(d,S,w,!0,z?Error("react-stack-top-frame"):v,z?g(r(d)):C)}})()),Rt}var or;function As(){return or||(or=1,process.env.NODE_ENV==="production"?Ht.exports=Ls():Ht.exports=Ns()),Ht.exports}var o=As(),ar=be.createContext(void 0),ir=t=>{const e=be.useContext(ar);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Rs=({client:t,children:e})=>(be.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),o.jsx(ar.Provider,{value:t,children:e})),lr=be.createContext(!1),$s=()=>be.useContext(lr);lr.Provider;function Ys(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Is=be.createContext(Ys()),Fs=()=>be.useContext(Is),Ws=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},zs=t=>{be.useEffect(()=>{t.clearReset()},[t])},Bs=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||Xn(n,[t.error,r])),Vs=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Hs=(t,e)=>t.isLoading&&t.isFetching&&!e,Us=(t,e)=>t?.suspense&&e.isPending,cr=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function qs(t,e,n){if(process.env.NODE_ENV!=="production"&&(typeof t!="object"||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=$s(),s=Fs(),l=ir(),i=l.defaultQueryOptions(t);l.getDefaultOptions().queries?._experimental_beforeQuery?.(i),process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=r?"isRestoring":"optimistic",Vs(i),Ws(i,s),zs(s);const a=!l.getQueryCache().get(i.queryHash),[c]=be.useState(()=>new e(l,i)),h=c.getOptimisticResult(i),f=!r&&t.subscribed!==!1;if(be.useSyncExternalStore(be.useCallback(p=>{const m=f?c.subscribe(Vt.batchCalls(p)):zt;return c.updateResult(),m},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),be.useEffect(()=>{c.setOptions(i)},[i,c]),Us(i,h))throw cr(i,c,s);if(Bs({result:h,errorResetBoundary:s,throwOnError:i.throwOnError,query:l.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw h.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(i,h),i.experimental_prefetchInRender&&!Lt&&Hs(h,r)&&(a?cr(i,c,s):l.getQueryCache().get(i.queryHash)?.promise)?.catch(zt).finally(()=>{c.updateResult()}),i.notifyOnChangeProps?h:c.trackResult(h)}function ur(t,e){return qs(t,Ps)}function Cn(t,e){const n=ir(),[r]=be.useState(()=>new Es(n,t));be.useEffect(()=>{r.setOptions(t)},[r,t]);const s=be.useSyncExternalStore(be.useCallback(i=>r.subscribe(Vt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=be.useCallback((i,a)=>{r.mutate(i,a).catch(zt)},[r]);if(s.error&&Xn(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}const dr=P.createContext(void 0),Gs=async()=>({"Content-Type":"application/json"});function Qs(t){const e=Me.c(10),{children:n,baseUrl:r,queryClient:s,getHeaders:l}=t,i=l===void 0?Gs:l;let a;e[0]!==r||e[1]!==i||e[2]!==s?(a={baseUrl:r,queryClient:s,getHeaders:i},e[0]=r,e[1]=i,e[2]=s,e[3]=a):a=e[3];let c;e[4]!==n||e[5]!==s?(c=o.jsx(Rs,{client:s,children:n}),e[4]=n,e[5]=s,e[6]=c):c=e[6];let h;return e[7]!==a||e[8]!==c?(h=o.jsx(dr.Provider,{value:a,children:c}),e[7]=a,e[8]=c,e[9]=h):h=e[9],h}function vt(){const t=P.useContext(dr);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function Ks(t){if(typeof t=="string")try{const e=JSON.parse(t);return{message:e.message||t,code:e.code,details:e.details}}catch{return{message:t}}return t instanceof Error?{message:t.message}:{message:"Unbekannter Fehler"}}async function jt(t,e){const n=await fetch(t,e);if(n.status>=400){const r=await n.text();if(!r)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let s=null;try{s=JSON.parse(r)}catch{throw new Error(r)}throw new Error(s?.message??s?.error??r)}return n}async function hr(t,e){return(await jt(t,{method:"GET",headers:await e()})).json()}async function fr(t,e,n){return(await jt(`${t}/${e}`,{method:"GET",headers:await n()})).json()}async function mr(t,e,n){await jt(`${t}/${e}`,{method:"DELETE",headers:await n()})}async function pr(t,e,n){const r=await jt(t,{method:"POST",headers:await n(),body:JSON.stringify(e)});return r.status===204?e:r.json()}async function Js(t,e,n,r){const s=await jt(e,{method:t,headers:await n(),body:r?JSON.stringify(r):void 0});if(s.status!==204)return s.json()}async function gr(t,e,n){const r=await jt(`${t}/${e.id}`,{method:"PUT",headers:await n(),body:JSON.stringify(e)});return r.status===204?e:r.json()}function br(t,e,n){const r=Me.c(14),{baseUrl:s,getHeaders:l}=vt();let i;if(r[0]!==n||r[1]!==e){let f;r[3]!==n?(f=n?.toString(),r[3]=n,r[4]=f):f=r[4],i=[...e.map(Zs),String(f)],r[0]=n,r[1]=e,r[2]=i}else i=r[2];let a;r[5]!==t||r[6]!==s||r[7]!==l||r[8]!==n?(a=()=>fr(`${s}${t}`,n,l),r[5]=t,r[6]=s,r[7]=l,r[8]=n,r[9]=a):a=r[9];const c=!!n;let h;return r[10]!==i||r[11]!==a||r[12]!==c?(h={queryKey:i,queryFn:a,enabled:c},r[10]=i,r[11]=a,r[12]=c,r[13]=h):h=r[13],ur(h)}function Zs(t){return t.toString()}function yr(t,e,n){const r=Me.c(10),s=n===void 0?!0:n,{baseUrl:l,getHeaders:i}=vt();let a;r[0]!==e?(a=[...e.map(Xs)],r[0]=e,r[1]=a):a=r[1];let c;r[2]!==t||r[3]!==l||r[4]!==i?(c=()=>hr(`${l}${t}`,i),r[2]=t,r[3]=l,r[4]=i,r[5]=c):c=r[5];let h;return r[6]!==s||r[7]!==a||r[8]!==c?(h={queryKey:a,queryFn:c,enabled:s},r[6]=s,r[7]=a,r[8]=c,r[9]=h):h=r[9],ur(h)}function Xs(t){return t.toString()}function vr(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(to)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>pr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(eo)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Cn(c)}function eo(t){return t.toString()}function to(t){return t.toString()}function Sn(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(ro)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>gr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(no)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Cn(c)}function no(t){return t.toString()}function ro(t){return t.toString()}function xr(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(oo)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>mr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(so)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Cn(c)}function so(t){return t.toString()}function oo(t){return t.toString()}var Ut={exports:{}},ao=Ut.exports,Cr;function io(){return Cr||(Cr=1,(function(t,e){(function(n,r){t.exports=r()})(ao,(function(){var n=1e3,r=6e4,s=36e5,l="millisecond",i="second",a="minute",c="hour",h="day",f="week",p="month",m="quarter",y="year",x="date",k="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,F={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var g=["th","st","nd","rd"],b=D%100;return"["+D+(g[(b-20)%10]||g[b]||g[0])+"]"}},W=function(D,g,b){var j=String(D);return!j||j.length>=g?D:""+Array(g+1-j.length).join(b)+D},R={s:W,z:function(D){var g=-D.utcOffset(),b=Math.abs(g),j=Math.floor(b/60),v=b%60;return(g<=0?"+":"-")+W(j,2,"0")+":"+W(v,2,"0")},m:function D(g,b){if(g.date()<b.date())return-D(b,g);var j=12*(b.year()-g.year())+(b.month()-g.month()),v=g.clone().add(j,p),C=b-v<0,O=g.clone().add(j+(C?-1:1),p);return+(-(j+(b-v)/(C?v-O:O-v))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:p,y,w:f,d:h,D:x,h:c,m:a,s:i,ms:l,Q:m}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},Y="en",$={};$[Y]=F;var T="$isDayjsObject",E=function(D){return D instanceof B||!(!D||!D[T])},M=function D(g,b,j){var v;if(!g)return Y;if(typeof g=="string"){var C=g.toLowerCase();$[C]&&(v=C),b&&($[C]=b,v=C);var O=g.split("-");if(!v&&O.length>1)return D(O[0])}else{var d=g.name;$[d]=g,v=d}return!j&&v&&(Y=v),v||!j&&Y},_=function(D,g){if(E(D))return D.clone();var b=typeof g=="object"?g:{};return b.date=D,b.args=arguments,new B(b)},L=R;L.l=M,L.i=E,L.w=function(D,g){return _(D,{locale:g.$L,utc:g.$u,x:g.$x,$offset:g.$offset})};var B=(function(){function D(b){this.$L=M(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[T]=!0}var g=D.prototype;return g.parse=function(b){this.$d=(function(j){var v=j.date,C=j.utc;if(v===null)return new Date(NaN);if(L.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var O=v.match(A);if(O){var d=O[2]-1||0,S=(O[7]||"0").substring(0,3);return C?new Date(Date.UTC(O[1],d,O[3]||1,O[4]||0,O[5]||0,O[6]||0,S)):new Date(O[1],d,O[3]||1,O[4]||0,O[5]||0,O[6]||0,S)}}return new Date(v)})(b),this.init()},g.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},g.$utils=function(){return L},g.isValid=function(){return this.$d.toString()!==k},g.isSame=function(b,j){var v=_(b);return this.startOf(j)<=v&&v<=this.endOf(j)},g.isAfter=function(b,j){return _(b)<this.startOf(j)},g.isBefore=function(b,j){return this.endOf(j)<_(b)},g.$g=function(b,j,v){return L.u(b)?this[j]:this.set(v,b)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(b,j){var v=this,C=!!L.u(j)||j,O=L.p(b),d=function(K,q){var te=L.w(v.$u?Date.UTC(v.$y,q,K):new Date(v.$y,q,K),v);return C?te:te.endOf(h)},S=function(K,q){return L.w(v.toDate()[K].apply(v.toDate("s"),(C?[0,0,0,0]:[23,59,59,999]).slice(q)),v)},w=this.$W,z=this.$M,H=this.$D,Q="set"+(this.$u?"UTC":"");switch(O){case y:return C?d(1,0):d(31,11);case p:return C?d(1,z):d(0,z+1);case f:var U=this.$locale().weekStart||0,G=(w<U?w+7:w)-U;return d(C?H-G:H+(6-G),z);case h:case x:return S(Q+"Hours",0);case c:return S(Q+"Minutes",1);case a:return S(Q+"Seconds",2);case i:return S(Q+"Milliseconds",3);default:return this.clone()}},g.endOf=function(b){return this.startOf(b,!1)},g.$set=function(b,j){var v,C=L.p(b),O="set"+(this.$u?"UTC":""),d=(v={},v[h]=O+"Date",v[x]=O+"Date",v[p]=O+"Month",v[y]=O+"FullYear",v[c]=O+"Hours",v[a]=O+"Minutes",v[i]=O+"Seconds",v[l]=O+"Milliseconds",v)[C],S=C===h?this.$D+(j-this.$W):j;if(C===p||C===y){var w=this.clone().set(x,1);w.$d[d](S),w.init(),this.$d=w.set(x,Math.min(this.$D,w.daysInMonth())).$d}else d&&this.$d[d](S);return this.init(),this},g.set=function(b,j){return this.clone().$set(b,j)},g.get=function(b){return this[L.p(b)]()},g.add=function(b,j){var v,C=this;b=Number(b);var O=L.p(j),d=function(z){var H=_(C);return L.w(H.date(H.date()+Math.round(z*b)),C)};if(O===p)return this.set(p,this.$M+b);if(O===y)return this.set(y,this.$y+b);if(O===h)return d(1);if(O===f)return d(7);var S=(v={},v[a]=r,v[c]=s,v[i]=n,v)[O]||1,w=this.$d.getTime()+b*S;return L.w(w,this)},g.subtract=function(b,j){return this.add(-1*b,j)},g.format=function(b){var j=this,v=this.$locale();if(!this.isValid())return v.invalidDate||k;var C=b||"YYYY-MM-DDTHH:mm:ssZ",O=L.z(this),d=this.$H,S=this.$m,w=this.$M,z=v.weekdays,H=v.months,Q=v.meridiem,U=function(q,te,X,ne){return q&&(q[te]||q(j,C))||X[te].slice(0,ne)},G=function(q){return L.s(d%12||12,q,"0")},K=Q||function(q,te,X){var ne=q<12?"AM":"PM";return X?ne.toLowerCase():ne};return C.replace(I,(function(q,te){return te||(function(X){switch(X){case"YY":return String(j.$y).slice(-2);case"YYYY":return L.s(j.$y,4,"0");case"M":return w+1;case"MM":return L.s(w+1,2,"0");case"MMM":return U(v.monthsShort,w,H,3);case"MMMM":return U(H,w);case"D":return j.$D;case"DD":return L.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return U(v.weekdaysMin,j.$W,z,2);case"ddd":return U(v.weekdaysShort,j.$W,z,3);case"dddd":return z[j.$W];case"H":return String(d);case"HH":return L.s(d,2,"0");case"h":return G(1);case"hh":return G(2);case"a":return K(d,S,!0);case"A":return K(d,S,!1);case"m":return String(S);case"mm":return L.s(S,2,"0");case"s":return String(j.$s);case"ss":return L.s(j.$s,2,"0");case"SSS":return L.s(j.$ms,3,"0");case"Z":return O}return null})(q)||O.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(b,j,v){var C,O=this,d=L.p(j),S=_(b),w=(S.utcOffset()-this.utcOffset())*r,z=this-S,H=function(){return L.m(O,S)};switch(d){case y:C=H()/12;break;case p:C=H();break;case m:C=H()/3;break;case f:C=(z-w)/6048e5;break;case h:C=(z-w)/864e5;break;case c:C=z/s;break;case a:C=z/r;break;case i:C=z/n;break;default:C=z}return v?C:L.a(C)},g.daysInMonth=function(){return this.endOf(p).$D},g.$locale=function(){return $[this.$L]},g.locale=function(b,j){if(!b)return this.$L;var v=this.clone(),C=M(b,j,!0);return C&&(v.$L=C),v},g.clone=function(){return L.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},D})(),N=B.prototype;return _.prototype=N,[["$ms",l],["$s",i],["$m",a],["$H",c],["$W",h],["$M",p],["$y",y],["$D",x]].forEach((function(D){N[D[1]]=function(g){return this.$g(g,D[0],D[1])}})),_.extend=function(D,g){return D.$i||(D(g,B,_),D.$i=!0),_},_.locale=M,_.isDayjs=E,_.unix=function(D){return _(1e3*D)},_.en=$[Y],_.Ls=$,_.p={},_}))})(Ut)),Ut.exports}var lo=io();const V=Vn(lo);function co({direction:t,levelIndex:e,rowIndex:n,cellIndex:r,size:s}){switch(t){case"up":return e===0&&n===0?null:n===0?{levelIndex:e-1,rowIndex:r<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:r}:{levelIndex:e,rowIndex:n-1,cellIndex:r};case"down":return n===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:r}:n===s[e].length-2&&r>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:r}:{levelIndex:e,rowIndex:n+1,cellIndex:r};case"left":return e===0&&n===0&&r===0?null:n===0&&r===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:r===0?{levelIndex:e,rowIndex:n-1,cellIndex:s[e][n-1]-1}:{levelIndex:e,rowIndex:n,cellIndex:r-1};case"right":return n===s[e].length-1&&r===s[e][n]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:r===s[e][n]-1?{levelIndex:e,rowIndex:n+1,cellIndex:0}:{levelIndex:e,rowIndex:n,cellIndex:r+1};default:return{levelIndex:e,rowIndex:n,cellIndex:r}}}function Sr({controlsRef:t,direction:e,levelIndex:n,rowIndex:r,cellIndex:s,size:l}){const i=co({direction:e,size:l,rowIndex:r,cellIndex:s,levelIndex:n});if(!i)return;const a=t.current?.[i.levelIndex]?.[i.rowIndex]?.[i.cellIndex];a&&(a.disabled||a.getAttribute("data-hidden")||a.getAttribute("data-outside")?Sr({controlsRef:t,direction:e,levelIndex:i.levelIndex,cellIndex:i.cellIndex,rowIndex:i.rowIndex,size:l}):a.focus())}function uo(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function ho(t){return t.current?.map(e=>e.map(n=>n.length))}function wn({controlsRef:t,levelIndex:e,rowIndex:n,cellIndex:r,event:s}){const l=uo(s.key);if(l){s.preventDefault();const i=ho(t);Sr({controlsRef:t,direction:l,levelIndex:e,rowIndex:n,cellIndex:r,size:i})}}function Ae(t){return t==null||t===""?t:V(t).format("YYYY-MM-DD")}function wr(t){return t==null||t===""?t:V(t).format("YYYY-MM-DD HH:mm:ss")}const fo={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},mo=P.createContext(fo);function lt(){const t=P.useContext(mo),e=P.useCallback(l=>l||t.locale,[t.locale]),n=P.useCallback(l=>typeof l=="number"?l:t.firstDayOfWeek,[t.firstDayOfWeek]),r=P.useCallback(l=>Array.isArray(l)?l:t.weekendDays,[t.weekendDays]),s=P.useCallback(l=>typeof l=="string"?l:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:n,getWeekendDays:r,getLabelSeparator:s}}function po({value:t,type:e,withTime:n}){const r=n?wr:Ae;if(e==="range"&&Array.isArray(t)){const s=r(t[0]),l=r(t[1]);return s?l?`${s} – ${l}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?r(t):""}function Dr({value:t,type:e,name:n,form:r,withTime:s=!1}){return o.jsx("input",{type:"hidden",value:po({value:t,type:e,withTime:s}),name:n,form:r})}Dr.displayName="@mantine/dates/HiddenDatesInput";function kr(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=kr(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function de(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=kr(t))&&(r&&(r+=" "),r+=e);return r}var _r={day:"m_396ce5cb"};const go=u.createVarsResolver((t,{size:e})=>({day:{"--day-size":u.getSize(e,"day-size")}})),Dn=u.factory((t,e)=>{const n=u.useProps("Day",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,date:h,disabled:f,__staticSelector:p,weekend:m,outside:y,selected:x,renderDay:k,inRange:A,firstInRange:I,lastInRange:F,hidden:W,static:R,highlightToday:Y,attributes:$,...T}=n,E=u.useStyles({name:p||"Day",classes:_r,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:$,vars:c,varsResolver:go,rootSelector:"day"});return o.jsx(u.UnstyledButton,{...E("day",{style:W?{display:"none"}:void 0}),component:R?"div":"button",ref:e,disabled:f,"data-today":V(h).isSame(new Date,"day")||void 0,"data-hidden":W||void 0,"data-highlight-today":Y||void 0,"data-disabled":f||void 0,"data-weekend":!f&&!y&&m||void 0,"data-outside":!f&&y||void 0,"data-selected":!f&&x||void 0,"data-in-range":A&&!f||void 0,"data-first-in-range":I&&!f||void 0,"data-last-in-range":F&&!f||void 0,"data-static":R||void 0,unstyled:a,...T,children:k?.(h)||V(h).date()})});Dn.classes=_r,Dn.displayName="@mantine/dates/Day";function bo({locale:t,format:e="dd",firstDayOfWeek:n=1}){const r=V().day(n),s=[];for(let l=0;l<7;l+=1)typeof e=="string"?s.push(V(r).add(l,"days").locale(t).format(e)):s.push(e(V(r).add(l,"days").format("YYYY-MM-DD")));return s}var jr={weekday:"m_18a3eca"};const yo=u.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":u.getFontSize(e),"--wr-spacing":u.getSpacing(e)}})),kn=u.factory((t,e)=>{const n=u.useProps("WeekdaysRow",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,locale:h,firstDayOfWeek:f,weekdayFormat:p,cellComponent:m="th",__staticSelector:y,withWeekNumbers:x,attributes:k,...A}=n,I=u.useStyles({name:y||"WeekdaysRow",classes:jr,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:k,vars:c,varsResolver:yo,rootSelector:"weekdaysRow"}),F=lt(),W=bo({locale:F.getLocale(h),format:p,firstDayOfWeek:F.getFirstDayOfWeek(f)}).map((R,Y)=>o.jsx(m,{...I("weekday"),children:R},Y));return o.jsxs(u.Box,{component:"tr",ref:e,...I("weekdaysRow"),...A,children:[x&&o.jsx(m,{...I("weekday"),children:"#"}),W]})});kn.classes=jr,kn.displayName="@mantine/dates/WeekdaysRow";function vo(t,e=1){let n=V(t);if(!n.isValid())return n;const r=e===0?6:e-1;for(;n.day()!==r;)n=n.add(1,"day");return n.format("YYYY-MM-DD")}function xo(t,e=1){let n=V(t);for(;n.day()!==e;)n=n.subtract(1,"day");return n.format("YYYY-MM-DD")}function Co({month:t,firstDayOfWeek:e=1,consistentWeeks:n}){const r=V(t).subtract(V(t).date()-1,"day"),s=V(r.format("YYYY-M-D")),l=s.format("YYYY-MM-DD"),i=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),a=vo(i,e),c=[];let h=V(xo(l,e));for(;V(h).isBefore(a,"day");){const f=[];for(let p=0;p<7;p+=1)f.push(h.format("YYYY-MM-DD")),h=h.add(1,"day");c.push(f)}if(n&&c.length<6){const f=c[c.length-1],p=f[f.length-1];let m=V(p).add(1,"day");for(;c.length<6;){const y=[];for(let x=0;x<7;x+=1)y.push(m.format("YYYY-MM-DD")),m=m.add(1,"day");c.push(y)}}return c}function _n(t,e){return V(t).format("YYYY-MM")===V(e).format("YYYY-MM")}function Pr(t,e){return e?V(t).isAfter(V(e).subtract(1,"day"),"day"):!0}function Mr(t,e){return e?V(t).isBefore(V(e).add(1,"day"),"day"):!0}function So({dates:t,minDate:e,maxDate:n,getDayProps:r,excludeDate:s,hideOutsideDates:l,month:i}){const a=t.flat().filter(f=>Mr(f,n)&&Pr(f,e)&&!s?.(f)&&!r?.(f)?.disabled&&(!l||_n(f,i))),c=a.find(f=>r?.(f)?.selected);if(c)return c;const h=a.find(f=>V().isSame(f,"date"));return h||a[0]}var qt={exports:{}},wo=qt.exports,Tr;function Do(){return Tr||(Tr=1,(function(t,e){(function(n,r){t.exports=r()})(wo,(function(){var n="day";return function(r,s,l){var i=function(h){return h.add(4-h.isoWeekday(),n)},a=s.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(h){if(!this.$utils().u(h))return this.add(7*(h-this.isoWeek()),n);var f,p,m,y,x=i(this),k=(f=this.isoWeekYear(),p=this.$u,m=(p?l.utc:l)().year(f).startOf("year"),y=4-m.isoWeekday(),m.isoWeekday()>4&&(y+=7),m.add(y,n));return x.diff(k,"week")+1},a.isoWeekday=function(h){return this.$utils().u(h)?this.day()||7:this.day(this.day()%7?h:h-7)};var c=a.startOf;a.startOf=function(h,f){var p=this.$utils(),m=!!p.u(f)||f;return p.p(h)==="isoweek"?m?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(h,f)}}}))})(qt)),qt.exports}var ko=Do();const _o=Vn(ko);V.extend(_o);function jo(t){const e=t.find(n=>V(n).day()===1);return V(e).isoWeek()}var Or={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Po={withCellSpacing:!0},Mo=u.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":u.getFontSize(e),"--wn-size":u.getSize(e,"wn-size")}})),Gt=u.factory((t,e)=>{const n=u.useProps("Month",Po,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,locale:f,firstDayOfWeek:p,weekdayFormat:m,month:y,weekendDays:x,getDayProps:k,excludeDate:A,minDate:I,maxDate:F,renderDay:W,hideOutsideDates:R,hideWeekdays:Y,getDayAriaLabel:$,static:T,__getDayRef:E,__onDayKeyDown:M,__onDayClick:_,__onDayMouseEnter:L,__preventFocus:B,__stopPropagation:N,withCellSpacing:D,size:g,highlightToday:b,withWeekNumbers:j,attributes:v,...C}=n,O=u.useStyles({name:h||"Month",classes:Or,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:v,vars:c,varsResolver:Mo,rootSelector:"month"}),d=lt(),S=Co({month:y,firstDayOfWeek:d.getFirstDayOfWeek(p),consistentWeeks:d.consistentWeeks}),w=So({dates:S,minDate:Ae(I),maxDate:Ae(F),getDayProps:k,excludeDate:A,hideOutsideDates:R,month:y}),{resolvedClassNames:z,resolvedStyles:H}=u.useResolvedStylesApi({classNames:r,styles:i,props:n}),Q=S.map((U,G)=>{const K=U.map((q,te)=>{const X=!_n(q,y),ne=$?.(q)||V(q).locale(f||d.locale).format("D MMMM YYYY"),le=k?.(q),he=V(q).isSame(w,"date");return o.jsx("td",{...O("monthCell"),"data-with-spacing":D||void 0,children:o.jsx(Dn,{__staticSelector:h||"Month",classNames:z,styles:H,unstyled:a,"data-mantine-stop-propagation":N||void 0,highlightToday:b,renderDay:W,date:q,size:g,weekend:d.getWeekendDays(x).includes(V(q).get("day")),outside:X,hidden:R?X:!1,"aria-label":ne,static:T,disabled:A?.(q)||!Mr(q,Ae(F))||!Pr(q,Ae(I)),ref:re=>{re&&E?.(G,te,re)},...le,onKeyDown:re=>{le?.onKeyDown?.(re),M?.(re,{rowIndex:G,cellIndex:te,date:q})},onMouseEnter:re=>{le?.onMouseEnter?.(re),L?.(re,q)},onClick:re=>{le?.onClick?.(re),_?.(re,q)},onMouseDown:re=>{le?.onMouseDown?.(re),B&&re.preventDefault()},tabIndex:B||!he?-1:0})},q.toString())});return o.jsxs("tr",{...O("monthRow"),children:[j&&o.jsx("td",{...O("weekNumber"),children:jo(U)}),K]},G)});return o.jsxs(u.Box,{component:"table",...O("month"),size:g,ref:e,...C,children:[!Y&&o.jsx("thead",{...O("monthThead"),children:o.jsx(kn,{__staticSelector:h||"Month",locale:f,firstDayOfWeek:p,weekdayFormat:m,size:g,classNames:z,styles:H,unstyled:a,withWeekNumbers:j})}),o.jsx("tbody",{...O("monthTbody"),children:Q})]})});Gt.classes=Or,Gt.displayName="@mantine/dates/Month";var Er={pickerControl:"m_dc6a3c71"};const To=u.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":u.getFontSize(e),"--dpc-size":u.getSize(e,"dpc-size")}})),Qt=u.factory((t,e)=>{const n=u.useProps("PickerControl",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,firstInRange:h,lastInRange:f,inRange:p,__staticSelector:m,selected:y,disabled:x,attributes:k,...A}=n,I=u.useStyles({name:m||"PickerControl",classes:Er,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:k,vars:c,varsResolver:To,rootSelector:"pickerControl"});return o.jsx(u.UnstyledButton,{...I("pickerControl"),ref:e,unstyled:a,"data-picker-control":!0,"data-selected":y&&!x||void 0,"data-disabled":x||void 0,"data-in-range":p&&!x&&!y||void 0,"data-first-in-range":h&&!x||void 0,"data-last-in-range":f&&!x||void 0,disabled:x,...A})});Qt.classes=Er,Qt.displayName="@mantine/dates/PickerControl";function Lr({year:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&V(t).isBefore(e,"year")||n&&V(t).isAfter(n,"year"))}function Oo({years:t,minDate:e,maxDate:n,getYearControlProps:r}){const s=t.flat().filter(a=>!Lr({year:a,minDate:e,maxDate:n})&&!r?.(a)?.disabled),l=s.find(a=>r?.(a)?.selected);if(l)return l;const i=s.find(a=>V().isSame(a,"year"));return i||s[0]}function Nr(t){const e=V(t).year(),n=e-e%10;let r=0;const s=[[],[],[],[]];for(let l=0;l<4;l+=1){const i=l===3?1:3;for(let a=0;a<i;a+=1)s[l].push(V(new Date(n+r,0)).format("YYYY-MM-DD")),r+=1}return s}var Ar={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Eo={yearsListFormat:"YYYY",withCellSpacing:!0},Kt=u.factory((t,e)=>{const n=u.useProps("YearsList",Eo,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,decade:h,yearsListFormat:f,locale:p,minDate:m,maxDate:y,getYearControlProps:x,__staticSelector:k,__getControlRef:A,__onControlKeyDown:I,__onControlClick:F,__onControlMouseEnter:W,__preventFocus:R,__stopPropagation:Y,withCellSpacing:$,size:T,attributes:E,...M}=n,_=u.useStyles({name:k||"YearsList",classes:Ar,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:E,vars:c,rootSelector:"yearsList"}),L=lt(),B=Nr(h),N=Oo({years:B,minDate:m,maxDate:y,getYearControlProps:x}),D=B.map((g,b)=>{const j=g.map((v,C)=>{const O=x?.(v),d=V(v).isSame(N,"year");return o.jsx("td",{..._("yearsListCell"),"data-with-spacing":$||void 0,children:o.jsx(Qt,{..._("yearsListControl"),size:T,unstyled:a,"data-mantine-stop-propagation":Y||void 0,disabled:Lr({year:v,minDate:m,maxDate:y}),ref:S=>{S&&A?.(b,C,S)},...O,onKeyDown:S=>{O?.onKeyDown?.(S),I?.(S,{rowIndex:b,cellIndex:C,date:v})},onClick:S=>{O?.onClick?.(S),F?.(S,v)},onMouseEnter:S=>{O?.onMouseEnter?.(S),W?.(S,v)},onMouseDown:S=>{O?.onMouseDown?.(S),R&&S.preventDefault()},tabIndex:R||!d?-1:0,children:V(v).locale(L.getLocale(p)).format(f)})},C)});return o.jsx("tr",{..._("yearsListRow"),children:j},b)});return o.jsx(u.Box,{component:"table",ref:e,size:T,..._("yearsList"),...M,children:o.jsx("tbody",{children:D})})});Kt.classes=Ar,Kt.displayName="@mantine/dates/YearsList";function Rr({month:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&V(t).isBefore(e,"month")||n&&V(t).isAfter(n,"month"))}function Lo({months:t,minDate:e,maxDate:n,getMonthControlProps:r}){const s=t.flat().filter(a=>!Rr({month:a,minDate:e,maxDate:n})&&!r?.(a)?.disabled),l=s.find(a=>r?.(a)?.selected);if(l)return l;const i=s.find(a=>V().isSame(a,"month"));return i||s[0]}function No(t){const e=V(t).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let s=0;s<4;s+=1)for(let l=0;l<3;l+=1)n[s].push(V(e).add(r,"months").format("YYYY-MM-DD")),r+=1;return n}var $r={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Ao={monthsListFormat:"MMM",withCellSpacing:!0},Jt=u.factory((t,e)=>{const n=u.useProps("MonthsList",Ao,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,year:f,monthsListFormat:p,locale:m,minDate:y,maxDate:x,getMonthControlProps:k,__getControlRef:A,__onControlKeyDown:I,__onControlClick:F,__onControlMouseEnter:W,__preventFocus:R,__stopPropagation:Y,withCellSpacing:$,size:T,attributes:E,...M}=n,_=u.useStyles({name:h||"MonthsList",classes:$r,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:E,vars:c,rootSelector:"monthsList"}),L=lt(),B=No(f),N=Lo({months:B,minDate:Ae(y),maxDate:Ae(x),getMonthControlProps:k}),D=B.map((g,b)=>{const j=g.map((v,C)=>{const O=k?.(v),d=V(v).isSame(N,"month");return o.jsx("td",{..._("monthsListCell"),"data-with-spacing":$||void 0,children:o.jsx(Qt,{..._("monthsListControl"),size:T,unstyled:a,__staticSelector:h||"MonthsList","data-mantine-stop-propagation":Y||void 0,disabled:Rr({month:v,minDate:Ae(y),maxDate:Ae(x)}),ref:S=>{S&&A?.(b,C,S)},...O,onKeyDown:S=>{O?.onKeyDown?.(S),I?.(S,{rowIndex:b,cellIndex:C,date:v})},onClick:S=>{O?.onClick?.(S),F?.(S,v)},onMouseEnter:S=>{O?.onMouseEnter?.(S),W?.(S,v)},onMouseDown:S=>{O?.onMouseDown?.(S),R&&S.preventDefault()},tabIndex:R||!d?-1:0,children:V(v).locale(L.getLocale(m)).format(p)})},C)});return o.jsx("tr",{..._("monthsListRow"),children:j},b)});return o.jsx(u.Box,{component:"table",ref:e,size:T,..._("monthsList"),...M,children:o.jsx("tbody",{children:D})})});Jt.classes=$r,Jt.displayName="@mantine/dates/MonthsList";var Yr={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const Ro={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},$o=u.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":u.getSize(e,"dch-control-size"),"--dch-fz":u.getFontSize(e)}})),ct=u.factory((t,e)=>{const n=u.useProps("CalendarHeader",Ro,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,nextIcon:h,previousIcon:f,nextLabel:p,previousLabel:m,onNext:y,onPrevious:x,onLevelClick:k,label:A,nextDisabled:I,previousDisabled:F,hasNextLevel:W,levelControlAriaLabel:R,withNext:Y,withPrevious:$,headerControlsOrder:T,__staticSelector:E,__preventFocus:M,__stopPropagation:_,attributes:L,...B}=n,N=u.useStyles({name:E||"CalendarHeader",classes:Yr,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:L,vars:c,varsResolver:$o,rootSelector:"calendarHeader"}),D=M?C=>C.preventDefault():void 0,g=$&&P.createElement(u.UnstyledButton,{...N("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":m,onClick:x,unstyled:a,onMouseDown:D,disabled:F,"data-disabled":F||void 0,tabIndex:M||F?-1:0,"data-mantine-stop-propagation":_||void 0},f||o.jsx(u.AccordionChevron,{...N("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),b=P.createElement(u.UnstyledButton,{component:W?"button":"div",...N("calendarHeaderLevel"),key:"level",onClick:W?k:void 0,unstyled:a,onMouseDown:W?D:void 0,disabled:!W,"data-static":!W||void 0,"aria-label":R,tabIndex:M||!W?-1:0,"data-mantine-stop-propagation":_||void 0},A),j=Y&&P.createElement(u.UnstyledButton,{...N("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":p,onClick:y,unstyled:a,onMouseDown:D,disabled:I,"data-disabled":I||void 0,tabIndex:M||I?-1:0,"data-mantine-stop-propagation":_||void 0},h||o.jsx(u.AccordionChevron,{...N("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),v=T.map(C=>C==="previous"?g:C==="level"?b:C==="next"?j:null);return o.jsx(u.Box,{...N("calendarHeader"),ref:e,...B,children:v})});ct.classes=Yr,ct.displayName="@mantine/dates/CalendarHeader";function Yo(t){const e=Nr(t);return[e[0][0],e[3][0]]}const Io={decadeLabelFormat:"YYYY"},Zt=u.factory((t,e)=>{const n=u.useProps("DecadeLevel",Io,t),{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:p,__onControlMouseEnter:m,withCellSpacing:y,__preventFocus:x,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:W,onPrevious:R,nextDisabled:Y,previousDisabled:$,levelControlAriaLabel:T,withNext:E,withPrevious:M,headerControlsOrder:_,decadeLabelFormat:L,classNames:B,styles:N,unstyled:D,__staticSelector:g,__stopPropagation:b,size:j,attributes:v,...C}=n,O=lt(),[d,S]=Yo(r),w={__staticSelector:g||"DecadeLevel",classNames:B,styles:N,unstyled:D,size:j,attributes:v},z=typeof Y=="boolean"?Y:i?!V(S).endOf("year").isBefore(i):!1,H=typeof $=="boolean"?$:l?!V(d).startOf("year").isAfter(l):!1,Q=(U,G)=>V(U).locale(s||O.locale).format(G);return o.jsxs(u.Box,{"data-decade-level":!0,size:j,ref:e,...C,children:[o.jsx(ct,{label:typeof L=="function"?L(d,S):`${Q(d,L)} – ${Q(S,L)}`,__preventFocus:x,__stopPropagation:b,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:W,onPrevious:R,nextDisabled:z,previousDisabled:H,hasNextLevel:!1,levelControlAriaLabel:T,withNext:E,withPrevious:M,headerControlsOrder:_,...w}),o.jsx(Kt,{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:p,__onControlMouseEnter:m,__preventFocus:x,__stopPropagation:b,withCellSpacing:y,...w})]})});Zt.classes={...Kt.classes,...ct.classes},Zt.displayName="@mantine/dates/DecadeLevel";const Fo={yearLabelFormat:"YYYY"},Xt=u.factory((t,e)=>{const n=u.useProps("YearLevel",Fo,t),{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:p,__onControlMouseEnter:m,withCellSpacing:y,__preventFocus:x,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:W,onPrevious:R,onLevelClick:Y,nextDisabled:$,previousDisabled:T,hasNextLevel:E,levelControlAriaLabel:M,withNext:_,withPrevious:L,headerControlsOrder:B,yearLabelFormat:N,__staticSelector:D,__stopPropagation:g,size:b,classNames:j,styles:v,unstyled:C,attributes:O,...d}=n,S=lt(),w={__staticSelector:D||"YearLevel",classNames:j,styles:v,unstyled:C,size:b,attributes:O},z=typeof $=="boolean"?$:i?!V(r).endOf("year").isBefore(i):!1,H=typeof T=="boolean"?T:l?!V(r).startOf("year").isAfter(l):!1;return o.jsxs(u.Box,{"data-year-level":!0,size:b,ref:e,...d,children:[o.jsx(ct,{label:typeof N=="function"?N(r):V(r).locale(s||S.locale).format(N),__preventFocus:x,__stopPropagation:g,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:W,onPrevious:R,onLevelClick:Y,nextDisabled:z,previousDisabled:H,hasNextLevel:E,levelControlAriaLabel:M,withNext:_,withPrevious:L,headerControlsOrder:B,...w}),o.jsx(Jt,{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:p,__onControlMouseEnter:m,__preventFocus:x,__stopPropagation:g,withCellSpacing:y,...w})]})});Xt.classes={...ct.classes,...Jt.classes},Xt.displayName="@mantine/dates/YearLevel";const Wo={monthLabelFormat:"MMMM YYYY"},en=u.factory((t,e)=>{const n=u.useProps("MonthLevel",Wo,t),{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:p,renderDay:m,hideOutsideDates:y,hideWeekdays:x,getDayAriaLabel:k,__getDayRef:A,__onDayKeyDown:I,__onDayClick:F,__onDayMouseEnter:W,withCellSpacing:R,highlightToday:Y,withWeekNumbers:$,__preventFocus:T,__stopPropagation:E,nextIcon:M,previousIcon:_,nextLabel:L,previousLabel:B,onNext:N,onPrevious:D,onLevelClick:g,nextDisabled:b,previousDisabled:j,hasNextLevel:v,levelControlAriaLabel:C,withNext:O,withPrevious:d,headerControlsOrder:S,monthLabelFormat:w,classNames:z,styles:H,unstyled:Q,__staticSelector:U,size:G,static:K,attributes:q,...te}=n,X=lt(),ne={__staticSelector:U||"MonthLevel",classNames:z,styles:H,unstyled:Q,size:G,attributes:q},le=typeof b=="boolean"?b:p?!V(r).endOf("month").isBefore(p):!1,he=typeof j=="boolean"?j:f?!V(r).startOf("month").isAfter(f):!1;return o.jsxs(u.Box,{"data-month-level":!0,size:G,ref:e,...te,children:[o.jsx(ct,{label:typeof w=="function"?w(r):V(r).locale(s||X.locale).format(w),__preventFocus:T,__stopPropagation:E,nextIcon:M,previousIcon:_,nextLabel:L,previousLabel:B,onNext:N,onPrevious:D,onLevelClick:g,nextDisabled:le,previousDisabled:he,hasNextLevel:v,levelControlAriaLabel:C,withNext:O,withPrevious:d,headerControlsOrder:S,...ne}),o.jsx(Gt,{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:p,renderDay:m,hideOutsideDates:y,hideWeekdays:x,getDayAriaLabel:k,__getDayRef:A,__onDayKeyDown:I,__onDayClick:F,__onDayMouseEnter:W,__preventFocus:T,__stopPropagation:E,static:K,withCellSpacing:R,highlightToday:Y,withWeekNumbers:$,...ne})]})});en.classes={...Gt.classes,...ct.classes},en.displayName="@mantine/dates/MonthLevel";var Ir={levelsGroup:"m_30b26e33"};const ut=u.factory((t,e)=>{const n=u.useProps("LevelsGroup",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,attributes:f,...p}=n,m=u.useStyles({name:h||"LevelsGroup",classes:Ir,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:f,vars:c,rootSelector:"levelsGroup"});return o.jsx(u.Box,{ref:e,...m("levelsGroup"),...p})});ut.classes=Ir,ut.displayName="@mantine/dates/LevelsGroup";const zo={numberOfColumns:1},tn=u.factory((t,e)=>{const n=u.useProps("DecadeLevelGroup",zo,t),{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:p,__preventFocus:m,nextIcon:y,previousIcon:x,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,nextDisabled:W,previousDisabled:R,headerControlsOrder:Y,classNames:$,styles:T,unstyled:E,__staticSelector:M,__stopPropagation:_,numberOfColumns:L,levelControlAriaLabel:B,decadeLabelFormat:N,size:D,vars:g,attributes:b,...j}=n,v=P.useRef([]),C=Array(L).fill(0).map((O,d)=>{const S=V(r).add(d*10,"years").format("YYYY-MM-DD");return o.jsx(Zt,{size:D,yearsListFormat:a,decade:S,withNext:d===L-1,withPrevious:d===0,decadeLabelFormat:N,__onControlClick:h,__onControlMouseEnter:f,__onControlKeyDown:(w,z)=>wn({levelIndex:d,rowIndex:z.rowIndex,cellIndex:z.cellIndex,event:w,controlsRef:v}),__getControlRef:(w,z,H)=>{Array.isArray(v.current[d])||(v.current[d]=[]),Array.isArray(v.current[d][w])||(v.current[d][w]=[]),v.current[d][w][z]=H},levelControlAriaLabel:typeof B=="function"?B(S):B,locale:s,minDate:l,maxDate:i,__preventFocus:m,__stopPropagation:_,nextIcon:y,previousIcon:x,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,nextDisabled:W,previousDisabled:R,getYearControlProps:c,__staticSelector:M||"DecadeLevelGroup",classNames:$,styles:T,unstyled:E,withCellSpacing:p,headerControlsOrder:Y,attributes:b},d)});return o.jsx(ut,{classNames:$,styles:T,__staticSelector:M||"DecadeLevelGroup",ref:e,size:D,unstyled:E,attributes:b,...j,children:C})});tn.classes={...ut.classes,...Zt.classes},tn.displayName="@mantine/dates/DecadeLevelGroup";const Bo={numberOfColumns:1},nn=u.factory((t,e)=>{const n=u.useProps("YearLevelGroup",Bo,t),{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:p,__preventFocus:m,nextIcon:y,previousIcon:x,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,onLevelClick:W,nextDisabled:R,previousDisabled:Y,hasNextLevel:$,headerControlsOrder:T,classNames:E,styles:M,unstyled:_,__staticSelector:L,__stopPropagation:B,numberOfColumns:N,levelControlAriaLabel:D,yearLabelFormat:g,size:b,vars:j,attributes:v,...C}=n,O=P.useRef([]),d=Array(N).fill(0).map((S,w)=>{const z=V(r).add(w,"years").format("YYYY-MM-DD");return o.jsx(Xt,{size:b,monthsListFormat:a,year:z,withNext:w===N-1,withPrevious:w===0,yearLabelFormat:g,__stopPropagation:B,__onControlClick:h,__onControlMouseEnter:f,__onControlKeyDown:(H,Q)=>wn({levelIndex:w,rowIndex:Q.rowIndex,cellIndex:Q.cellIndex,event:H,controlsRef:O}),__getControlRef:(H,Q,U)=>{Array.isArray(O.current[w])||(O.current[w]=[]),Array.isArray(O.current[w][H])||(O.current[w][H]=[]),O.current[w][H][Q]=U},levelControlAriaLabel:typeof D=="function"?D(z):D,locale:s,minDate:l,maxDate:i,__preventFocus:m,nextIcon:y,previousIcon:x,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,onLevelClick:W,nextDisabled:R,previousDisabled:Y,hasNextLevel:$,getMonthControlProps:c,classNames:E,styles:M,unstyled:_,__staticSelector:L||"YearLevelGroup",withCellSpacing:p,headerControlsOrder:T,attributes:v},w)});return o.jsx(ut,{classNames:E,styles:M,__staticSelector:L||"YearLevelGroup",ref:e,size:b,unstyled:_,attributes:v,...C,children:d})});nn.classes={...Xt.classes,...ut.classes},nn.displayName="@mantine/dates/YearLevelGroup";const Vo={numberOfColumns:1},rn=u.factory((t,e)=>{const n=u.useProps("MonthLevelGroup",Vo,t),{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:p,renderDay:m,hideOutsideDates:y,hideWeekdays:x,getDayAriaLabel:k,__onDayClick:A,__onDayMouseEnter:I,withCellSpacing:F,highlightToday:W,withWeekNumbers:R,__preventFocus:Y,nextIcon:$,previousIcon:T,nextLabel:E,previousLabel:M,onNext:_,onPrevious:L,onLevelClick:B,nextDisabled:N,previousDisabled:D,hasNextLevel:g,headerControlsOrder:b,classNames:j,styles:v,unstyled:C,numberOfColumns:O,levelControlAriaLabel:d,monthLabelFormat:S,__staticSelector:w,__stopPropagation:z,size:H,static:Q,vars:U,attributes:G,...K}=n,q=P.useRef([]),te=Array(O).fill(0).map((X,ne)=>{const le=V(r).add(ne,"months").format("YYYY-MM-DD");return o.jsx(en,{month:le,withNext:ne===O-1,withPrevious:ne===0,monthLabelFormat:S,__stopPropagation:z,__onDayClick:A,__onDayMouseEnter:I,__onDayKeyDown:(he,re)=>wn({levelIndex:ne,rowIndex:re.rowIndex,cellIndex:re.cellIndex,event:he,controlsRef:q}),__getDayRef:(he,re,_e)=>{Array.isArray(q.current[ne])||(q.current[ne]=[]),Array.isArray(q.current[ne][he])||(q.current[ne][he]=[]),q.current[ne][he][re]=_e},levelControlAriaLabel:typeof d=="function"?d(le):d,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:p,renderDay:m,hideOutsideDates:y,hideWeekdays:x,getDayAriaLabel:k,__preventFocus:Y,nextIcon:$,previousIcon:T,nextLabel:E,previousLabel:M,onNext:_,onPrevious:L,onLevelClick:B,nextDisabled:N,previousDisabled:D,hasNextLevel:g,classNames:j,styles:v,unstyled:C,__staticSelector:w||"MonthLevelGroup",size:H,static:Q,withCellSpacing:F,highlightToday:W,withWeekNumbers:R,headerControlsOrder:b,attributes:G},ne)});return o.jsx(ut,{classNames:j,styles:v,__staticSelector:w||"MonthLevelGroup",ref:e,size:H,attributes:G,...K,children:te})});rn.classes={...ut.classes,...en.classes},rn.displayName="@mantine/dates/MonthLevelGroup";const Fr=t=>t==="range"?[null,null]:t==="multiple"?[]:null,Wr=(t,e)=>{const n=e?wr:Ae;return Array.isArray(t)?t.map(n):n(t)};function jn({type:t,value:e,defaultValue:n,onChange:r,withTime:s=!1}){const l=P.useRef(t),[i,a,c]=De.useUncontrolled({value:Wr(e,s),defaultValue:Wr(n,s),finalValue:Fr(t),onChange:r});let h=i;return l.current!==t&&(l.current=t,e===void 0&&(h=n!==void 0?n:Fr(t),a(h))),[h,a,c]}function Pn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function Ho(t){return t===0?"month":t===1?"year":"decade"}function $t(t,e,n){return Ho(De.clamp(Pn(t,0),Pn(e,0),Pn(n,2)))}const Uo={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},sn=u.factory((t,e)=>{const n=u.useProps("Calendar",Uo,t),{vars:r,maxLevel:s,minLevel:l,defaultLevel:i,level:a,onLevelChange:c,date:h,defaultDate:f,onDateChange:p,numberOfColumns:m,columnsToScroll:y,ariaLabels:x,nextLabel:k,previousLabel:A,onYearSelect:I,onMonthSelect:F,onYearMouseEnter:W,onMonthMouseEnter:R,headerControlsOrder:Y,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:T,__setDateRef:E,__setLevelRef:M,firstDayOfWeek:_,weekdayFormat:L,weekendDays:B,getDayProps:N,excludeDate:D,renderDay:g,hideOutsideDates:b,hideWeekdays:j,getDayAriaLabel:v,monthLabelFormat:C,nextIcon:O,previousIcon:d,__onDayClick:S,__onDayMouseEnter:w,withCellSpacing:z,highlightToday:H,withWeekNumbers:Q,monthsListFormat:U,getMonthControlProps:G,yearLabelFormat:K,yearsListFormat:q,getYearControlProps:te,decadeLabelFormat:X,classNames:ne,styles:le,unstyled:he,minDate:re,maxDate:_e,locale:pe,__staticSelector:Te,size:je,__preventFocus:nt,__stopPropagation:Re,onNextDecade:Je,onPreviousDecade:$e,onNextYear:Ye,onPreviousYear:Ze,onNextMonth:J,onPreviousMonth:ge,static:fe,enableKeyboardNavigation:rt,attributes:ie,...Oe}=n,{resolvedClassNames:dt,resolvedStyles:ht}=u.useResolvedStylesApi({classNames:ne,styles:le,props:n}),[qe,Ie]=De.useUncontrolled({value:a?$t(a,l,s):void 0,defaultValue:i?$t(i,l,s):void 0,finalValue:$t(void 0,l,s),onChange:c}),[xt,ve]=jn({type:"default",value:Ae(h),defaultValue:Ae(f),onChange:p});P.useImperativeHandle(E,()=>Z=>{ve(Z)}),P.useImperativeHandle(M,()=>Z=>{Ie(Z)});const st={__staticSelector:Te||"Calendar",styles:ht,classNames:dt,unstyled:he,size:je,attributes:ie},Ee=y||m||1,ot=new Date,Ct=re&&V(ot).isAfter(re)?re:V(ot).format("YYYY-MM-DD"),xe=xt||Ct,St=()=>{const Z=V(xe).add(Ee,"month").format("YYYY-MM-DD");J?.(Z),ve(Z)},Pe=()=>{const Z=V(xe).subtract(Ee,"month").format("YYYY-MM-DD");ge?.(Z),ve(Z)},at=()=>{const Z=V(xe).add(Ee,"year").format("YYYY-MM-DD");Ye?.(Z),ve(Z)},Fe=()=>{const Z=V(xe).subtract(Ee,"year").format("YYYY-MM-DD");Ze?.(Z),ve(Z)},Xe=()=>{const Z=V(xe).add(10*Ee,"year").format("YYYY-MM-DD");Je?.(Z),ve(Z)},We=()=>{const Z=V(xe).subtract(10*Ee,"year").format("YYYY-MM-DD");$e?.(Z),ve(Z)},Ge=P.useRef(null);P.useEffect(()=>{if(!rt||fe)return;const Z=ce=>{if(!Ge.current?.contains(document.activeElement))return;const Le=ce.ctrlKey||ce.metaKey,Qe=ce.shiftKey;switch(ce.key){case"ArrowUp":Le&&Qe?(ce.preventDefault(),We()):Le&&(ce.preventDefault(),Fe());break;case"ArrowDown":Le&&Qe?(ce.preventDefault(),Xe()):Le&&(ce.preventDefault(),at());break;case"y":case"Y":qe==="month"&&(ce.preventDefault(),Ie("year"));break}};return document.addEventListener("keydown",Z),()=>{document.removeEventListener("keydown",Z)}},[rt,fe,qe,at,Fe,Xe,We]);const et=Z=>{Ge.current=Z,typeof e=="function"?e(Z):e&&(e.current=Z)};return o.jsxs(u.Box,{ref:et,size:je,"data-calendar":!0,...Oe,children:[qe==="month"&&o.jsx(rn,{month:xe,minDate:re,maxDate:_e,firstDayOfWeek:_,weekdayFormat:L,weekendDays:B,getDayProps:N,excludeDate:D,renderDay:g,hideOutsideDates:b,hideWeekdays:j,getDayAriaLabel:v,onNext:St,onPrevious:Pe,hasNextLevel:s!=="month",onLevelClick:()=>Ie("year"),numberOfColumns:m,locale:pe,levelControlAriaLabel:x?.monthLevelControl,nextLabel:x?.nextMonth??k,nextIcon:O,previousLabel:x?.previousMonth??A,previousIcon:d,monthLabelFormat:C,__onDayClick:S,__onDayMouseEnter:w,__preventFocus:nt,__stopPropagation:Re,static:fe,withCellSpacing:z,highlightToday:H,withWeekNumbers:Q,headerControlsOrder:Y,...st}),qe==="year"&&o.jsx(nn,{year:xe,numberOfColumns:m,minDate:re,maxDate:_e,monthsListFormat:U,getMonthControlProps:G,locale:pe,onNext:at,onPrevious:Fe,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Ie("decade"),levelControlAriaLabel:x?.yearLevelControl,nextLabel:x?.nextYear??k,nextIcon:O,previousLabel:x?.previousYear??A,previousIcon:d,yearLabelFormat:K,__onControlMouseEnter:R,__onControlClick:(Z,ce)=>{T&&ve(ce),Ie($t("month",l,s)),F?.(ce)},__preventFocus:nt,__stopPropagation:Re,withCellSpacing:z,headerControlsOrder:Y,...st}),qe==="decade"&&o.jsx(tn,{decade:xe,minDate:re,maxDate:_e,yearsListFormat:q,getYearControlProps:te,locale:pe,onNext:Xe,onPrevious:We,numberOfColumns:m,nextLabel:x?.nextDecade??k,nextIcon:O,previousLabel:x?.previousDecade??A,previousIcon:d,decadeLabelFormat:X,__onControlMouseEnter:W,__onControlClick:(Z,ce)=>{$&&ve(ce),Ie($t("year",l,s)),I?.(ce)},__preventFocus:nt,__stopPropagation:Re,withCellSpacing:z,headerControlsOrder:Y,...st})]})});sn.classes={...tn.classes,...nn.classes,...rn.classes},sn.displayName="@mantine/dates/Calendar";function qo(t){const{maxLevel:e,minLevel:n,defaultLevel:r,level:s,onLevelChange:l,nextIcon:i,previousIcon:a,date:c,defaultDate:h,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:y,nextLabel:x,previousLabel:k,onYearSelect:A,onMonthSelect:I,onYearMouseEnter:F,onMonthMouseEnter:W,onNextMonth:R,onPreviousMonth:Y,onNextYear:$,onPreviousYear:T,onNextDecade:E,onPreviousDecade:M,withCellSpacing:_,highlightToday:L,__updateDateOnYearSelect:B,__updateDateOnMonthSelect:N,__setDateRef:D,__setLevelRef:g,withWeekNumbers:b,headerControlsOrder:j,firstDayOfWeek:v,weekdayFormat:C,weekendDays:O,getDayProps:d,excludeDate:S,renderDay:w,hideOutsideDates:z,hideWeekdays:H,getDayAriaLabel:Q,monthLabelFormat:U,monthsListFormat:G,getMonthControlProps:K,yearLabelFormat:q,yearsListFormat:te,getYearControlProps:X,decadeLabelFormat:ne,allowSingleDateInRange:le,allowDeselect:he,minDate:re,maxDate:_e,locale:pe,...Te}=t;return{calendarProps:{maxLevel:e,minLevel:n,defaultLevel:r,level:s,onLevelChange:l,nextIcon:i,previousIcon:a,date:c,defaultDate:h,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:y,nextLabel:x,previousLabel:k,onYearSelect:A,onMonthSelect:I,onYearMouseEnter:F,onMonthMouseEnter:W,onNextMonth:R,onPreviousMonth:Y,onNextYear:$,onPreviousYear:T,onNextDecade:E,onPreviousDecade:M,withCellSpacing:_,highlightToday:L,__updateDateOnYearSelect:B,__updateDateOnMonthSelect:N,__setDateRef:D,withWeekNumbers:b,headerControlsOrder:j,firstDayOfWeek:v,weekdayFormat:C,weekendDays:O,getDayProps:d,excludeDate:S,renderDay:w,hideOutsideDates:z,hideWeekdays:H,getDayAriaLabel:Q,monthLabelFormat:U,monthsListFormat:G,getMonthControlProps:K,yearLabelFormat:q,yearsListFormat:te,getYearControlProps:X,decadeLabelFormat:ne,allowSingleDateInRange:le,allowDeselect:he,minDate:re,maxDate:_e,locale:pe},others:Te}}function Go(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:V(e).format("YYYY-MM-DD")}function Qo({date:t,maxDate:e,minDate:n}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&V(t).isAfter(e,"date")||n&&V(t).isBefore(n,"date"))}const Ko={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},on=u.factory((t,e)=>{const n=u.useInputProps("DateInput",Ko,t),{inputProps:r,wrapperProps:s,value:l,defaultValue:i,onChange:a,clearable:c,clearButtonProps:h,popoverProps:f,getDayProps:p,locale:m,valueFormat:y,dateParser:x,minDate:k,maxDate:A,fixOnBlur:I,onFocus:F,onBlur:W,onClick:R,onKeyDown:Y,readOnly:$,name:T,form:E,rightSection:M,unstyled:_,classNames:L,styles:B,allowDeselect:N,date:D,defaultDate:g,onDateChange:b,getMonthControlProps:j,getYearControlProps:v,disabled:C,...O}=n,d=P.useRef(null),S=P.useRef(null),[w,z]=P.useState(!1),{calendarProps:H,others:Q}=qo(O),U=lt(),K=x||(J=>{const ge=V(J,y,U.getLocale(m)).toDate();return Number.isNaN(ge.getTime())?Go(J):V(ge).format("YYYY-MM-DD")}),q=N!==void 0?N:c,te=J=>J?V(J).locale(U.getLocale(m)).format(y):"",[X,ne,le]=jn({type:"default",value:l,defaultValue:i,onChange:a}),[he,re]=jn({type:"default",value:D,defaultValue:i||g,onChange:b});P.useEffect(()=>{le&&l!==null&&re(l)},[le,l]);const[_e,pe]=P.useState(te(X));P.useEffect(()=>{pe(te(X))},[U.getLocale(m)]);const Te=J=>{const ge=J.currentTarget.value;if(pe(ge),z(!0),ge.trim()===""&&(N||c))ne(null);else{const fe=K(ge);fe&&Qo({date:fe,minDate:k,maxDate:A})&&(ne(fe),re(fe))}},je=J=>{W?.(J),z(!1),I&&pe(te(X))},nt=J=>{F?.(J),z(!0)},Re=J=>{R?.(J),z(!0)},Je=J=>{J.key==="Escape"&&z(!1),Y?.(J)},$e=J=>({...p?.(J),selected:V(X).isSame(J,"day"),onClick:ge=>{p?.(J).onClick?.(ge);const fe=q&&V(X).isSame(J,"day")?null:J;ne(fe),!le&&fe&&pe(te(fe)),z(!1)}}),Ye=o.jsx(u.Input.ClearButton,{onClick:()=>{ne(null),!le&&pe(""),z(!1)},unstyled:_,...h}),Ze=c&&!!X&&!$&&!C;return De.useDidUpdate(()=>{X!==void 0&&!w&&pe(te(X))},[X]),De.useClickOutside(()=>z(!1),void 0,[d.current,S.current]),o.jsxs(o.Fragment,{children:[o.jsx(u.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:d,children:o.jsxs(u.Popover,{opened:w,trapFocus:!1,position:"bottom-start",disabled:$||C,withRoles:!1,unstyled:_,...f,children:[o.jsx(u.Popover.Target,{children:o.jsx(u.Input,{"data-dates-input":!0,"data-read-only":$||void 0,autoComplete:"off",ref:e,value:_e,onChange:Te,onBlur:je,onFocus:nt,onClick:Re,onKeyDown:Je,readOnly:$,rightSection:M,__clearSection:Ye,__clearable:Ze,...r,...Q,disabled:C,__staticSelector:"DateInput"})}),o.jsx(u.Popover.Dropdown,{onMouseDown:J=>J.preventDefault(),"data-dates-dropdown":!0,ref:S,children:o.jsx(sn,{__staticSelector:"DateInput",...H,classNames:L,styles:B,unstyled:_,__preventFocus:!0,minDate:k,maxDate:A,locale:m,getDayProps:$e,size:r.size,date:he,onDateChange:re,getMonthControlProps:J=>({selected:typeof X=="string"?_n(J,X):!1,...j?.(J)}),getYearControlProps:J=>({selected:typeof X=="string"?V(J).isSame(X,"year"):!1,...v?.(J)}),attributes:s.attributes})})]})}),o.jsx(Dr,{name:T,form:E,value:X,type:"default"})]})});on.classes={...u.Input.classes,...sn.classes},on.displayName="@mantine/dates/DateInput";function zr(t){const e=Me.c(49),{fields:n,onClose:r,queryKey:s,apiPath:l,steps:i,onCreated:a}=t,[c,h]=P.useState(0),[f,p]=P.useState(!1),[m,y]=P.useState(),{mutateAsync:x,isError:k,error:A,isPending:I}=vr(l,s),{mutateAsync:F,isPending:W}=Sn(l,s),R=I||W;let Y;e[0]!==n?(Y=new Set(n.filter(ea).map(Xo)),e[0]=n,e[1]=Y):Y=e[1];let $;e[2]!==Y?($=[...Y],e[2]=Y,e[3]=$):$=e[3];const T=$;let E;e[4]===Symbol.for("react.memo_cache_sentinel")?(E=function(w,z){return typeof w.required=="function"?w.required(z??{}):!!w.required},e[4]=E):E=e[4];const M=E;let _;e[5]!==n?(_=n.reduce(Zo,{}),e[5]=n,e[6]=_):_=e[6];let L;if(e[7]!==n){let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=(w,z)=>(w[z.id]=(H,Q)=>z.conditional&&!z.conditional(Q)||!M(z,Q)||H?null:"Pflichtfeld",w),e[9]=S):S=e[9],L=n.filter(Jo).reduce(S,{}),e[7]=n,e[8]=L}else L=e[8];let B;e[10]!==_||e[11]!==L?(B={mode:"uncontrolled",initialValues:_,validate:L},e[10]=_,e[11]=L,e[12]=B):B=e[12];const N=Bn.useForm(B);let D;e[13]!==N||e[14]!==m?(D=function(w){const z=N.getValues();if(w.conditional&&!w.conditional(z))return null;const H=M(w,z);return o.jsxs(P.Fragment,{children:[(w.type===void 0||w.type=="text")&&o.jsx(u.TextInput,{label:w.column.title,placeholder:w.placeholder??"",...N.getInputProps(w.id),type:w.id.includes("email")?"email":void 0,required:H},N.key(w.id)),w.type==="number"&&o.jsx(u.NumberInput,{decimalSeparator:",",label:w.column.title,placeholder:w.placeholder??"",...N.getInputProps(w.id),required:H},N.key(w.id)),w.type==="date"&&o.jsx(on,{label:w.column.title,placeholder:w.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...N.getInputProps(w.id),required:H},N.key(w.id)),w.type==="boolean"&&o.jsx(u.Checkbox,{mt:"md",label:w.column.title,...N.getInputProps(w.id,{type:"checkbox"}),required:H},N.key(w.id)),w.type==="textarea"&&o.jsx(u.Textarea,{label:w.column.title,placeholder:w.placeholder??"",...N.getInputProps(w.id),minRows:3,autosize:!0,required:H},N.key(w.id)),w.type==="custom"&&w.render&&w.render({...N.getValues(),...m&&{id:m}},N.setValues,p,{error:N.getInputProps(w.id).error,required:H})]},w.id)},e[13]=N,e[14]=m,e[15]=D):D=e[15];const g=D;let b;e[16]!==A?.message||e[17]!==A?.name||e[18]!==k?(b=k&&o.jsx(u.Alert,{variant:"outline",color:"red",title:A?.name??"Fehler aufgetreten",mb:"lg",children:A?.message??"Fehler aufgetreten"}),e[16]=A?.message,e[17]=A?.name,e[18]=k,e[19]=b):b=e[19];let j;e[20]!==c||e[21]!==x||e[22]!==N||e[23]!==k||e[24]!==r||e[25]!==a||e[26]!==m||e[27]!==T.length||e[28]!==F?(j=N.onSubmit(async S=>{if(m)await F({...S,id:m});else{const w=await x(S);y(w.id),a?.(w.id)}T.length&&c<T.length-1?k||h(c+1):k||(N.setInitialValues(S),N.reset(),r())}),e[20]=c,e[21]=x,e[22]=N,e[23]=k,e[24]=r,e[25]=a,e[26]=m,e[27]=T.length,e[28]=F,e[29]=j):j=e[29];let v;e[30]!==c||e[31]!==n||e[32]!==g||e[33]!==i||e[34]!==T?(v=T.length?o.jsx(u.Stepper,{active:c,size:"sm",children:T.map(S=>o.jsx(u.Stepper.Step,{...i&&i[S-1]?{label:i[S-1].label}:{},children:n.filter(w=>w.step===S).map(w=>g(w))},S))}):n.map(S=>g(S)),e[30]=c,e[31]=n,e[32]=g,e[33]=i,e[34]=T,e[35]=v):v=e[35];let C;e[36]!==c||e[37]!==f||e[38]!==R||e[39]!==r||e[40]!==T.length?(C=!f&&o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:()=>T.length?c===0?r():h(c-1):r(),variant:"outline",children:T.length?c===0?"Abbrechen":"Zurück":"Abbrechen"}),o.jsx(u.Button,{type:"submit",loading:R,children:T.length?c===T.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=c,e[37]=f,e[38]=R,e[39]=r,e[40]=T.length,e[41]=C):C=e[41];let O;e[42]!==v||e[43]!==C||e[44]!==j?(O=o.jsxs("form",{onSubmit:j,children:[v,C]}),e[42]=v,e[43]=C,e[44]=j,e[45]=O):O=e[45];let d;return e[46]!==O||e[47]!==b?(d=o.jsxs(o.Fragment,{children:[b,O]}),e[46]=O,e[47]=b,e[48]=d):d=e[48],d}function Jo(t){return t.required}function Zo(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function Xo(t){return t.step}function ea(t){return typeof t.step=="number"}var[ta,Mn]=u.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),Br=t=>{let{children:e,columnsOrder:n,setColumnsOrder:r,columnsToggle:s,setColumnsToggle:l,resetColumnsOrder:i,resetColumnsToggle:a,setColumnWidth:c,setMultipleColumnWidths:h,resetColumnsWidth:f}=t,[p,m]=P.useState(""),[y,x]=P.useState("");return o.jsx(ta,{value:{sourceColumn:p,setSourceColumn:m,targetColumn:y,setTargetColumn:x,columnsToggle:s,setColumnsToggle:l,swapColumns:()=>{if(!n||!r||!p||!y)return;let k=n.indexOf(p),A=n.indexOf(y);if(k!==-1&&A!==-1){let I=n.splice(k,1)[0];n.splice(A,0,I),r([...n])}},resetColumnsOrder:i,resetColumnsToggle:a,setColumnWidth:c,setMultipleColumnWidths:h,resetColumnsWidth:f},children:e})};function na(){return o.jsx("tr",{className:"mantine-datatable-empty-row",children:o.jsx("td",{})})}function ra(){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),o.jsx("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),o.jsx("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),o.jsx("path",{d:"M3 3l18 18"})]})}function sa({icon:t,text:e,active:n,children:r}){return o.jsx(u.Center,{className:"mantine-datatable-empty-state","data-active":n||void 0,children:r||o.jsxs(o.Fragment,{children:[t||o.jsx("div",{className:"mantine-datatable-empty-state-icon",children:o.jsx(ra,{})}),o.jsx(u.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function oa({key:t,columns:e=[],getInitialValueInEffect:n=!0}){function r(p,m){let y=[];return p.forEach(x=>{m.find(k=>k.accessor===x)&&y.push(x)}),m.forEach(x=>{y.includes(x.accessor)||y.push(x.accessor)}),y}let s=e&&e.map(p=>p.accessor)||[],[l,i]=De.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:n});function a(p){t&&i(p)}let c=()=>{a(s)};if(!t)return{columnsOrder:l,setColumnsOrder:a,resetColumnsOrder:c};let h=r(l,e),f=JSON.stringify(l);return JSON.stringify(h)!==f&&a(h),{columnsOrder:h,setColumnsOrder:a,resetColumnsOrder:c}}function aa({key:t,columns:e=[],getInitialValueInEffect:n=!0,headerRef:r,onFixedLayoutChange:s}){let l=P.useRef(!1),i=P.useRef({}),[a,c]=P.useState(!0),h=P.useMemo(()=>e.some(M=>M.resizable&&!M.hidden&&M.accessor!=="__selection__"),[e]),f=P.useMemo(()=>e.filter(M=>M.resizable&&!M.hidden&&M.accessor!=="__selection__"),[e]),p=P.useMemo(()=>f.some(M=>M.width===void 0||M.width===""||M.width==="initial"),[f]),m=P.useCallback(()=>e.filter(M=>M.accessor!=="__selection__").map(M=>({[M.accessor]:M.width??"auto"})),[e]),[y,x]=De.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?m():void 0,getInitialValueInEffect:!1}),[k,A]=P.useState(()=>m());P.useEffect(()=>{c(!1)},[]);let I=P.useCallback(()=>{if(!r?.current||a)return{};let M=r.current,_=Array.from(M.querySelectorAll("th[data-accessor]")),L={};return _.forEach(B=>{let N=B.getAttribute("data-accessor");if(!N||N==="__selection__")return;let D=f.find(g=>g.accessor===N);if(D&&(D.width===void 0||D.width===""||D.width==="initial")){let g=B.getBoundingClientRect();L[N]=Math.round(g.width)}}),L},[r,f,a]),F=P.useCallback(M=>{let _=M.filter(B=>B.accessor!=="__selection__"),L=k.map(B=>{let N=Object.keys(B)[0],D=_.find(g=>g.accessor===N);return D?{[N]:D.width}:B});A(L),t&&x(L)},[k,t,x]),W=P.useCallback(M=>{F(M)},[F]),R=P.useCallback(()=>{if(!(!r?.current||!s||a))if(p)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let M=I();i.current={...i.current,...M};let _=e.filter(L=>L.accessor!=="__selection__").map(L=>{let B=L.accessor,N=y?.find(g=>Object.keys(g)[0]===B);if(N&&N[B]!=="auto")return{[B]:N[B]};let D=M[B];return D?{[B]:`${D}px`}:{[B]:L.width??"auto"}});A(_),setTimeout(()=>{s(!0),l.current=!0},10)})});else{let M=e.filter(_=>_.accessor!=="__selection__").map(_=>({[_.accessor]:_.width??"auto"}));A(M),s(!0),l.current=!0}},[r,s,a,p,I,e,y]),Y=R;P.useEffect(()=>{if(!h||!s||a){s?.(!1);return}l.current=!1;let M=setTimeout(()=>{R()},50);return()=>clearTimeout(M)},[h,s,a,R]),P.useEffect(()=>{a||!t||!n||y&&y.length>0&&A(y)},[a,t,n,y]);let $=P.useCallback(()=>{t&&x(m()),i.current={},l.current=!1,s&&(s(!1),setTimeout(()=>{R()},10))},[t,x,m,s,R]),T=P.useCallback((M,_)=>{F([{accessor:M,width:_}])},[F]),E=P.useMemo(()=>h?k.filter(M=>{let _=Object.keys(M)[0];return f.some(L=>L.accessor===_)}).every(M=>{let _=Object.values(M)[0];return _==="auto"||_==="initial"}):!1,[h,k,f]);return{columnsWidth:k,setColumnsWidth:F,setColumnWidth:T,setMultipleColumnWidths:W,resetColumnsWidth:$,hasResizableColumns:h,allResizableWidthsInitial:E,measureAndSetColumnWidths:Y}}function ia({key:t,columns:e=[],getInitialValueInEffect:n=!0}){function r(p,m){let y=[];return p.forEach(x=>{m.find(k=>k.accessor===x.accessor)&&y.push(x)}),m.forEach(x=>{y.find(k=>k.accessor===x.accessor)||y.push({accessor:x.accessor,defaultToggle:x.defaultToggle||!0,toggleable:x.toggleable,toggled:x.defaultToggle===void 0?!0:x.defaultToggle})}),y}let s=e&&e.map(p=>({accessor:p.accessor,defaultToggle:p.defaultToggle||!0,toggleable:p.toggleable,toggled:p.defaultToggle===void 0?!0:p.defaultToggle})),[l,i]=De.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:n});function a(p){t&&i(p)}let c=()=>{a(s)};if(!t)return{columnsToggle:l,setColumnsToggle:a,resetColumnsToggle:c};let h=r(l,e),f=JSON.stringify(l);return JSON.stringify(h)!==f&&a(h),{columnsToggle:h,setColumnsToggle:a,resetColumnsToggle:c}}var la=({key:t,columns:e=[],getInitialValueInEffect:n=!0,headerRef:r,scrollViewportRef:s,onFixedLayoutChange:l})=>{let{columnsOrder:i,setColumnsOrder:a,resetColumnsOrder:c}=oa({key:t,columns:e,getInitialValueInEffect:n}),{columnsToggle:h,setColumnsToggle:f,resetColumnsToggle:p}=ia({key:t,columns:e,getInitialValueInEffect:n}),{columnsWidth:m,setColumnsWidth:y,setColumnWidth:x,setMultipleColumnWidths:k,resetColumnsWidth:A,hasResizableColumns:I,allResizableWidthsInitial:F,measureAndSetColumnWidths:W}=aa({key:t,columns:e,getInitialValueInEffect:n,headerRef:r,onFixedLayoutChange:l});return{effectiveColumns:P.useMemo(()=>i?i.map(R=>e.find(Y=>Y.accessor===R)).map(R=>({...R,hidden:R?.hidden||!h.find(Y=>Y.accessor===R?.accessor)?.toggled})).map(R=>R?.accessor==="__selection__"?R:{...R,width:m.find(Y=>Y[R?.accessor])?.[R?.accessor]}):e,[e,i,h,m]),setColumnsOrder:a,columnsOrder:i,resetColumnsOrder:c,columnsToggle:h,setColumnsToggle:f,resetColumnsToggle:p,columnsWidth:m,setColumnsWidth:y,setColumnWidth:x,setMultipleColumnWidths:k,resetColumnsWidth:A,hasResizableColumns:I,allResizableWidthsInitial:F,measureAndSetColumnWidths:W}},Vr=typeof window<"u"?P.useLayoutEffect:P.useEffect;function Hr(t){let e=P.useRef(t);return e.current=t,e}var Ur="--mantine-datatable-header-height",qr="--mantine-datatable-footer-height",Gr="--mantine-datatable-selection-column-width",Qr="--mantine-datatable-last-row-border-bottom";function Ue(t,e,n){t?.style.setProperty(e,n)}function Tn(t){let e=t.borderBoxSize?.[0]||t.contentBoxSize?.[0];return e?{width:e.inlineSize,height:e.blockSize}:{width:t.contentRect.width,height:t.contentRect.height}}function On(t,e,n){if(t){let r=new ResizeObserver(s=>{let l=s[0];l&&e(Tn(l))});return r.observe(t),()=>{r.disconnect(),n()}}}function ca({scrollCallbacks:t,withRowBorders:e}){let n={root:P.useRef(null),table:P.useRef(null),scrollViewport:P.useRef(null),header:P.useRef(null),footer:P.useRef(null),selectionColumnHeader:P.useRef(null)},{root:r,table:s,scrollViewport:l,header:i,footer:a,selectionColumnHeader:c}=n,h=Hr({withRowBorders:e}),f=Hr(t),p=P.useRef(()=>{}),m=P.useRef(()=>{}),y=P.useCallback(x=>{f.current.onScroll?.(x),p.current()},[]);return P.useEffect(()=>On(i.current,x=>{Ue(r.current,Ur,`${x.height}px`)},()=>Ue(r.current,Ur,"0")),[i.current]),P.useEffect(()=>On(a.current,x=>{Ue(r.current,qr,`${x.height}px`)},()=>Ue(r.current,qr,"0")),[a.current]),P.useEffect(()=>On(c.current,x=>{Ue(r.current,Gr,`${x.width}px`)},()=>Ue(r.current,Gr,"0")),[c.current]),Vr(()=>{if(typeof window===void 0)return;let x={top:!0,bottom:!0,left:!0,right:!0},k={width:0,height:0},A={width:0,height:0};function I($,T){let E=x[$];return x[$]=T,Ue(r.current,`--mantine-datatable-${$}-shadow-opacity`,T?"0":"1"),E}function F(){let $=k.height-A.height,T=$<0;Ue(r.current,"--mantine-datatable-footer-position",T?"relative":"sticky"),Ue(r.current,"--mantine-datatable-footer-bottom",T?`${$}px`:"0")}function W(){h.current.withRowBorders&&k.height<A.height?Ue(r.current,Qr,`${u.rem("1px")} solid var(--mantine-datatable-border-color)`):Ue(r.current,Qr,"unset")}m.current=W;function R(){let $=f.current,T=l.current,E=T?.scrollTop??0,M=T?.scrollLeft??0,_=E===0,L=k.height-E-A.height<1,B=I("top",_),N=I("bottom",L);_&&_!==B&&$.onScrollToTop?.(),L&&L!==N&&$.onScrollToBottom?.();let D=T?getComputedStyle(T).direction==="rtl":!1,g=(T?.scrollWidth??0)-A.width,b,j;if(D){let O=Math.abs(M);j=O<1,b=g-O<1}else b=M<1,j=k.width-M-A.width<1;let v=I("left",b),C=I("right",j);b&&b!==v&&$.onScrollToLeft?.(),j&&j!==C&&$.onScrollToRight?.()}p.current=R;let Y=new ResizeObserver($=>{for(let T of $)switch(T.target.tagName){case"TABLE":{k=Tn(T);break}case"DIV":{A=Tn(T);break}}R(),F(),W()});return Y.observe(s.current),Y.observe(l.current),()=>{Y.disconnect()}},[]),Vr(()=>{m.current()},[e]),{refs:n,onScroll:y}}function ua(t){let[e,n]=P.useState(null),r=t?.join(":")||"";return P.useEffect(()=>{n(null)},[r]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:n}}function da(t,e){let n=()=>{e(t.map(s=>s.matches))},r=t.map(s=>{try{return s.addEventListener("change",n),()=>s.removeEventListener("change",n)}catch{return s.addListener(n),()=>s.removeListener(n)}});return()=>{r.forEach(s=>s())}}function ha(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(n=>window.matchMedia(n).matches):t.map(()=>!1))}function fa(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,s]=P.useState(n?e:ha(t,e)),l=P.useRef(null);return P.useEffect(()=>{if("matchMedia"in window)return l.current=t.map(i=>window.matchMedia(i)),s(l.current.map(i=>i.matches)),da(l.current,i=>{s(i)})},[t]),r}function ma(t){let e=u.useMantineTheme(),n=P.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),r=P.useMemo(()=>t.map(()=>!0),[t]);return fa(n,r)}function an(t){let e=u.useMantineTheme(),n=typeof t=="function"?t(e):t;return De.useMediaQuery(n||"",!0)}function En(t){let e=t.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function pa(t,e,n){return t.filter(r=>!e.map(n).includes(n(r)))}function Ln(t,e){return t.filter((n,r,s)=>r===s.findIndex(l=>e(n)===e(l)))}function Kr(t,e){return e?e.match(/([^[.\]])+/g).reduce((n,r)=>n&&n[r],t):void 0}function ke(t,e){return typeof e=="string"?Kr(t,e):e(t)}function Jr(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+Jr(e.groups):1))}function Nn(t){let e=[];for(let n of t)n.columns&&n.columns.length>0?e.push(...n.columns.filter(r=>r!=null)):n.groups&&n.groups.length>0&&e.push(...Nn(n.groups));return e.filter(n=>n!=null)}function An(t,e){return t.columns&&t.columns.length>0?t.columns.filter((n,r)=>n.hidden?!1:e?e[r]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((n,r)=>n+An(r,e),0):0}function Zr(t,e,n=0){if(n===e)return[...t];let r=[];for(let s of t)s.groups&&s.groups.length>0&&r.push(...Zr(s.groups,e,n+1));return r}function ga(t,e,n){return n?!t||e:!1}function ba({rowExpansion:t,records:e,idAccessor:n}){let r=[];if(t&&e){let{trigger:a,allowMultiple:c,initiallyExpanded:h}=t;e&&a==="always"?r=e.map(f=>ke(f,n)):h&&(r=e.filter((f,p)=>h({record:f,index:p})).map(f=>ke(f,n)),c||(r=[r[0]]))}let s,l,i=P.useState(r);if(t){let{expandable:a,trigger:c,allowMultiple:h,collapseProps:f,content:p}=t;t.expanded?{recordIds:s,onRecordIdsChange:l}=t.expanded:[s,l]=i;let m=y=>l?.(s.filter(x=>x!==ke(y,n)));return{expandOnClick:c!=="always"&&c!=="never",isRowExpanded:y=>c==="always"?!0:s.includes(ke(y,n)),isExpandable:({record:y,index:x})=>a?a({record:y,index:x}):!0,expandRow:y=>{let x=ke(y,n);l?.(h?[...s,x]:[x])},collapseRow:m,collapseProps:f,content:({record:y,index:x})=>()=>p({record:y,index:x,collapse:()=>m(y)})}}}function ya(t,e){let[n,r]=P.useState(t),[s,l]=P.useState(t),i=De.useTimeout(()=>r(!0),0),a=De.useTimeout(()=>l(!1),e||200);return P.useEffect(()=>{t?(a.clear(),l(!0),i.start()):(i.clear(),r(!1),a.start())},[i,a,t]),{expanded:n,visible:s}}var Rn="mantine-datatable-nowrap",$n="mantine-datatable-ellipsis",Pt="mantine-datatable-pointer-cursor",Xr="mantine-datatable-context-menu-cursor",va="mantine-datatable-text-selection-disabled",ln="mantine-datatable-text-align-left",cn="mantine-datatable-text-align-center",un="mantine-datatable-text-align-right";function xa({className:t,style:e,visibleMediaQuery:n,title:r,noWrap:s,ellipsis:l,textAlign:i,width:a}){return an(n)?o.jsx(u.TableTh,{className:de({[Rn]:s||l,[$n]:l,[ln]:i==="left",[cn]:i==="center",[un]:i==="right"},t),style:[{width:a,minWidth:a,maxWidth:a},e],children:r}):null}function Ca({shadowVisible:t}){return o.jsx(u.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function Sa({className:t,style:e,columns:n,defaultColumnProps:r,selectionVisible:s,selectorCellShadowVisible:l,ref:i}){return o.jsx(u.TableTfoot,{ref:i,className:de("mantine-datatable-footer",t),style:e,children:o.jsxs(u.TableTr,{children:[s&&o.jsx(Ca,{shadowVisible:l}),n.map(({hidden:a,...c})=>{if(a)return null;let{accessor:h,visibleMediaQuery:f,textAlign:p,width:m,footer:y,footerClassName:x,footerStyle:k,noWrap:A,ellipsis:I}={...r,...c};return o.jsx(xa,{className:x,style:k,visibleMediaQuery:f,textAlign:p,width:m,title:y,noWrap:A,ellipsis:I},h)})]})})}function wa({group:{id:t,columns:e,groups:n,title:r,textAlign:s,className:l,style:i},maxDepth:a,currentDepth:c,previousGroups:h,isLastGroup:f,withColumnBorders:p=!1,totalTableColumns:m}){let y=P.useMemo(()=>e&&e.length>0?e:n&&n.length>0?Nn([{id:t,columns:e,groups:n}]):[],[e,n,t]),x=P.useMemo(()=>y.map(({visibleMediaQuery:Y})=>Y),[y]),k=ma(x),A=P.useMemo(()=>An({columns:e,groups:n},k),[t,e,n,k]),I=P.useMemo(()=>h.reduce((Y,$)=>Y+An($,k),0),[h,k]),F=n&&n.length>0?1:a-c,W=I+A<m,R=ga(f,W,p);return A>0?o.jsx(u.TableTh,{colSpan:A,rowSpan:F>1?F:void 0,className:de("mantine-datatable-column-group-header-cell",{[ln]:s==="left",[cn]:s==="center",[un]:s==="right","mantine-datatable-column-group-header-cell--needs-border":R},l),style:i,children:r??En(t)}):null}function Da(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}function ka(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}function _a({children:t,isActive:e,filterPopoverProps:n,filterPopoverDisableClickOutside:r}){let[s,{close:l,toggle:i}]=De.useDisclosure(!1),a=e?ka:Da,c=De.useClickOutside(l);return r&&(c=void 0),o.jsxs(u.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:l,trapFocus:!0,...n,children:[o.jsx(u.PopoverTarget,{children:o.jsx(u.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:h=>{h.preventDefault(),i()},onKeyDown:h=>h.stopPropagation(),children:o.jsx(a,{})})}),o.jsx(u.PopoverDropdown,{ref:c,onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),children:typeof t=="function"?t({close:l}):t})]})}var ja=t=>{let{accessor:e,columnRef:n}=t,[r,s]=P.useState(!1),l=P.useRef(0),i=P.useRef({current:0,next:0}),{dir:a}=u.useDirection(),c=a==="rtl",{setMultipleColumnWidths:h}=Mn(),f=P.useCallback(m=>{if(m.preventDefault(),m.stopPropagation(),!n.current)return;let y=n.current,x=y.nextElementSibling;for(;x;){let Y=x.getAttribute("data-accessor");if(Y&&Y!=="__selection__")break;x=x.nextElementSibling}if(!x)return;let k=x.getAttribute("data-accessor");if(!k)return;let A=k==="__selection__";s(!0),l.current=m.clientX;let I=y.offsetWidth,F=x.offsetWidth;i.current={current:I,next:F};let W=Y=>{if(!n.current)return;let $=n.current,T=$.nextElementSibling;if(!T)return;let E=Y.clientX-l.current;c&&(E=-E);let M=50,_=i.current.current-M,L=i.current.next-M,B=Math.max(-_,Math.min(E,L)),N=i.current.current+B,D=i.current.next-B;$.style.width=`${N}px`,T.style.width=`${D}px`,$.style.minWidth=`${N}px`,$.style.maxWidth=`${N}px`,T.style.minWidth=`${D}px`,T.style.maxWidth=`${D}px`},R=()=>{if(!n.current)return;let Y=n.current,$=Y.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let T=parseInt(Y.style.width)||Y.offsetWidth,E=$?parseInt($.style.width)||$.offsetWidth:0,M=[{accessor:e,width:`${T}px`}];if($&&!A){let _=$.getAttribute("data-accessor");_&&M.push({accessor:_,width:`${E}px`})}setTimeout(()=>{h(M)},0),document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",R)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",W),document.addEventListener("mouseup",R)},[e,n,c,h]),p=P.useCallback(()=>{if(!n.current)return;let m=n.current,y=m.nextElementSibling;m.style.width="",m.style.minWidth="",m.style.maxWidth="";let x=[{accessor:e,width:"auto"}];if(y){y.style.width="",y.style.minWidth="",y.style.maxWidth="";let k=y.getAttribute("data-accessor");k&&k!=="__selection__"&&x.push({accessor:k,width:"auto"})}setTimeout(()=>{h(x)},0)},[e,n,h]);return o.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:r?"col-resize":void 0},onMouseDown:f,onDoubleClick:p,onClick:m=>m.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Pa(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12 5l0 14"}),o.jsx("path",{d:"M16 9l-4 -4"}),o.jsx("path",{d:"M8 9l4 -4"})]})}function Ma(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M8 7l4 -4l4 4"}),o.jsx("path",{d:"M8 17l4 4l4 -4"}),o.jsx("path",{d:"M12 3l0 18"})]})}function Ta(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Oa(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M18 6l-12 12"}),o.jsx("path",{d:"M6 6l12 12"})]})}function Ea({className:t,style:e,accessor:n,visibleMediaQuery:r,title:s,sortable:l,draggable:i,toggleable:a,resizable:c,sortIcons:h,textAlign:f,width:p,sortStatus:m,onSortStatusChange:y,filter:x,filterPopoverProps:k,filterPopoverDisableClickOutside:A,filtering:I,sortKey:F}){let{setSourceColumn:W,setTargetColumn:R,swapColumns:Y,setColumnsToggle:$}=Mn(),[T,E]=P.useState(!1),M=P.useRef(null);if(!an(r))return null;let _=s??En(n),L=typeof _=="string"?_:void 0,B=l&&y?C=>{C?.defaultPrevented||y({sortKey:F,columnAccessor:n,direction:m?.columnAccessor===n?m.direction==="asc"?"desc":"asc":m?.direction??"asc"})}:void 0,N=C=>{C.stopPropagation(),W(n),E(!1)},D=C=>{C.preventDefault(),R(n),E(!0)},g=()=>{R(n),E(!1),Y()},b=()=>{E(!0)},j=()=>{E(!1)},v=C=>{C.stopPropagation(),$(O=>O.map(d=>d.accessor===n?{...d,toggled:!1}:d))};return o.jsxs(u.TableTh,{"data-accessor":n,className:de({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":a,"mantine-datatable-header-cell-resizable":c},t),style:[{width:p,...c?{}:{minWidth:p,maxWidth:p}},e],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:B,onKeyDown:C=>C.key==="Enter"&&B?.(),ref:M,children:[o.jsxs(u.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[o.jsxs(u.Flex,{align:"center",w:"100%",className:de({"mantine-datatable-header-cell-draggable":i,"mantine-datatable-header-cell-drag-over":T}),draggable:i,onDragStart:i?N:void 0,onDragEnter:i?b:void 0,onDragOver:i?D:void 0,onDrop:i?g:void 0,onDragLeave:i?j:void 0,children:[i?o.jsx(u.Center,{role:"img","aria-label":"Drag column",children:o.jsx(u.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:C=>{C.stopPropagation()},children:o.jsx(Ta,{})})}):null,o.jsx(u.Box,{className:de("mantine-datatable-header-cell-sortable-text",{[ln]:f==="left",[cn]:f==="center",[un]:f==="right"},Rn,$n),title:L,children:_})]}),a?o.jsx(u.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:o.jsx(u.ActionIcon,{size:"xs",variant:"light",onClick:v,children:o.jsx(Oa,{})})}):null,l||m?.columnAccessor===n?o.jsx(o.Fragment,{children:m?.columnAccessor===n?o.jsx(u.Center,{className:de("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":m.direction==="desc"}),role:"img","aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:h?.sorted||o.jsx(Pa,{})}):o.jsx(u.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:h?.unsorted||o.jsx(Ma,{})})}):null,x?o.jsx(_a,{filterPopoverProps:k,isActive:!!I,filterPopoverDisableClickOutside:A,children:x}):null]}),c&&n!=="__selection__"?o.jsx(ja,{accessor:n,columnRef:M}):null]})}function La({className:t,style:e,trigger:n,shadowVisible:r,checked:s,indeterminate:l,checkboxProps:i,onChange:a,rowSpan:c,ref:h}){let f=!i.disabled;return o.jsx(u.TableTh,{ref:h,className:de("mantine-datatable-header-selector-cell",{[Pt]:n==="cell"&&f},t),style:e,rowSpan:c,"data-shadow-visible":r||void 0,"data-accessor":"__selection__",onClick:n==="cell"&&f?a:void 0,children:o.jsx(u.Checkbox,{classNames:f?{input:Pt}:void 0,checked:s,indeterminate:l,onChange:a,...i,disabled:!(a||i.onChange)||i.disabled})})}function Na({selectionColumnHeaderRef:t,className:e,style:n,sortStatus:r,sortIcons:s,onSortStatusChange:l,columns:i,defaultColumnProps:a,groups:c,selectionTrigger:h,selectionVisible:f,selectionChecked:p,selectionIndeterminate:m,onSelectionChange:y,selectionCheckboxProps:x,selectorCellShadowVisible:k,selectionColumnClassName:A,selectionColumnStyle:I,withColumnBorders:F=!1,ref:W}){let R=c?Jr(c):0,Y=R>0?R+1:1,$=f?o.jsx(La,{ref:t,className:A,style:I,trigger:h,shadowVisible:k,checked:p,indeterminate:m,checkboxProps:x,onChange:y,rowSpan:c?Y:void 0}):null,{columnsToggle:T,setColumnsToggle:E}=Mn(),[M,_]=P.useState(!1),L=i.some(D=>D.toggleable),B=L?Object.fromEntries(i.map(({accessor:D,title:g})=>[D,g??En(String(D))])):void 0,N=o.jsxs(u.TableThead,{className:de("mantine-datatable-header",e),style:n,ref:W,onContextMenu:L?D=>{D.preventDefault(),_(g=>!g)}:void 0,children:[c&&Array.from({length:R},(D,g)=>{let b=Zr(c,g);return o.jsxs(u.TableTr,{children:[g===0&&$,b.map((j,v)=>o.jsx(wa,{group:j,maxDepth:R,currentDepth:g,previousGroups:b.slice(0,v),isLastGroup:v===b.length-1,withColumnBorders:F,totalTableColumns:i.length},j.id))]},`group-depth-${g}`)}),o.jsxs(u.TableTr,{children:[!c&&$,i.map(({hidden:D,...g},b)=>{if(D)return null;let{accessor:j,visibleMediaQuery:v,textAlign:C,width:O,title:d,sortable:S,draggable:w,toggleable:z,resizable:H,titleClassName:Q,titleStyle:U,filter:G,filterPopoverProps:K,filterPopoverDisableClickOutside:q,filtering:te,sortKey:X}={...a,...g};return o.jsx(Ea,{accessor:j,className:Q,style:U,visibleMediaQuery:v,textAlign:C,width:O,title:d,sortable:S,draggable:w,toggleable:z,resizable:H&&b<i.length-1,sortStatus:r,sortIcons:s,sortKey:X,onSortStatusChange:l,filter:G,filterPopoverProps:K,filterPopoverDisableClickOutside:q,filtering:te},j)})]})]});return L?o.jsxs(u.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:M,onChange:_,children:[o.jsx(u.PopoverTarget,{children:N}),o.jsx(u.PopoverDropdown,{children:o.jsx(u.Stack,{children:T.filter(D=>D.toggleable).map(D=>o.jsx(u.Group,{children:o.jsx(u.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:B[D.accessor],checked:D.toggled,onChange:g=>{E(T.map(b=>b.accessor===D.accessor?{...b,toggled:g.currentTarget.checked}:b))}})},D.accessor))})})]}):N}function Aa({fetching:t,customContent:e,backgroundBlur:n,size:r,type:s,color:l}){return o.jsx(u.Center,{className:de("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:n?`blur(${n}px)`:void 0}],children:t&&(e||o.jsx(u.Loader,{size:r,type:s,color:l}))})}function me(t,e,n){return t?u.parseThemeColor({color:typeof t=="object"?t[n]:t,theme:e}).value:void 0}function Ra({theme:t,c:e,backgroundColor:n,borderColor:r,rowBorderColor:s,stripedColor:l,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":me(e,t,"light"),"--mantine-datatable-color-dark":me(e,t,"dark"),"--mantine-datatable-background-color-light":me(n,t,"light"),"--mantine-datatable-background-color-dark":me(n,t,"dark"),"--mantine-datatable-border-color-light":me(r,t,"light"),"--mantine-datatable-border-color-dark":me(r,t,"dark"),"--mantine-datatable-row-border-color-light":me(s,t,"light"),"--mantine-datatable-row-border-color-dark":me(s,t,"dark"),"--mantine-datatable-striped-color-light":me(l,t,"light"),"--mantine-datatable-striped-color-dark":me(l,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":me(i,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":me(i,t,"dark")}}function es({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:n}){return{"--mantine-datatable-pagination-active-text-color-light":me(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":me(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":me(n,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":me(n,t,"dark")}}function $a({theme:t,color:e,backgroundColor:n}){return{"--mantine-datatable-row-color-light":me(e,t,"light"),"--mantine-datatable-row-color-dark":me(e,t,"dark"),"--mantine-datatable-row-background-color-light":me(n,t,"light"),"--mantine-datatable-row-background-color-dark":me(n,t,"dark")}}function Ya(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M8 9l4 -4l4 4"}),o.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var ts={xs:u.rem(22),sm:u.rem(26),md:u.rem(32),lg:u.rem(38),xl:u.rem(44)};function Ia({size:t,label:e,values:n,value:r,activeTextColor:s,activeBackgroundColor:l,onChange:i}){return o.jsxs(u.Group,{gap:"xs",children:[o.jsx(u.Text,{component:"div",size:t,children:e}),o.jsxs(u.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[o.jsx(u.MenuTarget,{children:o.jsx(u.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:o.jsx(Ya,{}),style:[{fontWeight:"normal"},a=>({height:ts[t],paddingLeft:a.spacing[t],paddingRight:a.spacing[t]})],children:r})}),o.jsx(u.MenuDropdown,{children:n.map(a=>{let c=a===r;return o.jsx(u.MenuItem,{className:de({"mantine-datatable-page-size-selector-active":c}),style:[{height:ts[t]},c&&(s||l)?h=>es({theme:h,paginationActiveTextColor:s,paginationActiveBackgroundColor:l}):void 0],disabled:c,onClick:()=>i(a),children:o.jsx(u.Text,{component:"div",size:t,children:a})},a)})})]})]})}function Fa({className:t,style:e,fetching:n,page:r,onPageChange:s,paginationWithEdges:l,paginationWithControls:i,paginationActiveTextColor:a,paginationActiveBackgroundColor:c,paginationSize:h,loadingText:f,noRecordsText:p,paginationText:m,totalRecords:y,recordsPerPage:x,onRecordsPerPageChange:k,recordsPerPageLabel:A,recordsPerPageOptions:I,recordsLength:F,horizontalSpacing:W,paginationWrapBreakpoint:R,getPaginationControlProps:Y,getPaginationItemProps:$,renderPagination:T}){let E;if(y){let g=(r-1)*x+1,b=g+(F||0)-1;E=m({from:g,to:b,totalRecords:y})}else E=n?f:p;let M=y&&x?Math.max(1,Math.ceil(y/x)):1,_=y?(r-1)*(x??0)+1:void 0,L=y?(_??1)+(F??0)-1:void 0,B=!an(({breakpoints:g})=>`(min-width: ${typeof R=="number"?`${u.rem(R)}rem`:g[R]||R})`),N={Text:g=>o.jsx(u.Text,{component:"div",className:"mantine-datatable-pagination-text",size:h,...g,children:E}),PageSizeSelector:g=>I?o.jsx(Ia,{activeTextColor:a,activeBackgroundColor:c,size:h,label:A,values:I,value:x,onChange:k,...g}):o.jsx(o.Fragment,{}),Pagination:g=>o.jsx(u.Pagination,{classNames:{root:de("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!F}),control:"mantine-datatable-pagination-pages-control"},style:a||c?b=>es({theme:b,paginationActiveTextColor:a,paginationActiveBackgroundColor:c}):void 0,withEdges:l,withControls:i,value:r,onChange:s,size:h,total:M,getControlProps:Y,getItemProps:$,...g})},D={state:{paginationSize:h,page:r,totalPages:M,totalRecords:y,recordsPerPage:x,recordsLength:F,fetching:n,from:_,to:L,isWrapped:B},actions:{setPage:g=>s?.(g),setRecordsPerPage:k?g=>k(g):void 0},Controls:N};return o.jsx(u.Box,{px:W??"xs",py:"xs",className:de("mantine-datatable-pagination",t),style:[{flexDirection:B?"column":"row"},e],children:typeof T=="function"?T(D):o.jsxs(o.Fragment,{children:[o.jsx(N.Text,{}),o.jsx(N.PageSizeSelector,{}),o.jsx(N.Pagination,{})]})})}function Wa({className:t,style:e,visibleMediaQuery:n,record:r,index:s,onClick:l,onDoubleClick:i,onContextMenu:a,noWrap:c,ellipsis:h,textAlign:f,width:p,accessor:m,render:y,defaultRender:x,customCellAttributes:k}){return an(n)?o.jsx(u.TableTd,{className:de({[Rn]:c||h,[$n]:h,[Pt]:l||i,[Xr]:a,[ln]:f==="left",[cn]:f==="center",[un]:f==="right"},t),style:[{width:p,minWidth:p,maxWidth:p},e],onClick:l,onDoubleClick:i,onContextMenu:a,...k?.(r,s),children:y?y(r,s):x?x(r,s,m):Kr(r,m)}):null}function za({open:t,colSpan:e,content:n,collapseProps:r}){let{expanded:s,visible:l}=ya(t,r?.transitionDuration);return l?o.jsxs(o.Fragment,{children:[o.jsx(u.TableTr,{}),o.jsx(u.TableTr,{children:o.jsx(u.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:o.jsx(u.Collapse,{in:s,...r,children:o.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:n()})})})})]}):null}function Ba({className:t,style:e,record:n,index:r,trigger:s,onChange:l,withRightShadow:i,checkboxProps:a,getCheckboxProps:c,...h}){let f={...a,...c(n,r)},p=!h.disabled&&!f.disabled,m=y=>{y.stopPropagation(),s==="cell"&&p&&l?.(y)};return o.jsx(u.TableTd,{className:de("mantine-datatable-row-selector-cell",{[Pt]:s==="cell"&&p},t),style:e,"data-shadow-visible":i||void 0,onClick:m,children:o.jsx(u.Checkbox,{classNames:p?{input:Pt}:void 0,onChange:l,...h,...f})})}function Va({record:t,index:e,columns:n,defaultColumnProps:r,defaultColumnRender:s,selectionTrigger:l,selectionVisible:i,selectionChecked:a,onSelectionChange:c,isRecordSelectable:h,selectionCheckboxProps:f,getSelectionCheckboxProps:p,onClick:m,onDoubleClick:y,onContextMenu:x,onCellClick:k,onCellDoubleClick:A,onCellContextMenu:I,expansion:F,customAttributes:W,color:R,backgroundColor:Y,className:$,style:T,selectorCellShadowVisible:E,selectionColumnClassName:M,selectionColumnStyle:_,rowFactory:L}){let B=o.jsxs(o.Fragment,{children:[i&&o.jsx(Ba,{className:M,style:_,record:t,index:e,trigger:l,withRightShadow:E,checked:a,disabled:!c||(h?!h(t,e):!1),onChange:c,checkboxProps:f,getCheckboxProps:p}),n.map(({hidden:g,hiddenContent:b,...j},v)=>{if(g||b)return null;let{accessor:C,visibleMediaQuery:O,textAlign:d,noWrap:S,ellipsis:w,width:z,render:H,cellsClassName:Q,cellsStyle:U,customCellAttributes:G}={...r,...j};return o.jsx(Wa,{className:typeof Q=="function"?Q(t,e):Q,style:U?.(t,e),visibleMediaQuery:O,record:t,index:e,onClick:k?K=>k({event:K,record:t,index:e,column:j,columnIndex:v}):void 0,onDoubleClick:A?K=>A({event:K,record:t,index:e,column:j,columnIndex:v}):void 0,onContextMenu:I?K=>I({event:K,record:t,index:e,column:j,columnIndex:v}):void 0,accessor:C,textAlign:d,noWrap:S,ellipsis:w,width:z,render:H,defaultRender:s,customCellAttributes:G},C)})]}),N=F&&o.jsx(za,{colSpan:n.filter(({hidden:g})=>!g).length+(i?1:0),open:F.isRowExpanded(t),content:F.content({record:t,index:e}),collapseProps:F.collapseProps}),D=Ha({record:t,index:e,selectionChecked:a,onClick:m,onDoubleClick:y,onContextMenu:x,expansion:F,customAttributes:W,color:R,backgroundColor:Y,className:$,style:T});return L?L({record:t,index:e,rowProps:D,children:B,expandedElement:N}):o.jsxs(o.Fragment,{children:[o.jsx(u.TableTr,{...D,children:B}),N]})}function Ha({record:t,index:e,selectionChecked:n,onClick:r,onDoubleClick:s,onContextMenu:l,expansion:i,customAttributes:a,color:c,backgroundColor:h,className:f,style:p}){return{className:de("mantine-datatable-row",{[Pt]:r||s||i?.isExpandable({record:t,index:e})&&i?.expandOnClick},{[Xr]:l},typeof f=="function"?f(t,e):f),"data-selected":n||void 0,onClick:m=>{if(i){let{isExpandable:y,isRowExpanded:x,expandOnClick:k,expandRow:A,collapseRow:I}=i;y({record:t,index:e})&&k&&(x(t)?I(t):A(t))}r?.({event:m,record:t,index:e})},onDoubleClick:s?m=>s({event:m,record:t,index:e}):void 0,onContextMenu:l?m=>l({event:m,record:t,index:e}):void 0,style:[c||h?m=>{let y=c?.(t,e),x=h?.(t,e);return $a({theme:m,color:y,backgroundColor:x})}:void 0,p?.(t,e)],...a?.(t,e)??{}}}function Ua({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:n,children:r,viewportRef:s,scrollAreaProps:l}){return o.jsxs(u.ScrollArea,{...l,viewportRef:s,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:n,children:[r,o.jsx(u.Box,{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),o.jsx("div",{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),o.jsx("div",{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),o.jsx(u.Box,{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function qa({withTableBorder:t,borderRadius:e,textSelectionDisabled:n,height:r="100%",minHeight:s,maxHeight:l,shadow:i,verticalAlign:a="center",fetching:c,columns:h,storeColumnsKey:f,groups:p,pinFirstColumn:m,pinLastColumn:y,defaultColumnProps:x,defaultColumnRender:k,idAccessor:A="id",records:I,selectionTrigger:F="checkbox",selectedRecords:W,onSelectedRecordsChange:R,selectionColumnClassName:Y,selectionColumnStyle:$,isRecordSelectable:T,selectionCheckboxProps:E,allRecordsSelectionCheckboxProps:M={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:_=(Ce,Be)=>({"aria-label":`Select record ${Be+1}`}),sortStatus:L,sortIcons:B,onSortStatusChange:N,horizontalSpacing:D,page:g,onPageChange:b,totalRecords:j,recordsPerPage:v,onRecordsPerPageChange:C,recordsPerPageOptions:O,recordsPerPageLabel:d="Records per page",paginationWithEdges:S,paginationWithControls:w,paginationActiveTextColor:z,paginationActiveBackgroundColor:H,paginationSize:Q="sm",paginationText:U=({from:Ce,to:Be,totalRecords:tt})=>`${Ce} - ${Be} / ${tt}`,paginationWrapBreakpoint:G="sm",getPaginationControlProps:K=Ce=>Ce==="previous"?{"aria-label":"Previous page"}:Ce==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:q,renderPagination:te,loaderBackgroundBlur:X,customLoader:ne,loaderSize:le,loaderType:he,loaderColor:re,loadingText:_e="...",emptyState:pe,noRecordsText:Te="No records",noRecordsIcon:je,highlightOnHover:nt,striped:Re,noHeader:Je,onRowClick:$e,onRowDoubleClick:Ye,onRowContextMenu:Ze,onCellClick:J,onCellDoubleClick:ge,onCellContextMenu:fe,onScroll:rt,onScrollToTop:ie,onScrollToBottom:Oe,onScrollToLeft:dt,onScrollToRight:ht,c:qe,backgroundColor:Ie,borderColor:xt,rowBorderColor:ve,stripedColor:st,highlightOnHoverColor:Ee,rowColor:ot,rowBackgroundColor:Ct,rowExpansion:xe,rowClassName:St,rowStyle:Pe,customRowAttributes:at,scrollViewportRef:Fe,scrollAreaProps:Xe,tableRef:We,bodyRef:Ge,m:et,my:Z,mx:ce,mt:Le,mb:Qe,ml:ft,mr:mt,className:Mt,classNames:it,style:pt,styles:ze,rowFactory:gt,tableWrapper:bt,...wt}){let Ce=P.useMemo(()=>p?Nn(p):h,[h,p]),[Be,tt]=P.useState(!1),{refs:ye,onScroll:Tt}=ca({scrollCallbacks:{onScroll:rt,onScrollToTop:ie,onScrollToBottom:Oe,onScrollToLeft:dt,onScrollToRight:ht},withRowBorders:wt.withRowBorders}),ee=la({key:f,columns:Ce,headerRef:ye.header,scrollViewportRef:ye.scrollViewport,onFixedLayoutChange:tt}),se=De.useMergedRef(ye.table,We),Ke=De.useMergedRef(ye.scrollViewport,Fe),Se=ba({rowExpansion:xe,records:I,idAccessor:A}),ue=P.useRef(!1),we=P.useRef(g),yt=P.useRef(I),Ne=P.useCallback(ae=>{ue.current=!0,yt.current=I,b(ae)},[b,I]);P.useEffect(()=>{we.current!==g&&(ue.current=!0,yt.current=I,we.current=g)},[g,I]);let dn=I?.length;P.useLayoutEffect(()=>{if(!ue.current||c||I===yt.current)return;let ae=ye.scrollViewport.current;if(!ae)return;let Dt=requestAnimationFrame(()=>{ae.scrollTo({top:0,left:0}),ue.current=!1});return()=>cancelAnimationFrame(Dt)},[c,I,ye.scrollViewport]);let ls=I?.map(ae=>ke(ae,A)),Ot=!!W,Yt=W?.map(ae=>ke(ae,A)),cs=ls!==void 0&&Yt!==void 0&&Yt.length>0,In=T?I?.filter(T):I,hn=In?.map(ae=>ke(ae,A)),fn=cs&&hn.every(ae=>Yt.includes(ae)),_i=cs&&hn.some(ae=>Yt.includes(ae)),ji=P.useCallback(()=>{W&&R&&R(fn?W.filter(ae=>!hn.includes(ke(ae,A))):Ln([...W,...In],ae=>ke(ae,A)))},[fn,A,R,hn,In,W]),{lastSelectionChangeIndex:mn,setLastSelectionChangeIndex:Pi}=ua(ls),Fn=Ot&&!m,Mi={m:et,my:Z,mx:ce,mt:Le,mb:Qe,ml:ft,mr:mt},Ti=P.useCallback(({children:ae})=>bt?bt({children:ae}):ae,[bt]);return o.jsx(Br,{...ee,children:o.jsxs(u.Box,{ref:ye.root,...Mi,className:de("mantine-datatable",{"mantine-datatable-with-border":t},Mt,it?.root),style:[ae=>({...Ra({theme:ae,c:qe,backgroundColor:Ie,borderColor:xt,rowBorderColor:ve,stripedColor:st,highlightOnHoverColor:Ee}),borderRadius:ae.radius[e]||e,boxShadow:ae.shadows[i]||i,height:r,minHeight:s,maxHeight:l}),pt,ze?.root,{position:"relative"}],children:[o.jsx(Ua,{viewportRef:Ke,leftShadowBehind:Ot||!!m,rightShadowBehind:y,onScrollPositionChange:Tt,scrollAreaProps:Xe,children:o.jsx(Ti,{children:o.jsxs(u.Table,{ref:se,horizontalSpacing:D,className:de("mantine-datatable-table",{[va]:n,"mantine-datatable-vertical-align-top":a==="top","mantine-datatable-vertical-align-bottom":a==="bottom","mantine-datatable-pin-last-column":y,"mantine-datatable-selection-column-visible":Ot,"mantine-datatable-pin-first-column":m,"mantine-datatable-resizable-columns":ee.hasResizableColumns&&Be},it?.table),style:{...ze?.table},"data-striped":dn&&Re||void 0,"data-highlight-on-hover":nt||void 0,...wt,children:[Je?null:o.jsx(Br,{...ee,children:o.jsx(Na,{ref:ye.header,selectionColumnHeaderRef:ye.selectionColumnHeader,className:it?.header,style:ze?.header,columns:Ce,defaultColumnProps:x,groups:p,sortStatus:L,sortIcons:B,onSortStatusChange:N,selectionTrigger:F,selectionVisible:Ot,selectionChecked:fn,selectionIndeterminate:_i&&!fn,onSelectionChange:ji,selectionCheckboxProps:{...E,...M},selectorCellShadowVisible:Fn,selectionColumnClassName:Y,selectionColumnStyle:$,withColumnBorders:wt.withColumnBorders})}),o.jsx("tbody",{ref:Ge,children:dn?I.map((ae,Dt)=>{let Wn=ke(ae,A),zn=Yt?.includes(Wn)||!1,us;return R&&W&&(us=Oi=>{if(Oi.nativeEvent.shiftKey&&mn!==null){let Et=I.filter(Dt>mn?(kt,_t)=>_t>=mn&&_t<=Dt&&(T?T(kt,_t):!0):(kt,_t)=>_t>=Dt&&_t<=mn&&(T?T(kt,_t):!0));R(zn?pa(W,Et,kt=>ke(kt,A)):Ln([...W,...Et],kt=>ke(kt,A)))}else R(zn?W.filter(Et=>ke(Et,A)!==Wn):Ln([...W,ae],Et=>ke(Et,A)));Pi(Dt)}),o.jsx(Va,{record:ae,index:Dt,columns:Ce,defaultColumnProps:x,defaultColumnRender:k,selectionTrigger:F,selectionVisible:Ot,selectionChecked:zn,onSelectionChange:us,isRecordSelectable:T,selectionCheckboxProps:E,getSelectionCheckboxProps:_,onClick:$e,onDoubleClick:Ye,onCellClick:J,onCellDoubleClick:ge,onContextMenu:Ze,onCellContextMenu:fe,expansion:Se,color:ot,backgroundColor:Ct,className:St,style:Pe,customAttributes:at,selectorCellShadowVisible:Fn,selectionColumnClassName:Y,selectionColumnStyle:$,idAccessor:A,rowFactory:gt},Wn)}):o.jsx(na,{})}),Ce.some(({footer:ae})=>ae)&&o.jsx(Sa,{ref:ye.footer,className:it?.footer,style:ze?.footer,columns:Ce,defaultColumnProps:x,selectionVisible:Ot,selectorCellShadowVisible:Fn})]})})}),g&&o.jsx(Fa,{className:it?.pagination,style:ze?.pagination,horizontalSpacing:D,fetching:c,page:g,onPageChange:Ne,totalRecords:j,recordsPerPage:v,onRecordsPerPageChange:C,recordsPerPageOptions:O,recordsPerPageLabel:d,paginationWithEdges:S,paginationWithControls:w,paginationActiveTextColor:z,paginationActiveBackgroundColor:H,paginationSize:Q,paginationText:U,paginationWrapBreakpoint:G,getPaginationControlProps:K,getPaginationItemProps:q,noRecordsText:Te,loadingText:_e,recordsLength:dn,renderPagination:te}),o.jsx(Aa,{fetching:c,backgroundBlur:X,customContent:ne,size:le,type:he,color:re}),o.jsx(sa,{icon:je,text:Te,active:!c&&!dn,children:pe})]})})}function ns(t){const e=Me.c(42),{fields:n,onClose:r,queryKey:s,apiPath:l,id:i,steps:a}=t,[c,h]=P.useState(0),[f,p]=P.useState(!1),{data:m,isLoading:y}=br(l,s,i),{mutateAsync:x,isError:k,error:A,isPending:I}=Sn(l,s);let F;e[0]!==n?(F=new Set(n.filter(Xa).map(Za)),e[0]=n,e[1]=F):F=e[1];let W;e[2]!==F?(W=[...F],e[2]=F,e[3]=W):W=e[3];const R=W;let Y;e[4]!==n?(Y=n.reduce(Ja,{}),e[4]=n,e[5]=Y):Y=e[5];let $;e[6]!==n?($=n.filter(Ka).reduce(Qa,{}),e[6]=n,e[7]=$):$=e[7];let T;e[8]!==Y||e[9]!==$?(T={mode:"uncontrolled",initialValues:Y,validate:$},e[8]=Y,e[9]=$,e[10]=T):T=e[10];const E=Bn.useForm(T);let M;e[11]!==m||e[12]!==n||e[13]!==E?(M=()=>{if(m){const v={...m};n.forEach(C=>{const O=C.id;C.type==="boolean"&&v[O]===null?v[O]=!1:C.type==="date"&&v[O]?v[O]=new Date(v[O]):v[O]===null&&(v[O]="")}),E.initialize(v),E.setValues(v)}},e[11]=m,e[12]=n,e[13]=E,e[14]=M):M=e[14];let _;e[15]!==m?(_=[m],e[15]=m,e[16]=_):_=e[16],P.useEffect(M,_);let L;e[17]===Symbol.for("react.memo_cache_sentinel")?(L=function(C,O){return typeof C.required=="function"?C.required(O??{}):!!C.required},e[17]=L):L=e[17];const B=L;let N;e[18]!==E||e[19]!==i?(N=function(C){const O=E.getValues();if(C.conditional&&!C.conditional(O))return null;const d=B(C,O);return o.jsxs(P.Fragment,{children:[(C.type===void 0||C.type=="text")&&o.jsx(u.TextInput,{label:C.column.title,placeholder:C.placeholder??"",...E.getInputProps(C.id),type:C.id.includes("email")?"email":void 0,required:d},E.key(C.id)),C.type==="number"&&o.jsx(u.NumberInput,{decimalSeparator:",",label:C.column.title,placeholder:C.placeholder??"",...E.getInputProps(C.id),required:d},E.key(C.id)),C.type==="date"&&o.jsx(on,{label:C.column.title,placeholder:C.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...E.getInputProps(C.id),required:d},E.key(C.id)),C.type==="boolean"&&o.jsx(u.Checkbox,{mt:"md",label:C.column.title,...E.getInputProps(C.id,{type:"checkbox"}),required:d},E.key(C.id)),C.type==="textarea"&&o.jsx(u.Textarea,{label:C.column.title,placeholder:C.placeholder??"",...E.getInputProps(C.id),minRows:3,autosize:!0,required:d},E.key(C.id)),C.type==="custom"&&C.render&&C.render({...E.getValues(),id:i},E.setValues,p,{error:E.getInputProps(C.id).error,required:d})]},C.id)},e[18]=E,e[19]=i,e[20]=N):N=e[20];const D=N;let g;e[21]!==k||e[22]!==A?.message||e[23]!==A?.name?(g=k&&o.jsx(u.Alert,{variant:"outline",color:"red",title:A?.name??"Fehler aufgetreten",mb:"lg",children:A?.message??"Fehler aufgetreten"}),e[21]=k,e[22]=A?.message,e[23]=A?.name,e[24]=g):g=e[24];let b;e[25]!==c||e[26]!==n||e[27]!==E||e[28]!==f||e[29]!==i||e[30]!==y||e[31]!==I||e[32]!==k||e[33]!==r||e[34]!==D||e[35]!==a||e[36]!==R||e[37]!==x?(b=y?o.jsxs(u.Stack,{gap:"md",children:[o.jsx(u.Skeleton,{height:40}),Array(n.length).fill(0).map(Ga),o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Skeleton,{width:100,height:36}),o.jsx(u.Skeleton,{width:100,height:36})]})]}):o.jsxs("form",{onSubmit:E.onSubmit(async v=>{await x({...v,id:i}),R.length&&c<R.length-1?k||h(c+1):k||(E.setInitialValues(v),E.reset(),r())}),children:[R.length?o.jsx(u.Stepper,{active:c,size:"sm",children:R.map(v=>o.jsx(u.Stepper.Step,{...a&&a[v-1]?{label:a[v-1].label}:{},children:n.filter(C=>C.step===v).map(C=>D(C))},v))}):n.map(v=>D(v)),!f&&o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:()=>R.length?c===0?r():h(c-1):r(),variant:"outline",children:R.length?c===0?"Abbrechen":"Zurück":"Abbrechen"}),o.jsx(u.Button,{type:"submit",loading:I,children:R.length?c===R.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=c,e[26]=n,e[27]=E,e[28]=f,e[29]=i,e[30]=y,e[31]=I,e[32]=k,e[33]=r,e[34]=D,e[35]=a,e[36]=R,e[37]=x,e[38]=b):b=e[38];let j;return e[39]!==g||e[40]!==b?(j=o.jsxs(o.Fragment,{children:[g,b]}),e[39]=g,e[40]=b,e[41]=j):j=e[41],j}function Ga(t,e){return o.jsx(u.Skeleton,{height:35},`skeleton-field-${e}`)}function Qa(t,e){return t[e.id]=(n,r)=>e.conditional&&!e.conditional(r)||!(typeof e.required=="function"?e.required(r):!!e.required)||n?null:"Pflichtfeld",t}function Ka(t){return t.required}function Ja(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function Za(t){return t.step}function Xa(t){return typeof t.step=="number"}function rs({queryKey:t,apiPath:e,onClose:n,selectedRecords:r}){const{mutateAsync:s,isError:l,error:i,isPending:a}=xr(e,t),[c,h]=P.useState(r),[f,p]=P.useState(!1),m=f||a;return P.useEffect(()=>{c.length||n()},[n,c]),c.length?o.jsxs(o.Fragment,{children:[l&&i.message&&o.jsx(u.Alert,{variant:"outline",color:"red",title:i.name,children:i.message}),o.jsx(u.Text,{children:c.length===1?`Soll ${c.length} Eintrag wirklich gelöscht werden?`:`Sollen ${c.length} Einträge wirklich gelöscht werden?`}),o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:n,variant:"outline",disabled:m,children:"Abbrechen"}),o.jsx(u.Button,{color:"red",loading:m,onClick:async()=>{p(!0);try{await Promise.all(c.map(y=>s(y.id))),h([])}finally{p(!1)}},children:"Löschen"})]})]}):o.jsx(o.Fragment,{})}function ss(t,e){const n=Me.c(8);let r;n[0]!==t||n[1]!==e?(r=()=>{const h=localStorage.getItem(`use_persistent_storage_${e}`);return h?JSON.parse(h):t},n[0]=t,n[1]=e,n[2]=r):r=n[2];const[s,l]=P.useState(r);let i;n[3]!==e?(i=h=>{l(h),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(h))},n[3]=e,n[4]=i):i=n[4];const a=i;let c;return n[5]!==a||n[6]!==s?(c=[s,a],n[5]=a,n[6]=s,n[7]=c):c=n[7],c}const ei=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/],ti=(t,e)=>{const n=t.map(i=>i[e]).filter(i=>i!=null&&i!=="");if(n.length===0)return"string";const r=n.slice(0,100),s={string:0,number:0,date:0};r.forEach(i=>{if(typeof i=="number")s.number++;else if(typeof i=="string"){const a=i.trim();if(a!==""&&!isNaN(Number(a))&&!isNaN(parseFloat(a))){s.number++;return}if(ei.some(c=>c.test(a))){const c=new Date(a);if(!isNaN(c.getTime())){s.date++;return}}s.string++}else i instanceof Date?s.date++:s.string++});const l=s.string+s.number+s.date;return s.date/l>=.6?"date":s.number/l>=.6?"number":s.string/l>=.6?"string":"mixed"};function os(t,e){switch(e){case"date":if(typeof t=="string"){const r=new Date(t.trim());return isNaN(r.getTime())?null:r.getTime()}return t instanceof Date?t.getTime():null;case"number":if(typeof t=="number")return t;const n=parseFloat(String(t).trim());return isNaN(n)?null:n;case"string":return(typeof t=="string"?t:String(t)).toLowerCase().trim();default:return String(t).toLowerCase().trim()}}const as=(t,e,n="asc")=>{if(!t||t.length===0)return[];const r=ti(t,e);return[...t].sort((s,l)=>{const i=s[e],a=l[e],c=i==null||i==="",h=a==null||a==="";if(c&&h)return 0;if(c)return n==="asc"?-1:1;if(h)return n==="asc"?1:-1;const f=os(i,r),p=os(a,r);return f===null&&p===null?0:f===null?n==="asc"?1:-1:p===null||f<p?n==="asc"?-1:1:f>p?n==="asc"?1:-1:0})};function ni(t,e){return e.split(".").reduce((n,r)=>{if(n&&typeof n=="object"&&r in n)return n[r]},t)}function ri(t,e){const n=e.column;if(n.render)return n.render(t,0);const r=n.accessor??e.id,s=ni(t,r);return s==null?o.jsx(u.Text,{c:"dimmed",children:"–"}):typeof s=="boolean"?o.jsx(u.Text,{fz:"sm",children:s?"Ja":"Nein"}):o.jsx(u.Text,{fz:"sm",children:String(s)})}function si(t){const e=Me.c(10),{field:n,record:r}=t,s=n.column.title??n.id;let l;e[0]!==s?(l=o.jsx(u.Text,{fw:700,fz:"sm",children:s}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==n||e[3]!==r?(i=ri(r,n),e[2]=n,e[3]=r,e[4]=i):i=e[4];let a;e[5]!==i?(a=o.jsx(u.Box,{ta:"right",fz:"sm",children:i}),e[5]=i,e[6]=a):a=e[6];let c;return e[7]!==l||e[8]!==a?(c=o.jsxs(u.Group,{wrap:"nowrap",justify:"space-between",align:"center",py:"xs",px:"sm",children:[l,a]}),e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function is(t){const e=Me.c(42),{records:n,fields:r,selection:s,selectedRecords:l,onSelectedRecordsChange:i,onRowClick:a,actions:c,canUpdate:h,canDelete:f,pagination:p,sort:m,rowExpansion:y}=t;let x;e[0]!==l?(x=l===void 0?[]:l,e[0]=l,e[1]=x):x=e[1];const k=x;let A;e[2]===Symbol.for("react.memo_cache_sentinel")?(A=new Set,e[2]=A):A=e[2];const[I,F]=P.useState(A);let W;e[3]===Symbol.for("react.memo_cache_sentinel")?(W=N=>{F(D=>{const g=new Set(D);return g.has(N)?g.delete(N):g.add(N),g})},e[3]=W):W=e[3];const R=W;let Y,$,T,E,M,_;if(e[4]!==c||e[5]!==f||e[6]!==h||e[7]!==I||e[8]!==r||e[9]!==a||e[10]!==i||e[11]!==n||e[12]!==y||e[13]!==k||e[14]!==s||e[15]!==m){_=Symbol.for("react.early_return_sentinel");e:{const N=r.filter(ui),D=N.filter(ci).reduce(li,[]);let g;e[22]!==k?(g=d=>k.some(S=>S.id===d.id),e[22]=k,e[23]=g):g=e[23];const b=g;let j;e[24]!==b||e[25]!==i||e[26]!==k?(j=d=>{i&&(b(d)?i(k.filter(S=>S.id!==d.id)):i([...k,d]))},e[24]=b,e[25]=i,e[26]=k,e[27]=j):j=e[27];const v=j;let C;e[28]!==a||e[29]!==s||e[30]!==v?(C=(d,S,w)=>{a?a({record:d,index:S,event:w}):s&&v(d)},e[28]=a,e[29]=s,e[30]=v,e[31]=C):C=e[31];const O=C;if(n.length===0){let d;e[32]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(u.Text,{c:"dimmed",ta:"center",py:"xl",children:"Keine Einträge gefunden"}),e[32]=d):d=e[32],_=d;break e}Y=u.Stack,$="sm",T="md",E=m&&D.length>0&&o.jsxs(u.Group,{gap:"xs",wrap:"nowrap",children:[o.jsx(u.Select,{data:D,value:m.field,onChange:d=>d&&m.onSortChange(d,m.direction),allowDeselect:!1,style:{flex:1}}),o.jsx(u.ActionIcon,{variant:"filled",size:"input-sm",onClick:()=>m.onSortChange(m.field,m.direction==="asc"?"desc":"asc"),children:m.direction==="asc"?o.jsx(Ve.IconSortAscending,{size:18}):o.jsx(Ve.IconSortDescending,{size:18})})]}),M=n.map((d,S)=>{const w=b(d),z=!!a||!!s,H=d.id??S,Q=I.has(H);return o.jsx(P.Fragment,{children:o.jsxs(u.Box,{bg:w?"var(--mantine-primary-color-light)":S%2===0?"var(--mantine-color-gray-0)":"white",bd:w?void 0:"1px solid var(--mantine-color-gray-2)",style:{borderRadius:"var(--mantine-radius-md)",overflow:"hidden"},children:[o.jsxs(u.Box,{w:"100%",style:{cursor:z||y?"pointer":"default"},onClick:U=>{y&&!a?R(H):O(d,S,U)},children:[(s||y||c&&c.length>0)&&o.jsxs(u.Group,{px:"sm",pt:"sm",justify:"space-between",children:[o.jsxs(u.Group,{gap:"xs",children:[y&&o.jsx(u.Box,{c:"var(--mantine-primary-color-filled)",style:{cursor:"pointer",display:"flex",alignItems:"center"},onClick:U=>{U.stopPropagation(),R(H)},children:o.jsx(Ve.IconChevronDown,{size:16,style:{transform:Q?"rotate(0deg)":"rotate(-90deg)",transition:"transform 200ms"}})}),s&&o.jsx(u.Checkbox,{checked:w,onChange:()=>v(d),onClick:ii})]}),c&&c.length>0&&(()=>{const U=c.filter(G=>!(G.label==="Bearbeiten"&&h&&!h(d)||G.label==="Löschen"&&f&&!f(d)));return U.length===0?null:o.jsxs(u.Menu,{shadow:"md",position:"bottom-end",children:[o.jsx(u.Menu.Target,{children:o.jsx(u.ActionIcon,{variant:"subtle",color:"gray",size:"sm",onClick:ai,children:o.jsx(Ve.IconDotsVertical,{size:16})})}),o.jsx(u.Menu.Dropdown,{children:U.map((G,K)=>o.jsx(u.Menu.Item,{leftSection:G.icon,onClick:q=>{q.stopPropagation(),G.onClick([d])},children:G.label},`card_action_${K}`))})]})})()]}),N.map((U,G)=>o.jsxs(P.Fragment,{children:[G>0&&o.jsx(u.Divider,{}),o.jsx(si,{field:U,record:d})]},U.id))]}),y&&o.jsxs(u.Collapse,{in:Q,children:[o.jsx(u.Divider,{}),o.jsx(u.Box,{px:"sm",py:"sm",children:y.content(d)})]})]})},H)})}e[4]=c,e[5]=f,e[6]=h,e[7]=I,e[8]=r,e[9]=a,e[10]=i,e[11]=n,e[12]=y,e[13]=k,e[14]=s,e[15]=m,e[16]=Y,e[17]=$,e[18]=T,e[19]=E,e[20]=M,e[21]=_}else Y=e[16],$=e[17],T=e[18],E=e[19],M=e[20],_=e[21];if(_!==Symbol.for("react.early_return_sentinel"))return _;let L;e[33]!==p?(L=p&&p.totalRecords>p.recordsPerPage&&o.jsxs(u.Stack,{gap:"xs",mt:"sm",children:[o.jsx(u.Group,{justify:"center",children:o.jsx(u.Pagination,{total:Math.ceil(p.totalRecords/p.recordsPerPage),value:p.page,onChange:p.onPageChange,size:"sm"})}),p.recordsPerPageOptions&&p.onRecordsPerPageChange&&o.jsxs(u.Group,{justify:"center",gap:"xs",children:[o.jsx(u.Text,{fz:"xs",c:"dimmed",children:"Einträge pro Seite:"}),o.jsx(u.Select,{data:p.recordsPerPageOptions.map(oi),value:String(p.recordsPerPage),onChange:N=>N&&p.onRecordsPerPageChange(Number(N)),allowDeselect:!1,size:"xs",w:70})]})]}),e[33]=p,e[34]=L):L=e[34];let B;return e[35]!==Y||e[36]!==L||e[37]!==$||e[38]!==T||e[39]!==E||e[40]!==M?(B=o.jsxs(Y,{gap:$,my:T,children:[E,M,L]}),e[35]=Y,e[36]=L,e[37]=$,e[38]=T,e[39]=E,e[40]=M,e[41]=B):B=e[41],B}function oi(t){return{value:String(t),label:String(t)}}function ai(t){return t.stopPropagation()}function ii(t){return t.stopPropagation()}function li(t,e){const n=e.column.accessor??e.id;return t.some(r=>r.value===n)||t.push({value:n,label:e.column.title??e.id}),t}function ci(t){return t.column.sortable!==!1}function ui(t){return t.list&&t.column}const Yn=[10,15,50,100,500];function di(t){const e=Me.c(133),{title:n,queryKey:r,connectedQueryKeys:s,apiPath:l,mutationApiPath:i,buttons:a,fields:c,selection:h,pagination:f,filters:p,actions:m,steps:y,defaultSort:x,onSortChange:k,createButtonText:A,queryParams:I,tabs:F,defaultTab:W,activeTab:R,onActiveTabChange:Y,canUpdate:$,canDelete:T,showRefresh:E,rowExpansion:M,onRowClick:_,mobileCards:L}=t,B=E===void 0?!0:E,N=L===void 0?!1:L,[D,g]=P.useState(W||(F&&F.length>0?F[0].value:null)),b=R!==void 0?R:D;let j;e[0]!==R||e[1]!==Y?(j=ee=>{R===void 0&&g(ee),Y&&Y(ee)},e[0]=R,e[1]=Y,e[2]=j):j=e[2];const v=j;let C;e[3]!==b||e[4]!==F?(C=F?.find(ee=>ee.value===b),e[3]=b,e[4]=F,e[5]=C):C=e[5];const O=C,d=O?.queryParams||{},S=O?.apiPath??l,w=O?.mutationApiPath??i??S,z={...I,...d},H=z?"?"+Object.entries(z).filter(Di).map(wi).join("&"):"";let Q;e[6]!==b||e[7]!==r?(Q=b?[...r,b]:r,e[6]=b,e[7]=r,e[8]=Q):Q=e[8];const U=Q,{data:G,isLoading:K,isError:q,isRefetching:te,refetch:X}=yr(S+H,U),{queryClient:ne}=vt();let le,he;e[9]!==G||e[10]!==s||e[11]!==ne?(le=()=>{!G||!Array.isArray(G)||s?.forEach(ee=>ne.invalidateQueries({queryKey:ee}))},he=[G,s,ne],e[9]=G,e[10]=s,e[11]=ne,e[12]=le,e[13]=he):(le=e[12],he=e[13]),P.useEffect(le,he);const re=!G||!Array.isArray(G)?[]:!p||p.length===0?G:G.filter(ee=>p.every(se=>{if(se.value===void 0)return!0;const Ke=se.id;if(se.type==="query"){const Se=ee[Ke];return Array.isArray(se.value)?Array.isArray(Se)?Se.some(ue=>{if(typeof ue=="string"||typeof ue=="number")return se.value.includes(String(ue));if(ue&&typeof ue=="object"){const we=ue;if("id"in we&&se.value.includes(we.id))return!0;for(const yt in we){const Ne=we[yt];if(typeof Ne=="string"&&se.value.includes(Ne)||Ne&&typeof Ne=="object"&&"id"in Ne&&se.value.includes(Ne.id))return!0}}return!1}):Se&&typeof Se=="object"&&"id"in Se?se.value.includes(Se.id):!1:typeof Se=="string"&&Se.includes(se.value)}else if(se.type==="date"){const Se=se.value;if(!Se)return!0;const[ue,we]=Se;if(!ue&&!we)return!0;const yt=ee[Ke];if(typeof yt=="string"){const Ne=yt.split(" ")[0];if(ue&&we)return Ne>=ue&&Ne<=we;if(ue&&!we)return Ne>=ue;if(!ue&&we)return Ne<=we}return!0}else if(se.type==="boolean")return ee[Ke]===se.value;return!0})),_e=x?.field??c[0].id,pe=x?.direction??"desc";let Te;e[14]!==_e||e[15]!==pe?(Te={columnAccessor:_e,direction:pe},e[14]=_e,e[15]=pe,e[16]=Te):Te=e[16];const[je,nt]=P.useState(Te);let Re;e[17]!==k?(Re=ee=>{nt(ee),k&&k(String(ee.columnAccessor),ee.direction)},e[17]=k,e[18]=Re):Re=e[18];const Je=Re,$e=as(re,je.columnAccessor,je.direction),[Ye,Ze]=ss(Yn[1],"mantine-table-page-size"),[J,ge]=P.useState(1),fe=f?$e.slice((J-1)*Ye,J*Ye):$e;let rt;e[19]===Symbol.for("react.memo_cache_sentinel")?(rt=[],e[19]=rt):rt=e[19];const[ie,Oe]=P.useState(rt);let dt;e[20]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>{Oe([])},e[20]=dt):dt=e[20];let ht;e[21]!==b?(ht=[b],e[21]=b,e[22]=ht):ht=e[22],P.useEffect(dt,ht);const[qe,Ie]=P.useState(!1),[xt,ve]=P.useState(!1),[st,Ee]=P.useState(!1);let ot;e[23]!==c?(ot=c.some(Si),e[23]=c,e[24]=ot):ot=e[24];const Ct=ot;let xe;e[25]!==c?(xe=c.some(Ci),e[25]=c,e[26]=xe):xe=e[26];const St=xe;let Pe;if(e[27]!==m||e[28]!==St||e[29]!==Ct){if(Pe=[],Ct){let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(Ve.IconPencil,{size:14}),e[31]=ee):ee=e[31];let se;e[32]===Symbol.for("react.memo_cache_sentinel")?(se={icon:ee,label:"Bearbeiten",onClick:Ke=>{Oe(Ke),ve(!0)}},e[32]=se):se=e[32],Pe.push(se)}if(m&&Pe.push(...m),St){let ee;e[33]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(Ve.IconTrash,{size:14}),e[33]=ee):ee=e[33];let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se={icon:ee,label:"Löschen",onClick:Ke=>{Oe(Ke),Ee(!0)}},e[34]=se):se=e[34],Pe.push(se)}e[27]=m,e[28]=St,e[29]=Ct,e[30]=Pe}else Pe=e[30];const at=n?"space-between":"end";let Fe;e[35]!==n?(Fe=n&&(typeof n=="string"?o.jsx(u.Title,{order:4,children:n}):n),e[35]=n,e[36]=Fe):Fe=e[36];let Xe;e[37]===Symbol.for("react.memo_cache_sentinel")?(Xe={marginLeft:"auto"},e[37]=Xe):Xe=e[37];let We;e[38]!==X||e[39]!==B?(We=B&&o.jsx(u.ActionIcon,{variant:"subtle",onClick:()=>X(),"aria-label":"Neuladen",children:o.jsx(Ve.IconRefresh,{})}),e[38]=X,e[39]=B,e[40]=We):We=e[40];let Ge;e[41]!==m||e[42]!==T||e[43]!==$||e[44]!==c||e[45]!==N||e[46]!==ie||e[47]!==h?(Ge=(c.some(xi)||h)&&(()=>{const ee=c.find(vi)&&(!$||ie.length>0&&$(ie[0])),se=c.find(yi)&&(!T||ie.length>0&&T(ie[0])),Ke=(m??[]).length>0,Se=ee||se||Ke;return o.jsx(u.Box,{...N?{visibleFrom:"sm"}:{},children:o.jsxs(u.Menu,{shadow:"md",children:[o.jsx(u.Menu.Target,{children:o.jsx(u.Button,{variant:"outline",rightSection:o.jsx(Ve.IconCaretDownFilled,{size:14}),disabled:!ie.length||!Se,children:"Aktionen"})}),o.jsxs(u.Menu.Dropdown,{children:[ee&&o.jsx(u.Menu.Item,{leftSection:o.jsx(Ve.IconPencil,{size:14}),onClick:()=>ve(!0),disabled:ie.length!==1,children:"Bearbeiten"}),(m??[]).map((ue,we)=>P.createElement(u.Menu.Item,{...ue.icon&&{leftSection:ue.icon},key:`custom_action_${we}`,onClick:()=>ue.onClick(ie),disabled:ue.disabled?.(ie)??!1},ue.label)),se&&o.jsx(u.Menu.Item,{leftSection:o.jsx(Ve.IconTrash,{size:14}),onClick:()=>Ee(!0),color:"red",children:"Löschen"})]})]})})})(),e[41]=m,e[42]=T,e[43]=$,e[44]=c,e[45]=N,e[46]=ie,e[47]=h,e[48]=Ge):Ge=e[48];let et;e[49]!==A||e[50]!==c||e[51]!==K?(et=c.find(bi)&&o.jsx(u.Button,{onClick:()=>Ie(!0),disabled:K,children:A??"Erstellen"}),e[49]=A,e[50]=c,e[51]=K,e[52]=et):et=e[52];let Z;e[53]!==a||e[54]!==We||e[55]!==Ge||e[56]!==et?(Z=o.jsxs(u.Group,{align:"center",gap:"xs",wrap:"wrap",justify:"end",style:Xe,children:[We,Ge,et,a]}),e[53]=a,e[54]=We,e[55]=Ge,e[56]=et,e[57]=Z):Z=e[57];let ce;e[58]!==at||e[59]!==Fe||e[60]!==Z?(ce=o.jsxs(u.Group,{gap:"xs",justify:at,align:"center",wrap:"wrap",children:[Fe,Z]}),e[58]=at,e[59]=Fe,e[60]=Z,e[61]=ce):ce=e[61];let Le;e[62]!==b||e[63]!==v||e[64]!==F?(Le=F&&F.length>0&&o.jsx(u.Tabs,{value:b,onChange:v,mt:"md",children:o.jsx(u.Tabs.List,{children:F.map(gi)})}),e[62]=b,e[63]=v,e[64]=F,e[65]=Le):Le=e[65];let Qe;e[66]!==q?(Qe=q&&o.jsx(u.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:o.jsx(Ve.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[66]=q,e[67]=Qe):Qe=e[67];let ft;e[68]!==K||e[69]!==te?(ft=(K||te)&&o.jsxs(u.Stack,{my:"md",children:[o.jsx(u.Skeleton,{height:40}),Array(5).fill(0).map(pi)]}),e[68]=K,e[69]=te,e[70]=ft):ft=e[70];let mt;e[71]!==T||e[72]!==$||e[73]!==c||e[74]!==Je||e[75]!==q||e[76]!==K||e[77]!==te||e[78]!==Pe||e[79]!==N||e[80]!==_||e[81]!==J||e[82]!==Ye||e[83]!==f||e[84]!==fe||e[85]!==M||e[86]!==ie||e[87]!==h||e[88]!==ge||e[89]!==Ze||e[90]!==je||e[91]!==$e?(mt=!K&&!te&&o.jsxs(o.Fragment,{children:[o.jsx(u.Box,{...N?{visibleFrom:"sm"}:{},children:o.jsx(qa,{withTableBorder:!0,my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:q,records:fe,sortStatus:je,onSortStatusChange:Je,...h&&{selectedRecords:ie,onSelectedRecordsChange:Oe},...f&&fe.length&&{totalRecords:$e.length,recordsPerPage:Ye,onPageChange:ge,page:J,recordsPerPageOptions:Yn,onRecordsPerPageChange:Ze,recordsPerPageLabel:"Einträge pro Seite"},...M&&{rowExpansion:{allowMultiple:M.allowMultiple??!1,content:ee=>{const{record:se}=ee;return M.content(se)},...M.expanded&&{expanded:M.expanded}}},columns:c.map(mi),noRecordsText:"Keine Einträge gefunden",onRowClick:_,..._&&{style:{cursor:"pointer"}}})}),N&&o.jsx(u.Box,{hiddenFrom:"sm",children:o.jsx(is,{records:fe,fields:c,selection:h,selectedRecords:ie,onSelectedRecordsChange:Oe,onRowClick:_,sort:{field:String(je.columnAccessor),direction:je.direction,onSortChange:(ee,se)=>{Je({columnAccessor:ee,direction:se})}},...f&&fe.length&&{pagination:{totalRecords:$e.length,recordsPerPage:Ye,page:J,onPageChange:ge,recordsPerPageOptions:Yn,onRecordsPerPageChange:ee=>{Ze(ee),ge(1)}}},...M&&{rowExpansion:{content:M.content}},...Pe.length>0&&{actions:Pe,canUpdate:$,canDelete:T}})})]}),e[71]=T,e[72]=$,e[73]=c,e[74]=Je,e[75]=q,e[76]=K,e[77]=te,e[78]=Pe,e[79]=N,e[80]=_,e[81]=J,e[82]=Ye,e[83]=f,e[84]=fe,e[85]=M,e[86]=ie,e[87]=h,e[88]=ge,e[89]=Ze,e[90]=je,e[91]=$e,e[92]=mt):mt=e[92];let Mt;e[93]===Symbol.for("react.memo_cache_sentinel")?(Mt=()=>{ve(!1),Oe([])},e[93]=Mt):Mt=e[93];const it=n??"Bearbeiten";let pt;e[94]!==w||e[95]!==c||e[96]!==r||e[97]!==ie[0]||e[98]!==ie.length||e[99]!==y?(pt=ie.length>0&&o.jsx(ns,{fields:c.filter(fi),queryKey:r,apiPath:w,id:ie[0].id,onClose:()=>{ve(!1),Oe([])},steps:y}),e[94]=w,e[95]=c,e[96]=r,e[97]=ie[0],e[98]=ie.length,e[99]=y,e[100]=pt):pt=e[100];let ze;e[101]!==it||e[102]!==pt||e[103]!==xt?(ze=o.jsx(u.Modal,{opened:xt,onClose:Mt,title:it,children:pt}),e[101]=it,e[102]=pt,e[103]=xt,e[104]=ze):ze=e[104];let gt;e[105]!==st||e[106]!==w||e[107]!==r||e[108]!==ie||e[109]!==n?(gt=ie.length>0&&o.jsx(u.Modal,{opened:st,onClose:()=>{Ee(!1),Oe([])},title:n??"Löschen",children:o.jsx(rs,{onClose:()=>{Ee(!1),Oe([])},queryKey:r,apiPath:w,selectedRecords:ie})}),e[105]=st,e[106]=w,e[107]=r,e[108]=ie,e[109]=n,e[110]=gt):gt=e[110];let bt;e[111]===Symbol.for("react.memo_cache_sentinel")?(bt=()=>{Ie(!1)},e[111]=bt):bt=e[111];const wt=n??"Anlegen";let Ce;e[112]===Symbol.for("react.memo_cache_sentinel")?(Ce=()=>{Ie(!1)},e[112]=Ce):Ce=e[112];let Be;e[113]!==c?(Be=c.filter(hi),e[113]=c,e[114]=Be):Be=e[114];let tt;e[115]!==w||e[116]!==r||e[117]!==y||e[118]!==Be?(tt=o.jsx(zr,{queryKey:r,apiPath:w,onClose:Ce,fields:Be,steps:y}),e[115]=w,e[116]=r,e[117]=y,e[118]=Be,e[119]=tt):tt=e[119];let ye;e[120]!==qe||e[121]!==wt||e[122]!==tt?(ye=o.jsx(u.Modal,{opened:qe,onClose:bt,title:wt,children:tt}),e[120]=qe,e[121]=wt,e[122]=tt,e[123]=ye):ye=e[123];let Tt;return e[124]!==ce||e[125]!==Le||e[126]!==Qe||e[127]!==ft||e[128]!==mt||e[129]!==ze||e[130]!==gt||e[131]!==ye?(Tt=o.jsxs(o.Fragment,{children:[ce,Le,Qe,ft,mt,ze,gt,ye]}),e[124]=ce,e[125]=Le,e[126]=Qe,e[127]=ft,e[128]=mt,e[129]=ze,e[130]=gt,e[131]=ye,e[132]=Tt):Tt=e[132],Tt}function hi(t){return t.create}function fi(t){return t.update}function mi(t){return t.column}function pi(t,e){return o.jsx(u.Skeleton,{height:35},`skeleton-${e}`)}function gi(t){return o.jsx(u.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function bi(t){return t.create}function yi(t){return t.delete}function vi(t){return t.update}function xi(t){return t.update}function Ci(t){return t.delete}function Si(t){return t.update}function wi(t){const[e,n]=t;return`${e}=${encodeURIComponent(n??"")}`}function Di(t){const[,e]=t;return e!=null}function ki(t){const e=Me.c(2);let n;return e[0]!==t?(n=o.jsx(di,{...t}),e[0]=t,e[1]=n):n=e[1],n}oe.CreateModal=zr,oe.DataTable=ki,oe.DataTableProvider=Qs,oe.DeleteModal=rs,oe.MobileCardList=is,oe.UpdateModal=ns,oe.api=Js,oe.createOne=pr,oe.deleteOne=mr,oe.getAll=hr,oe.getOne=fr,oe.parseApiError=Ks,oe.sortData=as,oe.updateOne=gr,oe.useAddOne=vr,oe.useDataTable=vt,oe.useDeleteOne=xr,oe.useGetAll=yr,oe.useGetOne=br,oe.usePersistentState=ss,oe.useUpdateOne=Sn,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})}));
|
|
24
11
|
//# sourceMappingURL=index.umd.js.map
|