@medplum/app 4.3.11 → 4.3.13
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/assets/favicon-DP3nZwE_.ico +0 -0
- package/dist/assets/index-Bvd9gX-s.js +601 -0
- package/dist/assets/index-Bvd9gX-s.js.map +1 -0
- package/dist/index.html +3 -3
- package/package.json +12 -12
- package/dist/assets/favicon-Pd8461Mt.ico +0 -0
- package/dist/assets/index-i6KQ4Bzn.js +0 -589
- package/dist/assets/index-i6KQ4Bzn.js.map +0 -1
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
function y4(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Sx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kv={exports:{}},Nu={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Vj;function x4(){if(Vj)return Nu;Vj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var c=null;if(s!==void 0&&(c=""+s),i.key!==void 0&&(c=""+i.key),"key"in i){s={};for(var d in i)d!=="key"&&(s[d]=i[d])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:c,ref:i!==void 0?i:null,props:s}}return Nu.Fragment=t,Nu.jsx=n,Nu.jsxs=n,Nu}var Fj;function b4(){return Fj||(Fj=1,kv.exports=x4()),kv.exports}var a=b4(),ei=function(){return ei=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ei.apply(this,arguments)};function lR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function S4(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Nv={exports:{}},yt={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var qj;function w4(){if(qj)return yt;qj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function x(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,j={};function C(M,F,te){this.props=M,this.context=F,this.refs=j,this.updater=te||b}C.prototype.isReactComponent={},C.prototype.setState=function(M,F){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,F,"setState")},C.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function T(){}T.prototype=C.prototype;function E(M,F,te){this.props=M,this.context=F,this.refs=j,this.updater=te||b}var R=E.prototype=new T;R.constructor=E,w(R,C.prototype),R.isPureReactComponent=!0;var _=Array.isArray,P={H:null,A:null,T:null,S:null,V:null},A=Object.prototype.hasOwnProperty;function k(M,F,te,ae,je,xe){return te=xe.ref,{$$typeof:e,type:M,key:F,ref:te!==void 0?te:null,props:xe}}function I(M,F){return k(M.type,F,void 0,void 0,void 0,M.props)}function B(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function q(M){var F={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(te){return F[te]})}var Z=/\/+/g;function K(M,F){return typeof M=="object"&&M!==null&&M.key!=null?q(""+M.key):F.toString(36)}function Q(){}function V(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(Q,Q):(M.status="pending",M.then(function(F){M.status==="pending"&&(M.status="fulfilled",M.value=F)},function(F){M.status==="pending"&&(M.status="rejected",M.reason=F)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function W(M,F,te,ae,je){var xe=typeof M;(xe==="undefined"||xe==="boolean")&&(M=null);var we=!1;if(M===null)we=!0;else switch(xe){case"bigint":case"string":case"number":we=!0;break;case"object":switch(M.$$typeof){case e:case t:we=!0;break;case m:return we=M._init,W(we(M._payload),F,te,ae,je)}}if(we)return je=je(M),we=ae===""?"."+K(M,0):ae,_(je)?(te="",we!=null&&(te=we.replace(Z,"$&/")+"/"),W(je,F,te,"",function(ot){return ot})):je!=null&&(B(je)&&(je=I(je,te+(je.key==null||M&&M.key===je.key?"":(""+je.key).replace(Z,"$&/")+"/")+we)),F.push(je)),1;we=0;var We=ae===""?".":ae+":";if(_(M))for(var Ee=0;Ee<M.length;Ee++)ae=M[Ee],xe=We+K(ae,Ee),we+=W(ae,F,te,xe,je);else if(Ee=x(M),typeof Ee=="function")for(M=Ee.call(M),Ee=0;!(ae=M.next()).done;)ae=ae.value,xe=We+K(ae,Ee++),we+=W(ae,F,te,xe,je);else if(xe==="object"){if(typeof M.then=="function")return W(V(M),F,te,ae,je);throw F=String(M),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return we}function O(M,F,te){if(M==null)return M;var ae=[],je=0;return W(M,ae,"","",function(xe){return F.call(te,xe,je++)}),ae}function L(M){if(M._status===-1){var F=M._result;F=F(),F.then(function(te){(M._status===0||M._status===-1)&&(M._status=1,M._result=te)},function(te){(M._status===0||M._status===-1)&&(M._status=2,M._result=te)}),M._status===-1&&(M._status=0,M._result=F)}if(M._status===1)return M._result.default;throw M._result}var $=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)};function H(){}return yt.Children={map:O,forEach:function(M,F,te){O(M,function(){F.apply(this,arguments)},te)},count:function(M){var F=0;return O(M,function(){F++}),F},toArray:function(M){return O(M,function(F){return F})||[]},only:function(M){if(!B(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},yt.Component=C,yt.Fragment=n,yt.Profiler=i,yt.PureComponent=E,yt.StrictMode=r,yt.Suspense=f,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,yt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return P.H.useMemoCache(M)}},yt.cache=function(M){return function(){return M.apply(null,arguments)}},yt.cloneElement=function(M,F,te){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ae=w({},M.props),je=M.key,xe=void 0;if(F!=null)for(we in F.ref!==void 0&&(xe=void 0),F.key!==void 0&&(je=""+F.key),F)!A.call(F,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&F.ref===void 0||(ae[we]=F[we]);var we=arguments.length-2;if(we===1)ae.children=te;else if(1<we){for(var We=Array(we),Ee=0;Ee<we;Ee++)We[Ee]=arguments[Ee+2];ae.children=We}return k(M.type,je,void 0,void 0,xe,ae)},yt.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:s,_context:M},M},yt.createElement=function(M,F,te){var ae,je={},xe=null;if(F!=null)for(ae in F.key!==void 0&&(xe=""+F.key),F)A.call(F,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(je[ae]=F[ae]);var we=arguments.length-2;if(we===1)je.children=te;else if(1<we){for(var We=Array(we),Ee=0;Ee<we;Ee++)We[Ee]=arguments[Ee+2];je.children=We}if(M&&M.defaultProps)for(ae in we=M.defaultProps,we)je[ae]===void 0&&(je[ae]=we[ae]);return k(M,xe,void 0,void 0,null,je)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(M){return{$$typeof:d,render:M}},yt.isValidElement=B,yt.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:L}},yt.memo=function(M,F){return{$$typeof:p,type:M,compare:F===void 0?null:F}},yt.startTransition=function(M){var F=P.T,te={};P.T=te;try{var ae=M(),je=P.S;je!==null&&je(te,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(H,$)}catch(xe){$(xe)}finally{P.T=F}},yt.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},yt.use=function(M){return P.H.use(M)},yt.useActionState=function(M,F,te){return P.H.useActionState(M,F,te)},yt.useCallback=function(M,F){return P.H.useCallback(M,F)},yt.useContext=function(M){return P.H.useContext(M)},yt.useDebugValue=function(){},yt.useDeferredValue=function(M,F){return P.H.useDeferredValue(M,F)},yt.useEffect=function(M,F,te){var ae=P.H;if(typeof te=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ae.useEffect(M,F)},yt.useId=function(){return P.H.useId()},yt.useImperativeHandle=function(M,F,te){return P.H.useImperativeHandle(M,F,te)},yt.useInsertionEffect=function(M,F){return P.H.useInsertionEffect(M,F)},yt.useLayoutEffect=function(M,F){return P.H.useLayoutEffect(M,F)},yt.useMemo=function(M,F){return P.H.useMemo(M,F)},yt.useOptimistic=function(M,F){return P.H.useOptimistic(M,F)},yt.useReducer=function(M,F,te){return P.H.useReducer(M,F,te)},yt.useRef=function(M){return P.H.useRef(M)},yt.useState=function(M){return P.H.useState(M)},yt.useSyncExternalStore=function(M,F,te){return P.H.useSyncExternalStore(M,F,te)},yt.useTransition=function(){return P.H.useTransition()},yt.version="19.1.1",yt}var Hj;function wx(){return Hj||(Hj=1,Nv.exports=w4()),Nv.exports}var v=wx();const En=Sx(v),j4=y4({__proto__:null,default:En},[v]);var yh="right-scroll-bar-position",xh="width-before-scroll-bar",C4="with-scroll-bars-hidden",E4="--removed-body-scroll-bar-size";function Ov(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function T4(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var R4=typeof window<"u"?v.useLayoutEffect:v.useEffect,Gj=new WeakMap;function _4(e,t){var n=T4(null,function(r){return e.forEach(function(i){return Ov(i,r)})});return R4(function(){var r=Gj.get(n);if(r){var i=new Set(r),s=new Set(e),c=n.current;i.forEach(function(d){s.has(d)||Ov(d,null)}),s.forEach(function(d){i.has(d)||Ov(d,c)})}Gj.set(n,e)},[e]),n}function D4(e){return e}function A4(e,t){t===void 0&&(t=D4);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var c=t(s,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(s){for(r=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(d){return s(d)},filter:function(){return n}}},assignMedium:function(s){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(s),c=n}var f=function(){var m=c;c=[],m.forEach(s)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(m){c.push(m),p()},filter:function(m){return c=c.filter(m),n}}}};return i}function P4(e){e===void 0&&(e={});var t=A4(null);return t.options=ei({async:!0,ssr:!1},e),t}var cR=function(e){var t=e.sideCar,n=lR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,ei({},n))};cR.isSideCarExport=!0;function k4(e,t){return e.useMedium(t),cR}var uR=P4(),Mv=function(){},fp=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Mv,onWheelCapture:Mv,onTouchMoveCapture:Mv}),i=r[0],s=r[1],c=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,g=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,j=e.inert,C=e.allowPinchZoom,T=e.as,E=T===void 0?"div":T,R=e.gapMode,_=lR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=x,A=_4([n,t]),k=ei(ei({},_),i);return v.createElement(v.Fragment,null,m&&v.createElement(P,{sideCar:uR,removeScrollBar:p,shards:g,noRelative:b,noIsolation:w,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:R}),c?v.cloneElement(v.Children.only(d),ei(ei({},k),{ref:A})):v.createElement(E,ei({},k,{className:f,ref:A}),d))});fp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fp.classNames={fullWidth:xh,zeroRight:yh};var N4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=N4();return t&&e.setAttribute("nonce",t),e}function M4(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function I4(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var L4=function(){var e=0,t=null;return{add:function(n){e==0&&(t=O4())&&(M4(t,n),I4(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$4=function(){var e=L4();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dR=function(){var e=$4(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},z4={left:0,top:0,right:0,gap:0},Iv=function(e){return parseInt(e||"",10)||0},U4=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Iv(n),Iv(r),Iv(i)]},B4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return z4;var t=U4(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},V4=dR(),sc="data-scroll-locked",F4=function(e,t,n,r){var i=e.left,s=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
+
.`.concat(C4,` {
|
|
19
|
+
overflow: hidden `).concat(r,`;
|
|
20
|
+
padding-right: `).concat(d,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
body[`).concat(sc,`] {
|
|
23
|
+
overflow: hidden `).concat(r,`;
|
|
24
|
+
overscroll-behavior: contain;
|
|
25
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
26
|
+
padding-left: `.concat(i,`px;
|
|
27
|
+
padding-top: `).concat(s,`px;
|
|
28
|
+
padding-right: `).concat(c,`px;
|
|
29
|
+
margin-left:0;
|
|
30
|
+
margin-top:0;
|
|
31
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
32
|
+
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(yh,` {
|
|
36
|
+
right: `).concat(d,"px ").concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(xh,` {
|
|
40
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(yh," .").concat(yh,` {
|
|
44
|
+
right: 0 `).concat(r,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat(xh," .").concat(xh,` {
|
|
48
|
+
margin-right: 0 `).concat(r,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body[`).concat(sc,`] {
|
|
52
|
+
`).concat(E4,": ").concat(d,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},Wj=function(){var e=parseInt(document.body.getAttribute(sc)||"0",10);return isFinite(e)?e:0},q4=function(){v.useEffect(function(){return document.body.setAttribute(sc,(Wj()+1).toString()),function(){var e=Wj()-1;e<=0?document.body.removeAttribute(sc):document.body.setAttribute(sc,e.toString())}},[])},H4=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;q4();var s=v.useMemo(function(){return B4(i)},[i]);return v.createElement(V4,{styles:F4(s,!t,i,n?"":"!important")})},Dy=!1;if(typeof window<"u")try{var Jf=Object.defineProperty({},"passive",{get:function(){return Dy=!0,!0}});window.addEventListener("test",Jf,Jf),window.removeEventListener("test",Jf,Jf)}catch{Dy=!1}var Wl=Dy?{passive:!1}:!1,G4=function(e){return e.tagName==="TEXTAREA"},fR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!G4(e)&&n[t]==="visible")},W4=function(e){return fR(e,"overflowY")},Q4=function(e){return fR(e,"overflowX")},Qj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=hR(e,r);if(i){var s=pR(e,r),c=s[1],d=s[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Y4=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},K4=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hR=function(e,t){return e==="v"?W4(t):Q4(t)},pR=function(e,t){return e==="v"?Y4(t):K4(t)},X4=function(e,t){return e==="h"&&t==="rtl"?-1:1},Z4=function(e,t,n,r,i){var s=X4(e,window.getComputedStyle(t).direction),c=s*r,d=n.target,f=t.contains(d),p=!1,m=c>0,g=0,x=0;do{if(!d)break;var b=pR(e,d),w=b[0],j=b[1],C=b[2],T=j-C-s*w;(w||T)&&hR(e,d)&&(g+=T,x+=w);var E=d.parentNode;d=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(m&&Math.abs(g)<1||!m&&Math.abs(x)<1)&&(p=!0),p},eh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yj=function(e){return[e.deltaX,e.deltaY]},Kj=function(e){return e&&"current"in e?e.current:e},J4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eO=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},tO=0,Ql=[];function nO(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(tO++)[0],s=v.useState(dR)[0],c=v.useRef(e);v.useEffect(function(){c.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var j=S4([e.lockRef.current],(e.shards||[]).map(Kj),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var d=v.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var T=eh(j),E=n.current,R="deltaX"in j?j.deltaX:E[0]-T[0],_="deltaY"in j?j.deltaY:E[1]-T[1],P,A=j.target,k=Math.abs(R)>Math.abs(_)?"h":"v";if("touches"in j&&k==="h"&&A.type==="range")return!1;var I=Qj(k,A);if(!I)return!0;if(I?P=k:(P=k==="v"?"h":"v",I=Qj(k,A)),!I)return!1;if(!r.current&&"changedTouches"in j&&(R||_)&&(r.current=P),!P)return!0;var B=r.current||P;return Z4(B,C,j,B==="h"?R:_)},[]),f=v.useCallback(function(j){var C=j;if(!(!Ql.length||Ql[Ql.length-1]!==s)){var T="deltaY"in C?Yj(C):eh(C),E=t.current.filter(function(P){return P.name===C.type&&(P.target===C.target||C.target===P.shadowParent)&&J4(P.delta,T)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(c.current.shards||[]).map(Kj).filter(Boolean).filter(function(P){return P.contains(C.target)}),_=R.length>0?d(C,R[0]):!c.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,T,E){var R={name:j,delta:C,target:T,should:E,shadowParent:rO(T)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(_){return _!==R})},1)},[]),m=v.useCallback(function(j){n.current=eh(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,Yj(j),j.target,d(j,e.lockRef.current))},[]),x=v.useCallback(function(j){p(j.type,eh(j),j.target,d(j,e.lockRef.current))},[]);v.useEffect(function(){return Ql.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Wl),document.addEventListener("touchmove",f,Wl),document.addEventListener("touchstart",m,Wl),function(){Ql=Ql.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,Wl),document.removeEventListener("touchmove",f,Wl),document.removeEventListener("touchstart",m,Wl)}},[]);var b=e.removeScrollBar,w=e.inert;return v.createElement(v.Fragment,null,w?v.createElement(s,{styles:eO(i)}):null,b?v.createElement(H4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oO=k4(uR,nO);var hc=v.forwardRef(function(e,t){return v.createElement(fp,ei({},e,{ref:t,sideCar:oO}))});hc.classNames=fp.classNames;function an(e){return Object.keys(e)}function Lv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function jx(e,t){const n={...e},r=t;return Lv(e)&&Lv(t)&&Object.keys(t).forEach(i=>{Lv(r[i])&&i in e?n[i]=jx(n[i],r[i]):n[i]=r[i]}),n}function iO(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function aO(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function Qu(e){const t=aO(e);return typeof t=="number"?t:typeof t=="string"?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?Number(t.replace("rem",""))*16:t.includes("em")?Number(t.replace("em",""))*16:Number(t):NaN}function $v(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function mR(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const i=`${r/16}${e}`;return t?$v(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");if(r.includes(e))return t?$v(r):r;const i=r.replace("px","");if(!Number.isNaN(Number(i))){const s=`${Number(i)/16}${e}`;return t?$v(s):s}}return r}return n}const le=mR("rem",{shouldScale:!0}),Ph=mR("em");function Xa(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function gR(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(r=>t.test(r))}return!1}function Xi(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function gr(e){const t=v.createContext(null);return[({children:i,value:s})=>a.jsx(t.Provider,{value:s,children:i}),()=>{const i=v.useContext(t);if(i===null)throw new Error(e);return i}]}function Zi(e=null){const t=v.createContext(e);return[({children:i,value:s})=>a.jsx(t.Provider,{value:s,children:i}),()=>v.useContext(t)]}function Xj(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function kh(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function sO(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].disabled)return r}return e}function lO(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].disabled)return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].disabled)return r}return e}function cO(e,t,n){return kh(e,n)===kh(t,n)}function vR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:s="rtl",orientation:c}){return d=>{n?.(d);const f=Array.from(kh(d.currentTarget,e)?.querySelectorAll(t)||[]).filter(w=>cO(d.currentTarget,w,e)),p=f.findIndex(w=>d.currentTarget===w),m=lO(p,f,r),g=sO(p,f,r),x=s==="rtl"?g:m,b=s==="rtl"?m:g;switch(d.key){case"ArrowRight":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[x].focus(),i&&f[x].click());break}case"ArrowLeft":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[b].focus(),i&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[g].focus(),i&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[m].focus(),i&&f[m].click());break}case"Home":{d.stopPropagation(),d.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{d.stopPropagation(),d.preventDefault();const w=f.length-1;!f[w].disabled&&f[w].focus();break}}}}const uO={app:100,modal:200,popover:300,overlay:400,max:9999};function Kr(e){return uO[e]}const Nh=()=>{};function dO(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Nh:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function nt(e,t="size",n=!0){if(e!==void 0)return gR(e)?n?le(e):e:`var(--${t}-${e})`}function Nn(e){return nt(e,"mantine-spacing")}function Ut(e){return e===void 0?"var(--mantine-radius-default)":nt(e,"mantine-radius")}function On(e){return nt(e,"mantine-font-size")}function yR(e){return nt(e,"mantine-line-height",!1)}function Cx(e){if(e)return nt(e,"mantine-shadow",!1)}function _r(e,t){return n=>{e?.(n),t?.(n)}}function Ex(e,t){return e in t?Qu(t[e]):Qu(e)}function Yu(e,t){const n=e.map(r=>({value:r,px:Ex(r,t)}));return n.sort((r,i)=>r.px-i.px),n}function Po(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function fO(e,t,n){return n?Array.from(kh(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function hO(){const[e,t]=v.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function bh(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}function Oh(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function pO(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;const n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1){const s=n[i];if(!(s in t)||e[s]!==t[s]&&!(Number.isNaN(e[s])&&Number.isNaN(t[s])))return!1}return!0}function Zj(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function _s(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function hp(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,i=_s(e),s=v.useRef(0),c=v.useRef(()=>{}),d=Object.assign(v.useCallback((...f)=>{window.clearTimeout(s.current);const p=()=>{s.current!==0&&(s.current=0,i(...f))};c.current=p,d.flush=p,s.current=window.setTimeout(p,n)},[i,n]),{flush:c.current});return v.useEffect(()=>()=>{window.clearTimeout(s.current),r&&d.flush()},[d,r]),d}const Jj=["mousedown","touchstart"];function mO(e,t,n){const r=v.useRef(null);return v.useEffect(()=>{const i=s=>{const{target:c}=s??{};if(Array.isArray(n)){const d=c?.hasAttribute("data-ignore-outside-clicks")||!document.body.contains(c)&&c.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!d&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||Jj).forEach(s=>document.addEventListener(s,i)),()=>{(t||Jj).forEach(s=>document.removeEventListener(s,i))}},[r,e,n]),r}function xR({timeout:e=2e3}={}){const[t,n]=v.useState(null),[r,i]=v.useState(!1),[s,c]=v.useState(null),d=m=>{window.clearTimeout(s),c(window.setTimeout(()=>i(!1),e)),i(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>d(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{i(!1),n(null),window.clearTimeout(s)},error:t,copied:r}}function gO(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function vO(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function bR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=v.useState(n?t:vO(e)),s=v.useRef(null);return v.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),i(s.current.matches),gO(s.current,c=>i(c.matches))},[e]),r}function yO(e,t){return bR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Ec=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Hi(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function SR({opened:e,shouldReturnFocus:t=!0}){const n=v.useRef(null),r=()=>{n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&n.current?.focus({preventScroll:!0})};return Hi(()=>{let i=-1;const s=c=>{c.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[e,t]),r}const xO=/input|select|textarea|button|object/,wR="a, input, select, textarea, button, object, [tabindex]";function bO(e){return e.style.display==="none"}function SO(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(bO(n))return!1;n=n.parentNode}return!0}function jR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Ay(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(jR(e));return(xO.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&SO(e)}function CR(e){const t=jR(e);return(Number.isNaN(t)||t>=0)&&Ay(e)}function wO(e){return Array.from(e.querySelectorAll(wR)).filter(CR)}function jO(e,t){const n=wO(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],i=e.getRootNode();let s=r===i.activeElement||e===i.activeElement;const c=i.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(s=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!s)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function CO(e=!0){const t=v.useRef(null),n=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const c=Array.from(i.querySelectorAll(wR));s=c.find(CR)||c.find(Ay)||null,!s&&Ay(i)&&(s=i)}s&&s.focus({preventScroll:!0})},r=v.useCallback(i=>{e&&i!==null&&t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)},[e]);return v.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=s=>{s.key==="Tab"&&t.current&&jO(t.current,s)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),r}const EO=e=>(e+1)%1e6;function TO(){const[,e]=v.useReducer(EO,0);return e}const RO=En.useId||(()=>{});function _O(){const e=RO();return e?`mantine-${e.replace(/:/g,"")}`:""}function vr(e){const t=_O(),[n,r]=v.useState(t);return Ec(()=>{r(Oh())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function ER(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Ku(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function DO(...e){const t=new Map;return n=>{if(e.forEach(r=>{const i=Ku(r,n);i&&t.set(r,i)}),t.size>0)return()=>{e.forEach(r=>{const i=t.get(r);i?i():Ku(r,null)}),t.clear()}}}function Bn(...e){return v.useCallback(DO(...e),e)}function Yn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[i,s]=v.useState(t!==void 0?t:n),c=(d,...f)=>{s(d),r?.(d,...f)};return e!==void 0?[e,r,!0]:[i,c,!1]}function Ma(e,t){const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)}const th="dots";function AO({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:i=1,onChange:s}){const c=Math.max(Math.trunc(e),0),[d,f]=Yn({value:r,onChange:s,defaultValue:i,finalValue:i}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(d+1),g=()=>p(d-1),x=()=>p(1),b=()=>p(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return Ma(1,c);const C=Math.max(d-t,n),T=Math.min(d+t,c-n),E=C>n+2,R=T<c-(n+1);if(!E&&R){const _=t*2+n+2;return[...Ma(1,_),th,...Ma(c-(n-1),c)]}if(E&&!R){const _=n+1+2*t;return[...Ma(1,n),th,...Ma(c-_,c)]}return[...Ma(1,n),th,...Ma(C,T),th,...Ma(c-n+1,c)]},[c,t,d]),active:d,setPage:p,next:m,previous:g,first:x,last:b}}function Tx(e,t){return bR("(prefers-reduced-motion: reduce)",e,t)}function PO(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!pO(e[n],t[n]))return!1;return!0}function kO(e){const t=v.useRef([]),n=v.useRef(0);return PO(t.current,e)||(t.current=e,n.current+=1),[n.current]}function NO(e,t){v.useEffect(e,kO(t))}function pp(e=!1,t){const{onOpen:n,onClose:r}={},[i,s]=v.useState(e),c=v.useCallback(()=>{s(p=>p||(n?.(),!0))},[n]),d=v.useCallback(()=>{s(p=>p&&(r?.(),!1))},[r]),f=v.useCallback(()=>{i?d():c()},[d,c,i]);return[i,{open:c,close:d,toggle:f}]}function OO(e,t,n={autoInvoke:!1}){const r=v.useRef(null),i=v.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),s=v.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return v.useEffect(()=>(n.autoInvoke&&i(),s),[s,i]),{start:i,clear:s}}function MO(e,t,n){const r=v.useRef(null),i=v.useRef(null);return v.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||i.current)&&(r.current=new MutationObserver(e),r.current.observe(s||i.current,t)),()=>{r.current?.disconnect()}},[e,t]),i}function IO(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var LO={};function TR(){return typeof process<"u"&&LO?"production":"development"}function mp(e){const t=En.version;return typeof En.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function RR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=RR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function It(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=RR(e))&&(r&&(r+=" "),r+=t);return r}const $O={};function zO(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,i])=>{t[r]?t[r]=It(t[r],i):t[r]=i})}),t}function gp({theme:e,classNames:t,props:n,stylesCtx:r}){const s=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||$O);return zO(s)}function Mh({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((s,c)=>typeof c=="function"?{...s,...c(e,n,r)}:{...s,...c},{})}const Rx=v.createContext(null);function Ji(){const e=v.useContext(Rx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function UO(){return Ji().cssVariablesResolver}function BO(){return Ji().classNamesPrefix}function vp(){return Ji().getStyleNonce}function VO(){return Ji().withStaticClasses}function FO(){return Ji().headless}function qO(){return Ji().stylesTransform?.sx}function HO(){return Ji().stylesTransform?.styles}function _R(){return Ji().env||"default"}function GO(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function WO(e){let t=e.replace("#","");if(t.length===3){const c=t.split("");t=[c[0],c[0],c[1],c[1],c[2],c[2]].join("")}if(t.length===8){const c=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:c}}const n=parseInt(t,16),r=n>>16&255,i=n>>8&255,s=n&255;return{r,g:i,b:s,a:1}}function QO(e){const[t,n,r,i]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function YO(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),i=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,d=(1-Math.abs(2*s-1))*i,f=r/60,p=d*(1-Math.abs(f%2-1)),m=s-d/2;let g,x,b;return f>=0&&f<1?(g=d,x=p,b=0):f>=1&&f<2?(g=p,x=d,b=0):f>=2&&f<3?(g=0,x=d,b=p):f>=3&&f<4?(g=0,x=p,b=d):f>=4&&f<5?(g=p,x=0,b=d):(g=d,x=0,b=p),{r:Math.round((g+m)*255),g:Math.round((x+m)*255),b:Math.round((b+m)*255),a:c||1}}function _x(e){return GO(e)?WO(e):e.startsWith("rgb")?QO(e):e.startsWith("hsl")?YO(e):{r:0,g:0,b:0,a:1}}function nh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:i,a:s}=_x(e),c=1-t,d=f=>Math.round(f*c);return`rgba(${d(n)}, ${d(r)}, ${d(i)}, ${s})`}function Xu(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function zv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function KO(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function XO(e){if(e.startsWith("oklch("))return(KO(e)||0)/100;const{r:t,g:n,b:r}=_x(e),i=t/255,s=n/255,c=r/255,d=zv(i),f=zv(s),p=zv(c);return .2126*d+.7152*f+.0722*p}function Ou(e,t=.179){return e.startsWith("var(")?!1:XO(e)>t}function go({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Ou(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Ou(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Ou(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,i]=e.split("."),s=i?Number(i):void 0,c=r in t.colors;if(c){const d=s!==void 0?t.colors[r][s]:t.colors[r][Xu(t,n||"light")];return{color:r,value:d,shade:s,isThemeColor:c,isLight:Ou(d,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:Ou(e,t.luminanceThreshold),shade:s,variable:void 0}}function Ft(e,t){const n=go({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Py(e,t){const n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=Ft(n.from,t),i=Ft(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function uo(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const s=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${s}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:i}=_x(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const Yl=uo,ZO=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{const s=go({color:e,theme:t}),c=typeof i=="boolean"?i:t.autoContrast;if(n==="filled"){const d=c&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:d,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:d,border:`${le(1)} solid transparent`}:{background:e,hover:nh(e,.1),color:d,border:`${le(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const d=t.colors[s.color][s.shade];return{background:uo(d,.1),hover:uo(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:uo(e,.1),hover:uo(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:uo(t.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:uo(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const d=t.colors[s.color][s.shade];return{background:"transparent",hover:uo(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:uo(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:nh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:nh(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:nh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:Py(r,t),hover:Py(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${le(1)} solid var(--mantine-color-default-border)`}:{}},JO={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},eC="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Dx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:JO,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:ZO,autoContrast:!1,luminanceThreshold:.3,fontFamily:eC,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:eC,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:le(34),lineHeight:"1.3"},h2:{fontSize:le(26),lineHeight:"1.35"},h3:{fontSize:le(22),lineHeight:"1.4"},h4:{fontSize:le(18),lineHeight:"1.45"},h5:{fontSize:le(16),lineHeight:"1.5"},h6:{fontSize:le(14),lineHeight:"1.5"}}},fontSizes:{xs:le(12),sm:le(14),md:le(16),lg:le(18),xl:le(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:le(2),sm:le(4),md:le(8),lg:le(16),xl:le(32)},spacing:{xs:le(10),sm:le(12),md:le(16),lg:le(20),xl:le(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), 0 ${le(1)} ${le(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(10)} ${le(15)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(7)} ${le(7)} ${le(-5)}`,md:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(20)} ${le(25)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(10)} ${le(10)} ${le(-5)}`,lg:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(28)} ${le(23)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(12)} ${le(12)} ${le(-7)}`,xl:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(36)} ${le(28)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(17)} ${le(17)} ${le(-7)}`},other:{},components:{}};function tC(e){return e==="auto"||e==="dark"||e==="light"}function e3({key:e="mantine-color-scheme-value"}={}){let t;return{get:n=>{if(typeof window>"u")return n;try{const r=window.localStorage.getItem(e);return tC(r)?r:n}catch{return n}},set:n=>{try{window.localStorage.setItem(e,n)}catch(r){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",r)}},subscribe:n=>{t=r=>{r.storageArea===window.localStorage&&r.key===e&&tC(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const t3="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",nC="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Uv(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function rC(e){if(!(e.primaryColor in e.colors))throw new Error(t3);if(typeof e.primaryShade=="object"&&(!Uv(e.primaryShade.dark)||!Uv(e.primaryShade.light)))throw new Error(nC);if(typeof e.primaryShade=="number"&&!Uv(e.primaryShade))throw new Error(nC)}function n3(e,t){if(!t)return rC(e),e;const n=jx(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),rC(n),n}const Ax=v.createContext(null),r3=()=>v.useContext(Ax)||Dx;function Sn(){const e=v.useContext(Ax);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function DR({theme:e,children:t,inherit:n=!0}){const r=r3(),i=v.useMemo(()=>n3(n?r:Dx,e),[e,r,n]);return a.jsx(Ax.Provider,{value:i,children:t})}DR.displayName="@mantine/core/MantineThemeProvider";function o3(){const e=Sn(),t=vp(),n=an(e.breakpoints).reduce((r,i)=>{const s=e.breakpoints[i].includes("px"),c=Qu(e.breakpoints[i]),d=s?`${c-.1}px`:Ph(c-.1),f=s?`${c}px`:Ph(c);return`${r}@media (max-width: ${d}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return a.jsx("style",{"data-mantine-styles":"classes",nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Bv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Mu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,i)=>`${i}{${r}}`,t)}function i3(e,t){const n=Bv(e.variables),r=n?Mu(t,n):"",i=Bv(e.dark),s=Bv(e.light),c=i?Mu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,i):"",d=s?Mu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${c}${d}`}function ea({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&go({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function oC(e,t){return ea({color:e.colors[e.primaryColor][Xu(e,t)],theme:e,autoContrast:null})}function rh({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n==="light"){const d=Xu(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${d===9?8:d+1})`,[`--mantine-color-${r}-light`]:Yl(e.colors[t][d],.1),[`--mantine-color-${r}-light-hover`]:Yl(e.colors[t][d],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline-hover`]:Yl(e.colors[t][d],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const s=Xu(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${s===9?8:s+1})`,[`--mantine-color-${r}-light`]:Yl(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:Yl(e.colors[t][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Yl(e.colors[t][Math.max(s-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}function a3(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Kl(e,t,n){an(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const AR=e=>{const t=Xu(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":oC(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":oC(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)"}};Kl(r.variables,e.breakpoints,"breakpoint"),Kl(r.variables,e.spacing,"spacing"),Kl(r.variables,e.fontSizes,"font-size"),Kl(r.variables,e.lineHeights,"line-height"),Kl(r.variables,e.shadows,"shadow"),Kl(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),an(e.colors).forEach(s=>{const c=e.colors[s];if(a3(c)){Object.assign(r.light,rh({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,rh({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((d,f)=>{r.variables[`--mantine-color-${s}-${f}`]=d}),Object.assign(r.light,rh({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,rh({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const i=e.headings.sizes;return an(i).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=i[s].fontSize,r.variables[`--mantine-${s}-line-height`]=i[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=i[s].fontWeight||e.headings.fontWeight}),r};function s3({theme:e,generator:t}){const n=AR(e),r=t?.(e);return r?jx(n,r):n}const Vv=AR(Dx);function l3(e){const t={variables:{},light:{},dark:{}};return an(e.variables).forEach(n=>{Vv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),an(e.light).forEach(n=>{Vv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),an(e.dark).forEach(n=>{Vv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function c3(e){return`
|
|
58
|
+
${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
|
|
59
|
+
${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
|
|
60
|
+
`}function PR({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=vp(),i=UO(),s=s3({theme:n,generator:i}),c=e===":root"&&t,d=c?l3(s):s,f=i3(d,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":c3(e)}`}}):null}PR.displayName="@mantine/CssVariables";function u3(){const e=console.error;console.error=(...t)=>{t.length>1&&typeof t[0]=="string"&&t[0].toLowerCase().includes("extra attributes from the server")&&typeof t[1]=="string"&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function Xl(e,t){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,r=e!=="auto"?e:n?"dark":"light";t()?.setAttribute("data-mantine-color-scheme",r)}function d3({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const i=v.useRef(null),[s,c]=v.useState(()=>e.get(t)),d=r||s,f=v.useCallback(m=>{r||(Xl(m,n),c(m),e.set(m))},[e.set,d,r]),p=v.useCallback(()=>{c(t),Xl(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Ec(()=>{Xl(e.get(t),n)},[]),v.useEffect(()=>{if(r)return Xl(r,n),()=>{};r===void 0&&Xl(s,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{s==="auto"&&Xl(g.matches?"dark":"light",n)};return i.current?.addEventListener("change",m),()=>i.current?.removeEventListener("change",m)},[s,r]),{colorScheme:d,setColorScheme:f,clearColorScheme:p}}function f3({respectReducedMotion:e,getRootElement:t}){Ec(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}u3();function kR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:s=!0,withCssVariables:c=!0,cssVariablesSelector:d=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=e3(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:x,forceColorScheme:b,stylesTransform:w,env:j}){const{colorScheme:C,setColorScheme:T,clearColorScheme:E}=d3({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return f3({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(Rx.Provider,{value:{colorScheme:C,setColorScheme:T,clearColorScheme:E,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:x,cssVariablesSelector:d,withStaticClasses:r,stylesTransform:w,env:j},children:a.jsxs(DR,{theme:e,children:[c&&a.jsx(PR,{cssVariablesSelector:d,deduplicateCssVariables:s}),i&&a.jsx(o3,{}),t]})})}kR.displayName="@mantine/core/MantineProvider";function Js({classNames:e,styles:t,props:n,stylesCtx:r}){const i=Sn();return{resolvedClassNames:gp({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Mh({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}const h3={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function p3({theme:e,options:t,unstyled:n}){return It(t?.focusable&&!n&&(e.focusClassName||h3[e.focusRing]),t?.active&&!n&&e.activeClassName)}function m3({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return gp({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function iC({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return gp({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function g3({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function v3({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function y3({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(i=>`${t}-${i}-${n}`)}function x3({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(s=>gp({theme:t,classNames:t.components[s]?.classNames,props:r,stylesCtx:i})?.[n])}function b3({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function S3({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:s,classes:c,unstyled:d,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:x,headless:b,transformedStyles:w}){return It(p3({theme:e,options:t,unstyled:d||b}),x3({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),b3({options:t,classes:c,selector:r,unstyled:d}),iC({selector:r,stylesCtx:g,theme:e,classNames:s,props:m}),iC({selector:r,stylesCtx:g,theme:e,classNames:w,props:m}),m3({selector:r,stylesCtx:g,options:t,props:m,theme:e}),g3({rootSelector:p,selector:r,className:f}),v3({selector:r,classes:c,unstyled:d||b}),x&&!b&&y3({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function w3({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(s=>Mh({theme:e,styles:e.components[s]?.styles,props:n,stylesCtx:r})[i]).reduce((s,c)=>({...s,...c}),{})}function ky({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...ky({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function j3(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Xa(n[r])}}),t),{})}function C3({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:s,themeName:c,headless:d}){return j3([d?{}:t?.(n,r,i),...c.map(f=>n.components?.[f]?.vars?.(n,r,i)),e?.(n,r,i)])?.[s]}function E3({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:s,rootSelector:c,styles:d,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:x}){return{...!x&&w3({theme:e,themeName:t,props:i,stylesCtx:s,selector:n}),...!x&&Mh({theme:e,styles:d,props:i,stylesCtx:s})[n],...!x&&Mh({theme:e,styles:r?.styles,props:r?.props||i,stylesCtx:s})[n],...C3({theme:e,props:i,stylesCtx:s,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?ky({style:f,theme:e}):null,...ky({style:r?.style,theme:e})}}function T3({props:e,stylesCtx:t,themeName:n}){const r=Sn(),i=HO()?.();return{getTransformedStyles:c=>i?[...c.map(f=>i(f,{props:e,theme:r,ctx:t})),...n.map(f=>i(r.components[f]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}function Me({name:e,classes:t,props:n,stylesCtx:r,className:i,style:s,rootSelector:c="root",unstyled:d,classNames:f,styles:p,vars:m,varsResolver:g}){const x=Sn(),b=BO(),w=VO(),j=FO(),C=(Array.isArray(e)?e:[e]).filter(R=>R),{withStylesTransform:T,getTransformedStyles:E}=T3({props:n,stylesCtx:r,themeName:C});return(R,_)=>({className:S3({theme:x,options:_,themeName:C,selector:R,classNamesPrefix:b,classNames:f,classes:t,unstyled:d,className:i,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:w,headless:j,transformedStyles:E([_?.styles,p])}),style:E3({theme:x,themeName:C,selector:R,options:_,props:n,stylesCtx:r,rootSelector:c,styles:p,style:s,vars:m,varsResolver:g,headless:j,withStylesTransform:T})})}function el(e,t){return typeof e=="boolean"?e:t.autoContrast}function aC(e){const t=document.createElement("style");return t.setAttribute("data-mantine-styles","inline"),t.innerHTML="*, *::before, *::after {transition: none !important;}",t.setAttribute("data-mantine-disable-transition","true"),e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(r=>r.remove())}function R3({keepTransitions:e}={}){const t=v.useRef(Nh),n=v.useRef(-1),r=v.useContext(Rx),i=vp(),s=v.useRef(i?.());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:aC(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},d=()=>{r.clearColorScheme(),t.current=e?()=>{}:aC(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=yO("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=v.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);return v.useEffect(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:d,toggleColorScheme:m}}function se(e,t,n){const r=Sn(),i=r.components[e]?.defaultProps,s=typeof i=="function"?i(r):i;return{...t,...s,...Xa(n)}}function Fv(e){return an(e).reduce((t,n)=>e[n]!==void 0?`${t}${iO(n)}:${e[n]};`:t,"").trim()}function _3({selector:e,styles:t,media:n,container:r}){const i=t?Fv(t):"",s=Array.isArray(n)?n.map(d=>`@media${d.query}{${e}{${Fv(d.styles)}}}`):[],c=Array.isArray(r)?r.map(d=>`@container ${d.query}{${e}{${Fv(d.styles)}}}`):[];return`${i?`${e}{${i}}`:""}${s.join("")}${c.join("")}`.trim()}function tl(e){const t=vp();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:_3(e)}})}function ta(e){const{m:t,mx:n,my:r,mt:i,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:x,pt:b,pb:w,pl:j,pr:C,pe:T,ps:E,bd:R,bg:_,c:P,opacity:A,ff:k,fz:I,fw:B,lts:q,ta:Z,lh:K,fs:Q,tt:V,td:W,w:O,miw:L,maw:$,h:H,mih:M,mah:F,bgsz:te,bgp:ae,bgr:je,bga:xe,pos:we,top:We,left:Ee,bottom:ot,right:tt,inset:Ct,display:Ot,flex:Mt,hiddenFrom:pt,visibleFrom:Rt,lightHidden:tn,darkHidden:Re,sx:Pe,...Ke}=e;return{styleProps:Xa({m:t,mx:n,my:r,mt:i,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:x,pt:b,pb:w,pl:j,pr:C,pe:T,ps:E,bd:R,bg:_,c:P,opacity:A,ff:k,fz:I,fw:B,lts:q,ta:Z,lh:K,fs:Q,tt:V,td:W,w:O,miw:L,maw:$,h:H,mih:M,mah:F,bgsz:te,bgp:ae,bgr:je,bga:xe,pos:we,top:We,left:Ee,bottom:ot,right:tt,inset:Ct,display:Ot,flex:Mt,hiddenFrom:pt,visibleFrom:Rt,lightHidden:tn,darkHidden:Re,sx:Pe}),rest:Ke}}const D3={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function Px(e,t){const n=go({color:e,theme:t});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function A3(e,t){const n=go({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Px(e,t)}function P3(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...i]=e.split(" ").filter(c=>c.trim()!=="");let s=`${le(n)}`;return r&&(s+=` ${r}`),i.length>0&&(s+=` ${Px(i.join(" "),t)}`),s.trim()}return e}const sC={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function k3(e){return typeof e=="string"&&e in sC?sC[e]:e}const N3=["h1","h2","h3","h4","h5","h6"];function O3(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&N3.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function M3(e){return e}const I3=["h1","h2","h3","h4","h5","h6"];function L3(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&I3.includes(e)?`var(--mantine-${e}-line-height)`:e}function $3(e){return typeof e=="number"?le(e):e}function z3(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return le(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const qv={color:Px,textColor:A3,fontSize:O3,spacing:z3,identity:M3,size:$3,lineHeight:L3,fontFamily:k3,border:P3};function lC(e){return e.replace("(min-width: ","").replace("em)","")}function U3({media:e,...t}){const r=Object.keys(e).sort((i,s)=>Number(lC(i))-Number(lC(s))).map(i=>({query:i,styles:e[i]}));return{...t,media:r}}function B3(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function V3(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function F3(e){return typeof e=="object"&&e!==null?an(e).filter(t=>t!=="base"):[]}function q3(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function NR({styleProps:e,data:t,theme:n}){return U3(an(e).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const s=t[i],c=Array.isArray(s.property)?s.property:[s.property],d=V3(e[i]);if(!B3(e[i]))return c.forEach(p=>{r.inlineStyles[p]=qv[s.type](d,n)}),r;r.hasResponsiveStyles=!0;const f=F3(e[i]);return c.forEach(p=>{d&&(r.styles[p]=qv[s.type](d,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:qv[s.type](q3(e[i],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function fd(){return`__m__-${v.useId().replace(/:/g,"")}`}function OR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...OR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function MR(e){return e.startsWith("data-")?e:`data-${e}`}function H3(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[MR(n)]=e[n]),t},{})}function IR(e){return e?typeof e=="string"?{[MR(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...IR(n)}),{}):H3(e):null}function Ny(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Ny(r,t)}),{}):typeof e=="function"?e(t):e??{}}function G3({theme:e,style:t,vars:n,styleProps:r}){const i=Ny(t,e),s=Ny(n,e);return{...i,...s,...r}}const LR=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:i,mod:s,size:c,hiddenFrom:d,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:x,...b},w)=>{const j=Sn(),C=e||"div",{styleProps:T,rest:E}=ta(b),_=qO()?.()?.(T.sx),P=fd(),A=NR({styleProps:T,theme:j,data:D3}),k={ref:w,style:G3({theme:j,style:t,vars:n,styleProps:A.inlineStyles}),className:It(r,_,{[P]:A.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${d}`]:d,[`mantine-visible-from-${f}`]:f}),"data-variant":i,"data-size":gR(c)?void 0:c||void 0,size:x,...IR(s),...E};return a.jsxs(a.Fragment,{children:[A.hasResponsiveStyles&&a.jsx(tl,{selector:`.${P}`,styles:A.styles,media:A.media}),typeof g=="function"?g(k):a.jsx(C,{...k})]})});LR.displayName="@mantine/core/Box";const ce=LR;function $R(e){return e}function W3(e){const t=e;return n=>{const r=v.forwardRef((i,s)=>a.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ge(e){const t=v.forwardRef(e);return t.extend=$R,t.withProps=n=>{const r=v.forwardRef((i,s)=>a.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function lr(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((i,s)=>a.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=$R,t}const Q3=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function nl(){return v.useContext(Q3)}var Hv={exports:{}},nr={};/**
|
|
61
|
+
* @license React
|
|
62
|
+
* react-dom.production.js
|
|
63
|
+
*
|
|
64
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the MIT license found in the
|
|
67
|
+
* LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/var cC;function Y3(){if(cC)return nr;cC=1;var e=wx();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,nr.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return s(f,p,null,m)},nr.flushSync=function(f){var p=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=m,r.d.f()}},nr.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(f,p))},nr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},nr.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},nr.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=d(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},nr.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},nr.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=d(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},nr.requestFormReset=function(f){r.d.r(f)},nr.unstable_batchedUpdates=function(f,p){return f(p)},nr.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},nr.useFormStatus=function(){return c.H.useHostTransitionStatus()},nr.version="19.1.1",nr}var uC;function zR(){if(uC)return Hv.exports;uC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hv.exports=Y3(),Hv.exports}var kx=zR();const Fu=Sx(kx);function yp(){return typeof window<"u"}function Tc(e){return UR(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fi(e){var t;return(t=(UR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function UR(e){return yp()?e instanceof Node||e instanceof Dr(e).Node:!1}function pn(e){return yp()?e instanceof Element||e instanceof Dr(e).Element:!1}function Wr(e){return yp()?e instanceof HTMLElement||e instanceof Dr(e).HTMLElement:!1}function Oy(e){return!yp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}const K3=new Set(["inline","contents"]);function hd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=vo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!K3.has(i)}const X3=new Set(["table","td","th"]);function Z3(e){return X3.has(Tc(e))}const J3=[":popover-open",":modal"];function xp(e){return J3.some(t=>{try{return e.matches(t)}catch{return!1}})}const eM=["transform","translate","scale","rotate","perspective"],tM=["transform","translate","scale","rotate","perspective","filter"],nM=["paint","layout","strict","content"];function Nx(e){const t=bp(),n=pn(e)?vo(e):e;return eM.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||tM.some(r=>(n.willChange||"").includes(r))||nM.some(r=>(n.contain||"").includes(r))}function rM(e){let t=Gi(e);for(;Wr(t)&&!Wa(t);){if(Nx(t))return t;if(xp(t))return null;t=Gi(t)}return null}function bp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const oM=new Set(["html","body","#document"]);function Wa(e){return oM.has(Tc(e))}function vo(e){return Dr(e).getComputedStyle(e)}function Sp(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gi(e){if(Tc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oy(e)&&e.host||fi(e);return Oy(t)?t.host:t}function BR(e){const t=Gi(e);return Wa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wr(t)&&hd(t)?t:BR(t)}function qi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=BR(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),c=Dr(i);if(s){const d=My(c);return t.concat(c,c.visualViewport||[],hd(i)?i:[],d&&n?qi(d):[])}return t.concat(i,qi(i,[],n))}function My(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dC(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Zu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Oy(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function VR(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function FR(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function iM(e){return lM()?!1:!fC()&&e.width===0&&e.height===0||fC()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function aM(){return/apple/i.test(navigator.vendor)}function fC(){const e=/android/i;return e.test(VR())||e.test(FR())}function sM(){return VR().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function lM(){return FR().includes("jsdom/")}function Iy(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function cM(e){return"nativeEvent"in e}function uM(e){return e.matches("html,body")}function Ps(e){return e?.ownerDocument||document}function Gv(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function oc(e){return"composedPath"in e?e.composedPath()[0]:e.target}const dM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fM(e){return Wr(e)&&e.matches(dM)}const Mo=Math.min,or=Math.max,Ih=Math.round,oh=Math.floor,ni=e=>({x:e,y:e}),hM={left:"right",right:"left",bottom:"top",top:"bottom"},pM={start:"end",end:"start"};function Ly(e,t,n){return or(e,Mo(t,n))}function Wi(e,t){return typeof e=="function"?e(t):e}function Io(e){return e.split("-")[0]}function Rc(e){return e.split("-")[1]}function Ox(e){return e==="x"?"y":"x"}function Mx(e){return e==="y"?"height":"width"}const mM=new Set(["top","bottom"]);function ko(e){return mM.has(Io(e))?"y":"x"}function Ix(e){return Ox(ko(e))}function gM(e,t,n){n===void 0&&(n=!1);const r=Rc(e),i=Ix(e),s=Mx(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Lh(c)),[c,Lh(c)]}function vM(e){const t=Lh(e);return[$y(e),t,$y(t)]}function $y(e){return e.replace(/start|end/g,t=>pM[t])}const hC=["left","right"],pC=["right","left"],yM=["top","bottom"],xM=["bottom","top"];function bM(e,t,n){switch(e){case"top":case"bottom":return n?t?pC:hC:t?hC:pC;case"left":case"right":return t?yM:xM;default:return[]}}function SM(e,t,n,r){const i=Rc(e);let s=bM(Io(e),n==="start",r);return i&&(s=s.map(c=>c+"-"+i),t&&(s=s.concat(s.map($y)))),s}function Lh(e){return e.replace(/left|right|bottom|top/g,t=>hM[t])}function wM(e){return{top:0,right:0,bottom:0,left:0,...e}}function Lx(e){return typeof e!="number"?wM(e):{top:e,right:e,bottom:e,left:e}}function pc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function mC(e,t,n){let{reference:r,floating:i}=e;const s=ko(t),c=Ix(t),d=Mx(c),f=Io(t),p=s==="y",m=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,x=r[d]/2-i[d]/2;let b;switch(f){case"top":b={x:m,y:r.y-i.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-i.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Rc(t)){case"start":b[c]-=x*(n&&p?-1:1);break;case"end":b[c]+=x*(n&&p?-1:1);break}return b}const jM=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:c}=n,d=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:g}=mC(p,r,f),x=r,b={},w=0;for(let j=0;j<d.length;j++){const{name:C,fn:T}=d[j],{x:E,y:R,data:_,reset:P}=await T({x:m,y:g,initialPlacement:r,placement:x,strategy:i,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=E??m,g=R??g,b={...b,[C]:{...b[C],..._}},P&&w<=50&&(w++,typeof P=="object"&&(P.placement&&(x=P.placement),P.rects&&(p=P.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:m,y:g}=mC(p,x,f)),j=-1)}return{x:m,y:g,placement:x,strategy:i,middlewareData:b}};async function $x(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:c,elements:d,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:x=!1,padding:b=0}=Wi(t,e),w=Lx(b),C=d[x?g==="floating"?"reference":"floating":g],T=pc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(C)))==null||n?C:C.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(d.floating)),boundary:p,rootBoundary:m,strategy:f})),E=g==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d.floating)),_=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},P=pc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:R,strategy:f}):E);return{top:(T.top-P.top+w.top)/_.y,bottom:(P.bottom-T.bottom+w.bottom)/_.y,left:(T.left-P.left+w.left)/_.x,right:(P.right-T.right+w.right)/_.x}}const CM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:c,elements:d,middlewareData:f}=t,{element:p,padding:m=0}=Wi(e,t)||{};if(p==null)return{};const g=Lx(m),x={x:n,y:r},b=Ix(i),w=Mx(b),j=await c.getDimensions(p),C=b==="y",T=C?"top":"left",E=C?"bottom":"right",R=C?"clientHeight":"clientWidth",_=s.reference[w]+s.reference[b]-x[b]-s.floating[w],P=x[b]-s.reference[b],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let k=A?A[R]:0;(!k||!await(c.isElement==null?void 0:c.isElement(A)))&&(k=d.floating[R]||s.floating[w]);const I=_/2-P/2,B=k/2-j[w]/2-1,q=Mo(g[T],B),Z=Mo(g[E],B),K=q,Q=k-j[w]-Z,V=k/2-j[w]/2+I,W=Ly(K,V,Q),O=!f.arrow&&Rc(i)!=null&&V!==W&&s.reference[w]/2-(V<K?q:Z)-j[w]/2<0,L=O?V<K?V-K:V-Q:0;return{[b]:x[b]+L,data:{[b]:W,centerOffset:V-W-L,...O&&{alignmentOffset:L}},reset:O}}}),EM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:c,initialPlacement:d,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:j=!0,...C}=Wi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=Io(i),E=ko(d),R=Io(d)===d,_=await(f.isRTL==null?void 0:f.isRTL(p.floating)),P=x||(R||!j?[Lh(d)]:vM(d)),A=w!=="none";!x&&A&&P.push(...SM(d,j,w,_));const k=[d,...P],I=await $x(t,C),B=[];let q=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&B.push(I[T]),g){const V=gM(i,c,_);B.push(I[V[0]],I[V[1]])}if(q=[...q,{placement:i,overflows:B}],!B.every(V=>V<=0)){var Z,K;const V=(((Z=s.flip)==null?void 0:Z.index)||0)+1,W=k[V];if(W&&(!(g==="alignment"?E!==ko(W):!1)||q.every($=>ko($.placement)===E?$.overflows[0]>0:!0)))return{data:{index:V,overflows:q},reset:{placement:W}};let O=(K=q.filter(L=>L.overflows[0]<=0).sort((L,$)=>L.overflows[1]-$.overflows[1])[0])==null?void 0:K.placement;if(!O)switch(b){case"bestFit":{var Q;const L=(Q=q.filter($=>{if(A){const H=ko($.placement);return H===E||H==="y"}return!0}).map($=>[$.placement,$.overflows.filter(H=>H>0).reduce((H,M)=>H+M,0)]).sort(($,H)=>$[1]-H[1])[0])==null?void 0:Q[0];L&&(O=L);break}case"initialPlacement":O=d;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function qR(e){const t=Mo(...e.map(s=>s.left)),n=Mo(...e.map(s=>s.top)),r=or(...e.map(s=>s.right)),i=or(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:i-n}}function TM(e){const t=e.slice().sort((i,s)=>i.y-s.y),n=[];let r=null;for(let i=0;i<t.length;i++){const s=t[i];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(i=>pc(qR(i)))}const RM=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:s,strategy:c}=t,{padding:d=2,x:f,y:p}=Wi(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),g=TM(m),x=pc(qR(m)),b=Lx(d);function w(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&p>C.top-b.top&&p<C.bottom+b.bottom)||x;if(g.length>=2){if(ko(n)==="y"){const q=g[0],Z=g[g.length-1],K=Io(n)==="top",Q=q.top,V=Z.bottom,W=K?q.left:Z.left,O=K?q.right:Z.right,L=O-W,$=V-Q;return{top:Q,bottom:V,left:W,right:O,width:L,height:$,x:W,y:Q}}const C=Io(n)==="left",T=or(...g.map(q=>q.right)),E=Mo(...g.map(q=>q.left)),R=g.filter(q=>C?q.left===E:q.right===T),_=R[0].top,P=R[R.length-1].bottom,A=E,k=T,I=k-A,B=P-_;return{top:_,bottom:P,left:A,right:k,width:I,height:B,x:A,y:_}}return x}const j=await s.getElementRects({reference:{getBoundingClientRect:w},floating:r.floating,strategy:c});return i.reference.x!==j.reference.x||i.reference.y!==j.reference.y||i.reference.width!==j.reference.width||i.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}},HR=new Set(["left","top"]);async function _M(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Io(n),d=Rc(n),f=ko(n)==="y",p=HR.has(c)?-1:1,m=s&&f?-1:1,g=Wi(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof w=="number"&&(b=d==="end"?w*-1:w),f?{x:b*m,y:x*p}:{x:x*p,y:b*m}}const DM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:c,middlewareData:d}=t,f=await _M(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:c}}}}},AM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:T,y:E}=C;return{x:T,y:E}}},...f}=Wi(e,t),p={x:n,y:r},m=await $x(t,f),g=ko(Io(i)),x=Ox(g);let b=p[x],w=p[g];if(s){const C=x==="y"?"top":"left",T=x==="y"?"bottom":"right",E=b+m[C],R=b-m[T];b=Ly(E,b,R)}if(c){const C=g==="y"?"top":"left",T=g==="y"?"bottom":"right",E=w+m[C],R=w-m[T];w=Ly(E,w,R)}const j=d.fn({...t,[x]:b,[g]:w});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[x]:s,[g]:c}}}}}},PM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=Wi(e,t),m={x:n,y:r},g=ko(i),x=Ox(g);let b=m[x],w=m[g];const j=Wi(d,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const R=x==="y"?"height":"width",_=s.reference[x]-s.floating[R]+C.mainAxis,P=s.reference[x]+s.reference[R]-C.mainAxis;b<_?b=_:b>P&&(b=P)}if(p){var T,E;const R=x==="y"?"width":"height",_=HR.has(Io(i)),P=s.reference[g]-s.floating[R]+(_&&((T=c.offset)==null?void 0:T[g])||0)+(_?0:C.crossAxis),A=s.reference[g]+s.reference[R]+(_?0:((E=c.offset)==null?void 0:E[g])||0)-(_?C.crossAxis:0);w<P?w=P:w>A&&(w=A)}return{[x]:b,[g]:w}}}},kM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:c,elements:d}=t,{apply:f=()=>{},...p}=Wi(e,t),m=await $x(t,p),g=Io(i),x=Rc(i),b=ko(i)==="y",{width:w,height:j}=s.floating;let C,T;g==="top"||g==="bottom"?(C=g,T=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(T=g,C=x==="end"?"top":"bottom");const E=j-m.top-m.bottom,R=w-m.left-m.right,_=Mo(j-m[C],E),P=Mo(w-m[T],R),A=!t.middlewareData.shift;let k=_,I=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=E),A&&!x){const q=or(m.left,0),Z=or(m.right,0),K=or(m.top,0),Q=or(m.bottom,0);b?I=w-2*(q!==0||Z!==0?q+Z:or(m.left,m.right)):k=j-2*(K!==0||Q!==0?K+Q:or(m.top,m.bottom))}await f({...t,availableWidth:I,availableHeight:k});const B=await c.getDimensions(d.floating);return w!==B.width||j!==B.height?{reset:{rects:!0}}:{}}}};function GR(e){const t=vo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Wr(e),s=i?e.offsetWidth:n,c=i?e.offsetHeight:r,d=Ih(n)!==s||Ih(r)!==c;return d&&(n=s,r=c),{width:n,height:r,$:d}}function zx(e){return pn(e)?e:e.contextElement}function lc(e){const t=zx(e);if(!Wr(t))return ni(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=GR(t);let c=(s?Ih(n.width):n.width)/r,d=(s?Ih(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const NM=ni(0);function WR(e){const t=Dr(e);return!bp()||!t.visualViewport?NM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function Us(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=zx(e);let c=ni(1);t&&(r?pn(r)&&(c=lc(r)):c=lc(e));const d=OM(s,n,r)?WR(s):ni(0);let f=(i.left+d.x)/c.x,p=(i.top+d.y)/c.y,m=i.width/c.x,g=i.height/c.y;if(s){const x=Dr(s),b=r&&pn(r)?Dr(r):r;let w=x,j=My(w);for(;j&&r&&b!==w;){const C=lc(j),T=j.getBoundingClientRect(),E=vo(j),R=T.left+(j.clientLeft+parseFloat(E.paddingLeft))*C.x,_=T.top+(j.clientTop+parseFloat(E.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=R,p+=_,w=Dr(j),j=My(w)}}return pc({width:m,height:g,x:f,y:p})}function wp(e,t){const n=Sp(e).scrollLeft;return t?t.left+n:Us(fi(e)).left+n}function QR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function MM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",c=fi(r),d=t?xp(t.floating):!1;if(r===c||d&&s)return n;let f={scrollLeft:0,scrollTop:0},p=ni(1);const m=ni(0),g=Wr(r);if((g||!g&&!s)&&((Tc(r)!=="body"||hd(c))&&(f=Sp(r)),Wr(r))){const b=Us(r);p=lc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const x=c&&!g&&!s?QR(c,f):ni(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-f.scrollLeft*p.x+m.x+x.x,y:n.y*p.y-f.scrollTop*p.y+m.y+x.y}}function IM(e){return Array.from(e.getClientRects())}function LM(e){const t=fi(e),n=Sp(e),r=e.ownerDocument.body,i=or(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=or(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+wp(e);const d=-n.scrollTop;return vo(r).direction==="rtl"&&(c+=or(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:c,y:d}}const gC=25;function $M(e,t){const n=Dr(e),r=fi(e),i=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,d=0,f=0;if(i){s=i.width,c=i.height;const m=bp();(!m||m&&t==="fixed")&&(d=i.offsetLeft,f=i.offsetTop)}const p=wp(r);if(p<=0){const m=r.ownerDocument,g=m.body,x=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(r.clientWidth-g.clientWidth-b);w<=gC&&(s-=w)}else p<=gC&&(s+=p);return{width:s,height:c,x:d,y:f}}const zM=new Set(["absolute","fixed"]);function UM(e,t){const n=Us(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Wr(e)?lc(e):ni(1),c=e.clientWidth*s.x,d=e.clientHeight*s.y,f=i*s.x,p=r*s.y;return{width:c,height:d,x:f,y:p}}function vC(e,t,n){let r;if(t==="viewport")r=$M(e,n);else if(t==="document")r=LM(fi(e));else if(pn(t))r=UM(t,n);else{const i=WR(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return pc(r)}function YR(e,t){const n=Gi(e);return n===t||!pn(n)||Wa(n)?!1:vo(n).position==="fixed"||YR(n,t)}function BM(e,t){const n=t.get(e);if(n)return n;let r=qi(e,[],!1).filter(d=>pn(d)&&Tc(d)!=="body"),i=null;const s=vo(e).position==="fixed";let c=s?Gi(e):e;for(;pn(c)&&!Wa(c);){const d=vo(c),f=Nx(c);!f&&d.position==="fixed"&&(i=null),(s?!f&&!i:!f&&d.position==="static"&&!!i&&zM.has(i.position)||hd(c)&&!f&&YR(e,c))?r=r.filter(m=>m!==c):i=d,c=Gi(c)}return t.set(e,r),r}function VM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const c=[...n==="clippingAncestors"?xp(t)?[]:BM(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((p,m)=>{const g=vC(t,m,i);return p.top=or(g.top,p.top),p.right=Mo(g.right,p.right),p.bottom=Mo(g.bottom,p.bottom),p.left=or(g.left,p.left),p},vC(t,d,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function FM(e){const{width:t,height:n}=GR(e);return{width:t,height:n}}function qM(e,t,n){const r=Wr(t),i=fi(t),s=n==="fixed",c=Us(e,!0,s,t);let d={scrollLeft:0,scrollTop:0};const f=ni(0);function p(){f.x=wp(i)}if(r||!r&&!s)if((Tc(t)!=="body"||hd(i))&&(d=Sp(t)),r){const b=Us(t,!0,s,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else i&&p();s&&!r&&i&&p();const m=i&&!r&&!s?QR(i,d):ni(0),g=c.left+d.scrollLeft-f.x-m.x,x=c.top+d.scrollTop-f.y-m.y;return{x:g,y:x,width:c.width,height:c.height}}function Wv(e){return vo(e).position==="static"}function yC(e,t){if(!Wr(e)||vo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return fi(e)===n&&(n=n.ownerDocument.body),n}function KR(e,t){const n=Dr(e);if(xp(e))return n;if(!Wr(e)){let i=Gi(e);for(;i&&!Wa(i);){if(pn(i)&&!Wv(i))return i;i=Gi(i)}return n}let r=yC(e,t);for(;r&&Z3(r)&&Wv(r);)r=yC(r,t);return r&&Wa(r)&&Wv(r)&&!Nx(r)?n:r||rM(e)||n}const HM=async function(e){const t=this.getOffsetParent||KR,n=this.getDimensions,r=await n(e.floating);return{reference:qM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GM(e){return vo(e).direction==="rtl"}const WM={convertOffsetParentRelativeRectToViewportRelativeRect:MM,getDocumentElement:fi,getClippingRect:VM,getOffsetParent:KR,getElementRects:HM,getClientRects:IM,getDimensions:FM,getScale:lc,isElement:pn,isRTL:GM};function XR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QM(e,t){let n=null,r;const i=fi(e);function s(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),s();const p=e.getBoundingClientRect(),{left:m,top:g,width:x,height:b}=p;if(d||t(),!x||!b)return;const w=oh(g),j=oh(i.clientWidth-(m+x)),C=oh(i.clientHeight-(g+b)),T=oh(m),R={rootMargin:-w+"px "+-j+"px "+-C+"px "+-T+"px",threshold:or(0,Mo(1,f))||1};let _=!0;function P(A){const k=A[0].intersectionRatio;if(k!==f){if(!_)return c();k?c(!1,k):r=setTimeout(()=>{c(!1,1e-7)},1e3)}k===1&&!XR(p,e.getBoundingClientRect())&&c(),_=!1}try{n=new IntersectionObserver(P,{...R,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,R)}n.observe(e)}return c(!0),s}function YM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=zx(e),m=i||s?[...p?qi(p):[],...qi(t)]:[];m.forEach(T=>{i&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const g=p&&d?QM(p,n):null;let x=-1,b=null;c&&(b=new ResizeObserver(T=>{let[E]=T;E&&E.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let w,j=f?Us(e):null;f&&C();function C(){const T=Us(e);j&&!XR(j,T)&&n(),j=T,w=requestAnimationFrame(C)}return n(),()=>{var T;m.forEach(E=>{i&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),g?.(),(T=b)==null||T.disconnect(),b=null,f&&cancelAnimationFrame(w)}}const KM=DM,XM=AM,ZM=EM,JM=kM,xC=CM,e9=RM,t9=PM,n9=(e,t,n)=>{const r=new Map,i={platform:WM,...n},s={...i.platform,_c:r};return jM(e,t,{...i,platform:s})};var r9=typeof document<"u",o9=function(){},Sh=r9?v.useLayoutEffect:o9;function $h(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$h(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!$h(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ZR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bC(e,t){const n=ZR(e);return Math.round(t*n)/n}function Qv(e){const t=v.useRef(e);return Sh(()=>{t.current=e}),t}function i9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:c}={},transform:d=!0,whileElementsMounted:f,open:p}=e,[m,g]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=v.useState(r);$h(x,r)||b(r);const[w,j]=v.useState(null),[C,T]=v.useState(null),E=v.useCallback($=>{$!==A.current&&(A.current=$,j($))},[]),R=v.useCallback($=>{$!==k.current&&(k.current=$,T($))},[]),_=s||w,P=c||C,A=v.useRef(null),k=v.useRef(null),I=v.useRef(m),B=f!=null,q=Qv(f),Z=Qv(i),K=Qv(p),Q=v.useCallback(()=>{if(!A.current||!k.current)return;const $={placement:t,strategy:n,middleware:x};Z.current&&($.platform=Z.current),n9(A.current,k.current,$).then(H=>{const M={...H,isPositioned:K.current!==!1};V.current&&!$h(I.current,M)&&(I.current=M,kx.flushSync(()=>{g(M)}))})},[x,t,n,Z,K]);Sh(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[p]);const V=v.useRef(!1);Sh(()=>(V.current=!0,()=>{V.current=!1}),[]),Sh(()=>{if(_&&(A.current=_),P&&(k.current=P),_&&P){if(q.current)return q.current(_,P,Q);Q()}},[_,P,Q,q,B]);const W=v.useMemo(()=>({reference:A,floating:k,setReference:E,setFloating:R}),[E,R]),O=v.useMemo(()=>({reference:_,floating:P}),[_,P]),L=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!O.floating)return $;const H=bC(O.floating,m.x),M=bC(O.floating,m.y);return d?{...$,transform:"translate("+H+"px, "+M+"px)",...ZR(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:M}},[n,d,O.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:Q,refs:W,elements:O,floatingStyles:L}),[m,Q,W,O,L])}const a9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?xC({element:r.current,padding:i}).fn(n):{}:r?xC({element:r,padding:i}).fn(n):{}}}},JR=(e,t)=>({...KM(e),options:[e,t]}),Ux=(e,t)=>({...XM(e),options:[e,t]}),SC=(e,t)=>({...t9(e),options:[e,t]}),zh=(e,t)=>({...ZM(e),options:[e,t]}),s9=(e,t)=>({...JM(e),options:[e,t]}),Gu=(e,t)=>({...e9(e),options:[e,t]}),e2=(e,t)=>({...a9(e),options:[e,t]});function l9(e){return v.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const t2={...j4},c9=t2.useInsertionEffect,u9=c9||(e=>e());function Fi(e){const t=v.useRef(()=>{});return u9(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var ri=typeof document<"u"?v.useLayoutEffect:v.useEffect;let wC=!1,d9=0;const jC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+d9++;function f9(){const[e,t]=v.useState(()=>wC?jC():void 0);return ri(()=>{e==null&&t(jC())},[]),v.useEffect(()=>{wC=!0},[]),e}const h9=t2.useId,n2=h9||f9;function p9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const m9=v.createContext(null),g9=v.createContext(null),Bx=()=>{var e;return((e=v.useContext(m9))==null?void 0:e.id)||null},Vx=()=>v.useContext(g9);function Fx(e){return"data-floating-ui-"+e}function Yv(e){const t=v.useRef(e);return ri(()=>{t.current=e}),t}const CC=Fx("safe-polygon");function wh(e,t,n){return n&&!Iy(n)?0:typeof e=="number"?e:e?.[t]}function v9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:c}=e,{enabled:d=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:x=!0}=t,b=Vx(),w=Bx(),j=Yv(p),C=Yv(f),T=Yv(n),E=v.useRef(),R=v.useRef(-1),_=v.useRef(),P=v.useRef(-1),A=v.useRef(!0),k=v.useRef(!1),I=v.useRef(()=>{}),B=v.useRef(!1),q=v.useCallback(()=>{var L;const $=(L=i.current.openEvent)==null?void 0:L.type;return $?.includes("mouse")&&$!=="mousedown"},[i]);v.useEffect(()=>{if(!d)return;function L($){let{open:H}=$;H||(clearTimeout(R.current),clearTimeout(P.current),A.current=!0,B.current=!1)}return s.on("openchange",L),()=>{s.off("openchange",L)}},[d,s]),v.useEffect(()=>{if(!d||!j.current||!n)return;function L(H){q()&&r(!1,H,"hover")}const $=Ps(c.floating).documentElement;return $.addEventListener("mouseleave",L),()=>{$.removeEventListener("mouseleave",L)}},[c.floating,n,r,d,j,q]);const Z=v.useCallback(function(L,$,H){$===void 0&&($=!0),H===void 0&&(H="hover");const M=wh(C.current,"close",E.current);M&&!_.current?(clearTimeout(R.current),R.current=window.setTimeout(()=>r(!1,L,H),M)):$&&(clearTimeout(R.current),r(!1,L,H))},[C,r]),K=Fi(()=>{I.current(),_.current=void 0}),Q=Fi(()=>{if(k.current){const L=Ps(c.floating).body;L.style.pointerEvents="",L.removeAttribute(CC),k.current=!1}}),V=Fi(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);v.useEffect(()=>{if(!d)return;function L(F){if(clearTimeout(R.current),A.current=!1,m&&!Iy(E.current)||g>0&&!wh(C.current,"open"))return;const te=wh(C.current,"open",E.current);te?R.current=window.setTimeout(()=>{T.current||r(!0,F,"hover")},te):n||r(!0,F,"hover")}function $(F){if(V())return;I.current();const te=Ps(c.floating);if(clearTimeout(P.current),B.current=!1,j.current&&i.current.floatingContext){n||clearTimeout(R.current),_.current=j.current({...i.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){Q(),K(),V()||Z(F,!0,"safe-polygon")}});const je=_.current;te.addEventListener("mousemove",je),I.current=()=>{te.removeEventListener("mousemove",je)};return}(E.current==="touch"?!Zu(c.floating,F.relatedTarget):!0)&&Z(F)}function H(F){V()||i.current.floatingContext&&(j.current==null||j.current({...i.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){Q(),K(),V()||Z(F)}})(F))}if(pn(c.domReference)){var M;const F=c.domReference;return n&&F.addEventListener("mouseleave",H),(M=c.floating)==null||M.addEventListener("mouseleave",H),x&&F.addEventListener("mousemove",L,{once:!0}),F.addEventListener("mouseenter",L),F.addEventListener("mouseleave",$),()=>{var te;n&&F.removeEventListener("mouseleave",H),(te=c.floating)==null||te.removeEventListener("mouseleave",H),x&&F.removeEventListener("mousemove",L),F.removeEventListener("mouseenter",L),F.removeEventListener("mouseleave",$)}}},[c,d,e,m,g,x,Z,K,Q,r,n,T,b,C,j,i,V]),ri(()=>{var L;if(d&&n&&(L=j.current)!=null&&L.__options.blockPointerEvents&&q()){k.current=!0;const H=c.floating;if(pn(c.domReference)&&H){var $;const M=Ps(c.floating).body;M.setAttribute(CC,"");const F=c.domReference,te=b==null||($=b.nodesRef.current.find(ae=>ae.id===w))==null||($=$.context)==null?void 0:$.elements.floating;return te&&(te.style.pointerEvents=""),M.style.pointerEvents="none",F.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{M.style.pointerEvents="",F.style.pointerEvents="",H.style.pointerEvents=""}}}},[d,n,w,c,b,j,q]),ri(()=>{n||(E.current=void 0,B.current=!1,K(),Q())},[n,K,Q]),v.useEffect(()=>()=>{K(),clearTimeout(R.current),clearTimeout(P.current),Q()},[d,c.domReference,K,Q]);const W=v.useMemo(()=>{function L($){E.current=$.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove($){const{nativeEvent:H}=$;function M(){!A.current&&!T.current&&r(!0,H,"hover")}m&&!Iy(E.current)||n||g===0||B.current&&$.movementX**2+$.movementY**2<2||(clearTimeout(P.current),E.current==="touch"?M():(B.current=!0,P.current=window.setTimeout(M,g)))}}},[m,r,n,T,g]),O=v.useMemo(()=>({onMouseEnter(){clearTimeout(R.current)},onMouseLeave(L){V()||Z(L.nativeEvent,!1)}}),[Z,V]);return v.useMemo(()=>d?{reference:W,floating:O}:{},[d,W,O])}const zy=()=>{},r2=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:zy,setState:zy,isInstantPhase:!1}),y9=()=>v.useContext(r2);function x9(e){const{children:t,delay:n,timeoutMs:r=0}=e,[i,s]=v.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),d=v.useCallback(f=>{s({currentId:f})},[]);return ri(()=>{i.currentId?c.current===null?c.current=i.currentId:i.isInstantPhase||s({isInstantPhase:!0}):(i.isInstantPhase&&s({isInstantPhase:!1}),c.current=null)},[i.currentId,i.isInstantPhase]),v.createElement(r2.Provider,{value:v.useMemo(()=>({...i,setState:s,setCurrentId:d}),[i,d])},t)}function b9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:i}=e,{id:s,enabled:c=!0}=t,d=s??i,f=y9(),{currentId:p,setCurrentId:m,initialDelay:g,setState:x,timeoutMs:b}=f;return ri(()=>{c&&p&&(x({delay:{open:1,close:wh(g,"close")}}),p!==d&&r(!1))},[c,d,r,x,p,g]),ri(()=>{function w(){r(!1),x({delay:g,currentId:null})}if(c&&p&&!n&&p===d){if(b){const j=window.setTimeout(w,b);return()=>{clearTimeout(j)}}w()}},[c,n,x,p,d,r,g,b]),ri(()=>{c&&(m===zy||!n||m(d))},[c,n,m,d]),f}function Kv(e,t){let n=e.filter(i=>{var s;return i.parentId===t&&((s=i.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(i=>{var s;return(s=r)==null?void 0:s.some(c=>{var d;return i.parentId===c.id&&((d=i.context)==null?void 0:d.open)})}),n=n.concat(r);return n}const S9="data-floating-ui-focusable",w9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},j9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},EC=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function C9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:x=!1,bubbles:b,capture:w}=t,j=Vx(),C=Fi(typeof f=="function"?f:()=>!1),T=typeof f=="function"?C:f,E=v.useRef(!1),R=v.useRef(!1),{escapeKey:_,outsidePress:P}=EC(b),{escapeKey:A,outsidePress:k}=EC(w),I=v.useRef(!1),B=Fi(W=>{var O;if(!n||!c||!d||W.key!=="Escape"||I.current)return;const L=(O=s.current.floatingContext)==null?void 0:O.nodeId,$=j?Kv(j.nodesRef.current,L):[];if(!_&&(W.stopPropagation(),$.length>0)){let H=!0;if($.forEach(M=>{var F;if((F=M.context)!=null&&F.open&&!M.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,cM(W)?W.nativeEvent:W,"escape-key")}),q=Fi(W=>{var O;const L=()=>{var $;B(W),($=oc(W))==null||$.removeEventListener("keydown",L)};(O=oc(W))==null||O.addEventListener("keydown",L)}),Z=Fi(W=>{var O;const L=E.current;E.current=!1;const $=R.current;if(R.current=!1,p==="click"&&$||L||typeof T=="function"&&!T(W))return;const H=oc(W),M="["+Fx("inert")+"]",F=Ps(i.floating).querySelectorAll(M);let te=pn(H)?H:null;for(;te&&!Wa(te);){const we=Gi(te);if(Wa(we)||!pn(we))break;te=we}if(F.length&&pn(H)&&!uM(H)&&!Zu(H,i.floating)&&Array.from(F).every(we=>!Zu(te,we)))return;if(Wr(H)&&V){const we=H.clientWidth>0&&H.scrollWidth>H.clientWidth,We=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let Ee=We&&W.offsetX>H.clientWidth;if(We&&vo(H).direction==="rtl"&&(Ee=W.offsetX<=H.offsetWidth-H.clientWidth),Ee||we&&W.offsetY>H.clientHeight)return}const ae=(O=s.current.floatingContext)==null?void 0:O.nodeId,je=j&&Kv(j.nodesRef.current,ae).some(we=>{var We;return Gv(W,(We=we.context)==null?void 0:We.elements.floating)});if(Gv(W,i.floating)||Gv(W,i.domReference)||je)return;const xe=j?Kv(j.nodesRef.current,ae):[];if(xe.length>0){let we=!0;if(xe.forEach(We=>{var Ee;if((Ee=We.context)!=null&&Ee.open&&!We.context.dataRef.current.__outsidePressBubbles){we=!1;return}}),!we)return}r(!1,W,"outside-press")}),K=Fi(W=>{var O;const L=()=>{var $;Z(W),($=oc(W))==null||$.removeEventListener(p,L)};(O=oc(W))==null||O.addEventListener(p,L)});v.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=_,s.current.__outsidePressBubbles=P;let W=-1;function O(F){r(!1,F,"ancestor-scroll")}function L(){window.clearTimeout(W),I.current=!0}function $(){W=window.setTimeout(()=>{I.current=!1},bp()?5:0)}const H=Ps(i.floating);d&&(H.addEventListener("keydown",A?q:B,A),H.addEventListener("compositionstart",L),H.addEventListener("compositionend",$)),T&&H.addEventListener(p,k?K:Z,k);let M=[];return x&&(pn(i.domReference)&&(M=qi(i.domReference)),pn(i.floating)&&(M=M.concat(qi(i.floating))),!pn(i.reference)&&i.reference&&i.reference.contextElement&&(M=M.concat(qi(i.reference.contextElement)))),M=M.filter(F=>{var te;return F!==((te=H.defaultView)==null?void 0:te.visualViewport)}),M.forEach(F=>{F.addEventListener("scroll",O,{passive:!0})}),()=>{d&&(H.removeEventListener("keydown",A?q:B,A),H.removeEventListener("compositionstart",L),H.removeEventListener("compositionend",$)),T&&H.removeEventListener(p,k?K:Z,k),M.forEach(F=>{F.removeEventListener("scroll",O)}),window.clearTimeout(W)}},[s,i,d,T,p,n,r,x,c,_,P,B,A,q,Z,k,K]),v.useEffect(()=>{E.current=!1},[T,p]);const Q=v.useMemo(()=>({onKeyDown:B,[w9[g]]:W=>{m&&r(!1,W.nativeEvent,"reference-press")}}),[B,r,m,g]),V=v.useMemo(()=>({onKeyDown:B,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[j9[p]]:()=>{E.current=!0}}),[B,p]);return v.useMemo(()=>c?{reference:Q,floating:V}:{},[c,Q,V])}function E9(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=n2(),s=v.useRef({}),[c]=v.useState(()=>p9()),d=Bx()!=null,[f,p]=v.useState(r.reference),m=Fi((b,w,j)=>{s.current.openEvent=b?w:void 0,c.emit("openchange",{open:b,event:w,reason:j,nested:d}),n?.(b,w,j)}),g=v.useMemo(()=>({setPositionReference:p}),[]),x=v.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return v.useMemo(()=>({dataRef:s,open:t,onOpenChange:m,elements:x,events:c,floatingId:i,refs:g}),[t,m,x,c,i,g])}function qx(e){e===void 0&&(e={});const{nodeId:t}=e,n=E9({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,c]=v.useState(null),[d,f]=v.useState(null),m=i?.domReference||s,g=v.useRef(null),x=Vx();ri(()=>{m&&(g.current=m)},[m]);const b=i9({...e,elements:{...i,...d&&{reference:d}}}),w=v.useCallback(R=>{const _=pn(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),contextElement:R}:R;f(_),b.refs.setReference(_)},[b.refs]),j=v.useCallback(R=>{(pn(R)||R===null)&&(g.current=R,c(R)),(pn(b.refs.reference.current)||b.refs.reference.current===null||R!==null&&!pn(R))&&b.refs.setReference(R)},[b.refs]),C=v.useMemo(()=>({...b.refs,setReference:j,setPositionReference:w,domReference:g}),[b.refs,j,w]),T=v.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),E=v.useMemo(()=>({...b,...r,refs:C,elements:T,nodeId:t}),[b,C,T,t,r]);return ri(()=>{r.dataRef.current.floatingContext=E;const R=x?.nodesRef.current.find(_=>_.id===t);R&&(R.context=E)}),v.useMemo(()=>({...b,context:E,refs:C,elements:T}),[b,C,T,E])}function T9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:c}=e,{enabled:d=!0,visibleOnly:f=!0}=t,p=v.useRef(!1),m=v.useRef(),g=v.useRef(!0);v.useEffect(()=>{if(!d)return;const b=Dr(c.domReference);function w(){!n&&Wr(c.domReference)&&c.domReference===dC(Ps(c.domReference))&&(p.current=!0)}function j(){g.current=!0}return b.addEventListener("blur",w),b.addEventListener("keydown",j,!0),()=>{b.removeEventListener("blur",w),b.removeEventListener("keydown",j,!0)}},[c.domReference,n,d]),v.useEffect(()=>{if(!d)return;function b(w){let{reason:j}=w;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return i.on("openchange",b),()=>{i.off("openchange",b)}},[i,d]),v.useEffect(()=>()=>{clearTimeout(m.current)},[]);const x=v.useMemo(()=>({onPointerDown(b){iM(b.nativeEvent)||(g.current=!1)},onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const w=oc(b.nativeEvent);if(f&&pn(w))try{if(aM()&&sM())throw Error();if(!w.matches(":focus-visible"))return}catch{if(!g.current&&!fM(w))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const w=b.relatedTarget,j=b.nativeEvent,C=pn(w)&&w.hasAttribute(Fx("focus-guard"))&&w.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var T;const E=dC(c.domReference?c.domReference.ownerDocument:document);!w&&E===c.domReference||Zu((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,E)||Zu(c.domReference,E)||C||r(!1,j,"focus")})}}),[s,c.domReference,r,f]);return v.useMemo(()=>d?{reference:x}:{},[d,x])}const TC="active",RC="selected";function Xv(e,t,n){const r=new Map,i=n==="item";let s=e;if(i&&e){const{[TC]:c,[RC]:d,...f}=e;s=f}return{...n==="floating"&&{tabIndex:-1,[S9]:""},...s,...t.map(c=>{const d=c?c[n]:null;return typeof d=="function"?e?d(e):null:d}).concat(e).reduce((c,d)=>(d&&Object.entries(d).forEach(f=>{let[p,m]=f;if(!(i&&[TC,RC].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof m=="function"){var g;(g=r.get(p))==null||g.push(m),c[p]=function(){for(var x,b=arguments.length,w=new Array(b),j=0;j<b;j++)w[j]=arguments[j];return(x=r.get(p))==null?void 0:x.map(C=>C(...w)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function R9(e){e===void 0&&(e=[]);const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),r=e.map(d=>d?.item),i=v.useCallback(d=>Xv(d,e,"reference"),t),s=v.useCallback(d=>Xv(d,e,"floating"),n),c=v.useCallback(d=>Xv(d,e,"item"),r);return v.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:c}),[i,s,c])}const _9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function D9(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:c="dialog"}=t,d=(n=_9.get(c))!=null?n:c,f=n2(),m=Bx()!=null,g=v.useMemo(()=>d==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":r?i:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:f},...d==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[d,i,m,r,f,c]),x=v.useMemo(()=>{const w={id:i,...d&&{role:d}};return d==="tooltip"||c==="label"?w:{...w,...d==="menu"&&{"aria-labelledby":f}}},[d,i,f,c]),b=v.useCallback(w=>{let{active:j,selected:C}=w;const T={role:"option",...j&&{id:i+"-option"}};switch(c){case"select":return{...T,"aria-selected":j&&C};case"combobox":return{...T,...j&&{"aria-selected":!0}}}return{}},[i,c]);return v.useMemo(()=>s?{reference:g,floating:x,item:b}:{},[s,g,x,b])}const[A9,bo]=gr("ScrollArea.Root component was not found in tree");function mc(e,t){const n=_s(t);Ec(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const P9=v.forwardRef((e,t)=>{const{style:n,...r}=e,i=bo(),[s,c]=v.useState(0),[d,f]=v.useState(0),p=!!(s&&d);return mc(i.scrollbarX,()=>{const m=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(m),f(m)}),mc(i.scrollbarY,()=>{const m=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(m),c(m)}),p?a.jsx("div",{...r,ref:t,style:{...n,width:s,height:d}}):null}),k9=v.forwardRef((e,t)=>{const n=bo(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(P9,{...e,ref:t}):null}),N9={scrollHideDelay:1e3,type:"hover"},o2=v.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",N9,e),{type:r,scrollHideDelay:i,scrollbars:s,...c}=n,[d,f]=v.useState(null),[p,m]=v.useState(null),[g,x]=v.useState(null),[b,w]=v.useState(null),[j,C]=v.useState(null),[T,E]=v.useState(0),[R,_]=v.useState(0),[P,A]=v.useState(!1),[k,I]=v.useState(!1),B=Bn(t,q=>f(q));return a.jsx(A9,{value:{type:r,scrollHideDelay:i,scrollArea:d,viewport:p,onViewportChange:m,content:g,onContentChange:x,scrollbarX:b,onScrollbarXChange:w,scrollbarXEnabled:P,onScrollbarXEnabledChange:A,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:k,onScrollbarYEnabledChange:I,onCornerWidthChange:E,onCornerHeightChange:_},children:a.jsx(ce,{...c,ref:B,__vars:{"--sa-corner-width":s!=="xy"?"0px":`${T}px`,"--sa-corner-height":s!=="xy"?"0px":`${R}px`}})})});o2.displayName="@mantine/core/ScrollAreaRoot";function i2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function jp(e){const t=i2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function a2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function O9(e,[t,n]){return Math.min(n,Math.max(t,e))}function _C(e,t,n="ltr"){const r=jp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,c=t.content-t.viewport,d=s-r,f=n==="ltr"?[0,c]:[c*-1,0],p=O9(e,f);return a2([0,c],[0,d])(p)}function M9(e,t,n,r="ltr"){const i=jp(n),s=i/2,c=t||s,d=i-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-d,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return a2([f,p],g)(e)}function s2(e,t){return e>0&&e<t}function qa(e){return e?parseInt(e,10):0}function $s(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[I9,l2]=gr("ScrollAreaScrollbar was not found in tree"),c2=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,x=bo(),[b,w]=v.useState(null),j=Bn(t,I=>w(I)),C=v.useRef(null),T=v.useRef(""),{viewport:E}=x,R=n.content-n.viewport,_=_s(p),P=_s(d),A=hp(m,10),k=I=>{if(C.current){const B=I.clientX-C.current.left,q=I.clientY-C.current.top;f({x:B,y:q})}};return v.useEffect(()=>{const I=B=>{const q=B.target;b?.contains(q)&&_(B,R)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,b,R,_]),v.useEffect(P,[n,P]),mc(b,A),mc(x.content,A),a.jsx(I9,{value:{scrollbar:b,hasThumb:r,onThumbChange:_s(i),onThumbPointerUp:_s(s),onThumbPositionChange:P,onThumbPointerDown:_s(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:$s(e.onPointerDown,I=>{I.preventDefault(),I.button===0&&(I.target.setPointerCapture(I.pointerId),C.current=b.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",k(I))}),onPointerMove:$s(e.onPointerMove,k),onPointerUp:$s(e.onPointerUp,I=>{const B=I.target;B.hasPointerCapture(I.pointerId)&&(I.preventDefault(),B.releasePointerCapture(I.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,C.current=null}})})}),u2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...s}=e,c=bo(),[d,f]=v.useState(),p=v.useRef(null),m=Bn(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),a.jsx(c2,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{...i,"--sa-thumb-width":`${jp(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,x)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),s2(b,x)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:qa(d.paddingLeft),paddingEnd:qa(d.paddingRight)}})}})});u2.displayName="@mantine/core/ScrollAreaScrollbarX";const d2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...s}=e,c=bo(),[d,f]=v.useState(),p=v.useRef(null),m=Bn(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),a.jsx(c2,{...s,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${jp(n)}px`,...i},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,x)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),s2(b,x)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:qa(d.paddingTop),paddingEnd:qa(d.paddingBottom)}})}})});d2.displayName="@mantine/core/ScrollAreaScrollbarY";const Cp=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:i}=nl(),s=bo(),c=v.useRef(null),d=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=i2(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{d.current=0},onThumbPointerDown:b=>{d.current=b}},x=(b,w)=>M9(b,d.current,f,w);return n==="horizontal"?a.jsx(u2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollLeft,w=_C(b,f,i);c.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollLeft=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollLeft=x(b,i))}}):n==="vertical"?a.jsx(d2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollTop,w=_C(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=x(b))}}):null});Cp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Hx=v.forwardRef((e,t)=>{const n=bo(),{forceMount:r,...i}=e,[s,c]=v.useState(!1),d=e.orientation==="horizontal",f=hp(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?p:m)}},10);return mc(n.viewport,f),mc(n.content,f),r||s?a.jsx(Cp,{"data-state":s?"visible":"hidden",...i,ref:t}):null});Hx.displayName="@mantine/core/ScrollAreaScrollbarAuto";const f2=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(),[s,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:d}=i;let f=0;if(d){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return d.addEventListener("pointerenter",p),d.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),d.removeEventListener("pointerenter",p),d.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),n||s?a.jsx(Hx,{"data-state":s?"visible":"hidden",...r,ref:t}):null});f2.displayName="@mantine/core/ScrollAreaScrollbarHover";const L9=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(),s=e.orientation==="horizontal",[c,d]=v.useState("hidden"),f=hp(()=>d("idle"),100);return v.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>d("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,i.scrollHideDelay]),v.useEffect(()=>{const{viewport:p}=i,m=s?"scrollLeft":"scrollTop";if(p){let g=p[m];const x=()=>{const b=p[m];g!==b&&(d("scrolling"),f()),g=b};return p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[i.viewport,s,f]),n||c!=="hidden"?a.jsx(Cp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:$s(e.onPointerEnter,()=>d("interacting")),onPointerLeave:$s(e.onPointerLeave,()=>d("idle"))}):null}),Uy=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=i,d=e.orientation==="horizontal";return v.useEffect(()=>(d?s(!0):c(!0),()=>{d?s(!1):c(!1)}),[d,s,c]),i.type==="hover"?a.jsx(f2,{...r,ref:t,forceMount:n}):i.type==="scroll"?a.jsx(L9,{...r,ref:t,forceMount:n}):i.type==="auto"?a.jsx(Hx,{...r,ref:t,forceMount:n}):i.type==="always"?a.jsx(Cp,{...r,ref:t}):null});Uy.displayName="@mantine/core/ScrollAreaScrollbar";function $9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,d=n.top!==s.top;(c||d)&&t(),n=s,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}const h2=v.forwardRef((e,t)=>{const{style:n,...r}=e,i=bo(),s=l2(),{onThumbPositionChange:c}=s,d=Bn(t,m=>s.onThumbChange(m)),f=v.useRef(void 0),p=hp(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=i;if(m){const g=()=>{if(p(),!f.current){const x=$9(m,c);f.current=x,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,p,c]),a.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:d,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:$s(e.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),b=m.clientX-x.left,w=m.clientY-x.top;s.onThumbPointerDown({x:b,y:w})}),onPointerUp:$s(e.onPointerUp,s.onThumbPointerUp)})});h2.displayName="@mantine/core/ScrollAreaThumb";const By=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=l2();return n||i.hasThumb?a.jsx(h2,{ref:t,...r}):null});By.displayName="@mantine/core/ScrollAreaThumb";const p2=v.forwardRef(({children:e,style:t,...n},r)=>{const i=bo(),s=Bn(r,i.onViewportChange);return a.jsx(ce,{...n,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t},children:a.jsx("div",{style:{minWidth:"100%"},ref:i.onContentChange,children:e})})});p2.displayName="@mantine/core/ScrollAreaViewport";var Gx={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const m2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},z9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Xr=ge((e,t)=>{const n=se("ScrollArea",m2,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:x,viewportRef:b,onScrollPositionChange:w,children:j,offsetScrollbars:C,scrollbars:T,onBottomReached:E,onTopReached:R,overscrollBehavior:_,...P}=n,[A,k]=v.useState(!1),[I,B]=v.useState(!1),[q,Z]=v.useState(!1),K=Me({name:"ScrollArea",props:n,classes:Gx,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:z9}),Q=v.useRef(null),V=l9([b,Q]);return v.useEffect(()=>{if(!Q.current||C!=="present")return;const W=Q.current,O=new ResizeObserver(()=>{const{scrollHeight:L,clientHeight:$,scrollWidth:H,clientWidth:M}=W;B(L>$),Z(H>M)});return O.observe(W),()=>O.disconnect()},[Q,C]),a.jsxs(o2,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:T,...K("root"),...P,children:[a.jsx(p2,{...x,...K("viewport",{style:x?.style}),ref:V,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":C==="present"&&!q?"true":void 0,"data-vertical-hidden":C==="present"&&!I?"true":void 0,onScroll:W=>{x?.onScroll?.(W),w?.({x:W.currentTarget.scrollLeft,y:W.currentTarget.scrollTop});const{scrollTop:O,scrollHeight:L,clientHeight:$}=W.currentTarget;O-(L-$)>=-.6&&E?.(),O===0&&R?.()},children:j}),(T==="xy"||T==="x")&&a.jsx(Uy,{...K("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!q?!0:void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:a.jsx(By,{...K("thumb")})}),(T==="xy"||T==="y")&&a.jsx(Uy,{...K("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!I?!0:void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:a.jsx(By,{...K("thumb")})}),a.jsx(k9,{...K("corner"),"data-hovered":A||void 0,"data-hidden":m==="never"||void 0})]})});Xr.displayName="@mantine/core/ScrollArea";const Ep=ge((e,t)=>{const{children:n,classNames:r,styles:i,scrollbarSize:s,scrollHideDelay:c,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:w,scrollbars:j,style:C,vars:T,onBottomReached:E,onTopReached:R,..._}=se("ScrollAreaAutosize",m2,e);return a.jsx(ce,{..._,ref:t,style:[{display:"flex",overflow:"auto"},C],children:a.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:a.jsx(Xr,{classNames:r,styles:i,scrollHideDelay:c,scrollbarSize:s,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:w,vars:T,scrollbars:j,onBottomReached:E,onTopReached:R,children:n})})})});Xr.classes=Gx;Ep.displayName="@mantine/core/ScrollAreaAutosize";Ep.classes=Gx;Xr.Autosize=Ep;var g2={root:"m_87cf2631"};const U9={__staticSelector:"UnstyledButton"},er=lr((e,t)=>{const n=se("UnstyledButton",U9,e),{className:r,component:i="button",__staticSelector:s,unstyled:c,classNames:d,styles:f,style:p,...m}=n,g=Me({name:s,props:n,classes:g2,className:r,style:p,classNames:d,styles:f,unstyled:c});return a.jsx(ce,{...g("root",{focusable:!0}),component:i,ref:t,type:i==="button"?"button":void 0,...m})});er.classes=g2;er.displayName="@mantine/core/UnstyledButton";var v2={root:"m_515a97f8"};const B9={},Wx=ge((e,t)=>{const n=se("VisuallyHidden",B9,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,...p}=n,m=Me({name:"VisuallyHidden",classes:v2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d});return a.jsx(ce,{component:"span",ref:t,...m("root"),...p})});Wx.classes=v2;Wx.displayName="@mantine/core/VisuallyHidden";var y2={root:"m_1b7284a3"};const V9={},F9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ut(t),"--paper-shadow":Cx(n)}}),mr=lr((e,t)=>{const n=se("Paper",V9,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,withBorder:f,vars:p,radius:m,shadow:g,variant:x,mod:b,...w}=n,j=Me({name:"Paper",props:n,classes:y2,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:F9});return a.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:x,...w})});mr.classes=y2;mr.displayName="@mantine/core/Paper";function x2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return t}function DC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function AC(e,t,n,r,i){return e==="center"||r==="center"?{left:t}:e==="end"?{[i==="ltr"?"right":"left"]:n}:e==="start"?{[i==="ltr"?"left":"right"]:n}:{}}const q9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function H9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:s,arrowY:c,dir:d}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[q9[f]]:r},g=-t/2;return f==="left"?{...m,...DC(p,c,n,i),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...DC(p,c,n,i),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...AC(p,s,n,i,d),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...AC(p,s,n,i,d),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Qx=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:s,arrowX:c,arrowY:d,style:f,...p},m)=>{const{dir:g}=nl();return s?a.jsx("div",{...p,ref:m,style:{...f,...H9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:g,arrowX:c,arrowY:d})}}):null});Qx.displayName="@mantine/core/FloatingArrow";var b2={root:"m_9814e45f"};const G9={zIndex:Kr("modal")},W9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&uo(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${le(i)})`:void 0,"--overlay-radius":s===void 0?void 0:Ut(s),"--overlay-z-index":c?.toString()}}),gc=lr((e,t)=>{const n=se("Overlay",G9,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,fixed:p,center:m,children:g,radius:x,zIndex:b,gradient:w,blur:j,color:C,backgroundOpacity:T,mod:E,...R}=n,_=Me({name:"Overlay",props:n,classes:b2,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:W9});return a.jsx(ce,{ref:t,..._("root"),mod:[{center:m,fixed:p},E],...R,children:g})});gc.classes=b2;gc.displayName="@mantine/core/Overlay";function Zv(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),typeof e.className=="string"&&t.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(t.style,e.style),typeof e.id=="string"&&t.setAttribute("id",e.id),t}function Q9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Zv(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const i=Zv(n);return i.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(i),i}return Zv(n)}const Y9={},S2=ge((e,t)=>{const{children:n,target:r,reuseTargetNode:i,...s}=se("Portal",Y9,e),[c,d]=v.useState(!1),f=v.useRef(null);return Ec(()=>(d(!0),f.current=Q9({target:r,reuseTargetNode:i,...s}),Ku(t,f.current),!r&&!i&&f.current&&document.body.appendChild(f.current),()=>{!r&&!i&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:kx.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});S2.displayName="@mantine/core/Portal";const Za=ge(({withinPortal:e=!0,children:t,...n},r)=>_R()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(S2,{ref:r,...n,children:t}));Za.displayName="@mantine/core/OptionalPortal";const Iu=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),ih={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Iu("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Iu("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Iu("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Iu("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Iu("top"),common:{transformOrigin:"top right"}}},PC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function K9({transition:e,state:t,duration:n,timingFunction:r}){const i={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ih?{transitionProperty:ih[e].transitionProperty,...i,...ih[e].common,...ih[e][PC[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[PC[t]]}}function X9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:c,onExited:d,enterDelay:f,exitDelay:p}){const m=Sn(),g=Tx(),x=m.respectReducedMotion?g:!1,[b,w]=v.useState(x?0:e),[j,C]=v.useState(r?"entered":"exited"),T=v.useRef(-1),E=v.useRef(-1),R=v.useRef(-1);function _(){window.clearTimeout(T.current),window.clearTimeout(E.current),cancelAnimationFrame(R.current)}const P=k=>{_();const I=k?i:s,B=k?c:d,q=x?0:k?e:t;w(q),q===0?(typeof I=="function"&&I(),typeof B=="function"&&B(),C(k?"entered":"exited")):R.current=requestAnimationFrame(()=>{Fu.flushSync(()=>{C(k?"pre-entering":"pre-exiting")}),R.current=requestAnimationFrame(()=>{typeof I=="function"&&I(),C(k?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof B=="function"&&B(),C(k?"entered":"exited")},q)})})},A=k=>{if(_(),typeof(k?f:p)!="number"){P(k);return}E.current=window.setTimeout(()=>{P(k)},k?f:p)};return Hi(()=>{A(r)},[r]),v.useEffect(()=>()=>{_()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function hi({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:i,children:s,timingFunction:c="ease",onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:x}){const b=_R(),{transitionDuration:w,transitionStatus:j,transitionTimingFunction:C}=X9({mounted:i,exitDuration:r,duration:n,timingFunction:c,onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:x});return w===0||b==="test"?i?a.jsx(a.Fragment,{children:s({})}):e?s({display:"none"}):null:j==="exited"?e?s({display:"none"}):null:a.jsx(a.Fragment,{children:s(K9({transition:t,duration:w,state:j,timingFunction:C}))})}hi.displayName="@mantine/core/Transition";const[Z9,w2]=gr("Popover component was not found in the tree");function Tp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const i=CO(t),s=Bn(i,r);return Xi(e)?v.cloneElement(e,{[n]:s}):e}function j2(e){return a.jsx(Wx,{tabIndex:-1,"data-autofocus":!0,...e})}Tp.displayName="@mantine/core/FocusTrap";j2.displayName="@mantine/core/FocusTrapInitialFocus";Tp.InitialFocus=j2;var C2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const J9={},Yx=ge((e,t)=>{const n=se("PopoverDropdown",J9,e),{className:r,style:i,vars:s,children:c,onKeyDownCapture:d,variant:f,classNames:p,styles:m,...g}=n,x=w2(),b=SR({opened:x.opened,shouldReturnFocus:x.returnFocus}),w=x.withRoles?{"aria-labelledby":x.getTargetId(),id:x.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=Bn(t,x.floating);return x.disabled?null:a.jsx(Za,{...x.portalProps,withinPortal:x.withinPortal,children:a.jsx(hi,{mounted:x.opened,...x.transitionProps,transition:x.transitionProps?.transition||"fade",duration:x.transitionProps?.duration??150,keepMounted:x.keepMounted,exitDuration:typeof x.transitionProps?.exitDuration=="number"?x.transitionProps.exitDuration:x.transitionProps?.duration,children:C=>a.jsx(Tp,{active:x.trapFocus&&x.opened,innerRef:j,children:a.jsxs(ce,{...w,...g,variant:f,onKeyDownCapture:dO(()=>{x.onClose?.(),x.onDismiss?.()},{active:x.closeOnEscape,onTrigger:b,onKeyDown:d}),"data-position":x.placement,"data-fixed":x.floatingStrategy==="fixed"||void 0,...x.getStyles("dropdown",{className:r,props:n,classNames:p,styles:m,style:[{...C,zIndex:x.zIndex,top:x.y??0,left:x.x??0,width:x.width==="target"?void 0:le(x.width)},x.resolvedStyles.dropdown,m?.dropdown,i]}),children:[c,a.jsx(Qx,{ref:x.arrowRef,arrowX:x.arrowX,arrowY:x.arrowY,visible:x.withArrow,position:x.placement,arrowSize:x.arrowSize,arrowRadius:x.arrowRadius,arrowOffset:x.arrowOffset,arrowPosition:x.arrowPosition,...x.getStyles("arrow",{props:n,classNames:p,styles:m})})]})})})})});Yx.classes=C2;Yx.displayName="@mantine/core/PopoverDropdown";const e5={refProp:"ref",popupType:"dialog"},E2=ge((e,t)=>{const{children:n,refProp:r,popupType:i,...s}=se("PopoverTarget",e5,e);if(!Xi(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=s,d=w2(),f=Bn(d.reference,mp(n),t),p=d.withRoles?{"aria-haspopup":i,"aria-expanded":d.opened,"aria-controls":d.getDropdownId(),id:d.getTargetId()}:{};return v.cloneElement(n,{...c,...p,...d.targetProps,className:It(d.targetProps.className,c.className,n.props.className),[r]:f,...d.controlled?null:{onClick:d.onToggle}})});E2.displayName="@mantine/core/PopoverTarget";function T2({opened:e,floating:t,position:n,positionDependencies:r}){const[i,s]=v.useState(0);v.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return YM(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,i,n]),Hi(()=>{t.update()},r),Hi(()=>{s(c=>c+1)},[e])}function t5(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function n5(e,t){const n=t5(e.middlewares),r=[JR(e.offset)];return n.shift&&r.push(Ux(typeof n.shift=="boolean"?{limiter:SC(),padding:5}:{limiter:SC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?zh():zh(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Gu():Gu(n.inline)),r.push(e2({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(s9({...typeof n.size=="boolean"?{}:n.size,apply({rects:i,availableWidth:s,availableHeight:c,...d}){const p=t().refs.floating.current?.style??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:i,availableWidth:s,availableHeight:c,...d}):Object.assign(p,{maxWidth:`${s}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(p,{width:`${i.reference.width}px`})}})),r}function r5(e){const[t,n]=Yn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=v.useRef(t),i=()=>{t&&!e.disabled&&n(!1)},s=()=>!e.disabled&&n(!t),c=qx({strategy:e.strategy,placement:e.position,middleware:n5(e,()=>c)});return T2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),Hi(()=>{e.onPositionChange?.(c.placement)},[c.placement]),Hi(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:c,controlled:typeof e.opened=="boolean",opened:t,onClose:i,onToggle:s}}const o5={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Kr("popover"),__staticSelector:"Popover",width:"max-content"},i5=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ut(t),"--popover-shadow":Cx(n)}});function zo(e){const t=se("Popover",o5,e),{children:n,position:r,offset:i,onPositionChange:s,positionDependencies:c,opened:d,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:x,withArrow:b,arrowSize:w,arrowOffset:j,arrowRadius:C,arrowPosition:T,unstyled:E,classNames:R,styles:_,closeOnClickOutside:P,withinPortal:A,portalProps:k,closeOnEscape:I,clickOutsideEvents:B,trapFocus:q,onClose:Z,onDismiss:K,onOpen:Q,onChange:V,zIndex:W,radius:O,shadow:L,id:$,defaultOpened:H,__staticSelector:M,withRoles:F,disabled:te,returnFocus:ae,variant:je,keepMounted:xe,vars:we,floatingStrategy:We,withOverlay:Ee,overlayProps:ot,...tt}=t,Ct=Me({name:M,props:t,classes:C2,classNames:R,styles:_,unstyled:E,rootSelector:"dropdown",vars:we,varsResolver:i5}),{resolvedStyles:Ot}=Js({classNames:R,styles:_,props:t}),Mt=v.useRef(null),[pt,Rt]=v.useState(null),[tn,Re]=v.useState(null),{dir:Pe}=nl(),Ke=vr($),_e=r5({middlewares:x,width:g,position:x2(Pe,r),offset:typeof i=="number"?i+(b?w/2:0):i,arrowRef:Mt,arrowOffset:j,onPositionChange:s,positionDependencies:c,opened:d,defaultOpened:H,onChange:V,onOpen:Q,onClose:Z,onDismiss:K,strategy:We,disabled:te});mO(()=>{P&&(_e.onClose(),K?.())},B,[pt,tn]);const he=v.useCallback(Oe=>{Rt(Oe),_e.floating.refs.setReference(Oe)},[_e.floating.refs.setReference]),Se=v.useCallback(Oe=>{Re(Oe),_e.floating.refs.setFloating(Oe)},[_e.floating.refs.setFloating]),$e=v.useCallback(()=>{f?.onExited?.(),p?.()},[f?.onExited,p]),be=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(Z9,{value:{returnFocus:ae,disabled:te,controlled:_e.controlled,reference:he,floating:Se,x:_e.floating.x,y:_e.floating.y,arrowX:_e.floating?.middlewareData?.arrow?.x,arrowY:_e.floating?.middlewareData?.arrow?.y,opened:_e.opened,arrowRef:Mt,transitionProps:{...f,onExited:$e,onEntered:be},width:g,withArrow:b,arrowSize:w,arrowOffset:j,arrowRadius:C,arrowPosition:T,placement:_e.floating.placement,trapFocus:q,withinPortal:A,portalProps:k,zIndex:W,radius:O,shadow:L,closeOnEscape:I,onDismiss:K,onClose:_e.onClose,onToggle:_e.onToggle,getTargetId:()=>`${Ke}-target`,getDropdownId:()=>`${Ke}-dropdown`,withRoles:F,targetProps:tt,__staticSelector:M,classNames:R,styles:_,unstyled:E,variant:je,keepMounted:xe,getStyles:Ct,resolvedStyles:Ot,floatingStrategy:We},children:[n,Ee&&a.jsx(hi,{transition:"fade",mounted:_e.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:Oe=>a.jsx(Za,{withinPortal:A,children:a.jsx(gc,{...ot,...Ct("overlay",{className:ot?.className,style:[Oe,ot?.style]})})})})]})}zo.Target=E2;zo.Dropdown=Yx;zo.displayName="@mantine/core/Popover";zo.extend=e=>e;var No={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const R2=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:It(No.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:No.bar}),a.jsx("span",{className:No.bar}),a.jsx("span",{className:No.bar})]}));R2.displayName="@mantine/core/Bars";const _2=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:It(No.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:No.dot}),a.jsx("span",{className:No.dot}),a.jsx("span",{className:No.dot})]}));_2.displayName="@mantine/core/Dots";const D2=v.forwardRef(({className:e,...t},n)=>a.jsx(ce,{component:"span",className:It(No.ovalLoader,e),...t,ref:n}));D2.displayName="@mantine/core/Oval";const A2={bars:R2,oval:D2,dots:_2},a5={loaders:A2,type:"oval"},s5=(e,{size:t,color:n})=>({root:{"--loader-size":nt(t,"loader-size"),"--loader-color":n?Ft(n,e):void 0}}),Pr=ge((e,t)=>{const n=se("Loader",a5,e),{size:r,color:i,type:s,vars:c,className:d,style:f,classNames:p,styles:m,unstyled:g,loaders:x,variant:b,children:w,...j}=n,C=Me({name:"Loader",props:n,classes:No,className:d,style:f,classNames:p,styles:m,unstyled:g,vars:c,varsResolver:s5});return w?a.jsx(ce,{...C("root"),ref:t,...j,children:w}):a.jsx(ce,{...C("root"),ref:t,component:x[s],variant:b,size:r,...j})});Pr.defaultLoaders=A2;Pr.classes=No;Pr.displayName="@mantine/core/Loader";var _c={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const kC={orientation:"horizontal"},l5=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Kx=ge((e,t)=>{const n=se("ActionIconGroup",kC,e),{className:r,style:i,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:x,...b}=se("ActionIconGroup",kC,e),w=Me({name:"ActionIconGroup",props:n,classes:_c,className:r,style:i,classNames:s,styles:c,unstyled:d,vars:p,varsResolver:l5,rootSelector:"group"});return a.jsx(ce,{...w("group"),ref:t,variant:g,mod:[{"data-orientation":f},x],role:"group",...b})});Kx.classes=_c;Kx.displayName="@mantine/core/ActionIconGroup";const NC={},c5=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":nt(c,"section-height"),"--section-padding-x":nt(c,"section-padding-x"),"--section-fz":On(c),"--section-radius":t===void 0?void 0:Ut(t),"--section-bg":n||i?d.background:void 0,"--section-color":d.color,"--section-bd":n||i?d.border:void 0}}},Xx=ge((e,t)=>{const n=se("ActionIconGroupSection",NC,e),{className:r,style:i,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:x,...b}=se("ActionIconGroupSection",NC,e),w=Me({name:"ActionIconGroupSection",props:n,classes:_c,className:r,style:i,classNames:s,styles:c,unstyled:d,vars:f,varsResolver:c5,rootSelector:"groupSection"});return a.jsx(ce,{...w("groupSection"),ref:t,variant:p,...b})});Xx.classes=_c;Xx.displayName="@mantine/core/ActionIconGroupSection";const u5={},d5=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":nt(t,"ai-size"),"--ai-radius":n===void 0?void 0:Ut(n),"--ai-bg":s||r?d.background:void 0,"--ai-hover":s||r?d.hover:void 0,"--ai-hover-color":s||r?d.hoverColor:void 0,"--ai-color":d.color,"--ai-bd":s||r?d.border:void 0}}},bn=lr((e,t)=>{const n=se("ActionIcon",u5,e),{className:r,unstyled:i,variant:s,classNames:c,styles:d,style:f,loading:p,loaderProps:m,size:g,color:x,radius:b,__staticSelector:w,gradient:j,vars:C,children:T,disabled:E,"data-disabled":R,autoContrast:_,mod:P,...A}=n,k=Me({name:["ActionIcon",w],props:n,className:r,style:f,classes:_c,classNames:c,styles:d,unstyled:i,vars:C,varsResolver:d5});return a.jsxs(er,{...k("root",{active:!E&&!p&&!R}),...A,unstyled:i,variant:s,size:g,disabled:E||p,ref:t,mod:[{loading:p,disabled:E||R},P],children:[a.jsx(hi,{mounted:!!p,transition:"slide-down",duration:150,children:I=>a.jsx(ce,{component:"span",...k("loader",{style:I}),"aria-hidden":!0,children:a.jsx(Pr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(ce,{component:"span",mod:{loading:p},...k("icon"),children:T})]})});bn.classes=_c;bn.displayName="@mantine/core/ActionIcon";bn.Group=Kx;bn.GroupSection=Xx;const P2=v.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:a.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));P2.displayName="@mantine/core/CloseIcon";var k2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const f5={variant:"subtle"},h5=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":nt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ut(n),"--cb-icon-size":le(r)}}),Ja=lr((e,t)=>{const n=se("CloseButton",f5,e),{iconSize:r,children:i,vars:s,radius:c,className:d,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":x,disabled:b,variant:w,icon:j,mod:C,__staticSelector:T,...E}=n,R=Me({name:T||"CloseButton",props:n,className:d,style:p,classes:k2,classNames:f,styles:m,unstyled:g,vars:s,varsResolver:h5});return a.jsxs(er,{ref:t,...E,unstyled:g,variant:w,disabled:b,mod:[{disabled:b||x},C],...R("root",{variant:w,active:!b&&!x}),children:[j||a.jsx(P2,{}),i]})});Ja.classes=k2;Ja.displayName="@mantine/core/CloseButton";function p5(e){return v.Children.toArray(e).filter(Boolean)}var N2={root:"m_4081bf90"};const m5={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},g5=(e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:s,wrap:c},{childWidth:d})=>({root:{"--group-child-width":t&&n?d:void 0,"--group-gap":Nn(r),"--group-align":i,"--group-justify":s,"--group-wrap":c}}),ye=ge((e,t)=>{const n=se("Group",m5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,children:f,gap:p,align:m,justify:g,wrap:x,grow:b,preventGrowOverflow:w,vars:j,variant:C,__size:T,mod:E,...R}=n,_=p5(f),P=_.length,A=Nn(p??"md"),I={childWidth:`calc(${100/P}% - (${A} - ${A} / ${P}))`},B=Me({name:"Group",props:n,stylesCtx:I,className:i,style:s,classes:N2,classNames:r,styles:c,unstyled:d,vars:j,varsResolver:g5});return a.jsx(ce,{...B("root"),ref:t,variant:C,mod:[{grow:b},E],size:T,...R,children:_})});ye.classes=N2;ye.displayName="@mantine/core/Group";const[v5,na]=gr("ModalBase component was not found in tree");function y5({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),i=v.useRef(-1),c=Tx()?0:t;return v.useEffect(()=>(e?(r(!0),window.clearTimeout(i.current)):c===0?r(!1):i.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(i.current)),[e,c]),n}function x5({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:s,returnFocus:c}){const d=vr(e),[f,p]=v.useState(!1),[m,g]=v.useState(!1),x=typeof t?.duration=="number"?t?.duration:200,b=y5({opened:n,transitionDuration:x});return ER("keydown",w=>{w.key==="Escape"&&i&&!w.isComposing&&n&&w.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&s()},{capture:!0}),SR({opened:n,shouldReturnFocus:r&&c}),{_id:d,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const O2=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:s,onEnterTransitionEnd:c,trapFocus:d,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:x,lockScroll:b,children:w,zIndex:j,shadow:C,padding:T,__vars:E,unstyled:R,removeScrollProps:_,...P},A)=>{const{_id:k,titleMounted:I,bodyMounted:B,shouldLockScroll:q,setTitleMounted:Z,setBodyMounted:K}=x5({id:r,transitionProps:i,opened:t,trapFocus:d,closeOnEscape:f,onClose:n,returnFocus:p}),{key:Q,...V}=_||{};return a.jsx(Za,{...x,withinPortal:g,children:a.jsx(v5,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${k}-title`,getBodyId:()=>`${k}-body`,titleMounted:I,bodyMounted:B,setTitleMounted:Z,setBodyMounted:K,trapFocus:d,closeOnEscape:f,zIndex:j,unstyled:R},children:a.jsx(hc,{enabled:q&&b,...V,children:a.jsx(ce,{ref:A,...P,__vars:{...E,"--mb-z-index":(j||Kr("modal")).toString(),"--mb-shadow":Cx(C),"--mb-padding":Nn(T)},children:w})},Q)})})});O2.displayName="@mantine/core/ModalBase";function b5(){const e=na();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var vc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const M2=v.forwardRef(({className:e,...t},n)=>{const r=b5(),i=na();return a.jsx(ce,{ref:n,...t,id:r,className:It({[vc.body]:!i.unstyled},e)})});M2.displayName="@mantine/core/ModalBaseBody";const I2=v.forwardRef(({className:e,onClick:t,...n},r)=>{const i=na();return a.jsx(Ja,{ref:r,...n,onClick:s=>{i.onClose(),t?.(s)},className:It({[vc.close]:!i.unstyled},e),unstyled:i.unstyled})});I2.displayName="@mantine/core/ModalBaseCloseButton";const L2=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...s},c)=>{const d=na();return a.jsx(hi,{mounted:d.opened,transition:"pop",...d.transitionProps,onExited:()=>{d.onExitTransitionEnd?.(),d.transitionProps?.onExited?.()},onEntered:()=>{d.onEnterTransitionEnd?.(),d.transitionProps?.onEntered?.()},...e,children:f=>a.jsx("div",{...n,className:It({[vc.inner]:!d.unstyled},n.className),children:a.jsx(Tp,{active:d.opened&&d.trapFocus,innerRef:c,children:a.jsx(mr,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":d.bodyMounted?d.getBodyId():void 0,"aria-labelledby":d.titleMounted?d.getTitleId():void 0,style:[i,f],className:It({[vc.content]:!d.unstyled},t),unstyled:d.unstyled,children:s.children})})})})});L2.displayName="@mantine/core/ModalBaseContent";const $2=v.forwardRef(({className:e,...t},n)=>{const r=na();return a.jsx(ce,{component:"header",ref:n,className:It({[vc.header]:!r.unstyled},e),...t})});$2.displayName="@mantine/core/ModalBaseHeader";const S5={duration:200,timingFunction:"ease",transition:"fade"};function w5(e){const t=na();return{...S5,...t.transitionProps,...e}}const z2=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...i},s)=>{const c=na(),d=w5(t);return a.jsx(hi,{mounted:r!==void 0?r:c.opened,...d,transition:"fade",children:f=>a.jsx(gc,{ref:s,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e?.(p),c.closeOnClickOutside&&c.onClose()},...i})})});z2.displayName="@mantine/core/ModalBaseOverlay";function j5(){const e=na();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const U2=v.forwardRef(({className:e,...t},n)=>{const r=j5(),i=na();return a.jsx(ce,{component:"h2",ref:n,className:It({[vc.title]:!i.unstyled},e),...t,id:r})});U2.displayName="@mantine/core/ModalBaseTitle";function C5({children:e}){return a.jsx(a.Fragment,{children:e})}const[E5,T5]=Zi({size:"sm"}),R5={},B2=ge((e,t)=>{const n=se("InputClearButton",R5,e),{size:r,variant:i,vars:s,classNames:c,styles:d,...f}=n,p=T5(),{resolvedClassNames:m,resolvedStyles:g}=Js({classNames:c,styles:d,props:n});return a.jsx(Ja,{variant:i||"transparent",ref:t,size:r||p?.size||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});B2.displayName="@mantine/core/InputClearButton";const[_5,Dc]=Zi({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var So={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const OC={},D5=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),Rp=ge((e,t)=>{const n=se("InputDescription",OC,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:x,...b}=se("InputDescription",OC,n),w=Dc(),j=Me({name:["InputWrapper",m],props:n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"description",vars:f,varsResolver:D5}),C=g&&w?.getStyles||j;return a.jsx(ce,{component:"p",ref:t,variant:x,size:p,...C("description",w?.getStyles?{className:i,style:s}:void 0),...b})});Rp.classes=So;Rp.displayName="@mantine/core/InputDescription";const A5={},P5=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),_p=ge((e,t)=>{const n=se("InputError",A5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:x,...b}=n,w=Me({name:["InputWrapper",m],props:n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"error",vars:f,varsResolver:P5}),j=Dc(),C=g&&j?.getStyles||w;return a.jsx(ce,{component:"p",ref:t,variant:x,size:p,...C("error",j?.getStyles?{className:i,style:s}:void 0),...b})});_p.classes=So;_p.displayName="@mantine/core/InputError";const MC={labelElement:"label"},k5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0}}),pd=ge((e,t)=>{const n=se("InputLabel",MC,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,labelElement:p,size:m,required:g,htmlFor:x,onMouseDown:b,children:w,__staticSelector:j,variant:C,mod:T,...E}=se("InputLabel",MC,n),R=Me({name:["InputWrapper",j],props:n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"label",vars:f,varsResolver:k5}),_=Dc(),P=_?.getStyles||R;return a.jsxs(ce,{...P("label",_?.getStyles?{className:i,style:s}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?x:void 0,mod:[{required:g},T],onMouseDown:A=>{b?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},...E,children:[w,g&&a.jsx("span",{...P("required"),"aria-hidden":!0,children:" *"})]})});pd.classes=So;pd.displayName="@mantine/core/InputLabel";const IC={},Zx=ge((e,t)=>{const n=se("InputPlaceholder",IC,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,__staticSelector:p,variant:m,error:g,mod:x,...b}=se("InputPlaceholder",IC,n),w=Me({name:["InputPlaceholder",p],props:n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"placeholder"});return a.jsx(ce,{...w("placeholder"),mod:[{error:!!g},x],component:"span",variant:m,ref:t,...b})});Zx.classes=So;Zx.displayName="@mantine/core/InputPlaceholder";function N5(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),i=e.slice(0,r),s=e.slice(r+1),c=t&&i.includes("description")||n&&i.includes("error");return{offsetBottom:t&&s.includes("description")||n&&s.includes("error"),offsetTop:c}}const O5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},M5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),Dp=ge((e,t)=>{const n=se("InputWrapper",O5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:x,inputWrapperOrder:b,label:w,error:j,description:C,labelProps:T,descriptionProps:E,errorProps:R,labelElement:_,children:P,withAsterisk:A,id:k,required:I,__stylesApiProps:B,mod:q,...Z}=n,K=Me({name:["InputWrapper",g],props:B||n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:M5}),Q={size:p,variant:m,__staticSelector:g},V=vr(k),W=typeof A=="boolean"?A:I,O=R?.id||`${V}-error`,L=E?.id||`${V}-description`,$=V,H=!!j&&typeof j!="boolean",M=!!C,F=`${H?O:""} ${M?L:""}`,te=F.trim().length>0?F.trim():void 0,ae=T?.id||`${V}-label`,je=w&&a.jsx(pd,{labelElement:_,id:ae,htmlFor:$,required:W,...Q,...T,children:w},"label"),xe=M&&a.jsx(Rp,{...E,...Q,size:E?.size||Q.size,id:E?.id||L,children:C},"description"),we=a.jsx(v.Fragment,{children:x(P)},"input"),We=H&&v.createElement(_p,{...R,...Q,size:R?.size||Q.size,key:"error",id:R?.id||O},j),Ee=b.map(ot=>{switch(ot){case"label":return je;case"input":return we;case"description":return xe;case"error":return We;default:return null}});return a.jsx(_5,{value:{getStyles:K,describedBy:te,inputId:$,labelId:ae,...N5(b,{hasDescription:M,hasError:H})},children:a.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},q],...K("root"),...Z,children:Ee})})});Dp.classes=So;Dp.displayName="@mantine/core/InputWrapper";const I5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},L5=(e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":nt(t.size,"input-height"),"--input-fz":On(t.size),"--input-radius":t.radius===void 0?void 0:Ut(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?nt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),fn=lr((e,t)=>{const n=se("Input",I5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:x,error:b,disabled:w,leftSection:j,leftSectionProps:C,leftSectionWidth:T,rightSection:E,rightSectionProps:R,rightSectionWidth:_,rightSectionPointerEvents:P,leftSectionPointerEvents:A,variant:k,vars:I,pointer:B,multiline:q,radius:Z,id:K,withAria:Q,withErrorStyles:V,mod:W,inputSize:O,__clearSection:L,__clearable:$,__defaultRightSection:H,...M}=n,{styleProps:F,rest:te}=ta(M),ae=Dc(),je={offsetBottom:ae?.offsetBottom,offsetTop:ae?.offsetTop},xe=Me({name:["Input",p],props:m||n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,stylesCtx:je,rootSelector:"wrapper",vars:I,varsResolver:L5}),we=Q?{required:f,disabled:w,"aria-invalid":!!b,"aria-describedby":ae?.describedBy,id:ae?.inputId||K}:{},We=E||$&&L||H;return a.jsx(E5,{value:{size:g||"sm"},children:a.jsxs(ce,{...xe("wrapper"),...F,...x,mod:[{error:!!b&&V,pointer:B,disabled:w,multiline:q,"data-with-right-section":!!We,"data-with-left-section":!!j},W],variant:k,size:g,children:[j&&a.jsx("div",{...C,"data-position":"left",...xe("section",{className:C?.className,style:C?.style}),children:j}),a.jsx(ce,{component:"input",...te,...we,ref:t,required:f,mod:{disabled:w,error:!!b&&V},variant:k,__size:O,...xe("input")}),We&&a.jsx("div",{...R,"data-position":"right",...xe("section",{className:R?.className,style:R?.style}),children:We})]})})});fn.classes=So;fn.Wrapper=Dp;fn.Label=pd;fn.Error=_p;fn.Description=Rp;fn.Placeholder=Zx;fn.ClearButton=B2;fn.displayName="@mantine/core/Input";function $5(e,t,n){const r=se(e,t,n),{label:i,description:s,error:c,required:d,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:x,__stylesApiProps:b,errorProps:w,labelProps:j,descriptionProps:C,wrapperProps:T,id:E,size:R,style:_,inputContainer:P,inputWrapperOrder:A,withAsterisk:k,variant:I,vars:B,mod:q,...Z}=r,{styleProps:K,rest:Q}=ta(Z),V={label:i,description:s,error:c,required:d,classNames:f,className:m,__staticSelector:x,__stylesApiProps:b||r,errorProps:w,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:R,style:_,inputContainer:P,inputWrapperOrder:A,withAsterisk:k,variant:I,id:E,mod:q,...T};return{...Q,classNames:f,styles:p,unstyled:g,wrapperProps:{...V,...K},inputProps:{required:d,classNames:f,styles:p,unstyled:g,size:R,__staticSelector:x,__stylesApiProps:b||r,error:c,variant:I,id:E}}}const z5={__staticSelector:"InputBase",withAria:!0},Nr=lr((e,t)=>{const{inputProps:n,wrapperProps:r,...i}=$5("InputBase",z5,e);return a.jsx(fn.Wrapper,{...r,children:a.jsx(fn,{...n,...i,ref:t})})});Nr.classes={...fn.classes,...fn.Wrapper.classes};Nr.displayName="@mantine/core/InputBase";const U5={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var V2={root:"m_8bffd616"};const B5={},li=lr((e,t)=>{const n=se("Flex",B5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,gap:p,rowGap:m,columnGap:g,align:x,justify:b,wrap:w,direction:j,...C}=n,T=Me({name:"Flex",classes:V2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f}),E=Sn(),R=fd(),_=NR({styleProps:{gap:p,rowGap:m,columnGap:g,align:x,justify:b,wrap:w,direction:j},theme:E,data:U5});return a.jsxs(a.Fragment,{children:[_.hasResponsiveStyles&&a.jsx(tl,{selector:`.${R}`,styles:_.styles,media:_.media}),a.jsx(ce,{ref:t,...T("root",{className:R,style:Xa(_.inlineStyles)}),...C})]})});li.classes=V2;li.displayName="@mantine/core/Flex";function V5(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function F5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const i=v.useRef(-1),[s,c]=v.useState(!1),[d,f]=v.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),w=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),T=qa(j.borderTopWidth)+qa(C.borderTopWidth),E=qa(j.borderLeftWidth)+qa(C.borderLeftWidth),R={top:b.top-w.top-T,left:b.left-w.left-E,width:b.width,height:b.height};n.current.style.transform=`translateY(${R.top}px) translateX(${R.left}px)`,n.current.style.width=`${R.width}px`,n.current.style.height=`${R.height}px`},m=()=>{window.clearTimeout(i.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=v.useRef(null),x=v.useRef(null);return v.useEffect(()=>{if(p(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(x.current=new ResizeObserver(m),x.current.observe(t)),()=>{g.current?.disconnect(),x.current?.disconnect()}},[t,e]),v.useEffect(()=>{if(t){const b=w=>{V5(w.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),OO(()=>{TR()!=="test"&&c(!0)},20,{autoInvoke:!0}),MO(b=>{b.forEach(w=>{w.type==="attributes"&&w.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:d}}var F2={root:"m_96b553a6"};const q5={},H5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Jx=ge((e,t)=>{const n=se("FloatingIndicator",q5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,target:p,parent:m,transitionDuration:g,mod:x,displayAfterTransitionEnd:b,...w}=n,j=Me({name:"FloatingIndicator",classes:F2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:H5}),C=v.useRef(null),{initialized:T,hidden:E}=F5({target:p,parent:m,ref:C,displayAfterTransitionEnd:b}),R=Bn(t,C);return!p||!m?null:a.jsx(ce,{ref:R,mod:[{initialized:T,hidden:E},x],...j("root"),...w})});Jx.displayName="@mantine/core/FloatingIndicator";Jx.classes=F2;var q2={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const G5={},W5=(e,{radius:t,color:n,variant:r,autoContrast:i})=>{const s=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:Ut(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},ra=ge((e,t)=>{const n=se("Alert",G5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,title:g,children:x,id:b,icon:w,withCloseButton:j,onClose:C,closeButtonLabel:T,variant:E,autoContrast:R,..._}=n,P=Me({name:"Alert",classes:q2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:W5}),A=vr(b),k=g&&`${A}-title`||void 0,I=`${A}-body`;return a.jsx(ce,{id:A,...P("root",{variant:E}),variant:E,ref:t,..._,role:"alert","aria-describedby":I,"aria-labelledby":k,children:a.jsxs("div",{...P("wrapper"),children:[w&&a.jsx("div",{...P("icon"),children:w}),a.jsxs("div",{...P("body"),children:[g&&a.jsx("div",{...P("title"),"data-with-close-button":j||void 0,children:a.jsx("span",{id:k,...P("label"),children:g})}),x&&a.jsx("div",{id:I,...P("message"),"data-variant":E,children:x})]}),j&&a.jsx(Ja,{...P("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:d})]})})});ra.classes=q2;ra.displayName="@mantine/core/Alert";var H2={root:"m_b6d8b162"};function Q5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const Y5={inherit:!1},K5=(e,{variant:t,lineClamp:n,gradient:r,size:i,color:s})=>({root:{"--text-fz":On(i),"--text-lh":yR(i),"--text-gradient":t==="gradient"?Py(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Ft(s,e):void 0}}),De=lr((e,t)=>{const n=se("Text",Y5,e),{lineClamp:r,truncate:i,inline:s,inherit:c,gradient:d,span:f,__staticSelector:p,vars:m,className:g,style:x,classNames:b,styles:w,unstyled:j,variant:C,mod:T,size:E,...R}=n,_=Me({name:["Text",p],props:n,classes:H2,className:g,style:x,classNames:b,styles:w,unstyled:j,vars:m,varsResolver:K5});return a.jsx(ce,{..._("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":Q5(i),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":c},T],size:E,...R})});De.classes=H2;De.displayName="@mantine/core/Text";var G2={root:"m_849cf0da"};const X5={underline:"hover"},At=lr((e,t)=>{const{underline:n,className:r,unstyled:i,mod:s,...c}=se("Anchor",X5,e);return a.jsx(De,{component:"a",ref:t,className:It({[G2.root]:!i},r),...c,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:i})});At.classes=G2;At.displayName="@mantine/core/Anchor";const[Z5,Ac]=gr("AppShell was not found in tree");var es={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const J5={},e0=ge((e,t)=>{const n=se("AppShellAside",J5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Ac();return b.disabled?null:a.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("aside",{className:i,classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});e0.classes=es;e0.displayName="@mantine/core/AppShellAside";const e7={},t0=ge((e,t)=>{const n=se("AppShellFooter",e7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Ac();return b.disabled?null:a.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("footer",{className:It({[hc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-footer-z-index":(m??b.zIndex)?.toString()}})});t0.classes=es;t0.displayName="@mantine/core/AppShellFooter";const t7={},n0=ge((e,t)=>{const n=se("AppShellHeader",t7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Ac();return b.disabled?null:a.jsx(ce,{component:"header",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("header",{className:It({[hc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-header-z-index":(m??b.zIndex)?.toString()}})});n0.classes=es;n0.displayName="@mantine/core/AppShellHeader";const n7={},r0=ge((e,t)=>{const n=se("AppShellMain",n7,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Ac();return a.jsx(ce,{component:"main",ref:t,...p.getStyles("main",{className:i,style:s,classNames:r,styles:c}),...f})});r0.classes=es;r0.displayName="@mantine/core/AppShellMain";function md(e){return typeof e=="object"?e.base:e}function gd(e){const t=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||t}function vd(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function r7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i}){const s=r?.width,c="translateX(var(--app-shell-aside-width))",d="translateX(calc(var(--app-shell-aside-width) * -1))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-aside-width"]="100%",n[r?.breakpoint]["--app-shell-aside-offset"]="0px"),gd(s)){const f=le(md(s));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(vd(s)&&(typeof s.base<"u"&&(e["--app-shell-aside-width"]=le(s.base),e["--app-shell-aside-offset"]=le(s.base)),an(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=le(s[f]),t[f]["--app-shell-aside-offset"]=le(s[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=c,t[f]["--app-shell-aside-transform-rtl"]=d,t[f]["--app-shell-aside-offset"]="0px !important"}if(r?.collapsed?.mobile){const f=Ex(r.breakpoint,i.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-aside-width"]="100%",n[f]["--app-shell-aside-offset"]="0px",n[f]["--app-shell-aside-transform"]=c,n[f]["--app-shell-aside-transform-rtl"]=d}}function o7({baseStyles:e,minMediaStyles:t,footer:n}){const r=n?.height,i="translateY(var(--app-shell-footer-height))",s=n?.offset??!0;if(gd(r)){const c=le(md(r));e["--app-shell-footer-height"]=c,s&&(e["--app-shell-footer-offset"]=c)}vd(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),s&&(e["--app-shell-footer-offset"]=le(r.base))),an(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),s&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-footer-transform"]=i,e["--app-shell-footer-offset"]="0px !important")}function i7({baseStyles:e,minMediaStyles:t,header:n}){const r=n?.height,i="translateY(calc(var(--app-shell-header-height) * -1))",s=n?.offset??!0;if(gd(r)){const c=le(md(r));e["--app-shell-header-height"]=c,s&&(e["--app-shell-header-offset"]=c)}vd(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),s&&(e["--app-shell-header-offset"]=le(r.base))),an(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),s&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-header-transform"]=i,e["--app-shell-header-offset"]="0px !important")}function a7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i}){const s=r?.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",d="translateX(var(--app-shell-navbar-width))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-navbar-width"]="100%",n[r?.breakpoint]["--app-shell-navbar-offset"]="0px"),gd(s)){const f=le(md(s));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(vd(s)&&(typeof s.base<"u"&&(e["--app-shell-navbar-width"]=le(s.base),e["--app-shell-navbar-offset"]=le(s.base)),an(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=le(s[f]),t[f]["--app-shell-navbar-offset"]=le(s[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=c,t[f]["--app-shell-navbar-transform-rtl"]=d,t[f]["--app-shell-navbar-offset"]="0px !important"}if(r?.collapsed?.mobile){const f=Ex(r.breakpoint,i.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-navbar-width"]="100%",n[f]["--app-shell-navbar-offset"]="0px",n[f]["--app-shell-navbar-transform"]=c,n[f]["--app-shell-navbar-transform-rtl"]=d}}function Jv(e){return Number(e)===0?"0px":Nn(e)}function s7({padding:e,baseStyles:t,minMediaStyles:n}){gd(e)&&(t["--app-shell-padding"]=Jv(md(e))),vd(e)&&(e.base&&(t["--app-shell-padding"]=Jv(e.base)),an(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Jv(e[r]))}))}function l7({navbar:e,header:t,footer:n,aside:r,padding:i,theme:s}){const c={},d={},f={};a7({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,navbar:e,theme:s}),r7({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,aside:r,theme:s}),i7({baseStyles:f,minMediaStyles:c,header:t}),o7({baseStyles:f,minMediaStyles:c,footer:n}),s7({baseStyles:f,minMediaStyles:c,padding:i});const p=Yu(an(c),s.breakpoints).map(x=>({query:`(min-width: ${Ph(x.px)})`,styles:c[x.value]})),m=Yu(an(d),s.breakpoints).map(x=>({query:`(max-width: ${Ph(x.px)})`,styles:d[x.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function c7({navbar:e,header:t,aside:n,footer:r,padding:i}){const s=Sn(),c=Ji(),{media:d,baseStyles:f}=l7({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s});return a.jsx(tl,{media:d,styles:f,selector:c.cssVariablesSelector})}const u7={},o0=ge((e,t)=>{const n=se("AppShellNavbar",u7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Ac();return b.disabled?null:a.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("navbar",{className:i,classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});o0.classes=es;o0.displayName="@mantine/core/AppShellNavbar";const d7={},i0=lr((e,t)=>{const n=se("AppShellSection",d7,e),{classNames:r,className:i,style:s,styles:c,vars:d,grow:f,mod:p,...m}=n,g=Ac();return a.jsx(ce,{ref:t,mod:[{grow:f},p],...g.getStyles("section",{className:i,style:s,classNames:r,styles:c}),...m})});i0.classes=es;i0.displayName="@mantine/core/AppShellSection";function f7({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),i=v.useRef(-1),s=v.useRef(-1);return ER("resize",()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),Ec(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const h7={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Kr("app")},p7=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Ar=ge((e,t)=>{const n=se("AppShell",h7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:x,transitionTimingFunction:b,header:w,zIndex:j,layout:C,disabled:T,aside:E,footer:R,offsetScrollbars:_=C!=="alt",mod:P,...A}=n,k=Me({name:"AppShell",classes:es,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:p7}),I=f7({disabled:T,transitionDuration:x});return a.jsxs(Z5,{value:{getStyles:k,withBorder:m,zIndex:j,disabled:T,offsetScrollbars:_},children:[a.jsx(c7,{navbar:p,header:w,aside:E,footer:R,padding:g}),a.jsx(ce,{ref:t,...k("root"),mod:[{resizing:I,layout:C,disabled:T},P],...A})]})});Ar.classes=es;Ar.displayName="@mantine/core/AppShell";Ar.Navbar=o0;Ar.Header=n0;Ar.Main=r0;Ar.Aside=e0;Ar.Footer=t0;Ar.Section=i0;function W2(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(t=>W2(t))}:e}function Q2(e){return e?e.map(t=>W2(t)):[]}function Y2(e){return e.reduce((t,n)=>"group"in n?{...t,...Y2(n.items)}:(t[n.value]=n,t),{})}var kr={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const m7={error:null},g7=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":nt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Ft(n,e):void 0}}),Ap=ge((e,t)=>{const n=se("ComboboxChevron",m7,e),{size:r,error:i,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,mod:g,...x}=n,b=Me({name:"ComboboxChevron",classes:kr,props:n,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,varsResolver:g7,rootSelector:"chevron"});return a.jsx(ce,{component:"svg",...x,...b("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},g],ref:t,children:a.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});Ap.classes=kr;Ap.displayName="@mantine/core/ComboboxChevron";const[v7,wo]=gr("Combobox component was not found in tree"),K2=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},s)=>a.jsx(fn.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:c=>{c.preventDefault(),t?.(c)},onClick:c=>{r(),n?.(c)}}));K2.displayName="@mantine/core/ComboboxClearButton";const y7={},a0=ge((e,t)=>{const{classNames:n,styles:r,className:i,style:s,hidden:c,...d}=se("ComboboxDropdown",y7,e),f=wo();return a.jsx(zo.Dropdown,{...d,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:i,style:s,classNames:n,styles:r})})});a0.classes=kr;a0.displayName="@mantine/core/ComboboxDropdown";const x7={refProp:"ref"},X2=ge((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",x7,e);if(wo(),!Xi(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return a.jsx(zo.Target,{ref:t,refProp:r,children:n})});X2.displayName="@mantine/core/ComboboxDropdownTarget";const b7={},s0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("ComboboxEmpty",b7,e),f=wo();return a.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:s,style:i}),...d})});s0.classes=kr;s0.displayName="@mantine/core/ComboboxEmpty";function l0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:s}){const c=wo(),[d,f]=v.useState(null),p=g=>{if(e?.(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const x=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&x!==-1?(g.preventDefault(),c.store.clickSelectedOption()):i==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&i==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(c.store.listId&&c.store.dropdownOpened)||void 0,"aria-controls":c.store.dropdownOpened?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&d||void 0,autoComplete:s,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const S7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Z2=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=se("ComboboxEventsTarget",S7,e);if(!Xi(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=wo(),g=l0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...p,[r]:Bn(t,m.store.targetRef,mp(n))})});Z2.displayName="@mantine/core/ComboboxEventsTarget";const w7={},c0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("ComboboxFooter",w7,e),f=wo();return a.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:i,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});c0.classes=kr;c0.displayName="@mantine/core/ComboboxFooter";const j7={},u0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,children:d,label:f,...p}=se("ComboboxGroup",j7,e),m=wo();return a.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:i,styles:s}),...p,children:[f&&a.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:s}),children:f}),d]})});u0.classes=kr;u0.displayName="@mantine/core/ComboboxGroup";const C7={},d0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("ComboboxHeader",C7,e),f=wo();return a.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:i,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});d0.classes=kr;d0.displayName="@mantine/core/ComboboxHeader";function J2({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}J2.displayName="@mantine/core/ComboboxHiddenInput";const E7={},f0=ge((e,t)=>{const n=se("ComboboxOption",E7,e),{classNames:r,className:i,style:s,styles:c,vars:d,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:x,disabled:b,selected:w,mod:j,...C}=n,T=wo(),E=v.useId(),R=p||E;return a.jsx(ce,{...T.getStyles("option",{className:i,classNames:r,styles:c,style:s}),...C,ref:t,id:R,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":w},j],role:"option",onClick:_=>{b?_.preventDefault():(T.onOptionSubmit?.(n.value,n),f?.(_))},onMouseDown:_=>{_.preventDefault(),g?.(_)},onMouseOver:_=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),x?.(_)}})});f0.classes=kr;f0.displayName="@mantine/core/ComboboxOption";const T7={},h0=ge((e,t)=>{const n=se("ComboboxOptions",T7,e),{classNames:r,className:i,style:s,styles:c,id:d,onMouseDown:f,labelledBy:p,...m}=n,g=wo(),x=vr(d);return v.useEffect(()=>{g.store.setListId(x)},[x]),a.jsx(ce,{ref:t,...g.getStyles("options",{className:i,style:s,classNames:r,styles:c}),...m,id:x,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f?.(b)}})});h0.classes=kr;h0.displayName="@mantine/core/ComboboxOptions";const R7={withAriaAttributes:!0,withKeyboardNavigation:!0},p0=ge((e,t)=>{const n=se("ComboboxSearch",R7,e),{classNames:r,styles:i,unstyled:s,vars:c,withAriaAttributes:d,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,x=wo(),b=x.getStyles("search"),w=l0({targetType:"input",withAriaAttributes:d,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(fn,{ref:Bn(t,x.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},i],size:m||x.size,...w,...g,__staticSelector:"Combobox"})});p0.classes=kr;p0.displayName="@mantine/core/ComboboxSearch";const _7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},e_=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=se("ComboboxTarget",_7,e);if(!Xi(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=wo(),g=l0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),x=v.cloneElement(n,{...g,...p});return a.jsx(zo.Target,{ref:Bn(t,m.store.targetRef),children:x})});e_.displayName="@mantine/core/ComboboxTarget";function D7(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function A7(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function P7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function yd({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:s=!0,scrollBehavior:c="instant"}={}){const[d,f]=Yn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=v.useRef(null),m=v.useRef(-1),g=v.useRef(null),x=v.useRef(null),b=v.useRef(-1),w=v.useRef(-1),j=v.useRef(-1),C=v.useCallback((O="unknown")=>{d||(f(!0),i?.(O))},[f,i,d]),T=v.useCallback((O="unknown")=>{d&&(f(!1),r?.(O))},[f,r,d]),E=v.useCallback((O="unknown")=>{d?T(O):C(O)},[T,C,d]),R=v.useCallback(()=>{const O=document.querySelector(`#${p.current} [data-combobox-selected]`);O?.removeAttribute("data-combobox-selected"),O?.removeAttribute("aria-selected")},[]),_=v.useCallback(O=>{const $=document.getElementById(p.current)?.querySelectorAll("[data-combobox-option]");if(!$)return null;const H=O>=$.length?0:O<0?$.length-1:O;return m.current=H,$?.[H]&&!$[H].hasAttribute("data-combobox-disabled")?(R(),$[H].setAttribute("data-combobox-selected","true"),$[H].setAttribute("aria-selected","true"),$[H].scrollIntoView({block:"nearest",behavior:c}),$[H].id):null},[c,R]),P=v.useCallback(()=>{const O=document.querySelector(`#${p.current} [data-combobox-active]`);if(O){const L=document.querySelectorAll(`#${p.current} [data-combobox-option]`),$=Array.from(L).findIndex(H=>H===O);return _($)}return _(0)},[_]),A=v.useCallback(()=>_(A7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[_,s]),k=v.useCallback(()=>_(D7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[_,s]),I=v.useCallback(()=>_(P7(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[_]),B=v.useCallback((O="selected",L)=>{j.current=window.setTimeout(()=>{const $=document.querySelectorAll(`#${p.current} [data-combobox-option]`),H=Array.from($).findIndex(M=>M.hasAttribute(`data-combobox-${O}`));m.current=H,L?.scrollIntoView&&$[H]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),q=v.useCallback(()=>{m.current=-1,R()},[R]),Z=v.useCallback(()=>{document.querySelectorAll(`#${p.current} [data-combobox-option]`)?.[m.current]?.click()},[]),K=v.useCallback(O=>{p.current=O},[]),Q=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),V=v.useCallback(()=>{w.current=window.setTimeout(()=>x.current.focus(),0)},[]),W=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(w.current),window.clearTimeout(j.current)},[]),{dropdownOpened:d,openDropdown:C,closeDropdown:T,toggleDropdown:E,selectedOptionIndex:m.current,getSelectedOptionIndex:W,selectOption:_,selectFirstOption:I,selectActiveOption:P,selectNextOption:A,selectPreviousOption:k,resetSelectedOption:q,updateSelectedOptionIndex:B,listId:p.current,setListId:K,clickSelectedOption:Z,searchRef:g,focusSearchInput:Q,targetRef:x,focusTarget:V}}const k7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},N7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":On(t),"--combobox-option-padding":nt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":On(t),"--combobox-option-padding":nt(t,"combobox-option-padding")}});function st(e){const t=se("Combobox",k7,e),{classNames:n,styles:r,unstyled:i,children:s,store:c,vars:d,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:x,__staticSelector:b,readOnly:w,...j}=t,C=yd(),T=c||C,E=Me({name:b||"Combobox",classes:kr,props:t,classNames:n,styles:r,unstyled:i,vars:d,varsResolver:N7}),R=()=>{p?.(),T.closeDropdown()};return a.jsx(v7,{value:{getStyles:E,store:T,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:x,readOnly:w},children:a.jsx(zo,{opened:T.dropdownOpened,...j,onChange:_=>!_&&R(),withRoles:!1,unstyled:i,children:s})})}const O7=e=>e;st.extend=O7;st.classes=kr;st.displayName="@mantine/core/Combobox";st.Target=e_;st.Dropdown=a0;st.Options=h0;st.Option=f0;st.Search=p0;st.Empty=s0;st.Chevron=Ap;st.Footer=c0;st.Header=d0;st.EventsTarget=Z2;st.DropdownTarget=X2;st.Group=u0;st.ClearButton=K2;st.HiddenInput=J2;var t_={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const n_=t_,Pp=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:s,children:c,label:d,description:f,id:p,disabled:m,error:g,size:x,labelPosition:b="left",bodyElement:w="div",labelElement:j="label",variant:C,style:T,vars:E,mod:R,..._},P)=>{const A=Me({name:e,props:t,className:n,style:T,classes:t_,classNames:r,styles:i,unstyled:s});return a.jsx(ce,{...A("root"),ref:P,__vars:{"--label-fz":On(x),"--label-lh":nt(x,"label-lh")},mod:[{"label-position":b},R],variant:C,size:x,..._,children:a.jsxs(ce,{component:w,htmlFor:w==="label"?p:void 0,...A("body"),children:[c,a.jsxs("div",{...A("labelWrapper"),"data-disabled":m||void 0,children:[d&&a.jsx(ce,{component:j,htmlFor:j==="label"?p:void 0,...A("label"),"data-disabled":m||void 0,children:d}),f&&a.jsx(fn.Description,{size:x,__inheritStyles:!1,...A("description"),children:f}),g&&typeof g!="boolean"&&a.jsx(fn.Error,{size:x,__inheritStyles:!1,...A("error"),children:g})]})]})})});Pp.displayName="@mantine/core/InlineInput";const r_=v.createContext(null),M7=r_.Provider,o_=()=>v.useContext(r_),[I7,L7]=Zi();var i_={card:"m_26775b0a"};const $7={withBorder:!0},z7=(e,{radius:t})=>({card:{"--card-radius":Ut(t)}}),m0=ge((e,t)=>{const n=se("CheckboxCard",$7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:x,onClick:b,defaultChecked:w,onChange:j,...C}=n,T=Me({name:"CheckboxCard",classes:i_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:z7,rootSelector:"card"}),E=o_(),R=typeof p=="boolean"?p:E?E.value.includes(x||""):void 0,[_,P]=Yn({value:R,defaultValue:w,finalValue:!1,onChange:j});return a.jsx(I7,{value:{checked:_},children:a.jsx(er,{ref:t,mod:[{"with-border":g,checked:_},m],...T("card"),...C,role:"checkbox","aria-checked":_,onClick:A=>{b?.(A),E?.onChange(x||""),P(!_)}})})});m0.displayName="@mantine/core/CheckboxCard";m0.classes=i_;function g0({children:e,role:t}){const n=Dc();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const U7={},v0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:d,readOnly:f,...p}=se("CheckboxGroup",U7,e),[m,g]=Yn({value:n,defaultValue:r,finalValue:[],onChange:i}),x=b=>{const w=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(w)?m.filter(j=>j!==w):[...m,w])};return a.jsx(M7,{value:{value:m,onChange:x,size:s},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(g0,{role:"group",children:d})})})});v0.classes=fn.Wrapper.classes;v0.displayName="@mantine/core/CheckboxGroup";function kp({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return a.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:a.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function a_({indeterminate:e,...t}){return e?a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:a.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):a.jsx(kp,{...t})}var s_={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const B7={icon:a_},V7=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const d=go({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--checkbox-size":nt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ut(t),"--checkbox-color":s==="outline"?f:Ft(n,e),"--checkbox-icon-color":i?Ft(i,e):el(c,e)?ea({color:n,theme:e,autoContrast:c}):void 0}}},y0=ge((e,t)=>{const n=se("CheckboxIndicator",B7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,icon:p,indeterminate:m,radius:g,color:x,iconColor:b,autoContrast:w,checked:j,mod:C,variant:T,disabled:E,...R}=n,_=p,P=Me({name:"CheckboxIndicator",classes:s_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:V7,rootSelector:"indicator"}),A=L7(),k=typeof j=="boolean"||typeof m=="boolean"?j||m:A?.checked||!1;return a.jsx(ce,{ref:t,...P("indicator",{variant:T}),variant:T,mod:[{checked:k,disabled:E},C],...R,children:a.jsx(_,{indeterminate:m,...P("icon")})})});y0.displayName="@mantine/core/CheckboxIndicator";y0.classes=s_;var l_={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const F7={labelPosition:"right",icon:a_},q7=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const d=go({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--checkbox-size":nt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ut(t),"--checkbox-color":s==="outline"?f:Ft(n,e),"--checkbox-icon-color":i?Ft(i,e):el(c,e)?ea({color:n,theme:e,autoContrast:c}):void 0}}},Dn=ge((e,t)=>{const n=se("Checkbox",F7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,id:g,size:x,radius:b,wrapperProps:w,checked:j,labelPosition:C,description:T,error:E,disabled:R,variant:_,indeterminate:P,icon:A,rootRef:k,iconColor:I,onChange:B,autoContrast:q,mod:Z,...K}=n,Q=o_(),V=x||Q?.size,W=A,O=Me({name:"Checkbox",props:n,classes:l_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:q7}),{styleProps:L,rest:$}=ta(K),H=vr(g),M=Q?{checked:Q.value.includes($.value),onChange:ae=>{Q.onChange(ae),B?.(ae)}}:{},F=v.useRef(null),te=t||F;return v.useEffect(()=>{te&&"current"in te&&te.current&&(te.current.indeterminate=P||!1)},[P,te]),a.jsx(Pp,{...O("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:H,size:V,labelPosition:C,label:m,description:T,error:E,disabled:R,classNames:r,styles:c,unstyled:d,"data-checked":M.checked||j||void 0,variant:_,ref:k,mod:Z,...L,...w,children:a.jsxs(ce,{...O("inner"),mod:{"data-label-position":C},children:[a.jsx(ce,{component:"input",id:H,ref:te,checked:j,disabled:R,mod:{error:!!E,indeterminate:P},...O("input",{focusable:!0,variant:_}),onChange:B,...$,...M,type:"checkbox"}),a.jsx(W,{indeterminate:P,...O("icon")})]})})});Dn.classes={...l_,...n_};Dn.displayName="@mantine/core/Checkbox";Dn.Group=v0;Dn.Indicator=y0;Dn.Card=m0;function yc(e){return"group"in e}function c_({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),i=[];for(let s=0;s<e.length;s+=1){const c=e[s];if(i.length===n)return i;yc(c)&&i.push({group:c.group,items:c_({options:c.items,search:t,limit:n-i.length})}),yc(c)||c.label.toLowerCase().includes(r)&&i.push(c)}return i}function H7(e){if(e.length===0)return!0;for(const t of e)if(!("group"in t)||t.items.length>0)return!1;return!0}function u_(e,t=new Set){if(Array.isArray(e))for(const n of e)if(yc(n))u_(n.items,t);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof n.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(t.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function G7(e,t){return Array.isArray(e)?e.includes(t):e===t}function d_({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:i,renderOption:s}){if(!yc(e)){const d=G7(n,e.value),f=t&&d&&a.jsx(kp,{className:kr.optionsDropdownCheckIcon}),p=a.jsxs(a.Fragment,{children:[r==="left"&&f,a.jsx("span",{children:e.label}),r==="right"&&f]});return a.jsx(st.Option,{value:e.value,disabled:e.disabled,className:It({[kr.optionsDropdownOption]:!i}),"data-reverse":r==="right"||void 0,"data-checked":d||void 0,"aria-selected":d,active:d,children:typeof s=="function"?s({option:e,checked:d}):p})}const c=e.items.map(d=>a.jsx(d_,{data:d,value:n,unstyled:i,withCheckIcon:t,checkIconPosition:r,renderOption:s},d.value));return a.jsx(st.Group,{label:e.group,children:c})}function W7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:s,maxDropdownHeight:c,withScrollArea:d=!0,filterOptions:f=!0,withCheckIcon:p=!1,value:m,checkIconPosition:g,nothingFoundMessage:x,unstyled:b,labelId:w,renderOption:j,scrollAreaProps:C,"aria-label":T}){u_(e);const R=typeof i=="string"?(r||c_)({options:e,search:f?i:"",limit:s??1/0}):e,_=H7(R),P=R.map(A=>a.jsx(d_,{data:A,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},yc(A)?A.group:A.value));return a.jsx(st.Dropdown,{hidden:t||n&&_,"data-composed":!0,children:a.jsxs(st.Options,{labelledBy:w,"aria-label":T,children:[d?a.jsx(Xr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:P}):P,_&&x&&a.jsx(st.Empty,{children:x})]})})}const f_=v.createContext(null),Q7=f_.Provider;function Y7(){return{withinGroup:!!v.useContext(f_)}}var Np={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const K7={},X7=(e,{spacing:t})=>({group:{"--ag-spacing":Nn(t)}}),x0=ge((e,t)=>{const n=se("AvatarGroup",K7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,spacing:p,...m}=n,g=Me({name:"AvatarGroup",classes:Np,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:X7,rootSelector:"group"});return a.jsx(Q7,{value:!0,children:a.jsx(ce,{ref:t,...g("group"),...m})})});x0.classes=Np;x0.displayName="@mantine/core/AvatarGroup";function Z7(e){return a.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function J7(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}const eI=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function tI(e,t=eI){const n=J7(e),r=Math.abs(n)%t.length;return t[r]}function nI(e,t=2){const n=e.split(" ");return n.length===1?e.slice(0,t).toUpperCase():n.map(r=>r[0]).slice(0,t).join("").toUpperCase()}const rI={},oI=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c,name:d,allowedInitialsColors:f})=>{const p=s==="initials"&&typeof d=="string"?tI(d,f):s,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:i,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":nt(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Ut(n),"--avatar-bg":p||r?m.background:void 0,"--avatar-color":p||r?m.color:void 0,"--avatar-bd":p||r?m.border:void 0}}},Bs=lr((e,t)=>{const n=se("Avatar",rI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,src:p,alt:m,radius:g,color:x,gradient:b,imageProps:w,children:j,autoContrast:C,mod:T,name:E,allowedInitialsColors:R,..._}=n,P=Y7(),[A,k]=v.useState(!p),I=Me({name:"Avatar",props:n,classes:Np,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:oI});return v.useEffect(()=>k(!p),[p]),a.jsx(ce,{...I("root"),mod:[{"within-group":P.withinGroup},T],ref:t,..._,children:A?a.jsx("span",{...I("placeholder"),title:m,children:j||typeof E=="string"&&nI(E)||a.jsx(Z7,{})}):a.jsx("img",{...w,...I("image"),src:p,alt:m,onError:B=>{k(!0),w?.onError?.(B)}})})});Bs.classes=Np;Bs.displayName="@mantine/core/Avatar";Bs.Group=x0;var h_={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const iI={},aI=(e,{radius:t,color:n,gradient:r,variant:i,size:s,autoContrast:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:c});return{root:{"--badge-height":nt(s,"badge-height"),"--badge-padding-x":nt(s,"badge-padding-x"),"--badge-fz":nt(s,"badge-fz"),"--badge-radius":t===void 0?void 0:Ut(t),"--badge-bg":n||i?d.background:void 0,"--badge-color":n||i?d.color:void 0,"--badge-bd":n||i?d.border:void 0,"--badge-dot-color":i==="dot"?Ft(n,e):void 0}}},Op=lr((e,t)=>{const n=se("Badge",iI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,gradient:g,leftSection:x,rightSection:b,children:w,variant:j,fullWidth:C,autoContrast:T,circle:E,mod:R,..._}=n,P=Me({name:"Badge",props:n,classes:h_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:aI});return a.jsxs(ce,{variant:j,mod:[{block:C,circle:E,"with-right-section":!!b,"with-left-section":!!x},R],...P("root",{variant:j}),ref:t,..._,children:[x&&a.jsx("span",{...P("section"),"data-position":"left",children:x}),a.jsx("span",{...P("label"),children:w}),b&&a.jsx("span",{...P("section"),"data-position":"right",children:b})]})});Op.classes=h_;Op.displayName="@mantine/core/Badge";var p_={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const sI={iconSize:48},lI=(e,{color:t,iconSize:n,radius:r})=>{const i=go({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=go({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":uo(s.value,.07),"--bq-bg-dark":uo(i.value,.06),"--bq-bd":Ft(t,e),"--bq-icon-size":le(n),"--bq-radius":Ut(r)}}},b0=ge((e,t)=>{const n=se("Blockquote",sI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,children:p,icon:m,iconSize:g,cite:x,...b}=n,w=Me({name:"Blockquote",classes:p_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:lI});return a.jsxs(ce,{component:"blockquote",ref:t,...w("root"),...b,children:[m&&a.jsx("span",{...w("icon"),children:m}),p,x&&a.jsx("cite",{...w("cite"),children:x})]})});b0.classes=p_;b0.displayName="@mantine/core/Blockquote";var Pc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const LC={orientation:"horizontal"},cI=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),S0=ge((e,t)=>{const n=se("ButtonGroup",LC,e),{className:r,style:i,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:x,...b}=se("ButtonGroup",LC,e),w=Me({name:"ButtonGroup",props:n,classes:Pc,className:r,style:i,classNames:s,styles:c,unstyled:d,vars:p,varsResolver:cI,rootSelector:"group"});return a.jsx(ce,{...w("group"),ref:t,variant:g,mod:[{"data-orientation":f},x],role:"group",...b})});S0.classes=Pc;S0.displayName="@mantine/core/ButtonGroup";const $C={},uI=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":nt(c,"section-height"),"--section-padding-x":nt(c,"section-padding-x"),"--section-fz":c?.includes("compact")?On(c.replace("compact-","")):On(c),"--section-radius":t===void 0?void 0:Ut(t),"--section-bg":n||i?d.background:void 0,"--section-color":d.color,"--section-bd":n||i?d.border:void 0}}},w0=ge((e,t)=>{const n=se("ButtonGroupSection",$C,e),{className:r,style:i,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:x,...b}=se("ButtonGroupSection",$C,e),w=Me({name:"ButtonGroupSection",props:n,classes:Pc,className:r,style:i,classNames:s,styles:c,unstyled:d,vars:f,varsResolver:uI,rootSelector:"groupSection"});return a.jsx(ce,{...w("groupSection"),ref:t,variant:p,...b})});w0.classes=Pc;w0.displayName="@mantine/core/ButtonGroupSection";const dI={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},fI={},hI=(e,{radius:t,color:n,gradient:r,variant:i,size:s,justify:c,autoContrast:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:d});return{root:{"--button-justify":c,"--button-height":nt(s,"button-height"),"--button-padding-x":nt(s,"button-padding-x"),"--button-fz":s?.includes("compact")?On(s.replace("compact-","")):On(s),"--button-radius":t===void 0?void 0:Ut(t),"--button-bg":n||i?f.background:void 0,"--button-hover":n||i?f.hover:void 0,"--button-color":f.color,"--button-bd":n||i?f.border:void 0,"--button-hover-color":n||i?f.hoverColor:void 0}}},ke=lr((e,t)=>{const n=se("Button",fI,e),{style:r,vars:i,className:s,color:c,disabled:d,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:x,radius:b,loading:w,loaderProps:j,gradient:C,classNames:T,styles:E,unstyled:R,"data-disabled":_,autoContrast:P,mod:A,...k}=n,I=Me({name:"Button",props:n,classes:Pc,className:s,style:r,classNames:T,styles:E,unstyled:R,vars:i,varsResolver:hI}),B=!!p,q=!!m;return a.jsxs(er,{ref:t,...I("root",{active:!d&&!w&&!_}),unstyled:R,variant:x,disabled:d||w,mod:[{disabled:d||_,loading:w,block:g,"with-left-section":B,"with-right-section":q},A],...k,children:[a.jsx(hi,{mounted:!!w,transition:dI,duration:150,children:Z=>a.jsx(ce,{component:"span",...I("loader",{style:Z}),"aria-hidden":!0,children:a.jsx(Pr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...I("inner"),children:[p&&a.jsx(ce,{component:"span",...I("section"),mod:{position:"left"},children:p}),a.jsx(ce,{component:"span",mod:{loading:w},...I("label"),children:f}),m&&a.jsx(ce,{component:"span",...I("section"),mod:{position:"right"},children:m})]})]})});ke.classes=Pc;ke.displayName="@mantine/core/Button";ke.Group=S0;ke.GroupSection=w0;var m_={root:"m_4451eb3a"};const pI={},Jn=lr((e,t)=>{const n=se("Center",pI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,inline:p,mod:m,...g}=n,x=Me({name:"Center",props:n,classes:m_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f});return a.jsx(ce,{ref:t,mod:[{inline:p},m],...x("root"),...g})});Jn.classes=m_;Jn.displayName="@mantine/core/Center";const[mI,gI]=Zi(),vI={};function g_(e){const{value:t,defaultValue:n,onChange:r,multiple:i,children:s}=se("ChipGroup",vI,e),[c,d]=Yn({value:t,defaultValue:n,finalValue:i?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?d(c.includes(g)?c.filter(x=>x!==g):[...c,g]):d(g)};return a.jsx(mI,{value:{isChipSelected:f,onChange:p,multiple:i},children:s})}g_.displayName="@mantine/core/ChipGroup";var v_={root:"m_f59ffda3",label:"m_be049a53","label--outline":"m_3904c1af","label--filled":"m_fa109255","label--light":"m_f7e165c3",iconWrapper:"m_9ac86df9",checkIcon:"m_d6d72580",input:"m_bde07329"};const yI={type:"checkbox"},xI=(e,{size:t,radius:n,variant:r,color:i,autoContrast:s})=>{const c=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":On(t),"--chip-size":nt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ut(n),"--chip-checked-padding":nt(t,"chip-checked-padding"),"--chip-padding":nt(t,"chip-padding"),"--chip-icon-size":nt(t,"chip-icon-size"),"--chip-bg":i||r?c.background:void 0,"--chip-hover":i||r?c.hover:void 0,"--chip-color":i||r?c.color:void 0,"--chip-bd":i||r?c.border:void 0,"--chip-spacing":nt(t,"chip-spacing")}}},Ju=ge((e,t)=>{const n=se("Chip",yI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,id:p,checked:m,defaultChecked:g,onChange:x,value:b,wrapperProps:w,type:j,disabled:C,children:T,size:E,variant:R,icon:_,rootRef:P,autoContrast:A,mod:k,...I}=n,B=Me({name:"Chip",classes:v_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:xI}),q=gI(),Z=vr(p),{styleProps:K,rest:Q}=ta(I),[V,W]=Yn({value:m,defaultValue:g,finalValue:!1,onChange:x}),O=q?{checked:q.isChipSelected(b),onChange:$=>{q.onChange($),x?.($.currentTarget.checked)},type:q.multiple?"checkbox":"radio"}:{},L=O.checked||V;return a.jsxs(ce,{size:E,variant:R,ref:P,mod:k,...B("root"),...K,...w,children:[a.jsx("input",{type:j,...B("input"),checked:L,onChange:$=>W($.currentTarget.checked),id:Z,disabled:C,ref:t,value:b,...O,...Q}),a.jsxs("label",{htmlFor:Z,"data-checked":L||void 0,"data-disabled":C||void 0,...B("label",{variant:R||"filled"}),children:[L&&a.jsx("span",{...B("iconWrapper"),children:_||a.jsx(kp,{...B("checkIcon")})}),a.jsx("span",{children:T})]})]})});Ju.classes=v_;Ju.displayName="@mantine/core/Chip";Ju.Group=g_;var y_={root:"m_b183c0a2"};const bI={},SI=(e,{color:t})=>({root:{"--code-bg":t?Ft(t,e):void 0}}),Mp=ge((e,t)=>{const n=se("Code",bI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,color:p,block:m,variant:g,mod:x,...b}=n,w=Me({name:"Code",props:n,classes:y_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:SI});return a.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},x],...w("root"),...b,dir:"ltr"})});Mp.classes=y_;Mp.displayName="@mantine/core/Code";var x_={root:"m_7485cace"};const wI={},jI=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:nt(t,"container-size")}}),xd=ge((e,t)=>{const n=se("Container",wI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,fluid:p,mod:m,...g}=n,x=Me({name:"Container",classes:x_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:jI});return a.jsx(ce,{ref:t,mod:[{fluid:p},m],...x("root"),...g})});xd.classes=x_;xd.displayName="@mantine/core/Container";const CI={timeout:1e3};function j0(e){const{children:t,timeout:n,value:r,...i}=se("CopyButton",CI,e),s=xR({timeout:n}),c=()=>s.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:s.copied,...i})})}j0.displayName="@mantine/core/CopyButton";var b_={root:"m_3eebeb36",label:"m_9e365f20"};const EI={orientation:"horizontal"},TI=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Ft(t,e):void 0,"--divider-border-style":n,"--divider-size":nt(r,"divider-size")}}),yn=ge((e,t)=>{const n=se("Divider",EI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,color:p,orientation:m,label:g,labelPosition:x,mod:b,...w}=n,j=Me({name:"Divider",classes:b_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:TI});return a.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...j("root"),...w,role:"separator",children:g&&a.jsx(ce,{component:"span",mod:{position:x},...j("label"),children:g})})});yn.classes=b_;yn.displayName="@mantine/core/Divider";function RI({open:e,close:t,openDelay:n,closeDelay:r}){const i=v.useRef(-1),s=v.useRef(-1),c=()=>{window.clearTimeout(i.current),window.clearTimeout(s.current)},d=()=>{c(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():s.current=window.setTimeout(t,r)};return v.useEffect(()=>c,[]),{openDropdown:d,closeDropdown:f}}const[zC,S_]=gr("Grid component was not found in tree"),Vy=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,UC=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Vy(e,t),BC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},VC=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function _I({span:e,order:t,offset:n,selector:r}){const i=Sn(),s=S_(),c=s.breakpoints||i.breakpoints,f=Po(e)===void 0?12:Po(e),p=Xa({"--col-order":Po(t)?.toString(),"--col-flex-grow":BC(f,s.grow),"--col-flex-basis":Vy(f,s.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":UC(f,s.columns,s.grow),"--col-offset":VC(Po(n),s.columns)}),m=an(c).reduce((b,w)=>(b[w]||(b[w]={}),typeof t=="object"&&t[w]!==void 0&&(b[w]["--col-order"]=t[w]?.toString()),typeof e=="object"&&e[w]!==void 0&&(b[w]["--col-flex-grow"]=BC(e[w],s.grow),b[w]["--col-flex-basis"]=Vy(e[w],s.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=UC(e[w],s.columns,s.grow)),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-offset"]=VC(n[w],s.columns)),b),{}),x=Yu(an(m),c).filter(b=>an(m[b.value]).length>0).map(b=>({query:s.type==="container"?`mantine-grid (min-width: ${c[b.value]})`:`(min-width: ${c[b.value]})`,styles:m[b.value]}));return a.jsx(tl,{styles:p,media:s.type==="container"?void 0:x,container:s.type==="container"?x:void 0,selector:r})}var C0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const DI={span:12},E0=ge((e,t)=>{const n=se("GridCol",DI,e),{classNames:r,className:i,style:s,styles:c,vars:d,span:f,order:p,offset:m,...g}=n,x=S_(),b=fd();return a.jsxs(a.Fragment,{children:[a.jsx(_I,{selector:`.${b}`,span:f,order:p,offset:m}),a.jsx(ce,{ref:t,...x.getStyles("col",{className:It(i,b),style:s,classNames:r,styles:c}),...g})]})});E0.classes=C0;E0.displayName="@mantine/core/GridCol";function FC({gutter:e,selector:t,breakpoints:n,type:r}){const i=Sn(),s=n||i.breakpoints,c=Xa({"--grid-gutter":Nn(Po(e))}),d=an(s).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Nn(e[g])),m),{}),p=Yu(an(d),s).filter(m=>an(d[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${s[m.value]})`:`(min-width: ${s[m.value]})`,styles:d[m.value]}));return a.jsx(tl,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const AI={gutter:"md",grow:!1,columns:12},PI=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),ir=ge((e,t)=>{const n=se("Grid",AI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,grow:p,gutter:m,columns:g,align:x,justify:b,children:w,breakpoints:j,type:C,...T}=n,E=Me({name:"Grid",classes:C0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:PI}),R=fd();return C==="container"&&j?a.jsxs(zC,{value:{getStyles:E,grow:p,columns:g||12,breakpoints:j,type:C},children:[a.jsx(FC,{selector:`.${R}`,...n}),a.jsx("div",{...E("container"),children:a.jsx(ce,{ref:t,...E("root",{className:R}),...T,children:a.jsx("div",{...E("inner"),children:w})})})]}):a.jsxs(zC,{value:{getStyles:E,grow:p,columns:g||12,breakpoints:j,type:C},children:[a.jsx(FC,{selector:`.${R}`,...n}),a.jsx(ce,{ref:t,...E("root",{className:R}),...T,children:a.jsx("div",{...E("inner"),children:w})})]})});ir.classes=C0;ir.displayName="@mantine/core/Grid";ir.Col=E0;function Uh(){return Uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uh.apply(null,arguments)}function T0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var kI=v.useLayoutEffect,NI=function(t){var n=En.useRef(t);return kI(function(){n.current=t}),n},qC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},OI=function(t,n){var r=En.useRef();return En.useCallback(function(i){t.current=i,r.current&&qC(r.current,null),r.current=n,n&&qC(n,i)},[n])},HC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},MI=function(t){Object.keys(HC).forEach(function(n){t.style.setProperty(n,HC[n],"important")})},GC=MI,dr=null,WC=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function II(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),dr||(dr=document.createElement("textarea"),dr.setAttribute("tabindex","-1"),dr.setAttribute("aria-hidden","true"),GC(dr)),dr.parentNode===null&&document.body.appendChild(dr);var i=e.paddingSize,s=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(x){var b=x;dr.style[b]=c[b]}),GC(dr),dr.value=t;var f=WC(dr,e);dr.value=t,f=WC(dr,e),dr.value="x";var p=dr.scrollHeight-i,m=p*n;d==="border-box"&&(m=m+i+s),f=Math.max(m,f);var g=p*r;return d==="border-box"&&(g=g+i+s),f=Math.min(g,f),[f,p]}var QC=function(){},LI=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},$I=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],zI=!!document.documentElement.currentStyle,UI=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=LI($I,n),i=r.boxSizing;if(i==="")return null;zI&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:c}},BI=UI;function R0(e,t,n){var r=NI(n);v.useLayoutEffect(function(){var i=function(c){return r.current(c)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var VI=function(t,n){R0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},FI=function(t){R0(window,"resize",t)},qI=function(t){R0(document.fonts,"loadingdone",t)},HI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],GI=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,s=t.minRows,c=t.onChange,d=c===void 0?QC:c,f=t.onHeightChange,p=f===void 0?QC:f,m=T0(t,HI),g=m.value!==void 0,x=v.useRef(null),b=OI(x,n),w=v.useRef(0),j=v.useRef(),C=function(){var R=x.current,_=r&&j.current?j.current:BI(R);if(_){j.current=_;var P=II(_,R.value||R.placeholder||"x",s,i),A=P[0],k=P[1];w.current!==A&&(w.current=A,R.style.setProperty("height",A+"px","important"),p(A,{rowHeight:k}))}},T=function(R){g||C(),d(R)};return v.useLayoutEffect(C),VI(x,function(){if(!g){var E=x.current.value;requestAnimationFrame(function(){var R=x.current;R&&E!==R.value&&C()})}}),FI(C),qI(C),v.createElement("textarea",Uh({},m,{onChange:T,ref:b}))},WI=v.forwardRef(GI);const QI={},rl=ge((e,t)=>{const{autosize:n,maxRows:r,minRows:i,__staticSelector:s,resize:c,...d}=se("Textarea",QI,e),f=n&&TR()!=="test",p=f?{maxRows:r,minRows:i}:{};return a.jsx(Nr,{component:f?WI:"textarea",ref:t,...d,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});rl.classes=Nr.classes;rl.displayName="@mantine/core/Textarea";function YC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const YI={serialize:JSON.stringify,deserialize:JSON.parse},kc=ge((e,t)=>{const{value:n,defaultValue:r,onChange:i,formatOnBlur:s,validationError:c,serialize:d,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:x,...b}=se("JsonInput",YI,e),[w,j]=Yn({value:n,defaultValue:r,finalValue:"",onChange:i}),[C,T]=v.useState(YC(w,f)),E=_=>{p?.(_),T(!0)},R=_=>{typeof m=="function"&&m(_);const P=YC(_.currentTarget.value,f);s&&!g&&P&&_.currentTarget.value.trim()!==""&&j(d(f(_.currentTarget.value),null,2)),T(P)};return a.jsx(rl,{value:w,onChange:_=>j(_.currentTarget.value),onFocus:E,onBlur:R,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?x:c||!0,"data-monospace":!0})});kc.classes=Nr.classes;kc.displayName="@mantine/core/JsonInput";const[KI,XI]=gr("List component was not found in tree");var _0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const ZI={},D0=ge((e,t)=>{const n=se("ListItem",ZI,e),{classNames:r,className:i,style:s,styles:c,vars:d,icon:f,children:p,mod:m,...g}=n,x=XI(),b=f||x.icon,w={classNames:r,styles:c};return a.jsx(ce,{...x.getStyles("item",{...w,className:i,style:s}),component:"li",mod:[{"with-icon":!!b,centered:x.center},m],ref:t,...g,children:a.jsxs("div",{...x.getStyles("itemWrapper",w),children:[b&&a.jsx("span",{...x.getStyles("itemIcon",w),children:b}),a.jsx("span",{...x.getStyles("itemLabel",w),children:p})]})})});D0.classes=_0;D0.displayName="@mantine/core/ListItem";const JI={type:"unordered"},eL=(e,{size:t,spacing:n})=>({root:{"--list-fz":On(t),"--list-lh":yR(t),"--list-spacing":Nn(n)}}),pr=ge((e,t)=>{const n=se("List",JI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,children:p,type:m,withPadding:g,icon:x,spacing:b,center:w,listStyleType:j,mod:C,...T}=n,E=Me({name:"List",classes:_0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:eL});return a.jsx(KI,{value:{center:w,icon:x,getStyles:E},children:a.jsx(ce,{...E("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...T,children:p})})});pr.classes=_0;pr.displayName="@mantine/core/List";pr.Item=D0;var w_={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const KC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Kr("overlay")},tL=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),Ip=ge((e,t)=>{const n=se("LoadingOverlay",KC,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:x,zIndex:b,...w}=n,j=Sn(),C=Me({name:"LoadingOverlay",classes:w_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:tL}),T={...KC.overlayProps,...g};return a.jsx(hi,{transition:"fade",...p,mounted:!!x,children:E=>a.jsxs(ce,{...C("root",{style:E}),ref:t,...w,children:[a.jsx(Pr,{...C("loader"),unstyled:d,...m}),a.jsx(gc,{...T,...C("overlay"),darkHidden:!0,unstyled:d,color:g?.color||j.white}),a.jsx(gc,{...T,...C("overlay"),lightHidden:!0,unstyled:d,color:g?.color||j.colors.dark[5]})]})})});Ip.classes=w_;Ip.displayName="@mantine/core/LoadingOverlay";const[nL,bd]=gr("Menu component was not found in the tree");var Nc={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const rL={},A0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("MenuDivider",rL,e),f=bd();return a.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:i,styles:s,classNames:n}),...d})});A0.classes=Nc;A0.displayName="@mantine/core/MenuDivider";const oL={},P0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=se("MenuDropdown",oL,e),x=v.useRef(null),b=bd(),w=_r(p,T=>{(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),x.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=_r(d,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=_r(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return a.jsxs(zo.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Bn(t,x),...b.getStyles("dropdown",{className:r,style:i,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:w,children:[b.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});P0.classes=Nc;P0.displayName="@mantine/core/MenuDropdown";const iL={},k0=lr((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,color:d,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:x,"data-disabled":b,...w}=se("MenuItem",iL,e),j=bd(),C=Sn(),{dir:T}=nl(),E=v.useRef(null),R=j.getItemIndex(E.current),_=w,P=_r(_.onMouseLeave,()=>j.setHovered(-1)),A=_r(_.onMouseEnter,()=>j.setHovered(j.getItemIndex(E.current))),k=_r(_.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),I=_r(_.onFocus,()=>j.setHovered(j.getItemIndex(E.current))),B=d?C.variantColorResolver({color:d,theme:C,variant:"light"}):void 0,q=d?go({color:d,theme:C}):null;return a.jsxs(er,{...w,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:I,...j.getStyles("item",{className:r,style:i,styles:s,classNames:n}),ref:Bn(E,t),role:"menuitem",disabled:x,"data-menu-item":!0,"data-disabled":x||b||void 0,"data-hovered":j.hovered===R?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:A,onMouseLeave:P,onClick:k,onKeyDown:vR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:T,orientation:"vertical",onKeyDown:_.onKeyDown}),__vars:{"--menu-item-color":q?.isThemeColor&&q?.shade===void 0?`var(--mantine-color-${q.color}-6)`:B?.color,"--menu-item-hover":B?.hover},children:[p&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:p}),g&&a.jsx("div",{...j.getStyles("itemLabel",{styles:s,classNames:n}),children:g}),m&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:m})]})});k0.classes=Nc;k0.displayName="@mantine/core/MenuItem";const aL={},N0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("MenuLabel",aL,e),f=bd();return a.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:i,styles:s,classNames:n}),...d})});N0.classes=Nc;N0.displayName="@mantine/core/MenuLabel";const sL={refProp:"ref"},j_=v.forwardRef((e,t)=>{const{children:n,refProp:r,...i}=se("MenuTarget",sL,e);if(!Xi(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=bd(),c=n.props,d=_r(c.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),f=_r(c.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),p=_r(c.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return a.jsx(zo.Target,{refProp:r,popupType:"menu",ref:t,...i,children:v.cloneElement(n,{onClick:d,onMouseEnter:f,onMouseLeave:p,"data-expanded":s.opened?!0:void 0})})});j_.displayName="@mantine/core/MenuTarget";const lL={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Ce(e){const t=se("Menu",lL,e),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:c,trapFocus:d,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:x,openDelay:b,closeDelay:w,classNames:j,styles:C,unstyled:T,variant:E,vars:R,menuItemTabIndex:_,keepMounted:P,withInitialFocusPlaceholder:A,...k}=t,I=Me({name:"Menu",classes:Nc,props:t,classNames:j,styles:C,unstyled:T}),[B,{setHovered:q,resetHovered:Z}]=hO(),[K,Q]=Yn({value:s,defaultValue:c,finalValue:!1,onChange:f}),[V,W]=v.useState(!1),O=()=>{Q(!1),W(!1),K&&i?.()},L=()=>{Q(!0),!K&&r?.()},$=()=>{K?O():L()},{openDropdown:H,closeDropdown:M}=RI({open:L,close:O,closeDelay:w,openDelay:b}),F=je=>fO("[data-menu-item]","[data-menu-dropdown]",je),{resolvedClassNames:te,resolvedStyles:ae}=Js({classNames:j,styles:C,props:t});return Hi(()=>{Z()},[K]),a.jsx(nL,{value:{getStyles:I,opened:K,toggleDropdown:$,getItemIndex:F,hovered:B,setHovered:q,openedViaClick:V,setOpenedViaClick:W,closeOnItemClick:p,closeDropdown:x==="click"?O:M,openDropdown:x==="click"?L:H,closeDropdownImmediately:O,loop:m,trigger:x,unstyled:T,menuItemTabIndex:_,withInitialFocusPlaceholder:A},children:a.jsx(zo,{...k,opened:K,onChange:$,defaultOpened:c,trapFocus:P?!1:d,closeOnEscape:g,__staticSelector:"Menu",classNames:te,styles:ae,unstyled:T,variant:E,keepMounted:P,children:n})})}Ce.extend=e=>e;Ce.withProps=W3(Ce);Ce.classes=Nc;Ce.displayName="@mantine/core/Menu";Ce.Item=k0;Ce.Label=N0;Ce.Dropdown=P0;Ce.Target=j_;Ce.Divider=A0;const[cL,Oc]=gr("Modal component was not found in tree");var oa={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const uL={},Lp=ge((e,t)=>{const n=se("ModalBody",uL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Oc();return a.jsx(M2,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:c,className:i}),...f})});Lp.classes=oa;Lp.displayName="@mantine/core/ModalBody";const dL={},$p=ge((e,t)=>{const n=se("ModalCloseButton",dL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Oc();return a.jsx(I2,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:c,className:i}),...f})});$p.classes=oa;$p.displayName="@mantine/core/ModalCloseButton";const fL={},zp=ge((e,t)=>{const n=se("ModalContent",fL,e),{classNames:r,className:i,style:s,styles:c,vars:d,children:f,__hidden:p,...m}=n,g=Oc(),x=g.scrollAreaComponent||C5;return a.jsx(L2,{...g.getStyles("content",{className:i,style:s,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:i,style:s,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...m,children:a.jsx(x,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});zp.classes=oa;zp.displayName="@mantine/core/ModalContent";const hL={},Up=ge((e,t)=>{const n=se("ModalHeader",hL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Oc();return a.jsx($2,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:c,className:i}),...f})});Up.classes=oa;Up.displayName="@mantine/core/ModalHeader";const pL={},Bp=ge((e,t)=>{const n=se("ModalOverlay",pL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Oc();return a.jsx(z2,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:c,className:i}),...f})});Bp.classes=oa;Bp.displayName="@mantine/core/ModalOverlay";const mL={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Kr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},gL=(e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:Ut(t),"--modal-size":nt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(i)}}),Vp=ge((e,t)=>{const n=se("ModalRoot",mL,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:x,centered:b,xOffset:w,__staticSelector:j,...C}=n,T=Me({name:j,classes:oa,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:gL});return a.jsx(cL,{value:{yOffset:p,scrollAreaComponent:m,getStyles:T,fullScreen:x},children:a.jsx(O2,{ref:t,...T("root"),"data-full-screen":x||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Xr.Autosize||void 0,unstyled:d,...C})})});Vp.classes=oa;Vp.displayName="@mantine/core/ModalRoot";const[vL,yL]=Zi();function C_({children:e}){const[t,n]=v.useState([]),[r,i]=v.useState(Kr("modal"));return a.jsx(vL,{value:{stack:t,addModal:(s,c)=>{n(d=>[...new Set([...d,s])]),i(d=>typeof c=="number"&&typeof d=="number"?Math.max(d,c):d)},removeModal:s=>n(c=>c.filter(d=>d!==s)),getZIndex:s=>`calc(${r} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}C_.displayName="@mantine/core/ModalStack";const xL={},Fp=ge((e,t)=>{const n=se("ModalTitle",xL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Oc();return a.jsx(U2,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:c,className:i}),...f})});Fp.classes=oa;Fp.displayName="@mantine/core/ModalTitle";const bL={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Kr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Vn=ge((e,t)=>{const{title:n,withOverlay:r,overlayProps:i,withCloseButton:s,closeButtonProps:c,children:d,radius:f,opened:p,stackId:m,zIndex:g,...x}=se("Modal",bL,e),b=yL(),w=!!n||s,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:p;return v.useEffect(()=>{b&&m&&(p?b.addModal(m,g||Kr("modal")):b.removeModal(m))},[p,m,g]),a.jsxs(Vp,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...x,...j,children:[r&&a.jsx(Bp,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...i}),a.jsxs(zp,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[w&&a.jsxs(Up,{children:[n&&a.jsx(Fp,{children:n}),s&&a.jsx($p,{...c})]}),a.jsx(Lp,{children:d})]})]})});Vn.classes=oa;Vn.displayName="@mantine/core/Modal";Vn.Root=Vp;Vn.Overlay=Bp;Vn.Content=zp;Vn.Body=Lp;Vn.Header=Up;Vn.Title=Fp;Vn.CloseButton=$p;Vn.Stack=C_;const[SL,O0]=Zi(),[wL,jL]=Zi();var qp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const CL={},EL=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?nt(t):nt(n,"pg-gap")}}),M0=ge((e,t)=>{const n=se("PillGroup",CL,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,disabled:m,...g}=n,b=O0()?.size||p||void 0,w=Me({name:"PillGroup",classes:qp,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:EL,stylesCtx:{size:b},rootSelector:"group"});return a.jsx(wL,{value:{size:b,disabled:m},children:a.jsx(ce,{ref:t,size:b,...w("group"),...g})})});M0.classes=qp;M0.displayName="@mantine/core/PillGroup";const TL={variant:"default"},RL=(e,{radius:t},{size:n})=>({root:{"--pill-fz":nt(n,"pill-fz"),"--pill-height":nt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ut(t)}}),Vs=ge((e,t)=>{const n=se("Pill",TL,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:x,removeButtonProps:b,radius:w,size:j,disabled:C,mod:T,...E}=n,R=jL(),_=O0(),P=j||R?.size||void 0,A=_?.variant==="filled"?"contrast":p||"default",k=Me({name:"Pill",classes:qp,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:RL,stylesCtx:{size:P}});return a.jsxs(ce,{component:"span",ref:t,variant:A,size:P,...k("root",{variant:A}),mod:[{"with-remove":g&&!C,disabled:C||R?.disabled},T],...E,children:[a.jsx("span",{...k("label"),children:m}),g&&a.jsx(Ja,{variant:"transparent",radius:w,tabIndex:-1,"aria-hidden":!0,unstyled:d,...b,...k("remove",{className:b?.className,style:b?.style}),onMouseDown:I=>{I.preventDefault(),I.stopPropagation(),b?.onMouseDown?.(I)},onClick:I=>{I.stopPropagation(),x?.(),b?.onClick?.(I)}})]})});Vs.classes=qp;Vs.displayName="@mantine/core/Pill";Vs.Group=M0;var E_={field:"m_45c4369d"};const _L={type:"visible"},I0=ge((e,t)=>{const n=se("PillsInputField",_L,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,type:p,disabled:m,id:g,pointer:x,mod:b,...w}=n,j=O0(),C=Dc(),T=Me({name:"PillsInputField",classes:E_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"field"}),E=m||j?.disabled;return a.jsx(ce,{component:"input",ref:Bn(t,j?.fieldRef),"data-type":p,disabled:E,mod:[{disabled:E,pointer:x},b],...T("field"),...w,id:C?.inputId||g,"aria-invalid":j?.hasError,"aria-describedby":C?.describedBy,type:"text",onMouseDown:R=>!x&&R.stopPropagation()})});I0.classes=E_;I0.displayName="@mantine/core/PillsInputField";const DL={},xc=ge((e,t)=>{const n=se("PillsInput",DL,e),{children:r,onMouseDown:i,onClick:s,size:c,disabled:d,__staticSelector:f,error:p,variant:m,...g}=n,x=v.useRef(null);return a.jsx(SL,{value:{fieldRef:x,size:c,disabled:d,hasError:!!p,variant:m},children:a.jsx(Nr,{size:c,error:p,variant:m,component:"div",ref:t,onMouseDown:b=>{b.preventDefault(),i?.(b),x.current?.focus()},onClick:b=>{b.preventDefault(),b.currentTarget.closest("fieldset")?.disabled||(x.current?.focus(),s?.(b))},...g,multiline:!0,disabled:d,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});xc.displayName="@mantine/core/PillsInput";xc.Field=I0;function AL({data:e,value:t}){const n=t.map(i=>i.trim().toLowerCase());return e.reduce((i,s)=>(yc(s)?i.push({group:s.group,items:s.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(s.value.toLowerCase().trim())===-1&&i.push(s),i),[])}const PL={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Hp=ge((e,t)=>{const n=se("MultiSelect",PL,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,value:m,defaultValue:g,onChange:x,onKeyDown:b,variant:w,data:j,dropdownOpened:C,defaultDropdownOpened:T,onDropdownOpen:E,onDropdownClose:R,selectFirstOptionOnChange:_,onOptionSubmit:P,comboboxProps:A,filter:k,limit:I,withScrollArea:B,maxDropdownHeight:q,searchValue:Z,defaultSearchValue:K,onSearchChange:Q,readOnly:V,disabled:W,onFocus:O,onBlur:L,radius:$,rightSection:H,rightSectionWidth:M,rightSectionPointerEvents:F,rightSectionProps:te,leftSection:ae,leftSectionWidth:je,leftSectionPointerEvents:xe,leftSectionProps:we,inputContainer:We,inputWrapperOrder:Ee,withAsterisk:ot,labelProps:tt,descriptionProps:Ct,errorProps:Ot,wrapperProps:Mt,description:pt,label:Rt,error:tn,maxValues:Re,searchable:Pe,nothingFoundMessage:Ke,withCheckIcon:_e,checkIconPosition:he,hidePickedOptions:Se,withErrorStyles:$e,name:be,form:Oe,id:_t,clearable:bt,clearButtonProps:nn,hiddenInputProps:Lt,placeholder:Ln,hiddenInputValuesDivider:An,required:Vo,mod:Eo,renderOption:yi,onRemove:Ir,onClear:xi,scrollAreaProps:Zr,chevronColor:fl,...bi}=n,ca=vr(_t),Fo=Q2(j),br=Y2(Fo),Hn=yd({opened:C,defaultOpened:T,onDropdownOpen:E,onDropdownClose:()=>{R?.(),Hn.resetSelectedOption()}}),{styleProps:Si,rest:{type:ua,autoComplete:is,...as}}=ta(bi),[U,X]=Yn({value:m,defaultValue:g,finalValue:[],onChange:x}),[oe,me]=Yn({value:Z,defaultValue:K,finalValue:"",onChange:Q}),Te=Je=>{me(Je),Hn.resetSelectedOption()},Ve=Me({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:d}),{resolvedClassNames:Qe,resolvedStyles:Fe}=Js({props:n,styles:c,classNames:r}),Ze=Je=>{b?.(Je),Je.key===" "&&!Pe&&(Je.preventDefault(),Hn.toggleDropdown()),Je.key==="Backspace"&&oe.length===0&&U.length>0&&(Ir?.(U[U.length-1]),X(U.slice(0,U.length-1)))},rt=U.map((Je,Kt)=>a.jsx(Vs,{withRemoveButton:!V&&!br[Je]?.disabled,onRemove:()=>{X(U.filter(gn=>Je!==gn)),Ir?.(Je)},unstyled:d,disabled:W,...Ve("pill"),children:br[Je]?.label||Je},`${Je}-${Kt}`));v.useEffect(()=>{_&&Hn.selectFirstOption()},[_,oe]);const qe=a.jsx(st.ClearButton,{...nn,onClear:()=>{xi?.(),X([]),Te("")}}),Ye=AL({data:Fo,value:U}),ft=bt&&U.length>0&&!W&&!V;return a.jsxs(a.Fragment,{children:[a.jsxs(st,{store:Hn,classNames:Qe,styles:Fe,unstyled:d,size:p,readOnly:V,__staticSelector:"MultiSelect",onOptionSubmit:Je=>{P?.(Je),Te(""),Hn.updateSelectedOptionIndex("selected"),U.includes(br[Je].value)?(X(U.filter(Kt=>Kt!==br[Je].value)),Ir?.(br[Je].value)):U.length<Re&&X([...U,br[Je].value])},...A,children:[a.jsx(st.DropdownTarget,{children:a.jsx(xc,{...Si,__staticSelector:"MultiSelect",classNames:Qe,styles:Fe,unstyled:d,size:p,className:i,style:s,variant:w,disabled:W,radius:$,__defaultRightSection:a.jsx(st.Chevron,{size:p,error:tn,unstyled:d,color:fl}),__clearSection:qe,__clearable:ft,rightSection:H,rightSectionPointerEvents:F||(qe?"all":"none"),rightSectionWidth:M,rightSectionProps:te,leftSection:ae,leftSectionWidth:je,leftSectionPointerEvents:xe,leftSectionProps:we,inputContainer:We,inputWrapperOrder:Ee,withAsterisk:ot,labelProps:tt,descriptionProps:Ct,errorProps:Ot,wrapperProps:Mt,description:pt,label:Rt,error:tn,withErrorStyles:$e,__stylesApiProps:{...n,rightSectionPointerEvents:F||(ft?"all":"none"),multiline:!0},pointer:!Pe,onClick:()=>Pe?Hn.openDropdown():Hn.toggleDropdown(),"data-expanded":Hn.dropdownOpened||void 0,id:ca,required:Vo,mod:Eo,children:a.jsxs(Vs.Group,{disabled:W,unstyled:d,...Ve("pillsList"),children:[rt,a.jsx(st.EventsTarget,{autoComplete:is,children:a.jsx(xc.Field,{...as,ref:t,id:ca,placeholder:Ln,type:!Pe&&!Ln?"hidden":"visible",...Ve("inputField"),unstyled:d,onFocus:Je=>{O?.(Je),Pe&&Hn.openDropdown()},onBlur:Je=>{L?.(Je),Hn.closeDropdown(),Te("")},onKeyDown:Ze,value:oe,onChange:Je=>{Te(Je.currentTarget.value),Pe&&Hn.openDropdown(),_&&Hn.selectFirstOption()},disabled:W,readOnly:V||!Pe,pointer:!Pe})})]})})}),a.jsx(W7,{data:Se?Ye:Fo,hidden:V||W,filter:k,search:oe,limit:I,hiddenWhenEmpty:!Ke,withScrollArea:B,maxDropdownHeight:q,filterOptions:Pe,value:U,checkIconPosition:he,withCheckIcon:_e,nothingFoundMessage:Ke,unstyled:d,labelId:Rt?`${ca}-label`:void 0,"aria-label":Rt?void 0:bi["aria-label"],renderOption:yi,scrollAreaProps:Zr})]}),a.jsx(st.HiddenInput,{name:be,valuesDivider:An,value:U,form:Oe,disabled:W,...Lt})]})});Hp.classes={...Nr.classes,...st.classes};Hp.displayName="@mantine/core/MultiSelect";function kL(e){return"group"in e}function L0({data:e}){if(kL(e)){const i=e.items.map(s=>a.jsx(L0,{data:s},s.value));return a.jsx("optgroup",{label:e.group,children:i})}const{value:t,label:n,...r}=e;return a.jsx("option",{value:e.value,...r,children:e.label},e.value)}L0.displayName="@mantine/core/NativeSelectOption";const NL={rightSectionPointerEvents:"none"},sn=ge((e,t)=>{const{data:n,children:r,size:i,error:s,rightSection:c,unstyled:d,...f}=se("NativeSelect",NL,e),p=Q2(n).map((m,g)=>a.jsx(L0,{data:m},g));return a.jsx(Nr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:i,pointer:!0,error:s,unstyled:d,rightSection:c||a.jsx(Ap,{size:i,error:s,unstyled:d}),children:r||p})});sn.classes=Nr.classes;sn.displayName="@mantine/core/NativeSelect";var T_={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const OL={withCloseButton:!0},ML=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ut(t),"--notification-color":n?Ft(n,e):void 0}}),$0=ge((e,t)=>{const n=se("Notification",OL,e),{className:r,color:i,radius:s,loading:c,withCloseButton:d,withBorder:f,title:p,icon:m,children:g,onClose:x,closeButtonProps:b,classNames:w,style:j,styles:C,unstyled:T,variant:E,vars:R,mod:_,loaderProps:P,role:A,...k}=n,I=Me({name:"Notification",classes:T_,props:n,className:r,style:j,classNames:w,styles:C,unstyled:T,vars:R,varsResolver:ML});return a.jsxs(ce,{...I("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},_],ref:t,variant:E,role:A||"alert",...k,children:[m&&!c&&a.jsx("div",{...I("icon"),children:m}),c&&a.jsx(Pr,{size:28,color:i,...P,...I("loader")}),a.jsxs("div",{...I("body"),children:[p&&a.jsx("div",{...I("title"),children:p}),a.jsx(ce,{...I("description"),mod:{"data-with-title":!!p},children:g})]}),d&&a.jsx(Ja,{iconSize:16,color:"gray",...b,unstyled:T,onClick:x,...I("closeButton")})]})});$0.classes=T_;$0.displayName="@mantine/core/Notification";function R_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var ed;(function(e){e.event="event",e.props="prop"})(ed||(ed={}));function Ba(){}function IL(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(s,c){return s===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function td(e){return!!(e||"").match(/\d/)}function cc(e){return e==null}function LL(e){return typeof e=="number"&&isNaN(e)}function __(e){return cc(e)||LL(e)||typeof e=="number"&&!isFinite(e)}function D_(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function $L(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function zL(e,t,n){var r=$L(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function UL(e){var t=v.useRef(e);t.current=e;var n=v.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function z0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),s=i[0],c=i[1]||"";return{beforeDecimal:s,afterDecimal:c,hasNegation:n,addNegation:r}}function BL(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function A_(e,t,n){for(var r="",i=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||i;return r}function XC(e,t){return Array(t+1).join(e)}function P_(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],s=r[1];if(s=Number(s),!s)return n+i;i=i.replace(".","");var c=1+s,d=i.length;return c<0?i="0."+XC("0",Math.abs(c))+i:c>=d?i=i+XC("0",c-d):i=(i.substring(0,c)||"0")+"."+i.substring(c),n+i}function ZC(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=z0(e),s=i.beforeDecimal,c=i.afterDecimal,d=i.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=s;s&&Number(m[0])&&(g=s.split("").reverse().reduce(function(j,C,T){return j.length>T?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var x=A_(m[1]||"",t,n),b=d?"-":"",w=r?".":"";return""+b+g+w+x}function Ds(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var k_=IL(function(e,t){for(var n=0,r=0,i=e.length,s=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[s-1-r]&&s-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:s-r}}}),VL=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function FL(e,t,n){return Math.min(Math.max(e,t),n)}function ey(e){return Math.max(e.selectionStart,e.selectionEnd)}function qL(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function HL(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function GL(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function WL(e,t,n,r,i,s,c){c===void 0&&(c=GL);var d=i.findIndex(function(_){return _}),f=e.slice(0,d);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var p=n.length,m=e.length,g={},x=new Array(p),b=0;b<p;b++){x[b]=-1;for(var w=0,j=m;w<j;w++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:w});if(C&&g[w]!==!0){x[b]=w,g[w]=!0;break}}}for(var T=r;T<p&&(x[T]===-1||!s(n[T]));)T++;var E=T===p||x[T]===-1?m:x[T];for(T=r-1;T>0&&x[T]===-1;)T--;var R=T===-1||x[T]===-1?0:x[T]+1;return R>E?E:r-R<E-r?R:E}function JC(e,t,n,r){var i=e.length;if(t=FL(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function QL(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(td(e[n])||td(e[n-1]));return t}function N_(e,t,n,r,i,s){s===void 0&&(s=Ba);var c=UL(function(w,j){var C,T;return __(w)?(T="",C=""):typeof w=="number"||j?(T=typeof w=="number"?P_(w):w,C=r(T)):(T=i(w,void 0),C=r(T)),{formattedValue:C,numAsString:T}}),d=v.useState(function(){return c(cc(e)?t:e,n)}),f=d[0],p=d[1],m=function(w,j){w.formattedValue!==f.formattedValue&&p({formattedValue:w.formattedValue,numAsString:w.value}),s(w,j)},g=e,x=n;cc(e)&&(g=f.numAsString,x=!0);var b=c(g,x);return v.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function YL(e){return e.replace(/[^0-9]/g,"")}function KL(e){return e}function XL(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,s=e.getInputRef,c=e.format;c===void 0&&(c=KL);var d=e.removeFormatting;d===void 0&&(d=YL);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,x=e.onChange;x===void 0&&(x=Ba);var b=e.onKeyDown;b===void 0&&(b=Ba);var w=e.onMouseUp;w===void 0&&(w=Ba);var j=e.onFocus;j===void 0&&(j=Ba);var C=e.onBlur;C===void 0&&(C=Ba);var T=e.value,E=e.getCaretBoundary;E===void 0&&(E=QL);var R=e.isValidInputCharacter;R===void 0&&(R=td);var _=e.isCharacterSame,P=R_(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=N_(T,f,!!p,c,d,m),k=A[0],I=k.formattedValue,B=k.numAsString,q=A[1],Z=v.useRef(),K=v.useRef({formattedValue:I,numAsString:B}),Q=function(Re,Pe){K.current={formattedValue:Re.formattedValue,numAsString:Re.value},q(Re,Pe)},V=v.useState(!1),W=V[0],O=V[1],L=v.useRef(null),$=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return O(!0),function(){clearTimeout($.current.setCaretTimeout),clearTimeout($.current.focusTimeout)}},[]);var H=c,M=function(Re,Pe){var Ke=parseFloat(Pe);return{formattedValue:Re,value:Pe,floatValue:isNaN(Ke)?void 0:Ke}},F=function(Re,Pe,Ke){Re.selectionStart===0&&Re.selectionEnd===Re.value.length||(Ds(Re,Pe),$.current.setCaretTimeout=setTimeout(function(){Re.value===Ke&&Re.selectionStart!==Pe&&Ds(Re,Pe)},0))},te=function(Re,Pe,Ke){return JC(Re,Pe,E(Re),Ke)},ae=function(Re,Pe,Ke){var _e=E(Pe),he=WL(Pe,I,Re,Ke,_e,R,_);return he=JC(Pe,he,_e),he},je=function(Re){var Pe=Re.formattedValue;Pe===void 0&&(Pe="");var Ke=Re.input,_e=Re.source,he=Re.event,Se=Re.numAsString,$e;if(Ke){var be=Re.inputValue||Ke.value,Oe=ey(Ke);Ke.value=Pe,$e=ae(be,Pe,Oe),$e!==void 0&&F(Ke,$e,Pe)}Pe!==I&&Q(M(Pe,Se),{event:he,source:_e})};v.useEffect(function(){var Re=K.current,Pe=Re.formattedValue,Ke=Re.numAsString;(I!==Pe||B!==Ke)&&Q(M(I,B),{event:void 0,source:ed.props})},[I,B]);var xe=L.current?ey(L.current):void 0,we=typeof window<"u"?v.useLayoutEffect:v.useEffect;we(function(){var Re=L.current;if(I!==K.current.formattedValue&&Re){var Pe=ae(K.current.formattedValue,I,xe);Re.value=I,F(Re,Pe,I)}},[I]);var We=function(Re,Pe,Ke){var _e=Pe.target,he=Z.current?VL(Z.current,_e.selectionEnd):k_(I,Re),Se=Object.assign(Object.assign({},he),{lastValue:I}),$e=d(Re,Se),be=H($e);if($e=d(be,void 0),g&&!g(M(be,$e))){var Oe=Pe.target,_t=ey(Oe),bt=ae(Re,I,_t);return Oe.value=I,F(Oe,bt,I),!1}return je({formattedValue:be,numAsString:$e,inputValue:Re,event:Pe,source:Ke,input:Pe.target}),!0},Ee=function(Re,Pe){Pe===void 0&&(Pe=0);var Ke=Re.selectionStart,_e=Re.selectionEnd;Z.current={selectionStart:Ke,selectionEnd:_e+Pe}},ot=function(Re){var Pe=Re.target,Ke=Pe.value,_e=We(Ke,Re,ed.event);_e&&x(Re),Z.current=void 0},tt=function(Re){var Pe=Re.target,Ke=Re.key,_e=Pe.selectionStart,he=Pe.selectionEnd,Se=Pe.value;Se===void 0&&(Se="");var $e;Ke==="ArrowLeft"||Ke==="Backspace"?$e=Math.max(_e-1,0):Ke==="ArrowRight"?$e=Math.min(_e+1,Se.length):Ke==="Delete"&&($e=_e);var be=0;Ke==="Delete"&&_e===he&&(be=1);var Oe=Ke==="ArrowLeft"||Ke==="ArrowRight";if($e===void 0||_e!==he&&!Oe){b(Re),Ee(Pe,be);return}var _t=$e;if(Oe){var bt=Ke==="ArrowLeft"?"left":"right";_t=te(Se,$e,bt),_t!==$e&&Re.preventDefault()}else Ke==="Delete"&&!R(Se[$e])?_t=te(Se,$e,"right"):Ke==="Backspace"&&!R(Se[$e])&&(_t=te(Se,$e,"left"));_t!==$e&&F(Pe,_t,Se),b(Re),Ee(Pe,be)},Ct=function(Re){var Pe=Re.target,Ke=function(){var _e=Pe.selectionStart,he=Pe.selectionEnd,Se=Pe.value;if(Se===void 0&&(Se=""),_e===he){var $e=te(Se,_e);$e!==_e&&F(Pe,$e,Se)}};Ke(),requestAnimationFrame(function(){Ke()}),w(Re),Ee(Pe)},Ot=function(Re){Re.persist&&Re.persist();var Pe=Re.target,Ke=Re.currentTarget;L.current=Pe,$.current.focusTimeout=setTimeout(function(){var _e=Pe.selectionStart,he=Pe.selectionEnd,Se=Pe.value;Se===void 0&&(Se="");var $e=te(Se,_e);$e!==_e&&!(_e===0&&he===Se.length)&&F(Pe,$e,Se),j(Object.assign(Object.assign({},Re),{currentTarget:Ke}))},0)},Mt=function(Re){L.current=null,clearTimeout($.current.focusTimeout),clearTimeout($.current.setCaretTimeout),C(Re)},pt=W&&qL()?"numeric":void 0,Rt=Object.assign({inputMode:pt},P,{type:t,value:I,onChange:ot,onKeyDown:tt,onMouseUp:Ct,onFocus:Ot,onBlur:Mt});if(n==="text")return i?En.createElement(En.Fragment,null,i(I,P)||null):En.createElement("span",Object.assign({},P,{ref:s}),I);if(r){var tn=r;return En.createElement(tn,Object.assign({},Rt,{ref:s}))}return En.createElement("input",Object.assign({},Rt,{ref:s}))}function eE(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var s=t.suffix;s===void 0&&(s="");var c=t.allowNegative,d=t.thousandsGroupStyle;if(d===void 0&&(d="thousand"),e===""||e==="-")return e;var f=Gp(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,x=z0(e,c),b=x.beforeDecimal,w=x.afterDecimal,j=x.addNegation;return n!==void 0&&(w=A_(w,n,!!r)),p&&(b=zL(b,p,d)),i&&(b=i+b),s&&(w=w+s),j&&(b="-"+b),e=b+(g&&m||"")+w,e}function Gp(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function ZL(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),s=r.test(e);return e=e.replace(/-/g,""),i&&!s&&t&&(e="-"+e),e}function JL(e,t){return new RegExp("(^-)|[0-9]|"+D_(e),"g")}function e6(e,t,n){return e===""?!0:!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function t6(e,t,n){var r;t===void 0&&(t=HL(e));var i=n.allowNegative,s=n.prefix;s===void 0&&(s="");var c=n.suffix;c===void 0&&(c="");var d=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,x=Gp(n),b=x.allowedDecimalSeparators,w=x.decimalSeparator,j=e[g]===w;if(td(e)&&(e===s||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=d===0?"":w;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var T=function(L,$,H){var M=!1,F=!1;s.startsWith("-")?M=!1:L.startsWith("--")?(M=!1,F=!0):c.startsWith("-")&&L.length===c.length?M=!1:L[0]==="-"&&(M=!0);var te=M?1:0;return F&&(te=2),te&&(L=L.substring(te),$-=te,H-=te),{value:L,start:$,end:H,hasNegation:M}},E=T(e,m,g),R=E.hasNegation;r=E,e=r.value,m=r.start,g=r.end;var _=T(t.lastValue,f.start,f.end),P=_.start,A=_.end,k=_.value,I=e.substring(m,g);e.length&&k.length&&(P>k.length-c.length||A<s.length)&&!(I&&c.startsWith(I))&&(e=k);var B=0;e.startsWith(s)?B+=s.length:m<s.length&&(B=m),e=e.substring(B),g-=B;var q=e.length,Z=e.length-c.length;e.endsWith(c)?q=Z:(g>Z||g>e.length-c.length)&&(q=g),e=e.substring(0,q),e=ZL(R?"-"+e:e,i),e=(e.match(JL(w))||[]).join("");var K=e.indexOf(w);e=e.replace(new RegExp(D_(w),"g"),function(L,$){return $===K?".":""});var Q=z0(e,i),V=Q.beforeDecimal,W=Q.afterDecimal,O=Q.addNegation;return p.end-p.start<f.end-f.start&&V===""&&j&&!parseFloat(W)&&(e=O?"-":""),e}function n6(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),s=e[0]==="-";i.fill(!1,0,n.length+(s?1:0));var c=e.length;return i.fill(!1,c-r.length+1,c+1),i}function r6(e){var t=Gp(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var s=e.allowNegative;if(s===void 0&&(s=!0),n===r)throw new Error(`
|
|
69
|
+
Decimal separator can't be same as thousand separator.
|
|
70
|
+
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
71
|
+
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
72
|
+
`);return i.startsWith("-")&&s&&(console.error(`
|
|
73
|
+
Prefix can't start with '-' when allowNegative is true.
|
|
74
|
+
prefix: `+i+`
|
|
75
|
+
allowNegative: `+s+`
|
|
76
|
+
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function o6(e){e=r6(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=Ba);var s=e.onBlur;s===void 0&&(s=Ba);var c=e.thousandSeparator,d=e.decimalScale,f=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var m=e.defaultValue,g=e.value,x=e.valueIsNumericString,b=e.onValueChange,w=R_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Gp(e),C=j.decimalSeparator,T=j.allowedDecimalSeparators,E=function(O){return eE(O,e)},R=function(O,L){return t6(O,L,e)},_=cc(g)?m:g,P=x??e6(_,p,t);cc(g)?cc(m)||(P=P||typeof m=="number"):P=P||typeof g=="number";var A=function(O){return __(O)?O:(typeof O=="number"&&(O=P_(O)),P&&typeof d=="number"?ZC(O,d,!!f):O)},k=N_(A(g),A(m),!!P,E,R,b),I=k[0],B=I.numAsString,q=I.formattedValue,Z=k[1],K=function(O){var L=O.target,$=O.key,H=L.selectionStart,M=L.selectionEnd,F=L.value;if(F===void 0&&(F=""),($==="Backspace"||$==="Delete")&&M<p.length){O.preventDefault();return}if(H!==M){i(O);return}$==="Backspace"&&F[0]==="-"&&H===p.length+1&&n&&Ds(L,1),d&&f&&($==="Backspace"&&F[H-1]===C?(Ds(L,H-1),O.preventDefault()):$==="Delete"&&F[H]===C&&O.preventDefault()),T?.includes($)&&F[H]===C&&Ds(L,H+1);var te=c===!0?",":c;$==="Backspace"&&F[H-1]===te&&Ds(L,H-1),$==="Delete"&&F[H]===te&&Ds(L,H+1),i(O)},Q=function(O){var L=B;if(L.match(/\d/g)||(L=""),r||(L=BL(L)),f&&d&&(L=ZC(L,d,f)),L!==B){var $=eE(L,e);Z({formattedValue:$,value:L,floatValue:parseFloat(L)},{event:O,source:ed.event})}s(O)},V=function(O){return O===C?!0:td(O)},W=function(O){var L=O.currentValue,$=O.lastValue,H=O.formattedValue,M=O.currentValueIndex,F=O.formattedValueIndex,te=L[M],ae=H[F],je=k_($,L),xe=je.to,we=function(We){return R(We).indexOf(".")+p.length};return g===0&&f&&d&&L[xe.start]===C&&we(L)<M&&we(H)>F?!1:M>=xe.start&&M<xe.end&&T&&T.includes(te)&&ae===C?!0:te===ae};return Object.assign(Object.assign({},w),{value:q,valueIsNumericString:!1,isValidInputCharacter:V,isCharacterSame:W,onValueChange:Z,format:E,removeFormatting:R,getCaretBoundary:function(O){return n6(O,e)},onKeyDown:K,onBlur:Q})}function i6(e){var t=o6(e);return En.createElement(XL,Object.assign({},t))}function tE({direction:e,style:t,...n}){return a.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:a.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var Fy={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const a6=/^(0\.0*|-0(\.0*)?)$/,s6=/^-?0\d+(\.\d+)?\.?$/;function qy(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function ty(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||qy(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function l6(e){return e.toString().replace(".","").length}function c6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&l6(t)<14&&t!==""}function nE(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,i=n===void 0||e<=n;return r&&i}const u6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},d6=(e,{size:t})=>({controls:{"--ni-chevron-size":nt(t,"ni-chevron-size")}});function f6(e,t,n){const r=e.toString().replace(/^0+/,""),i=parseFloat(r);return Number.isNaN(i)?r:i>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:bh(i,n,t)}const Wp=ge((e,t)=>{const n=se("NumberInput",u6,e),{className:r,classNames:i,styles:s,unstyled:c,vars:d,onChange:f,onValueChange:p,value:m,defaultValue:g,max:x,min:b,step:w,hideControls:j,rightSection:C,isAllowed:T,clampBehavior:E,onBlur:R,allowDecimal:_,decimalScale:P,onKeyDown:A,onKeyDownCapture:k,handlersRef:I,startValue:B,disabled:q,rightSectionPointerEvents:Z,allowNegative:K,readOnly:Q,size:V,rightSectionWidth:W,stepHoldInterval:O,stepHoldDelay:L,allowLeadingZeros:$,withKeyboardEvents:H,trimLeadingZeroesOnBlur:M,...F}=n,te=Me({name:"NumberInput",classes:Fy,props:n,classNames:i,styles:s,unstyled:c,vars:d,varsResolver:d6}),{resolvedClassNames:ae,resolvedStyles:je}=Js({classNames:i,styles:s,props:n}),[xe,we]=Yn({value:m,defaultValue:g,finalValue:"",onChange:f}),We=L!==void 0&&O!==void 0,Ee=v.useRef(null),ot=v.useRef(null),tt=v.useRef(0),Ct=(be,Oe)=>{Oe.source==="event"&&we(c6(be.floatValue,be.value)&&!a6.test(be.value)&&!($&&s6.test(be.value))?be.floatValue:be.value),p?.(be,Oe)},Ot=be=>{const Oe=String(be).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Oe?Math.max(0,(Oe[1]?Oe[1].length:0)-(Oe[2]?+Oe[2]:0)):0},Mt=be=>{Ee.current&&typeof be<"u"&&Ee.current.setSelectionRange(be,be)},pt=v.useRef(Nh);pt.current=()=>{if(!ty(xe))return;let be;const Oe=Ot(xe),_t=Ot(w),bt=Math.max(Oe,_t),nn=10**bt;if(!qy(xe)&&(typeof xe!="number"||Number.isNaN(xe)))be=bh(B,b,x);else if(x!==void 0){const Ln=(Math.round(Number(xe)*nn)+Math.round(w*nn))/nn;be=Ln<=x?Ln:x}else be=(Math.round(Number(xe)*nn)+Math.round(w*nn))/nn;const Lt=be.toFixed(bt);we(parseFloat(Lt)),p?.({floatValue:parseFloat(Lt),formattedValue:Lt,value:Lt},{source:"increment"}),setTimeout(()=>Mt(Ee.current?.value.length),0)};const Rt=v.useRef(Nh);Rt.current=()=>{if(!ty(xe))return;let be;const Oe=b!==void 0?b:K?Number.MIN_SAFE_INTEGER:0,_t=Ot(xe),bt=Ot(w),nn=Math.max(_t,bt),Lt=10**nn;if(!qy(xe)&&typeof xe!="number"||Number.isNaN(xe))be=bh(B,Oe,x);else{const An=(Math.round(Number(xe)*Lt)-Math.round(w*Lt))/Lt;be=Oe!==void 0&&An<Oe?Oe:An}const Ln=be.toFixed(nn);we(parseFloat(Ln)),p?.({floatValue:parseFloat(Ln),formattedValue:Ln,value:Ln},{source:"decrement"}),setTimeout(()=>Mt(Ee.current?.value.length),0)};const tn=be=>{A?.(be),!(Q||!H)&&(be.key==="ArrowUp"&&(be.preventDefault(),pt.current()),be.key==="ArrowDown"&&(be.preventDefault(),Rt.current()))},Re=be=>{if(k?.(be),be.key==="Backspace"){const Oe=Ee.current;Oe.selectionStart===0&&Oe.selectionStart===Oe.selectionEnd&&(be.preventDefault(),window.setTimeout(()=>Mt(0),0))}},Pe=be=>{let Oe=xe;E==="blur"&&typeof Oe=="number"&&(Oe=bh(Oe,b,x)),M&&typeof Oe=="string"&&Ot(Oe)<15&&(Oe=f6(Oe,x,b)),xe!==Oe&&we(Oe),R?.(be)};Ku(I,{increment:pt.current,decrement:Rt.current});const Ke=be=>{be?pt.current():Rt.current(),tt.current+=1},_e=be=>{if(Ke(be),We){const Oe=typeof O=="number"?O:O(tt.current);ot.current=window.setTimeout(()=>_e(be),Oe)}},he=(be,Oe)=>{be.preventDefault(),Ee.current?.focus(),Ke(Oe),We&&(ot.current=window.setTimeout(()=>_e(Oe),L))},Se=()=>{ot.current&&window.clearTimeout(ot.current),ot.current=null,tt.current=0},$e=a.jsxs("div",{...te("controls"),children:[a.jsx(er,{...te("control"),tabIndex:-1,"aria-hidden":!0,disabled:q||typeof xe=="number"&&x!==void 0&&xe>=x,mod:{direction:"up"},onMouseDown:be=>be.preventDefault(),onPointerDown:be=>{he(be,!0)},onPointerUp:Se,onPointerLeave:Se,children:a.jsx(tE,{direction:"up"})}),a.jsx(er,{...te("control"),tabIndex:-1,"aria-hidden":!0,disabled:q||typeof xe=="number"&&b!==void 0&&xe<=b,mod:{direction:"down"},onMouseDown:be=>be.preventDefault(),onPointerDown:be=>{he(be,!1)},onPointerUp:Se,onPointerLeave:Se,children:a.jsx(tE,{direction:"down"})})]});return a.jsx(Nr,{component:i6,allowNegative:K,className:It(Fy.root,r),size:V,...F,readOnly:Q,disabled:q,value:xe,getInputRef:Bn(t,Ee),onValueChange:Ct,rightSection:j||Q||!ty(xe)?C:C||$e,classNames:ae,styles:je,unstyled:c,__staticSelector:"NumberInput",decimalScale:_?P:0,onKeyDown:tn,onKeyDownCapture:Re,rightSectionPointerEvents:Z??(q?"none":void 0),rightSectionWidth:W??`var(--ni-right-section-width-${V||"sm"})`,allowLeadingZeros:$,onBlur:Pe,isAllowed:be=>E==="strict"?T?T(be)&&nE(be.floatValue,b,x):nE(be.floatValue,b,x):T?T(be):!0})});Wp.classes={...Nr.classes,...Fy};Wp.displayName="@mantine/core/NumberInput";const[h6,Qp]=gr("Pagination.Root component was not found in tree");var Sd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const p6={withPadding:!0},wd=ge((e,t)=>{const n=se("PaginationControl",p6,e),{classNames:r,className:i,style:s,styles:c,vars:d,active:f,disabled:p,withPadding:m,mod:g,...x}=n,b=Qp(),w=p||b.disabled;return a.jsx(er,{ref:t,disabled:w,mod:[{active:f,disabled:w,"with-padding":m},g],...b.getStyles("control",{className:i,style:s,classNames:r,styles:c,active:!w}),...x})});wd.classes=Sd;wd.displayName="@mantine/core/PaginationControl";function jd({style:e,children:t,path:n,...r}){return a.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r,children:a.jsx("path",{d:n,fill:"currentColor"})})}const m6=e=>a.jsx(jd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),g6=e=>a.jsx(jd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),v6=e=>a.jsx(jd,{...e,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),y6=e=>a.jsx(jd,{...e,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),x6=e=>a.jsx(jd,{...e,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),b6={icon:x6},Yp=ge((e,t)=>{const n=se("PaginationDots",b6,e),{classNames:r,className:i,style:s,styles:c,vars:d,icon:f,...p}=n,m=Qp(),g=f;return a.jsx(ce,{ref:t,...m.getStyles("dots",{className:i,style:s,styles:c,classNames:r}),...p,children:a.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Yp.classes=Sd;Yp.displayName="@mantine/core/PaginationDots";function Kp({icon:e,name:t,action:n,type:r}){const i={icon:e},s=v.forwardRef((c,d)=>{const{icon:f,...p}=se(t,i,c),m=f,g=Qp(),x=r==="next"?g.active===g.total:g.active===1;return a.jsx(wd,{disabled:g.disabled||x,ref:d,onClick:g[n],withPadding:!1,...p,children:a.jsx(m,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return s.displayName=`@mantine/core/${t}`,s}const O_=Kp({icon:m6,name:"PaginationNext",action:"onNext",type:"next"}),M_=Kp({icon:g6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),I_=Kp({icon:v6,name:"PaginationFirst",action:"onFirst",type:"previous"}),L_=Kp({icon:y6,name:"PaginationLast",action:"onLast",type:"next"});function U0({dotsIcon:e}){const t=Qp(),n=t.range.map((r,i)=>r==="dots"?a.jsx(Yp,{icon:e},i):a.jsx(wd,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...t.getItemProps?.(r),children:t.getItemProps?.(r)?.children??r},i));return a.jsx(a.Fragment,{children:n})}U0.displayName="@mantine/core/PaginationItems";const S6={siblings:1,boundaries:1},w6=(e,{size:t,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ut(n),"--pagination-control-size":nt(t,"pagination-control-size"),"--pagination-control-fz":On(t),"--pagination-active-bg":r?Ft(r,e):void 0,"--pagination-active-color":el(i,e)?ea({color:r,theme:e,autoContrast:i}):void 0}}),Xp=ge((e,t)=>{const n=se("PaginationRoot",S6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,total:p,value:m,defaultValue:g,onChange:x,disabled:b,siblings:w,boundaries:j,color:C,radius:T,onNextPage:E,onPreviousPage:R,onFirstPage:_,onLastPage:P,getItemProps:A,autoContrast:k,...I}=n,B=Me({name:"Pagination",classes:Sd,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:w6}),{range:q,setPage:Z,next:K,previous:Q,active:V,first:W,last:O}=AO({page:m,initialPage:g,onChange:x,total:p,siblings:w,boundaries:j}),L=_r(E,K),$=_r(R,Q),H=_r(_,W),M=_r(P,O);return a.jsx(h6,{value:{total:p,range:q,active:V,disabled:b,getItemProps:A,onChange:Z,onNext:L,onPrevious:$,onFirst:H,onLast:M,getStyles:B},children:a.jsx(ce,{ref:t,...B("root"),...I})})});Xp.classes=Sd;Xp.displayName="@mantine/core/PaginationRoot";const j6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},jo=ge((e,t)=>{const n=se("Pagination",j6,e),{withEdges:r,withControls:i,getControlProps:s,nextIcon:c,previousIcon:d,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:x,hideWithOnePage:b,withPages:w,...j}=n;return g<=0||b&&g===1?null:a.jsx(Xp,{ref:t,total:g,...j,children:a.jsxs(ye,{gap:x,children:[r&&a.jsx(I_,{icon:p,...s?.("first")}),i&&a.jsx(M_,{icon:d,...s?.("previous")}),w&&a.jsx(U0,{dotsIcon:m}),i&&a.jsx(O_,{icon:c,...s?.("next")}),r&&a.jsx(L_,{icon:f,...s?.("last")})]})})});jo.classes=Sd;jo.displayName="@mantine/core/Pagination";jo.Root=Xp;jo.Control=wd;jo.Dots=Yp;jo.First=I_;jo.Last=L_;jo.Next=O_;jo.Previous=M_;jo.Items=U0;const C6=({reveal:e})=>a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:a.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var Hy={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const E6={visibilityToggleIcon:C6},T6=(e,{size:t})=>({root:{"--psi-icon-size":nt(t,"psi-icon-size"),"--psi-button-size":nt(t,"psi-button-size")}}),Oo=ge((e,t)=>{const n=se("PasswordInput",E6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,required:p,error:m,leftSection:g,disabled:x,id:b,variant:w,inputContainer:j,description:C,label:T,size:E,errorProps:R,descriptionProps:_,labelProps:P,withAsterisk:A,inputWrapperOrder:k,wrapperProps:I,radius:B,rightSection:q,rightSectionWidth:Z,rightSectionPointerEvents:K,leftSectionWidth:Q,visible:V,defaultVisible:W,onVisibilityChange:O,visibilityToggleIcon:L,visibilityToggleButtonProps:$,rightSectionProps:H,leftSectionProps:M,leftSectionPointerEvents:F,withErrorStyles:te,mod:ae,...je}=n,xe=vr(b),[we,We]=Yn({value:V,defaultValue:W,finalValue:!1,onChange:O}),Ee=()=>We(!we),ot=Me({name:"PasswordInput",classes:Hy,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:T6}),{resolvedClassNames:tt,resolvedStyles:Ct}=Js({classNames:r,styles:c,props:n}),{styleProps:Ot,rest:Mt}=ta(je),pt=L,Rt=R?.id||`${xe}-error`,tn=_?.id||`${xe}-description`,Ke=`${!!m&&typeof m!="boolean"?Rt:""} ${!!C?tn:""}`,_e=Ke.trim().length>0?Ke.trim():void 0,he=a.jsx(bn,{...ot("visibilityToggle"),disabled:x,radius:B,"aria-hidden":!$,tabIndex:-1,...$,variant:$?.variant??"subtle",color:"gray",unstyled:d,onTouchEnd:Se=>{Se.preventDefault(),$?.onTouchEnd?.(Se),Ee()},onMouseDown:Se=>{Se.preventDefault(),$?.onMouseDown?.(Se),Ee()},onKeyDown:Se=>{$?.onKeyDown?.(Se),Se.key===" "&&(Se.preventDefault(),Ee())},children:a.jsx(pt,{reveal:we})});return a.jsx(fn.Wrapper,{required:p,id:xe,label:T,error:m,description:C,size:E,classNames:tt,styles:Ct,__staticSelector:"PasswordInput",unstyled:d,withAsterisk:A,inputWrapperOrder:k,inputContainer:j,variant:w,labelProps:{...P,htmlFor:xe},descriptionProps:{..._,id:tn},errorProps:{...R,id:Rt},mod:ae,...ot("root"),...Ot,...I,children:a.jsx(fn,{component:"div",error:m,leftSection:g,size:E,classNames:{...tt,input:It(Hy.input,tt.input)},styles:Ct,radius:B,disabled:x,__staticSelector:"PasswordInput",rightSectionWidth:Z,rightSection:q??he,variant:w,unstyled:d,leftSectionWidth:Q,rightSectionPointerEvents:K||"all",rightSectionProps:H,leftSectionProps:M,leftSectionPointerEvents:F,withAria:!1,withErrorStyles:te,children:a.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...ot("innerInput"),disabled:x,id:xe,ref:t,...Mt,"aria-describedby":_e,autoComplete:Mt.autoComplete||"off",type:we?"text":"password"})})})});Oo.classes={...Nr.classes,...Hy};Oo.displayName="@mantine/core/PasswordInput";const[R6,$_]=Zi(),[_6,D6]=Zi();var z_={card:"m_9dc8ae12"};const A6={withBorder:!0},P6=(e,{radius:t})=>({card:{"--card-radius":Ut(t)}}),B0=ge((e,t)=>{const n=se("RadioCard",A6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:x,onClick:b,name:w,onKeyDown:j,...C}=n,T=Me({name:"RadioCard",classes:z_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:P6,rootSelector:"card"}),{dir:E}=nl(),R=$_(),_=typeof p=="boolean"?p:R?.value===x||!1,P=w||R?.name,A=k=>{if(j?.(k),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(k.nativeEvent.code)){k.preventDefault();const I=Array.from(document.querySelectorAll(`[role="radio"][name="${P||"__mantine"}"]`)),B=I.findIndex(K=>K===k.target),q=B+1>=I.length?0:B+1,Z=B-1<0?I.length-1:B-1;k.nativeEvent.code==="ArrowDown"&&(I[q].focus(),I[q].click()),k.nativeEvent.code==="ArrowUp"&&(I[Z].focus(),I[Z].click()),k.nativeEvent.code==="ArrowLeft"&&(I[E==="ltr"?Z:q].focus(),I[E==="ltr"?Z:q].click()),k.nativeEvent.code==="ArrowRight"&&(I[E==="ltr"?q:Z].focus(),I[E==="ltr"?q:Z].click())}};return a.jsx(_6,{value:{checked:_},children:a.jsx(er,{ref:t,mod:[{"with-border":g,checked:_},m],...T("card"),...C,role:"radio","aria-checked":_,name:P,onClick:k=>{b?.(k),R?.onChange(x||"")},onKeyDown:A})})});B0.displayName="@mantine/core/RadioCard";B0.classes=z_;const k6={},V0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:d,name:f,readOnly:p,...m}=se("RadioGroup",k6,e),g=vr(f),[x,b]=Yn({value:n,defaultValue:r,finalValue:"",onChange:i}),w=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return a.jsx(R6,{value:{value:x,onChange:w,size:s,name:g},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:a.jsx(g0,{role:"radiogroup",children:d})})})});V0.classes=fn.Wrapper.classes;V0.displayName="@mantine/core/RadioGroup";function U_({size:e,style:t,...n}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:a.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var B_={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const N6={icon:U_},O6=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const d=go({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--radio-size":nt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Ut(t),"--radio-color":s==="outline"?f:Ft(n,e),"--radio-icon-size":nt(r,"radio-icon-size"),"--radio-icon-color":i?Ft(i,e):el(c,e)?ea({color:n,theme:e,autoContrast:c}):void 0}}},F0=ge((e,t)=>{const n=se("RadioIndicator",N6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,icon:p,radius:m,color:g,iconColor:x,autoContrast:b,checked:w,mod:j,variant:C,disabled:T,...E}=n,R=p,_=Me({name:"RadioIndicator",classes:B_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:O6,rootSelector:"indicator"}),P=D6(),A=typeof w=="boolean"?w:P?.checked||!1;return a.jsx(ce,{ref:t,..._("indicator",{variant:C}),variant:C,mod:[{checked:A,disabled:T},j],...E,children:a.jsx(R,{..._("icon")})})});F0.displayName="@mantine/core/RadioIndicator";F0.classes=B_;var V_={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const M6={labelPosition:"right"},I6=(e,{size:t,radius:n,color:r,iconColor:i,variant:s,autoContrast:c})=>{const d=go({color:r||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--radio-size":nt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ut(n),"--radio-color":s==="outline"?f:Ft(r,e),"--radio-icon-color":i?Ft(i,e):el(c,e)?ea({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":nt(t,"radio-icon-size")}}},Fs=ge((e,t)=>{const n=se("Radio",M6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,id:p,size:m,label:g,labelPosition:x,description:b,error:w,radius:j,color:C,variant:T,disabled:E,wrapperProps:R,icon:_=U_,rootRef:P,iconColor:A,onChange:k,mod:I,...B}=n,q=Me({name:"Radio",classes:V_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:I6}),Z=$_(),K=Z?.size??m,Q=n.size?m:K,{styleProps:V,rest:W}=ta(B),O=vr(p),L=Z?{checked:Z.value===W.value,name:W.name??Z.name,onChange:$=>{Z.onChange($),k?.($)}}:{};return a.jsx(Pp,{...q("root"),__staticSelector:"Radio",__stylesApiProps:n,id:O,size:Q,labelPosition:x,label:g,description:b,error:w,disabled:E,classNames:r,styles:c,unstyled:d,"data-checked":L.checked||void 0,variant:T,ref:P,mod:I,...V,...R,children:a.jsxs(ce,{...q("inner"),mod:{"label-position":x},children:[a.jsx(ce,{...q("radio",{focusable:!0,variant:T}),onChange:k,...W,...L,component:"input",mod:{error:!!w},ref:t,id:O,disabled:E,type:"radio"}),a.jsx(_,{...q("icon"),"aria-hidden":!0})]})})});Fs.classes=V_;Fs.displayName="@mantine/core/Radio";Fs.Group=V0;Fs.Card=B0;Fs.Indicator=F0;const L6={duration:100,transition:"fade"};function $6(e,t){return{...L6,...t,...e}}function z6({offset:e,position:t,defaultOpened:n}){const[r,i]=v.useState(n),s=v.useRef(null),{x:c,y:d,elements:f,refs:p,update:m,placement:g}=qx({placement:t,middleware:[Ux({crossAxis:!0,padding:5,rootBoundary:"document"})]}),x=g.includes("right")?e:t.includes("left")?e*-1:0,b=g.includes("bottom")?e:t.includes("top")?e*-1:0,w=v.useCallback(({clientX:j,clientY:C})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+x,top:C+b,right:j,bottom:C}}})},[f.reference]);return v.useEffect(()=>{if(p.floating.current){const j=s.current;j.addEventListener("mousemove",w);const C=qi(p.floating.current);return C.forEach(T=>{T.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",w),C.forEach(T=>{T.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,w,r]),{handleMouseMove:w,x:c,y:d,opened:r,setOpened:i,boundaryRef:s,floating:p.setFloating}}var Zp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const U6={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Kr("popover")},B6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ut(t),"--tooltip-bg":n?Ft(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),q0=ge((e,t)=>{const n=se("TooltipFloating",U6,e),{children:r,refProp:i,withinPortal:s,style:c,className:d,classNames:f,styles:p,unstyled:m,radius:g,color:x,label:b,offset:w,position:j,multiline:C,zIndex:T,disabled:E,defaultOpened:R,variant:_,vars:P,portalProps:A,...k}=n,I=Sn(),B=Me({name:"TooltipFloating",props:n,classes:Zp,className:d,style:c,classNames:f,styles:p,unstyled:m,rootSelector:"tooltip",vars:P,varsResolver:B6}),{handleMouseMove:q,x:Z,y:K,opened:Q,boundaryRef:V,floating:W,setOpened:O}=z6({offset:w,position:j,defaultOpened:R});if(!Xi(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const L=Bn(V,mp(r),t),$=r.props,H=F=>{$.onMouseEnter?.(F),q(F),O(!0)},M=F=>{$.onMouseLeave?.(F),O(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Za,{...A,withinPortal:s,children:a.jsx(ce,{...k,...B("tooltip",{style:{...OR(c,I),zIndex:T,display:!E&&Q?"block":"none",top:(K&&Math.round(K))??"",left:(Z&&Math.round(Z))??""}}),variant:_,ref:W,mod:{multiline:C},children:b})}),v.cloneElement(r,{...$,[i]:L,onMouseEnter:H,onMouseLeave:M})]})});q0.classes=Zp;q0.displayName="@mantine/core/TooltipFloating";const F_=v.createContext(!1),V6=F_.Provider,F6=()=>v.useContext(F_),q6={openDelay:0,closeDelay:0};function H0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",q6,e);return a.jsx(V6,{value:!0,children:a.jsx(x9,{delay:{open:t,close:n},children:r})})}H0.displayName="@mantine/core/TooltipGroup";H0.extend=e=>e;function H6(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function G6(e){const t=H6(e.middlewares),n=[JR(e.offset)];return t.shift&&n.push(Ux(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?zh():zh(t.flip)),n.push(e2({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Gu():Gu(t.inline)):e.inline&&n.push(Gu()),n}function W6(e){const[t,n]=v.useState(e.defaultOpened),i=typeof e.opened=="boolean"?e.opened:t,s=F6(),c=vr(),d=v.useCallback(A=>{n(A),A&&E(c)},[c]),{x:f,y:p,context:m,refs:g,update:x,placement:b,middlewareData:{arrow:{x:w,y:j}={}}}=qx({strategy:e.strategy,placement:e.position,open:i,onOpenChange:d,middleware:G6(e)}),{delay:C,currentId:T,setCurrentId:E}=b9(m,{id:c}),{getReferenceProps:R,getFloatingProps:_}=R9([v9(m,{enabled:e.events?.hover,delay:s?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),T9(m,{enabled:e.events?.focus,visibleOnly:!0}),D9(m,{role:"tooltip"}),C9(m,{enabled:typeof e.opened>"u"})]);T2({opened:i,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:x}}),Hi(()=>{e.onPositionChange?.(b)},[b]);const P=i&&T&&T!==c;return{x:f,y:p,arrowX:w,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:_,getReferenceProps:R,isGroupPhase:P,opened:i,placement:b}}const rE={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Kr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},Q6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ut(t),"--tooltip-bg":n?Ft(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Qi=ge((e,t)=>{const n=se("Tooltip",rE,e),{children:r,position:i,refProp:s,label:c,openDelay:d,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:x,radius:b,color:w,classNames:j,styles:C,unstyled:T,style:E,className:R,withArrow:_,arrowSize:P,arrowOffset:A,arrowRadius:k,arrowPosition:I,offset:B,transitionProps:q,multiline:Z,events:K,zIndex:Q,disabled:V,positionDependencies:W,onClick:O,onMouseEnter:L,onMouseLeave:$,inline:H,variant:M,keepMounted:F,vars:te,portalProps:ae,mod:je,floatingStrategy:xe,middlewares:we,...We}=se("Tooltip",rE,n),{dir:Ee}=nl(),ot=v.useRef(null),tt=W6({position:x2(Ee,i),closeDelay:f,openDelay:d,onPositionChange:p,opened:m,defaultOpened:g,events:K,arrowRef:ot,arrowOffset:A,offset:typeof B=="number"?B+(_?P/2:0):B,positionDependencies:[...W,r],inline:H,strategy:xe,middlewares:we}),Ct=Me({name:"Tooltip",props:n,classes:Zp,className:R,style:E,classNames:j,styles:C,unstyled:T,rootSelector:"tooltip",vars:te,varsResolver:Q6});if(!Xi(r))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Ot=Bn(tt.reference,mp(r),t),Mt=$6(q,{duration:100,transition:"fade"}),pt=r.props;return a.jsxs(a.Fragment,{children:[a.jsx(Za,{...ae,withinPortal:x,children:a.jsx(hi,{...Mt,keepMounted:F,mounted:!V&&!!tt.opened,duration:tt.isGroupPhase?10:Mt.duration,children:Rt=>a.jsxs(ce,{...We,"data-fixed":xe==="fixed"||void 0,variant:M,mod:[{multiline:Z},je],...tt.getFloatingProps({ref:tt.floating,className:Ct("tooltip").className,style:{...Ct("tooltip").style,...Rt,zIndex:Q,top:tt.y??0,left:tt.x??0}}),children:[c,a.jsx(Qx,{ref:ot,arrowX:tt.arrowX,arrowY:tt.arrowY,visible:_,position:tt.placement,arrowSize:P,arrowOffset:A,arrowRadius:k,arrowPosition:I,...Ct("arrow")})]})})}),v.cloneElement(r,tt.getReferenceProps({onClick:O,onMouseEnter:L,onMouseLeave:$,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:It(R,pt.className),...pt,[s]:Ot}))]})});Qi.classes=Zp;Qi.displayName="@mantine/core/Tooltip";Qi.Floating=q0;Qi.Group=H0;function Y6({size:e,thickness:t,sum:n,value:r,root:i,offset:s}){const c=(e*.9-t*2)/2,d=Math.PI*c*2/100,f=i||r===void 0?`${(100-n)*d}, ${n*d}`:`${r*d}, ${(100-r)*d}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:i?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:i?0:s||0}}function q_({size:e,value:t,offset:n,sum:r,thickness:i,root:s,color:c,lineRoundCaps:d,tooltip:f,getStyles:p,display:m,...g}){const x=Sn();return a.jsx(Qi.Floating,{disabled:!f,label:f,children:a.jsx(ce,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Ft(c,x):void 0},fill:"none",strokeLinecap:d?"round":"butt",...Y6({sum:r,size:e,thickness:i,value:t,offset:n,root:s})})})}q_.displayName="@mantine/core/Curve";function K6({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:i}){const s=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let d=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:s,offset:d,data:n[m],root:!1}),d-=n[m].value/100*c;if(f.push({sum:s,offset:d,data:{color:i},root:!0}),p.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){p.push({...f[0],lineRoundCaps:r}),p.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)p.push({...f[m],lineRoundCaps:!1})}else p.push({...f[0],lineRoundCaps:r});return p}var H_={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function X6(e,t){return Math.min(e||12,(t||120)/4)}const Z6={size:120,thickness:12},J6=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":le(t),"--rp-label-offset":le(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Jp=ge((e,t)=>{const n=se("RingProgress",Z6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,label:p,sections:m,size:g,thickness:x,roundCaps:b,rootColor:w,transitionDuration:j,...C}=n,T=Me({name:"RingProgress",classes:H_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:J6}),E=X6(x,g),R=K6({size:g,thickness:E,sections:m,renderRoundedLineCaps:b,rootColor:w}).map(({data:_,sum:P,root:A,lineRoundCaps:k,offset:I},B)=>v.createElement(q_,{..._,key:B,size:g,thickness:E,sum:P,offset:I,color:_?.color,root:A,lineRoundCaps:k,getStyles:T}));return a.jsxs(ce,{...T("root"),size:g,ref:t,...C,children:[a.jsx("svg",{...T("svg"),children:R}),p&&a.jsx("div",{...T("label"),children:p})]})});Jp.classes=H_;Jp.displayName="@mantine/core/RingProgress";var G_={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const e$={withItemsBorders:!0},t$=(e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:Ut(t),"--sc-color":n?Ft(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":s,"--sc-padding":nt(i,"sc-padding"),"--sc-font-size":On(i)}}),Cd=ge((e,t)=>{const n=se("SegmentedControl",e$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,data:p,value:m,defaultValue:g,onChange:x,size:b,name:w,disabled:j,readOnly:C,fullWidth:T,orientation:E,radius:R,color:_,transitionDuration:P,transitionTimingFunction:A,variant:k,autoContrast:I,withItemsBorders:B,mod:q,...Z}=n,K=Me({name:"SegmentedControl",props:n,classes:G_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:t$}),Q=Sn(),V=p.map(Ee=>typeof Ee=="string"?{label:Ee,value:Ee}:Ee),W=IO(),[O,L]=v.useState(Oh()),[$,H]=v.useState(null),[M,F]=v.useState({}),te=(Ee,ot)=>{M[ot]=Ee,F(M)},[ae,je]=Yn({value:m,defaultValue:g,finalValue:Array.isArray(p)?V.find(Ee=>!Ee.disabled)?.value??p[0]?.value??null:null,onChange:x}),xe=vr(w),we=V.map(Ee=>v.createElement(ce,{...K("control"),mod:{active:ae===Ee.value,orientation:E},key:Ee.value},v.createElement("input",{...K("input"),disabled:j||Ee.disabled,type:"radio",name:xe,value:Ee.value,id:`${xe}-${Ee.value}`,checked:ae===Ee.value,onChange:()=>!C&&je(Ee.value),"data-focus-ring":Q.focusRing,key:`${Ee.value}-input`}),v.createElement(ce,{component:"label",...K("label"),mod:{active:ae===Ee.value&&!(j||Ee.disabled),disabled:j||Ee.disabled,"read-only":C},htmlFor:`${xe}-${Ee.value}`,ref:ot=>te(ot,Ee.value),__vars:{"--sc-label-color":_!==void 0?ea({color:_,theme:Q,autoContrast:I}):void 0},key:`${Ee.value}-label`},a.jsx("span",{...K("innerLabel"),children:Ee.label})))),We=Bn(t,Ee=>H(Ee));return NO(()=>{L(Oh())},[p.length]),p.length===0?null:a.jsxs(ce,{...K("root"),variant:k,size:b,ref:We,mod:[{"full-width":T,orientation:E,initialized:W,"with-items-borders":B},q],...Z,role:"radiogroup","data-disabled":j,children:[typeof ae=="string"&&a.jsx(Jx,{target:M[ae],parent:$,component:"span",transitionDuration:"var(--sc-transition-duration)",...K("indicator")},O),we]})});Cd.classes=G_;Cd.displayName="@mantine/core/SegmentedControl";function n$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const i=Sn(),s=t===void 0?e:t,c=Xa({"--sg-spacing-x":Nn(Po(e)),"--sg-spacing-y":Nn(Po(s)),"--sg-cols":Po(n)?.toString()}),d=an(i.breakpoints).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=Nn(e[g])),typeof s=="object"&&s[g]!==void 0&&(m[g]["--sg-spacing-y"]=Nn(s[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),p=Yu(an(d),i.breakpoints).filter(m=>an(d[m.value]).length>0).map(m=>({query:`(min-width: ${i.breakpoints[m.value]})`,styles:d[m.value]}));return a.jsx(tl,{styles:c,media:p,selector:r})}function ny(e){return typeof e=="object"&&e!==null?an(e):[]}function r$(e){return e.sort((t,n)=>Qu(t)-Qu(n))}function o$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...ny(e),...ny(t),...ny(n)]));return r$(r)}function i$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const i=t===void 0?e:t,s=Xa({"--sg-spacing-x":Nn(Po(e)),"--sg-spacing-y":Nn(Po(i)),"--sg-cols":Po(n)?.toString()}),c=o$({spacing:e,verticalSpacing:t,cols:n}),d=c.reduce((p,m)=>(p[m]||(p[m]={}),typeof e=="object"&&e[m]!==void 0&&(p[m]["--sg-spacing-x"]=Nn(e[m])),typeof i=="object"&&i[m]!==void 0&&(p[m]["--sg-spacing-y"]=Nn(i[m])),typeof n=="object"&&n[m]!==void 0&&(p[m]["--sg-cols"]=n[m]),p),{}),f=c.map(p=>({query:`simple-grid (min-width: ${p})`,styles:d[p]}));return a.jsx(tl,{styles:s,container:f,selector:r})}var W_={container:"m_925c2d2c",root:"m_2415a157"};const a$={cols:1,spacing:"md",type:"media"},em=ge((e,t)=>{const n=se("SimpleGrid",a$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,cols:p,verticalSpacing:m,spacing:g,type:x,...b}=n,w=Me({name:"SimpleGrid",classes:W_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f}),j=fd();return x==="container"?a.jsxs(a.Fragment,{children:[a.jsx(i$,{...n,selector:`.${j}`}),a.jsx("div",{...w("container"),children:a.jsx(ce,{ref:t,...w("root",{className:j}),...b})})]}):a.jsxs(a.Fragment,{children:[a.jsx(n$,{...n,selector:`.${j}`}),a.jsx(ce,{ref:t,...w("root",{className:j}),...b})]})});em.classes=W_;em.displayName="@mantine/core/SimpleGrid";const s$={},tm=ge((e,t)=>{const{w:n,h:r,miw:i,mih:s,...c}=se("Space",s$,e);return a.jsx(ce,{ref:t,...c,w:n,miw:i??n,h:r,mih:s??r})});tm.displayName="@mantine/core/Space";var Q_={root:"m_6d731127"};const l$={gap:"md",align:"stretch",justify:"flex-start"},c$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Nn(t),"--stack-align":n,"--stack-justify":r}}),Ue=ge((e,t)=>{const n=se("Stack",l$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,align:p,justify:m,gap:g,variant:x,...b}=n,w=Me({name:"Stack",props:n,classes:Q_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:c$});return a.jsx(ce,{ref:t,...w("root"),variant:x,...b})});Ue.classes=Q_;Ue.displayName="@mantine/core/Stack";const[u$,d$]=gr("Stepper component was not found in tree"),Bh=()=>null;Bh.displayName="@mantine/core/StepperCompleted";var G0={root:"m_cbb4ea7e",steps:"m_aaf89d0b",separator:"m_2a371ac9",content:"m_78da155d",step:"m_cbb57068","step--horizontal":"m_f56b1e2c","step--vertical":"m_833edb7e",verticalSeparator:"m_6496b3f3",stepWrapper:"m_818e70b",stepIcon:"m_1959ad01",stepCompletedIcon:"m_a79331dc",stepBody:"m_1956aa2a",stepLabel:"m_12051f6c",stepDescription:"m_164eea74"};const ah=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,f$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},W0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,step:d,state:f,color:p,icon:m,completedIcon:g,progressIcon:x,label:b,description:w,withIcon:j,iconSize:C,loading:T,allowStepClick:E,allowStepSelect:R,iconPosition:_,orientation:P,mod:A,...k}=se("StepperStep",f$,e),I=d$(),B=Sn(),q={classNames:n,styles:s},Z=f==="stepCompleted"?null:f==="stepProgress"?x:m,K={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return a.jsxs(er,{...I.getStyles("step",{className:r,style:i,variant:I.orientation,...q}),mod:[{"icon-position":_||I.iconPosition,"allow-click":E},A],ref:t,...K,...k,__vars:{"--step-color":p?Ft(p,B):void 0},tabIndex:E?0:-1,children:[j&&a.jsxs("span",{...I.getStyles("stepWrapper",q),children:[a.jsxs("span",{...I.getStyles("stepIcon",q),...K,children:[a.jsx(hi,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:Q=>a.jsx("span",{...I.getStyles("stepCompletedIcon",{style:Q,...q}),children:T?a.jsx(Pr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...I.getStyles("stepLoader",q)}):ah(g,d)||a.jsx(kp,{size:"60%"})})}),f!=="stepCompleted"?T?a.jsx(Pr,{...I.getStyles("stepLoader",q),size:"calc(var(--stepper-icon-size) / 2)",color:p}):ah(Z||m,d):null]}),P==="vertical"&&a.jsx("span",{...I.getStyles("verticalSeparator",q),"data-active":f==="stepCompleted"||void 0})]}),(b||w)&&a.jsxs("span",{...I.getStyles("stepBody",q),"data-orientation":I.orientation,"data-icon-position":_||I.iconPosition,children:[b&&a.jsx("span",{...I.getStyles("stepLabel",q),children:ah(b,d)}),w&&a.jsx("span",{...I.getStyles("stepDescription",q),children:ah(w,d)})]})]})});W0.classes=G0;W0.displayName="@mantine/core/StepperStep";const h$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},p$=(e,{color:t,iconSize:n,size:r,contentPadding:i,radius:s,autoContrast:c})=>({root:{"--stepper-color":t?Ft(t,e):void 0,"--stepper-icon-color":el(c,e)?ea({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?nt(r,"stepper-icon-size"):le(n),"--stepper-content-padding":Nn(i),"--stepper-radius":s===void 0?void 0:Ut(s),"--stepper-fz":On(r),"--stepper-spacing":Nn(r)}}),bc=ge((e,t)=>{const n=se("Stepper",h$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,children:p,onStepClick:m,active:g,icon:x,completedIcon:b,progressIcon:w,color:j,iconSize:C,contentPadding:T,orientation:E,iconPosition:R,size:_,radius:P,allowNextStepsSelect:A,wrap:k,autoContrast:I,...B}=n,q=Me({name:"Stepper",classes:G0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:p$}),Z=v.Children.toArray(p),K=Z.filter($=>$.type!==Bh),Q=Z.find($=>$.type===Bh),V=K.reduce(($,H,M)=>{const F=g===M?"stepProgress":g>M?"stepCompleted":"stepInactive",ae=typeof m!="function"?!1:typeof H.props.allowStepSelect=="boolean"?H.props.allowStepSelect:F==="stepCompleted"||A;return $.push(v.cloneElement(H,{icon:H.props.icon||x||M+1,key:M,step:M,state:F,onClick:()=>ae&&m?.(M),allowStepClick:ae,completedIcon:H.props.completedIcon||b,progressIcon:H.props.progressIcon||w,color:H.props.color||j,iconSize:C,iconPosition:H.props.iconPosition||R,orientation:E})),E==="horizontal"&&M!==K.length-1&&$.push(v.createElement("div",{...q("separator"),"data-active":M<g||void 0,"data-orientation":E,key:`separator-${M}`})),$},[]),W=K[g]?.props?.children,O=Q?.props?.children,L=g>K.length-1?O:W;return a.jsx(u$,{value:{getStyles:q,orientation:E,iconPosition:R},children:a.jsxs(ce,{...q("root"),ref:t,size:_,...B,children:[a.jsx(ce,{...q("steps"),mod:{orientation:E,"icon-position":R,wrap:k&&E!=="vertical"},children:V}),L&&a.jsx("div",{...q("content"),children:L})]})})});bc.classes=G0;bc.displayName="@mantine/core/Stepper";bc.Completed=Bh;bc.Step=W0;const Y_=v.createContext(null),m$=Y_.Provider,g$=()=>v.useContext(Y_),v$={},Q0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:d,readOnly:f,...p}=se("SwitchGroup",v$,e),[m,g]=Yn({value:n,defaultValue:r,finalValue:[],onChange:i}),x=b=>{const w=b.currentTarget.value;!f&&g(m.includes(w)?m.filter(j=>j!==w):[...m,w])};return a.jsx(m$,{value:{value:m,onChange:x,size:s},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(g0,{role:"group",children:d})})})});Q0.classes=fn.Wrapper.classes;Q0.displayName="@mantine/core/SwitchGroup";var K_={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const y$={labelPosition:"right"},x$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ut(t),"--switch-height":nt(r,"switch-height"),"--switch-width":nt(r,"switch-width"),"--switch-thumb-size":nt(r,"switch-thumb-size"),"--switch-label-font-size":nt(r,"switch-label-font-size"),"--switch-track-label-padding":nt(r,"switch-track-label-padding"),"--switch-color":n?Ft(n,e):void 0}}),Ed=ge((e,t)=>{const n=se("Switch",y$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,offLabel:g,onLabel:x,id:b,size:w,radius:j,wrapperProps:C,thumbIcon:T,checked:E,defaultChecked:R,onChange:_,labelPosition:P,description:A,error:k,disabled:I,variant:B,rootRef:q,mod:Z,...K}=n,Q=g$(),V=w||Q?.size,W=Me({name:"Switch",props:n,classes:K_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:x$}),{styleProps:O,rest:L}=ta(K),$=vr(b),H=Q?{checked:Q.value.includes(L.value),onChange:Q.onChange}:{},[M,F]=Yn({value:H.checked??E,defaultValue:R,finalValue:!1});return a.jsxs(Pp,{...W("root"),__staticSelector:"Switch",__stylesApiProps:n,id:$,size:V,labelPosition:P,label:m,description:A,error:k,disabled:I,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:d,"data-checked":H.checked||E||void 0,variant:B,ref:q,mod:Z,...O,...C,children:[a.jsx("input",{...L,disabled:I,checked:M,"data-checked":H.checked||E||void 0,onChange:te=>{Q?H.onChange?.(te):_?.(te),F(te.currentTarget.checked)},id:$,ref:t,type:"checkbox",role:"switch",...W("input")}),a.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:k,"label-position":P,"without-labels":!x&&!g},...W("track"),children:[a.jsx(ce,{component:"span",mod:"reduce-motion",...W("thumb"),children:T}),a.jsx("span",{...W("trackLabel"),children:M?x:g})]})]})});Ed.classes={...K_,...n_};Ed.displayName="@mantine/core/Switch";Ed.Group=Q0;const[b$,S$]=gr("Table component was not found in the tree");var Td={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function w$(e,t){if(!t)return;const n={};return t.columnBorder&&e.withColumnBorders&&(n["data-with-column-border"]=!0),t.rowBorder&&e.withRowBorders&&(n["data-with-row-border"]=!0),t.striped&&e.striped&&(n["data-striped"]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n["data-hover"]=!0),t.captionSide&&e.captionSide&&(n["data-side"]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n["data-sticky"]=!0),n}function ol(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ge((i,s)=>{const c=se(n,{},i),{classNames:d,className:f,style:p,styles:m,...g}=c,x=S$();return a.jsx(ce,{component:e,ref:s,...w$(x,t),...x.getStyles(e,{className:f,classNames:d,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=Td,r}const Gy=ol("th",{columnBorder:!0}),X_=ol("td",{columnBorder:!0}),jh=ol("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),Z_=ol("thead",{stickyHeader:!0}),J_=ol("tbody"),eD=ol("tfoot"),tD=ol("caption",{captionSide:!0});function Y0({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx(tD,{children:e.caption}),e.head&&a.jsx(Z_,{children:a.jsx(jh,{children:e.head.map((t,n)=>a.jsx(Gy,{children:t},n))})}),e.body&&a.jsx(J_,{children:e.body.map((t,n)=>a.jsx(jh,{children:t.map((r,i)=>a.jsx(X_,{children:r},i))},n))}),e.foot&&a.jsx(eD,{children:a.jsx(jh,{children:e.foot.map((t,n)=>a.jsx(Gy,{children:t},n))})})]})}Y0.displayName="@mantine/core/TableDataRenderer";const j$={type:"scrollarea"},C$=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":le(t),"--table-max-height":le(n),"--table-overflow":r==="native"?"auto":void 0}}),K0=ge((e,t)=>{const n=se("TableScrollContainer",j$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,children:p,minWidth:m,maxHeight:g,type:x,scrollAreaProps:b,...w}=n,j=Me({name:"TableScrollContainer",classes:Td,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:C$,rootSelector:"scrollContainer"});return a.jsx(ce,{component:x==="scrollarea"?Xr:"div",...x==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...j("scrollContainer"),...w,children:a.jsx("div",{...j("scrollContainerInner"),children:p})})});K0.classes=Td;K0.displayName="@mantine/core/TableScrollContainer";const E$={withRowBorders:!0,verticalSpacing:7},T$=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:s,stripedColor:c,highlightOnHoverColor:d,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Nn(r),"--table-vertical-spacing":Nn(i),"--table-border-color":s?Ft(s,e):void 0,"--table-striped-color":f&&c?Ft(c,e):void 0,"--table-highlight-on-hover-color":p&&d?Ft(d,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),ve=ge((e,t)=>{const n=se("Table",E$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:x,highlightOnHoverColor:b,striped:w,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,withTableBorder:E,borderColor:R,layout:_,variant:P,data:A,children:k,stickyHeader:I,stickyHeaderOffset:B,mod:q,tabularNums:Z,...K}=n,Q=Me({name:"Table",props:n,className:i,style:s,classes:Td,classNames:r,styles:c,unstyled:d,rootSelector:"table",vars:f,varsResolver:T$});return a.jsx(b$,{value:{getStyles:Q,stickyHeader:I,striped:w===!0?"odd":w||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,captionSide:g||"bottom"},children:a.jsx(ce,{component:"table",variant:P,ref:t,mod:[{"data-with-table-border":E,"data-tabular-nums":Z},q],...Q("table"),...K,children:k||!!A&&a.jsx(Y0,{data:A})})})});ve.classes=Td;ve.displayName="@mantine/core/Table";ve.Td=X_;ve.Th=Gy;ve.Tr=jh;ve.Thead=Z_;ve.Tbody=J_;ve.Tfoot=eD;ve.Caption=tD;ve.ScrollContainer=K0;ve.DataRenderer=Y0;const[R$,X0]=gr("Tabs component was not found in the tree");var Rd={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",panel:"m_b0c91715",tab:"m_4ec4dce6",tabSection:"m_fc420b1f","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const _$={},Z0=ge((e,t)=>{const n=se("TabsList",_$,e),{children:r,className:i,grow:s,justify:c,classNames:d,styles:f,style:p,mod:m,...g}=n,x=X0();return a.jsx(ce,{...g,...x.getStyles("list",{className:i,style:p,classNames:d,styles:f,props:n,variant:x.variant}),ref:t,role:"tablist",variant:x.variant,mod:[{grow:s,orientation:x.orientation,placement:x.orientation==="vertical"&&x.placement,inverted:x.inverted},m],"aria-orientation":x.orientation,__vars:{"--tabs-justify":c},children:r})});Z0.classes=Rd;Z0.displayName="@mantine/core/TabsList";const D$={},J0=ge((e,t)=>{const n=se("TabsPanel",D$,e),{children:r,className:i,value:s,classNames:c,styles:d,style:f,mod:p,keepMounted:m,...g}=n,x=X0(),b=x.value===s,w=x.keepMounted||m||b?r:null;return a.jsx(ce,{...g,...x.getStyles("panel",{className:i,classNames:c,styles:d,style:[f,b?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:x.orientation},p],role:"tabpanel",id:x.getPanelId(s),"aria-labelledby":x.getTabId(s),children:w})});J0.classes=Rd;J0.displayName="@mantine/core/TabsPanel";const A$={},eb=ge((e,t)=>{const n=se("TabsTab",A$,e),{className:r,children:i,rightSection:s,leftSection:c,value:d,onClick:f,onKeyDown:p,disabled:m,color:g,style:x,classNames:b,styles:w,vars:j,mod:C,tabIndex:T,...E}=n,R=Sn(),{dir:_}=nl(),P=X0(),A=d===P.value,k=B=>{P.onChange(P.allowTabDeactivation&&d===P.value?null:d),f?.(B)},I={classNames:b,styles:w,props:n};return a.jsxs(er,{...E,...P.getStyles("tab",{className:r,style:x,variant:P.variant,...I}),disabled:m,unstyled:P.unstyled,variant:P.variant,mod:[{active:A,disabled:m,orientation:P.orientation,inverted:P.inverted,placement:P.orientation==="vertical"&&P.placement},C],ref:t,role:"tab",id:P.getTabId(d),"aria-selected":A,tabIndex:T!==void 0?T:A||P.value===null?0:-1,"aria-controls":P.getPanelId(d),onClick:k,__vars:{"--tabs-color":g?Ft(g,R):void 0},onKeyDown:vR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:P.activateTabWithKeyboard,loop:P.loop,orientation:P.orientation||"horizontal",dir:_,onKeyDown:p}),children:[c&&a.jsx("span",{...P.getStyles("tabSection",I),"data-position":"left",children:c}),i&&a.jsx("span",{...P.getStyles("tabLabel",I),children:i}),s&&a.jsx("span",{...P.getStyles("tabSection",I),"data-position":"right",children:s})]})});eb.classes=Rd;eb.displayName="@mantine/core/TabsTab";const oE="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",P$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},k$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ut(t),"--tabs-color":Ft(n,e),"--tabs-text-color":el(r,e)?ea({color:n,theme:e,autoContrast:r}):void 0}}),zt=ge((e,t)=>{const n=se("Tabs",P$,e),{defaultValue:r,value:i,onChange:s,orientation:c,children:d,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:x,color:b,radius:w,inverted:j,placement:C,keepMounted:T,classNames:E,styles:R,unstyled:_,className:P,style:A,vars:k,autoContrast:I,mod:B,...q}=n,Z=vr(p),[K,Q]=Yn({value:i,defaultValue:r,finalValue:null,onChange:s}),V=Me({name:"Tabs",props:n,classes:Rd,className:P,style:A,classNames:E,styles:R,unstyled:_,vars:k,varsResolver:k$});return a.jsx(R$,{value:{placement:C,value:K,orientation:c,id:Z,loop:f,activateTabWithKeyboard:m,getTabId:Xj(`${Z}-tab`,oE),getPanelId:Xj(`${Z}-panel`,oE),onChange:Q,allowTabDeactivation:g,variant:x,color:b,radius:w,inverted:j,keepMounted:T,unstyled:_,getStyles:V},children:a.jsx(ce,{ref:t,id:Z,variant:x,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},B],...V("root"),...q,children:d})})});zt.classes=Rd;zt.displayName="@mantine/core/Tabs";zt.Tab=eb;zt.Panel=J0;zt.List=Z0;const N$={},ze=ge((e,t)=>{const n=se("TextInput",N$,e);return a.jsx(Nr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ze.classes=Nr.classes;ze.displayName="@mantine/core/TextInput";var nD={root:"m_7341320d"};const O$={},M$=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":nt(t,"ti-size"),"--ti-radius":n===void 0?void 0:Ut(n),"--ti-bg":s||r?d.background:void 0,"--ti-color":s||r?d.color:void 0,"--ti-bd":s||r?d.border:void 0}}},tb=ge((e,t)=>{const n=se("ThemeIcon",O$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,autoContrast:p,...m}=n,g=Me({name:"ThemeIcon",classes:nD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:M$});return a.jsx(ce,{ref:t,...g("root"),...m})});tb.classes=nD;tb.displayName="@mantine/core/ThemeIcon";const I$=["h1","h2","h3","h4","h5","h6"],L$=["xs","sm","md","lg","xl"];function $$(e,t){const n=t!==void 0?t:`h${e}`;return I$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:L$.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var rD={root:"m_8a5d1357"};const z$={order:1},U$=(e,{order:t,size:n,lineClamp:r,textWrap:i})=>{const s=$$(t,n);return{root:{"--title-fw":s.fontWeight,"--title-lh":s.lineHeight,"--title-fz":s.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":i}}},Ie=ge((e,t)=>{const n=se("Title",z$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,order:f,vars:p,size:m,variant:g,lineClamp:x,textWrap:b,mod:w,...j}=n,C=Me({name:"Title",props:n,classes:rD,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:U$});return[1,2,3,4,5,6].includes(f)?a.jsx(ce,{...C("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof x=="number"},w],size:m,...j}):null});Ie.classes=rD;Ie.displayName="@mantine/core/Title";function B$(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(i){t=typeof i=="function"?i(t):i},setState(i){this.updateState(i),r.forEach(s=>s(t))},initialize(i){n||(t=i,n=!0)},subscribe(i){return r.add(i),()=>r.delete(i)}}}function V$(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function F$(e,t,n){const r=[],i=[],s={};for(const c of e){const d=c.position||t;s[d]=s[d]||0,s[d]+=1,s[d]<=n?i.push(c):r.push(c)}return{notifications:i,queue:r}}const q$=()=>B$({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),il=q$(),H$=(e=il)=>V$(e);function Mc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),i=F$(r,n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ne(e,t=il){const n=e.id||Oh();return Mc(t,r=>e.id&&r.some(i=>i.id===e.id)?r:[...r,{...e,id:n}]),n}function oD(e,t=il){return Mc(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function ks(e,t=il){return Mc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function G$(e=il){Mc(e,()=>[])}function W$(e=il){Mc(e,t=>t.slice(0,e.getState().limit))}const ho={show:Ne,hide:oD,update:ks,clean:G$,cleanQueue:W$,updateState:Mc};function Wy(e,t){return Wy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Wy(e,t)}function iD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Wy(e,t)}var ry={exports:{}},oy,iE;function Q$(){if(iE)return oy;iE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return oy=e,oy}var iy,aE;function Y$(){if(aE)return iy;aE=1;var e=Q$();function t(){}function n(){}return n.resetWarningCache=t,iy=function(){function r(c,d,f,p,m,g){if(g!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},iy}var sE;function K$(){return sE||(sE=1,ry.exports=Y$()()),ry.exports}var X$=K$();const on=Sx(X$),lE={disabled:!1},Vh=En.createContext(null);var Z$=function(t){return t.scrollTop},qu="unmounted",Ts="exited",Rs="entering",ic="entered",Qy="exiting",ia=(function(e){iD(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var c=i,d=c&&!c.isMounting?r.enter:r.appear,f;return s.appearStatus=null,r.in?d?(f=Ts,s.appearStatus=Rs):f=ic:r.unmountOnExit||r.mountOnEnter?f=qu:f=Ts,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(i,s){var c=i.in;return c&&s.status===qu?{status:Ts}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var c=this.state.status;this.props.in?c!==Rs&&c!==ic&&(s=Rs):(c===Rs||c===ic)&&(s=Qy)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,c,d;return s=c=d=i,i!=null&&typeof i!="number"&&(s=i.exit,c=i.enter,d=i.appear!==void 0?i.appear:c),{exit:s,enter:c,appear:d}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===Rs){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:Fu.findDOMNode(this);c&&Z$(c)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ts&&this.setState({status:qu})},n.performEnter=function(i){var s=this,c=this.props.enter,d=this.context?this.context.isMounting:i,f=this.props.nodeRef?[d]:[Fu.findDOMNode(this),d],p=f[0],m=f[1],g=this.getTimeouts(),x=d?g.appear:g.enter;if(!i&&!c||lE.disabled){this.safeSetState({status:ic},function(){s.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:Rs},function(){s.props.onEntering(p,m),s.onTransitionEnd(x,function(){s.safeSetState({status:ic},function(){s.props.onEntered(p,m)})})})},n.performExit=function(){var i=this,s=this.props.exit,c=this.getTimeouts(),d=this.props.nodeRef?void 0:Fu.findDOMNode(this);if(!s||lE.disabled){this.safeSetState({status:Ts},function(){i.props.onExited(d)});return}this.props.onExit(d),this.safeSetState({status:Qy},function(){i.props.onExiting(d),i.onTransitionEnd(c.exit,function(){i.safeSetState({status:Ts},function(){i.props.onExited(d)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,c=!0;return this.nextCallback=function(d){c&&(c=!1,s.nextCallback=null,i(d))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var c=this.props.nodeRef?this.props.nodeRef.current:Fu.findDOMNode(this),d=i==null&&!this.props.addEndListener;if(!c||d){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],p=f[0],m=f[1];this.props.addEndListener(p,m)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===qu)return null;var s=this.props,c=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var d=T0(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return En.createElement(Vh.Provider,{value:null},typeof c=="function"?c(i,d):En.cloneElement(En.Children.only(c),d))},t})(En.Component);ia.contextType=Vh;ia.propTypes={};function Zl(){}ia.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Zl,onEntering:Zl,onEntered:Zl,onExit:Zl,onExiting:Zl,onExited:Zl};ia.UNMOUNTED=qu;ia.EXITED=Ts;ia.ENTERING=Rs;ia.ENTERED=ic;ia.EXITING=Qy;function J$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nb(e,t){var n=function(s){return t&&v.isValidElement(s)?t(s):s},r=Object.create(null);return e&&v.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function ez(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),i=[];for(var s in e)s in t?i.length&&(r[s]=i,i=[]):i.push(s);var c,d={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];d[r[f][c]]=n(p)}d[f]=n(f)}for(c=0;c<i.length;c++)d[i[c]]=n(i[c]);return d}function Ns(e,t,n){return n[t]!=null?n[t]:e.props[t]}function tz(e,t){return nb(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Ns(n,"appear",e),enter:Ns(n,"enter",e),exit:Ns(n,"exit",e)})})}function nz(e,t,n){var r=nb(e.children),i=ez(t,r);return Object.keys(i).forEach(function(s){var c=i[s];if(v.isValidElement(c)){var d=s in t,f=s in r,p=t[s],m=v.isValidElement(p)&&!p.props.in;f&&(!d||m)?i[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:Ns(c,"exit",e),enter:Ns(c,"enter",e)}):!f&&d&&!m?i[s]=v.cloneElement(c,{in:!1}):f&&d&&v.isValidElement(p)&&(i[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:Ns(c,"exit",e),enter:Ns(c,"enter",e)}))}}),i}var rz=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},oz={component:"div",childFactory:function(t){return t}},$a=(function(e){iD(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var c=s.handleExited.bind(J$(s));return s.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},s}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,s){var c=s.children,d=s.handleExited,f=s.firstRender;return{children:f?tz(i,d):nz(i,c,d),firstRender:!1}},n.handleExited=function(i,s){var c=nb(this.props.children);i.key in c||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(d){var f=Uh({},d.children);return delete f[i.key],{children:f}}))},n.render=function(){var i=this.props,s=i.component,c=i.childFactory,d=T0(i,["component","childFactory"]),f=this.state.contextValue,p=rz(this.state.children).map(c);return delete d.appear,delete d.enter,delete d.exit,s===null?En.createElement(Vh.Provider,{value:f},p):En.createElement(Vh.Provider,{value:f},En.createElement(s,d,p))},t})(En.Component);$a.propTypes={};$a.defaultProps=oz;const aD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function iz(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),aD.reduce((n,r)=>(n[r]=[],n),{}))}const cE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},az={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function sz({state:e,maxHeight:t,position:n,transitionDuration:r}){const[i,s]=n.split("-"),c=s==="center"?`${i}-center`:s,d={opacity:0,maxHeight:t,transform:cE[c],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},f={opacity:1,transform:az[c]},p={opacity:0,maxHeight:0,transform:cE[c]};return{...d,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function lz(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const sD=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},i)=>{const{autoClose:s,message:c,...d}=e,f=lz(n,e.autoClose),p=v.useRef(-1),m=()=>window.clearTimeout(p.current),g=()=>{t(e.id),m()},x=()=>{typeof f=="number"&&(p.current=window.setTimeout(g,f))};return v.useEffect(()=>{e.onOpen?.(e)},[]),v.useEffect(()=>(x(),m),[f]),a.jsx($0,{...r,...d,onClose:g,ref:i,onMouseEnter:m,onMouseLeave:x,children:c})});sD.displayName="@mantine/notifications/NotificationContainer";var lD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const cz=ia,uz={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Kr("overlay"),store:il,withinPortal:!0},dz=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":le(n)}}),aa=ge((e,t)=>{const n=se("Notifications",uz,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:x,notificationMaxHeight:b,limit:w,zIndex:j,store:C,portalProps:T,withinPortal:E,...R}=n,_=Sn(),P=H$(C),A=TO(),k=Tx(),I=v.useRef({}),B=v.useRef(0),Z=(_.respectReducedMotion?k:!1)?1:g,K=Me({name:"Notifications",classes:lD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:dz});v.useEffect(()=>{C?.updateState(W=>({...W,limit:w||5,defaultPosition:p}))},[w,p]),Hi(()=>{P.notifications.length>B.current&&setTimeout(()=>A(),0),B.current=P.notifications.length},[P.notifications]);const Q=iz(P.notifications,p),V=aD.reduce((W,O)=>(W[O]=Q[O].map(({style:L,...$})=>a.jsx(cz,{timeout:Z,onEnter:()=>I.current[$.id].offsetHeight,nodeRef:{current:I.current[$.id]},children:H=>a.jsx(sD,{ref:M=>{I.current[$.id]=M},data:$,onHide:M=>oD(M,C),autoClose:m,...K("notification",{style:{...sz({state:H,position:O,transitionDuration:Z,maxHeight:b}),...L}})})},$.id)),W),{});return a.jsxs(Za,{withinPortal:E,...T,children:[a.jsx(ce,{...K("root"),"data-position":"top-center",ref:t,...R,children:a.jsx($a,{children:V["top-center"]})}),a.jsx(ce,{...K("root"),"data-position":"top-left",...R,children:a.jsx($a,{children:V["top-left"]})}),a.jsx(ce,{...K("root",{className:hc.classNames.fullWidth}),"data-position":"top-right",...R,children:a.jsx($a,{children:V["top-right"]})}),a.jsx(ce,{...K("root",{className:hc.classNames.fullWidth}),"data-position":"bottom-right",...R,children:a.jsx($a,{children:V["bottom-right"]})}),a.jsx(ce,{...K("root"),"data-position":"bottom-left",...R,children:a.jsx($a,{children:V["bottom-left"]})}),a.jsx(ce,{...K("root"),"data-position":"bottom-center",...R,children:a.jsx($a,{children:V["bottom-center"]})})]})});aa.classes=lD;aa.displayName="@mantine/notifications/Notifications";aa.show=ho.show;aa.hide=ho.hide;aa.update=ho.update;aa.clean=ho.clean;aa.cleanQueue=ho.cleanQueue;aa.updateState=ho.updateState;class fz{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class _d{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class hz{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(i,s){const c=i.consumeAndParse(n);return r(s,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(i,s,c){const d=i.consumeAndParse(n);return r(s,c,d)},precedence:n})}construct(t){return new pz(t,this.prefixParselets,this.infixParselets)}}class pz{constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){return this.peek()?.id!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let i=r.parse(this,n);for(;t>this.getPrecedence();){const s=this.consume();i=this.getInfixParselet(s).parse(this,i,s)}return i}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&this.peek()?.id!==t){const r=this.peek();throw Error(`Expected ${t} but got "${r.id}" (${r.value}) at line ${r.line} column ${r.column}.`)}if(n&&this.peek()?.value!==n){const r=this.peek();throw Error(`Expected "${n}" but got "${r.value}" at line ${r.line} column ${r.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class cD{constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){const n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){this.cache.has(t)?this.cache.delete(t):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(t,n)}delete(t){this.cache.delete(t)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}}const Uo="http://hl7.org",uD="ok",mz="created",gz="gone",vz="not-modified",yz="not-found",xz="unauthorized",bz="forbidden",Sz="accepted",wz={resourceType:"OperationOutcome",id:uD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},jz={resourceType:"OperationOutcome",id:yz,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},nd={resourceType:"OperationOutcome",id:xz,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},Cz={...nd,issue:[...nd.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},uE={...nd,issue:[...nd.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},nm={resourceType:"OperationOutcome",id:bz,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function oi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function mn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Ez(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Tz(e){return!e||typeof e!="object"?!1:e instanceof Error||typeof DOMException<"u"&&e instanceof DOMException?!0:Object.prototype.toString.call(e)==="[object Error]"}function rm(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function dD(e){return e.id===uD||e.id===mz||e.id===vz||e.id===Sz}function Rz(e){return e.id===gz}class ut extends Error{constructor(t,n){super(fD(t)),this.outcome=t,this.cause=n}}function Ht(e){return e instanceof ut?e.outcome:rm(e)?e:oi(Ge(e))}function Ge(e){return e?typeof e=="string"?e:Tz(e)?e.message:rm(e)?fD(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function fD(e){const t=e.issue?.map(hD)??[];return t.length>0?t.join("; "):"Unknown error"}function hD(e){let t;return e.details?.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",e.expression?.length&&(t+=` (${e.expression.join(", ")})`),t}function _z(e,t){const n=t.max&&t.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:t.max;return{path:e,description:"",type:t.type??[],min:t.min??0,max:n??1,isArray:!!n&&n>1,constraints:[]}}function Dz(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([i,s])=>[i,_z(i,s)])),constraints:[],innerTypes:[]};return t}const Az={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},Pz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},kz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"code"}]},text:{type:[{code:"string"}]},line:{max:9007199254740991,type:[{code:"string"}]},city:{type:[{code:"string"}]},district:{type:[{code:"string"}]},state:{type:[{code:"string"}]},postalCode:{type:[{code:"string"}]},country:{type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},Nz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Oz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"author[x]":{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]},{code:"string"}]},time:{type:[{code:"dateTime"}]},text:{min:1,type:[{code:"markdown"}]}}},Mz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},contentType:{type:[{code:"code"}]},language:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]},url:{type:[{code:"url"}]},size:{type:[{code:"unsignedInt"}]},hash:{type:[{code:"base64Binary"}]},title:{type:[{code:"string"}]},creation:{type:[{code:"dateTime"}]}}},Iz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Lz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},code:{type:[{code:"code"}]},display:{type:[{code:"string"}]},userSelected:{type:[{code:"boolean"}]}}},$z={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},zz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"code"}]},value:{type:[{code:"string"}]},use:{type:[{code:"code"}]},rank:{type:[{code:"positiveInt"}]},period:{type:[{code:"Period"}]}}},Uz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{min:1,type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]}}},Bz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Vz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},"subject[x]":{type:[{code:"CodeableConcept"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Group"]}]},mustSupport:{max:9007199254740991,type:[{code:"string"}]},codeFilter:{max:9007199254740991,type:[{code:"DataRequirementCodeFilter"}]},dateFilter:{max:9007199254740991,type:[{code:"DataRequirementDateFilter"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:9007199254740991,type:[{code:"DataRequirementSort"}]}}},Fz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]},code:{max:9007199254740991,type:[{code:"Coding"}]}}},qz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},"value[x]":{type:[{code:"dateTime"},{code:"Period"},{code:"Duration"}]}}},Hz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},Gz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Wz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:9007199254740991,type:[{code:"CodeableConcept"}]},patientInstruction:{type:[{code:"string"}]},timing:{type:[{code:"Timing"}]},"asNeeded[x]":{type:[{code:"boolean"},{code:"CodeableConcept"}]},site:{type:[{code:"CodeableConcept"}]},route:{type:[{code:"CodeableConcept"}]},method:{type:[{code:"CodeableConcept"}]},doseAndRate:{max:9007199254740991,type:[{code:"DosageDoseAndRate"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},maxDosePerLifetime:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},Qz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{type:[{code:"CodeableConcept"}]},"dose[x]":{type:[{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},"rate[x]":{type:[{code:"Ratio"},{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},Yz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Kz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},representation:{max:9007199254740991,type:[{code:"code"}]},sliceName:{type:[{code:"string"}]},sliceIsConstraining:{type:[{code:"boolean"}]},label:{type:[{code:"string"}]},code:{max:9007199254740991,type:[{code:"Coding"}]},slicing:{type:[{code:"ElementDefinitionSlicing"}]},short:{type:[{code:"string"}]},definition:{type:[{code:"markdown"}]},comment:{type:[{code:"markdown"}]},requirements:{type:[{code:"markdown"}]},alias:{max:9007199254740991,type:[{code:"string"}]},min:{type:[{code:"unsignedInt"}]},max:{type:[{code:"string"}]},base:{type:[{code:"ElementDefinitionBase"}]},contentReference:{type:[{code:"uri"}]},type:{max:9007199254740991,type:[{code:"ElementDefinitionType"}]},"defaultValue[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},meaningWhenMissing:{type:[{code:"markdown"}]},orderMeaning:{type:[{code:"string"}]},"fixed[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},"pattern[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},example:{max:9007199254740991,type:[{code:"ElementDefinitionExample"}]},"minValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},"maxValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},maxLength:{type:[{code:"integer"}]},condition:{max:9007199254740991,type:[{code:"id"}]},constraint:{max:9007199254740991,type:[{code:"ElementDefinitionConstraint"}]},mustSupport:{type:[{code:"boolean"}]},isModifier:{type:[{code:"boolean"}]},isModifierReason:{type:[{code:"string"}]},isSummary:{type:[{code:"boolean"}]},binding:{type:[{code:"ElementDefinitionBinding"}]},mapping:{max:9007199254740991,type:[{code:"ElementDefinitionMapping"}]}}},Xz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},Zz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},discriminator:{max:9007199254740991,type:[{code:"ElementDefinitionSlicingDiscriminator"}]},description:{type:[{code:"string"}]},ordered:{type:[{code:"boolean"}]},rules:{min:1,type:[{code:"code"}]}}},Jz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},min:{min:1,type:[{code:"unsignedInt"}]},max:{min:1,type:[{code:"string"}]}}},e8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},targetProfile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},aggregation:{max:9007199254740991,type:[{code:"code"}]},versioning:{type:[{code:"code"}]}}},t8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},label:{min:1,type:[{code:"string"}]},"value[x]":{min:1,type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},n8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},key:{min:1,type:[{code:"id"}]},requirements:{type:[{code:"string"}]},severity:{min:1,type:[{code:"code"}]},human:{min:1,type:[{code:"string"}]},expression:{type:[{code:"string"}]},xpath:{type:[{code:"string"}]},source:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},r8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},o8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},identity:{min:1,type:[{code:"id"}]},language:{type:[{code:"code"}]},map:{min:1,type:[{code:"string"}]},comment:{type:[{code:"string"}]}}},i8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},description:{type:[{code:"string"}]},name:{type:[{code:"id"}]},language:{min:1,type:[{code:"code"}]},expression:{type:[{code:"string"}]},reference:{type:[{code:"uri"}]}}},a8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"uri"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},s8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},text:{type:[{code:"string"}]},family:{type:[{code:"string"}]},given:{max:9007199254740991,type:[{code:"string"}]},prefix:{max:9007199254740991,type:[{code:"string"}]},suffix:{max:9007199254740991,type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},l8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"CodeableConcept"}]},system:{type:[{code:"uri"}]},value:{type:[{code:"string"}]},period:{type:[{code:"Period"}]},assigner:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},c8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},country:{min:1,type:[{code:"CodeableConcept"}]},jurisdiction:{type:[{code:"CodeableConcept"}]},status:{min:1,type:[{code:"CodeableConcept"}]},dateRange:{min:1,type:[{code:"Period"}]},restoreDate:{type:[{code:"dateTime"}]}}},u8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},onBehalfOf:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},accounts:{max:9007199254740991,type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},d8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},f8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},h8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"code"}]},use:{min:1,type:[{code:"code"}]},min:{type:[{code:"integer"}]},max:{type:[{code:"string"}]},documentation:{type:[{code:"string"}]},type:{min:1,type:[{code:"code"}]},profile:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},p8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},m8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"age[x]":{type:[{code:"Range"},{code:"CodeableConcept"}]},gender:{type:[{code:"CodeableConcept"}]},race:{type:[{code:"CodeableConcept"}]},physiologicalCondition:{type:[{code:"CodeableConcept"}]}}},g8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},height:{type:[{code:"Quantity"}]},width:{type:[{code:"Quantity"}]},depth:{type:[{code:"Quantity"}]},weight:{type:[{code:"Quantity"}]},nominalVolume:{type:[{code:"Quantity"}]},externalDiameter:{type:[{code:"Quantity"}]},shape:{type:[{code:"string"}]},color:{max:9007199254740991,type:[{code:"string"}]},imprint:{max:9007199254740991,type:[{code:"string"}]},image:{max:9007199254740991,type:[{code:"Attachment"}]},scoring:{type:[{code:"CodeableConcept"}]}}},v8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},identifier:{type:[{code:"Identifier"}]},type:{min:1,type:[{code:"CodeableConcept"}]},period:{min:1,type:[{code:"Quantity"}]},specialPrecautionsForStorage:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},y8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},x8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},b8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},S8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},reference:{type:[{code:"string"}]},type:{type:[{code:"uri"}]},identifier:{type:[{code:"Identifier"}]},display:{type:[{code:"string"}]}}},w8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},label:{type:[{code:"string"}]},display:{type:[{code:"string"}]},citation:{type:[{code:"markdown"}]},url:{type:[{code:"url"}]},document:{type:[{code:"Attachment"}]},resource:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/Resource"]}]}}},j8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},C8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,max:9007199254740991,type:[{code:"Coding"}]},when:{min:1,type:[{code:"instant"}]},who:{min:1,type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},onBehalfOf:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},targetFormat:{type:[{code:"code"}]},sigFormat:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]}}},E8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"amount[x]":{type:[{code:"Quantity"},{code:"Range"},{code:"string"}]},amountType:{type:[{code:"CodeableConcept"}]},amountText:{type:[{code:"string"}]},referenceRange:{type:[{code:"SubstanceAmountReferenceRange"}]}}},T8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},R8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},event:{max:9007199254740991,type:[{code:"dateTime"}]},repeat:{type:[{code:"TimingRepeat"}]},code:{type:[{code:"CodeableConcept"}]}}},_8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"bounds[x]":{type:[{code:"Duration"},{code:"Range"},{code:"Period"}]},count:{type:[{code:"positiveInt"}]},countMax:{type:[{code:"positiveInt"}]},duration:{type:[{code:"decimal"}]},durationMax:{type:[{code:"decimal"}]},durationUnit:{type:[{code:"code"}]},frequency:{type:[{code:"positiveInt"}]},frequencyMax:{type:[{code:"positiveInt"}]},period:{type:[{code:"decimal"}]},periodMax:{type:[{code:"decimal"}]},periodUnit:{type:[{code:"code"}]},dayOfWeek:{max:9007199254740991,type:[{code:"code"}]},timeOfDay:{max:9007199254740991,type:[{code:"time"}]},when:{max:9007199254740991,type:[{code:"code"}]},offset:{type:[{code:"unsignedInt"}]}}},D8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{type:[{code:"string"}]},"timing[x]":{type:[{code:"Timing"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Schedule"]},{code:"date"},{code:"dateTime"}]},data:{max:9007199254740991,type:[{code:"DataRequirement"}]},condition:{type:[{code:"Expression"}]}}},A8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"Coding"}]},"value[x]":{min:1,type:[{code:"CodeableConcept"},{code:"Quantity"},{code:"Range"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/ResearchStudy","http://hl7.org/fhir/StructureDefinition/InsurancePlan","http://hl7.org/fhir/StructureDefinition/HealthcareService","http://hl7.org/fhir/StructureDefinition/Group","http://hl7.org/fhir/StructureDefinition/Location","http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},P8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},k8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},N8={elements:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},tokenAuthMethod:{type:[{code:"code"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},usePkce:{type:[{code:"boolean"}]},useSubject:{type:[{code:"boolean"}]}}},O8={Element:Az,BackboneElement:Pz,Address:kz,Age:Nz,Annotation:Oz,Attachment:Mz,CodeableConcept:Iz,Coding:Lz,ContactDetail:$z,ContactPoint:zz,Contributor:Uz,Count:Bz,DataRequirement:Vz,DataRequirementCodeFilter:Fz,DataRequirementDateFilter:qz,DataRequirementSort:Hz,Distance:Gz,Dosage:Wz,DosageDoseAndRate:Qz,Duration:Yz,ElementDefinition:Kz,ElementDefinitionSlicingDiscriminator:Xz,ElementDefinitionSlicing:Zz,ElementDefinitionBase:Jz,ElementDefinitionType:e8,ElementDefinitionExample:t8,ElementDefinitionConstraint:n8,ElementDefinitionBinding:r8,ElementDefinitionMapping:o8,Expression:i8,Extension:a8,HumanName:s8,Identifier:l8,MarketingStatus:c8,Meta:u8,Money:d8,Narrative:f8,ParameterDefinition:h8,Period:p8,Population:m8,ProdCharacteristic:g8,ProductShelfLife:v8,Quantity:y8,Range:x8,Ratio:b8,Reference:S8,RelatedArtifact:w8,SampledData:j8,Signature:C8,SubstanceAmount:E8,SubstanceAmountReferenceRange:T8,Timing:R8,TimingRepeat:_8,TriggerDefinition:D8,UsageContext:A8,MoneyQuantity:P8,SimpleQuantity:k8,IdentityProvider:N8};function M8(e){return new L8(e).parse()}const Fh=Dz(O8),rb=Object.create(null),dE=Object.create(null),I8={"http://hl7.org/fhir/StructureDefinition/MoneyQuantity":"MoneyQuantity","http://hl7.org/fhir/StructureDefinition/SimpleQuantity":"SimpleQuantity","http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition":"ViewDefinition"};function pD(e){let t;return t=dE[e],t||(t=dE[e]=Object.create(null)),t}function fE(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");TU(n);for(const r of n)mD(r)}function mD(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=M8(e),n=I8[e.url];let r,i;n?(r=Fh,i=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||e.type?.startsWith("http://")||e.type?.startsWith("https://")?(r=Fh,i=e.type):(r=pD(e.url),i=e.type),r[i]=t;for(const s of t.innerTypes)s.parentType=t,r[s.name]=s;rb[e.url]=t}function gD(e){return!!Fh[e]}function om(e,t){if(t){const n=pD(t)[e];if(n)return n}return Fh[e]}function vD(e,t){const n=om(e,t);if(!n)throw new ut(oi("Unknown data type: "+e));return n}function ob(e){return!!rb[e]}function Ic(e){return rb[e]}class L8{constructor(t){if(!t.snapshot?.element||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,path:this.root.path,title:t.title,type:t.type,url:t.url,version:t.version,kind:t.kind,description:U8(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if(t.id?.includes(":")){if(this.slicingContext?.current){const n=ay(t,this.slicingContext.path);this.slicingContext.current.elements[n]=this.parseElementDefinition(t)}}else{const n=this.parseElementDefinition(t);this.checkFieldEnter(t,n);let r=this.backboneContext;for(;r;){if(t.path?.startsWith(r.path+".")){r.type.elements[ay(t,r.path)]=n;break}r=r.parent}if(!r){const i=ay(t,this.root.path);t.isSummary&&this.resourceSchema.summaryProperties?.add(i.replace("[x]","")),n.min>0&&this.resourceSchema.mandatoryProperties?.add(i.replace("[x]","")),this.resourceSchema.elements[i]=n}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!Jl(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!Jl(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=SE(t);this.backboneContext={type:{name:n,type:n,path:t.path,title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path,parent:Jl(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){z8(t)&&!this.peek()?.sliceName||(n.slicing={discriminator:(t.slicing?.discriminator??[]).map(r=>{if(r.type!=="value"&&r.type!=="pattern"&&r.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${r.type}`);return{path:r.path,type:r.type}}),slices:[],ordered:t.slicing?.ordered??!1,rule:t.slicing?.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!Jl(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Jl(this.backboneContext.path,t?.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const n=t.contentReference.slice(t.contentReference.indexOf("#")+1),r=this.elementIndex[n];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,base:{path:r.base?.path??n,min:t.base?.min??r.base?.min??r.min,max:t.base?.max??r.base?.max??r.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){const n=this.peek();return!!(Jl(t?.path,n?.path)&&t.type?.some(r=>["BackboneElement","Element"].includes(r.code)))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=SE(t)),r||(r=pi(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){const n=hE(t.max),r=t.base?.max?hE(t.base.max):n,i={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||t.base?.path||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(s=>({key:s.key??"",severity:s.severity??"error",expression:s.expression??"",description:s.human??""})),type:this.parseElementDefinitionType(t),fixed:pE(Sc(i,"fixed[x]")),pattern:pE(Sc(i,"pattern[x]")),binding:t.binding}}}function hE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function ay(e,t=""){return $8(e.path,t)}function $8(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Jl(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function pE(e){return Array.isArray(e)&&e.length>0?e[0]:xn(e)?void 0:e}function z8(e){const t=e.slicing?.discriminator;return!!(e.type?.some(n=>n.code==="Extension")&&t?.length===1&&t[0].type==="value"&&t[0].path==="url")}function U8(e){let t=e.description;return t?.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function B8(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?V8:Sc,[i,...s]=t.split(".");let c=[r(e,i,n)];for(const d of s){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,d,n));else(n?.withPath&&p&&p.value!==void 0||!n?.withPath&&p!==void 0)&&f.push(r(p,d,n));c=f}return c}function V8(e,t,n){const r=e.path;return F8(Sc(e,t,n),r,t)}function F8(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((i,s)=>({...i,path:`${r}${n}[${s}]`})):{...e,path:`${r}${n}`}}const yD={date:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/,dateTime:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/};function q8(e,t,n,r){if(Array.isArray(e))return!1;let i;t.path==="$this"?i=n:i=(r??n.elements)[t.path];const s=n.type;switch(t.type){case"value":case"pattern":if(!e||!i)return!1;if(i.pattern)return sb(e,i.pattern);if(i.fixed)return ci(e,i.fixed);if(i.binding?.strength==="required"&&i.binding.valueSet)return!0;break;case"type":return!e||!s?.length?!1:s.some(c=>c.code===e.type)}return!1}function Xe(e){return[{type:re.boolean,value:e}]}function Qr(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:re.integer,value:e}:typeof e=="number"?{type:re.decimal,value:e}:typeof e=="boolean"?{type:re.boolean,value:e}:typeof e=="string"?{type:re.string,value:e}:po(e)?{type:re.Quantity,value:e}:mi(e)?{type:e.resourceType,value:e}:PD(e)?{type:re.CodeableConcept,value:e}:AD(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function ti(e){return e.length===0?!1:!!e[0].value}function Yi(e,t){if(e.length!==0){if(e.length===1&&(!t||e[0].type===t))return e[0];throw new Error(`Expected singleton of type ${t}, but found ${JSON.stringify(e)}`)}}function Sc(e,t,n){if(!e.value)return;const r=ts(e.type,t,n?.profileUrl);return r?xD(e,t,r):Dd(e,t)}function xD(e,t,n){const r=e.value,i=n.type;if(!i||i.length===0)return;let s,c="undefined",d;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of i){const g=p.replace("[x]",In(m.code));if(s=r[g],d=r["_"+g],s!==void 0||d!==void 0){c=m.code;break}}if(d)if(Array.isArray(s)){s=s.slice();for(let m=0;m<Math.max(s.length,d.length);m++)s[m]=yE(s[m],d[m])}else s=yE(s,d);if(!xn(s))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(s)?s.map(m=>mE(m,c)):mE(s,c)}function mE(e,t){return t==="Resource"&&mi(e)&&(t=e.resourceType),{type:t,value:e}}function Dd(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const i=n[t];Array.isArray(i)?r=i.map(Qr):r=Qr(i)}else{const i=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(re)){const c=i+In(s);if(c in n){const d=n[c];Array.isArray(d)?r=d.map(f=>({type:s,value:f})):r={type:s,value:d};break}}}if(Array.isArray(r)){if(r.length===0||xn(r[0]))return}else if(xn(r))return;return r}function bD(e){const t=[];for(const n of e){let r=!1;for(const i of t)if(ti(im(n,i))){r=!0;break}r||t.push(n)}return t}function H8(e){return Xe(!ti(e))}function G8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Xe(!1):Xe(e.every((n,r)=>ti(im(n,t[r]))))}function W8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Xe(!0):Xe(e.some((n,r)=>!ti(im(n,t[r]))))}function im(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?Xe(Math.abs(n-r)<1e-8):po(n)&&po(r)?Xe(TD(n,r)):Xe(typeof n=="object"&&typeof r=="object"?ib(e,t):n===r)}function SD(e,t){return e.length===0&&t.length===0?Xe(!0):e.length!==t.length?Xe(!1):(e.sort(gE),t.sort(gE),Xe(e.every((n,r)=>ti(Q8(n,t[r])))))}function Q8(e,t){const{type:n,value:r}=e,{type:i,value:s}=t,c=r?.valueOf(),d=s?.valueOf();return typeof c=="number"&&typeof d=="number"?Xe(Math.abs(c-d)<.01):po(c)&&po(d)?Xe(TD(c,d)):Xe(n==="Coding"&&i==="Coding"?typeof c!="object"||typeof d!="object"?!1:c.code===d.code&&c.system===d.system:typeof c=="object"&&typeof d=="object"?ib({...c,id:void 0},{...d,id:void 0}):typeof c=="string"&&typeof d=="string"?c.toLowerCase()===d.toLowerCase():c===d)}function gE(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function wD(e,t){const{value:n}=e;if(n==null)return!1;let r=t;switch(r.startsWith("System.")&&(r=r.substring(7)),r.startsWith("FHIR.")&&(r=r.substring(5)),r){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return jD(n);case"DateTime":return rd(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return CD(n);case"Quantity":return po(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function jD(e){return typeof e=="string"&&!!yD.date.exec(e)}function rd(e){return typeof e=="string"&&!!yD.dateTime.exec(e)}function CD(e){return!!(e&&typeof e=="object"&&("start"in e&&rd(e.start)||"end"in e&&rd(e.end)))}function ED(e){if(e){if(jD(e)||rd(e))return{start:sh(e,"0000-01-01T00:00:00.000"),end:sh(e,"xxxx-12-31T23:59:59.999")};if(CD(e))return{start:e.start?sh(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?sh(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function sh(e,t){let n="Z";const r=Math.max(e.indexOf("+",10),e.indexOf("-",10));r>-1?(n=e.substring(r),e=e.substring(0,r)):e.endsWith("Z")&&(e=e.substring(0,e.length-1));const i=e+t.substring(e.length)+n;return new Date(i).toISOString()}function po(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function TD(e,t){return Math.abs(e.value-t.value)<.01&&(e.unit===t.unit||e.code===t.code||e.unit===t.code||e.code===t.unit)}function ib(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const s=e[i],c=t[i];if(vE(s)&&vE(c)){if(!ib(s,c))return!1}else if(s!==c)return!1}return!0}function vE(e){return e!==null&&typeof e=="object"}function yE(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return Y8(e??{},t)}return e}function Y8(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function RD(e,t){return mi(e,t)&&"id"in e&&typeof e.id=="string"}function qt(e){const t=Dt(e)??"undefined/undefined",n=Ki(e);return n===t?{reference:t}:{reference:t,display:n}}function Dt(e){if(sa(e))return e.reference;if(RD(e))return`${e.resourceType}/${e.id}`}function qs(e){if(e)return sa(e)?e.reference.split("/")[1]:e.id}function K8(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ki(e){if(K8(e)){const t=X8(e);if(t)return t}if(e.resourceType==="Device"){const t=Z8(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Qa(e.medicationCodeableConcept);if(e.resourceType==="Subscription"&&e.criteria)return e.criteria;if(e.resourceType==="User"&&e.email)return e.email;if("name"in e&&e.name&&typeof e.name=="string")return e.name;if("code"in e&&e.code){let t=e.code;if(Array.isArray(t)&&(t=t[0]),PD(t))return Qa(t);if(lU(t))return t.text}return Dt(e)??""}function X8(e){const t=e.name;if(t&&t.length>0)return Lc(t[0])}function Z8(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function J8(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=xE(n);if(r)return r}else return xE(t)}function xE(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function _D(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const i=n.getUTCFullYear(),s=n.getUTCMonth(),c=n.getUTCDate(),d=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=d-i;(f<s||f===s&&p<c)&&m--;let g=d*12+f-(i*12+s);p<c&&g--;const x=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:x}}function eU(e,t){const{years:n,months:r,days:i}=_D(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":i.toString().padStart(3,"0")+"D"}function pi(e,...t){let n=e;for(let r=0;r<t.length&&n;r++)n=n?.extension?.find(i=>i.url===t[r]);return n}function Lo(e,t){const n=ab(e);return JSON.stringify(n,null,t?2:void 0)??""}function ab(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?tU(e):nU(e):e}function tU(e){const t=e.length;if(t===0)return;let n,r=0;for(let i=0;i<t;i++){const s=e[i],c=ab(s);c!==s&&!n&&(n=Array.from(e)),c===void 0?n&&(n[i]=null):(n&&(n[i]=c),r++)}if(r!==0)return n??e}function nU(e){let t,n=0;for(const r in e){const i=e[r],s=ab(i);s!==i&&!t&&(t={...e}),s===void 0?t&&delete t[r]:(t&&(t[r]=s),n++)}if(n!==0)return t??e}function xn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Tn(e):!1}function Tn(e){if(e==null)return!1;const t=typeof e;return t==="string"&&e!==""||t==="object"&&("length"in e&&e.length>0||Object.keys(e).length>0)}function ci(e,t,n){return e===t||xn(e)&&xn(t)?!0:xn(e)||xn(t)?!1:Array.isArray(e)&&Array.isArray(t)?rU(e,t):Array.isArray(e)||Array.isArray(t)?!1:ar(e)&&ar(t)?oU(e,t,n):(ar(e)||ar(t),!1)}function rU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ci(e[n],t[n]))return!1;return!0}function oU(e,t,n){const r=new Set;Object.keys(e).forEach(i=>r.add(i)),Object.keys(t).forEach(i=>r.add(i)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const i of r){const s=e[i],c=t[i];if(!ci(s,c,i))return!1}return!0}function sb(e,t){return xn(e)?!0:xn(t)?!1:Array.isArray(e)&&Array.isArray(t)?iU(e,t):Array.isArray(e)||Array.isArray(t)?!1:ar(e)&&ar(t)?aU(e,t):ar(e)||ar(t)?!1:e===t}function iU(e,t){return t.every(n=>e.some(r=>sb(r,n)))}function aU(e,t){return Object.entries(t).every(([n,r])=>n in e&&sb(e[n],r))}function Yr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function DD(e){return/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i.test(e)}function ar(e){return e!==null&&typeof e=="object"}function sU(e){return typeof e=="string"}function AD(e){return ar(e)&&"code"in e&&typeof e.code=="string"}function PD(e){return ar(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(AD)}function lU(e){return ar(e)&&"text"in e&&typeof e.text=="string"}const kD=[];for(let e=0;e<256;e++)kD.push(e.toString(16).padStart(2,"0"));function cU(e){const t=ND(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=kD[n[i]];return r.join("")}function uU(e){const t=ND(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=String.fromCharCode(n[i]);return window.btoa(r.join(""))}function ND(e){return ArrayBuffer.isView(e)?e.buffer:e}function In(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function lb(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Os(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function dU(e,t){return e.coding?.find(n=>n.system===t)?.code}function fU(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const bE=e=>new Promise(t=>{setTimeout(t,e)});function Yy(e,t,n){const r=[];for(let i=0;i<n-1;i++){const s=e.indexOf(t);if(s<0)break;r.push(e.slice(0,s)),e=e.slice(s+t.length)}return r.push(e),r}function hU(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Lu(e,t){return e?(e.push(t),e):[t]}function od(e){return e.sort((t,n)=>t.localeCompare(n))}function cb(e){return e.endsWith("/")?e:e+"/"}function pU(e){return e.startsWith("/")?e.slice(1):e}function Zo(e,t){return new URL(pU(t),cb(e.toString())).toString()}function mU(e,t){return Zo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function gU(e){return typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)&&(e=Object.fromEntries(Object.entries(e).filter(t=>t[1]!==void 0))),new URLSearchParams(e).toString()}function OD(e,t){return e?.meta?.profile?.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function vU(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}function Hs(e){if(!e)return"";switch(e.type){case"Address":return MD(e.value);case"CodeableConcept":return Qa(e.value);case"Coding":return Ad(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Lc(e.value);case"Quantity":return Ms(e.value);case"Reference":return yU(e.value);default:return e.value?.toString()??""}}function yU(e){return e?e.display??e.reference??Lo(e):""}function MD(e,t){if(!e)return"";const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&t?.use,n.join(", ").trim()}function Lc(e,t){if(!e)return"";const n=[];if(e.prefix&&t?.prefix!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&t?.suffix!==!1&&n.push(...e.suffix),e.use&&(t?.all||t?.use)&&n.push("["+e.use+"]"),n.length===0){const r=ad(e.text);if(r)return r}return n.join(" ").trim()}function am(e){return e instanceof Date&&!isNaN(e.getTime())}function xU(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return am(r)?r.toLocaleTimeString(t,n):""}function sr(e,t,n){if(!e)return"";const r=new Date(e);return am(r)?r.toLocaleString(t,n):""}function bU(e,t,n){return!e||!e.start&&!e.end?"":sr(e.start,t,n)+" - "+sr(e.end,t,n)}const SU={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},wU={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},jU={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function ID(e){if(!e)return"";const t=[];return CU(t,e.repeat),e.event&&t.push(e.event.map(n=>sr(n)).join(", ")),In(t.join(" ").trim())}function CU(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,i=t.periodUnit;n===1&&r===1?e.push(SU[i]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+wU[i]):e.push("per "+r+" "+jU[i])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(In).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>xU(s)).join(", "))}function id(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=e?.low&&{...e.low,comparator:void 0},i=e?.high&&{...e.high,comparator:void 0};return r?.value===void 0&&i?.value===void 0?"":r?.value!==void 0&&i?.value===void 0?`>= ${Ms(r)}`:r?.value===void 0&&i?.value!==void 0?`<= ${Ms(i)}`:(r?.unit===i?.unit&&delete r?.unit,`${Ms(r)} - ${Ms(i)}`)}function Ms(e,t){if(!e)return"";const n=[];return e.comparator&&(n.push(e.comparator),n.push(" ")),e.value!==void 0&&n.push(e.value),e.unit&&(e.unit!=="%"&&n[n.length-1]!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function EU(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Qa(e){if(!e)return"";const t=ad(e.text);return t||(e.coding?e.coding.map(n=>Ad(n)).join(", "):"")}function Ad(e,t){const n=ad(e?.display);return n?`${n}`:ad(e?.code)??""}function LD(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(Ms(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Qa(e.valueCodeableConcept));else{const n=ad(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>LD(n)).join(" / ")),t.join(" / ").trim()}function ad(e){return typeof e=="string"?e:void 0}const re={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function TU(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&$D(n.type)}function $D(e){let t=ui.types[e];return t||(t={searchParamsDetails:{}},ui.types[e]=t),!t.searchParams&&e!=="Binary"&&(t.searchParams={_id:{base:[e],code:"_id",type:"token",expression:e+".id"},_lastUpdated:{base:[e],code:"_lastUpdated",type:"date",expression:e+".meta.lastUpdated"},_compartment:{base:[e],code:"_compartment",type:"reference",expression:e+".meta.compartment"},_profile:{base:[e],code:"_profile",type:"uri",expression:e+".meta.profile"},_security:{base:[e],code:"_security",type:"token",expression:e+".meta.security"},_source:{base:[e],code:"_source",type:"uri",expression:e+".meta.source"},_tag:{base:[e],code:"_tag",type:"token",expression:e+".meta.tag"}}),t}function RU(e){for(const t of e.base??[]){const n=$D(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function SE(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?_U((e.base?.path??e.path)?.split(".")):t}function _U(e){return e.length===1?e[0]:e.map(In).join("")}function ub(e){return ui.types[e]?.searchParams}function DU(e,t){return ui.types[e]?.searchParams?.[t]}function Gs(e){const t=e.replaceAll("[x]","").split(".").pop();return zD(t)}function zD(e){let t;return e.length<100?t=e.match(/[A-Z]+(?![a-z])|[A-Z]?[a-z]+|\d+/g)??[]:t=e.split(/(?=[A-Z])/),t.map(PU).join(" ").replace("_"," ").replace(/\s+/g," ")}const AU=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function PU(e){const t=e.toUpperCase();return e===t?e:AU.has(t)?t:t.charAt(0)+e.slice(1)}function ts(e,t,n){const r=om(e,n);if(r)return kU(r.elements,t)}function kU(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const i=t[r];if(i>="A"&&i<="Z"){const s=t.slice(0,r)+"[x]",c=e[s];if(c)return c}}}function mi(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function sa(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const ui={types:{}};function Ch(e){if(e.startsWith("T"))return e+"T00:00:00.000Z".substring(e.length);if(e.length<=10)return e;try{return new Date(e).toISOString()}catch{return e}}const Ui=()=>[],Tr={empty:(e,t)=>Xe(t.length===0||t.every(n=>xn(n.value))),hasValue:(e,t)=>Xe(t.length!==0),exists:(e,t,n)=>Xe(n?t.filter(r=>ti(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!xn(r.value))),all:(e,t,n)=>Xe(t.every(r=>ti(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Xe(!1);return Xe(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Xe(!0);return Xe(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Xe(!1);return Xe(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Xe(!0);return Xe(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Xe(!0);const r=n.eval(e,js(e));return r.length===0?Xe(!1):Xe(t.every(i=>r.some(s=>s.value===i.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,js(e));return r.length===0?Xe(!0):t.length===0?Xe(!1):Xe(r.every(i=>t.some(s=>s.value===i.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(i=>i.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Xe(t.length===Tr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ti(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:Ui,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{const r=n.eval(e,t)[0]?.value;if(typeof r!="number")throw new Error("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{const r=n.eval(e,t)[0]?.value;if(typeof r!="number")throw new Error("Expected a number for take(num)");return r>=t.length?t:r<=0?[]:t.slice(0,r)},intersect:(e,t,n)=>{if(!n)return t;const r=n.eval(e,js(e)),i=[];for(const s of t)!i.some(c=>c.value===s.value)&&r.some(c=>c.value===s.value)&&i.push(s);return i},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,js(e)),i=[];for(const s of t)r.some(c=>c.value===s.value)||i.push(s);return i},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,js(e));return bD([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,js(e));return[...t,...r]},htmlChecks:(e,t,n)=>[Qr(!0)],iif:(e,t,n,r,i)=>{const s=n.eval(e,t);if(s.length>1||s.length===1&&typeof s[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ti(s)?r.eval(e,t):i?i.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Xe(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Xe(!0);if(["false","f","no","n","0","0.0"].includes(r))return Xe(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Xe(Tr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return typeof n=="number"?[{type:re.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:re.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:re.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Xe(Tr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:Ch(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Xe(Tr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:Ch(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Xe(Tr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return typeof n=="number"?[{type:re.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:re.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:re.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Xe(Tr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return po(n)?[{type:re.Quantity,value:n}]:typeof n=="number"?[{type:re.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:re.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:re.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Xe(Tr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return n==null?[]:po(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Xe(Tr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:Ch("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Xe(Tr.toTime(e,t).length===1),indexOf:(e,t,n)=>co((r,i)=>r.indexOf(i),e,t,n),substring:(e,t,n,r)=>co((i,s,c)=>{const d=s,f=c?d+c:i.length;return d<0||d>=i.length?void 0:i.substring(d,f)},e,t,n,r),startsWith:(e,t,n)=>co((r,i)=>r.startsWith(i),e,t,n),endsWith:(e,t,n)=>co((r,i)=>r.endsWith(i),e,t,n),contains:(e,t,n)=>co((r,i)=>r.includes(i),e,t,n),upper:(e,t)=>co(n=>n.toUpperCase(),e,t),lower:(e,t)=>co(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>co((i,s,c)=>i.replaceAll(s,c),e,t,n,r),matches:(e,t,n)=>co((r,i)=>!!new RegExp(i).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>co((i,s,c)=>i.replaceAll(new RegExp(s,"g"),c),e,t,n,r),length:(e,t)=>co(n=>n.length,e,t),toChars:(e,t)=>co(n=>n?n.split(""):void 0,e,t),encode:Ui,decode:Ui,escape:Ui,unescape:Ui,trim:Ui,split:Ui,join:(e,t,n)=>{const r=n?.eval(e,js(e))[0]?.value??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:re.string,value:t.map(i=>i.value?.toString()??"").join(r)}]},abs:(e,t)=>Ko(Math.abs,e,t),ceiling:(e,t)=>Ko(Math.ceil,e,t),exp:(e,t)=>Ko(Math.exp,e,t),floor:(e,t)=>Ko(Math.floor,e,t),ln:(e,t)=>Ko(Math.log,e,t),log:(e,t,n)=>Ko((r,i)=>Math.log(r)/Math.log(i),e,t,n),power:(e,t,n)=>Ko(Math.pow,e,t,n),round:(e,t)=>Ko(Math.round,e,t),sqrt:(e,t)=>Ko(Math.sqrt,e,t),truncate:(e,t)=>Ko(n=>n|0,e,t),children:Ui,descendants:Ui,trace:(e,t,n)=>t,now:()=>[{type:re.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:re.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:re.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,i)=>{const s=Tr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const c=Tr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const d=i.eval(e,t)[0]?.value;if(d!=="years"&&d!=="months"&&d!=="days")throw new Error("Invalid units");const f=_D(s[0].value,c[0].value);return[{type:re.Quantity,value:{value:f[d],unit:d}}]},is:(e,t,n)=>{let r="";return n instanceof qh?r=n.name:n instanceof db&&(r=n.left.name+"."+n.right.name),r?t.map(i=>({type:re.boolean,value:wD(i,r)})):[]},not:(e,t)=>Tr.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let i;if(typeof r=="string")i=r;else if(typeof r=="object"){const s=r;if(s.resource)return Qr(s.resource);s.reference?i=s.reference:s.type&&s.identifier&&(i=`${s.type}?identifier=${s.identifier.system}|${s.identifier.value}`)}if(i?.includes("?")){const[s]=i.split("?");return{type:s,value:{resourceType:s}}}if(i?.includes("/")){const[s,c]=i.split("/");return{type:s,value:{resourceType:s,id:c}}}return{type:re.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:re.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:re.BackboneElement,value:{namespace:"System",name:"Integer"}}:mi(n)?{type:re.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:re.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const i=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(s=>({type:re.boolean,value:s.value?.resourceType===i}))},getResourceKey:(e,t)=>{const n=t[0].value;return n?.id?[{type:re.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!r?.reference)return[];let i="";return n instanceof qh&&(i=n.name),i&&!r.reference.startsWith(i+"/")?[]:[{type:re.id,value:qs(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,i=t?.[0]?.value;if(i){const s=pi(i,r);if(s)return[{type:re.Extension,value:s}]}return[]}};function co(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Jo(n,1);if(typeof i!="string")throw new Error("String function cannot be called with non-string");const s=e(i,...r.map(c=>c?.eval(t,n)[0]?.value));return s===void 0?[]:Array.isArray(s)?s.map(Qr):[Qr(s)]}function Ko(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Jo(n,1),s=po(i),c=s?i.value:i;if(typeof c!="number")throw new Error("Math function cannot be called with non-number");const d=e(c,...r.map(m=>m.eval(t,n)[0]?.value)),f=s?re.Quantity:n[0].type,p=s?{...i,value:d}:d;return[{type:f,value:p}]}function Jo(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const n of e)if(n==null)throw new Error("Expected non-null argument");return e}function js(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class UD{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const i of n)r.push(this.child.eval({parent:t,variables:{$this:i}},[i]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class ec{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class qh{constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(i=>this.evalValue(i)).filter(i=>i?.value!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return mi(n,this.name)?t:Sc(t,this.name)}toString(){return this.name}}class NU{eval(){return[]}toString(){return"{}"}}class OU extends fz{constructor(t,n,r){super(t,n),this.impl=r}eval(t,n){return this.impl(this.child.eval(t,n))}toString(){return this.operator+this.child.toString()}}class Hh extends _d{constructor(t,n){super("as",t,n)}eval(t,n){return Tr.ofType(t,this.left.eval(t,n),this.right)}}class Or extends _d{}class Do extends Or{constructor(t,n,r,i){super(t,n,r),this.impl=i}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.eval(t,n);if(i.length!==1)return[];const s=r[0].value,c=i[0].value,d=po(s)?s.value:s,f=po(c)?c.value:c,p=this.impl(d,f);return typeof p=="boolean"?Xe(p):po(s)?[{type:re.Quantity,value:{...s,value:p}}]:[Qr(p)]}}class MU extends _d{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n),s=[...r,...i];return s.length>0&&s.every(c=>typeof c.value=="string")?[{type:re.string,value:s.map(c=>c.value).join("")}]:s}}class IU extends Or{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return Xe(r.some(s=>s.value===i[0].value))}}class LU extends Or{constructor(t,n){super("in",t,n)}eval(t,n){const r=Yi(this.left.eval(t,n)),i=this.right.eval(t,n);return r?Xe(i.some(s=>im(r,s)[0].value)):[]}}class db extends _d{constructor(t,n){super(".",t,n)}eval(t,n){return this.right.eval(t,this.left.eval(t,n))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class fb extends _d{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return bD([...r,...i])}}class $U extends Or{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return G8(r,i)}}class zU extends Or{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return W8(r,i)}}class UU extends Or{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return SD(r,i)}}class BU extends Or{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return H8(SD(r,i))}}class hb extends Or{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.name;return Xe(wD(r[0],i))}}class VU extends Or{constructor(t,n){super("and",t,n)}eval(t,n){const r=Yi(this.left.eval(t,n),"boolean"),i=Yi(this.right.eval(t,n),"boolean");return r?.value===!0&&i?.value===!0?Xe(!0):r?.value===!1||i?.value===!1?Xe(!1):[]}}class FU extends Or{constructor(t,n){super("or",t,n)}eval(t,n){const r=Yi(this.left.eval(t,n),"boolean"),i=Yi(this.right.eval(t,n),"boolean");return r?.value===!1&&i?.value===!1?Xe(!1):r?.value||i?.value?Xe(!0):[]}}class qU extends Or{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Yi(this.left.eval(t,n),"boolean"),i=Yi(this.right.eval(t,n),"boolean");return!r||!i?[]:Xe(r.value!==i.value)}}class HU extends Or{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Yi(this.left.eval(t,n),"boolean"),i=Yi(this.right.eval(t,n),"boolean");return i?.value===!0||r?.value===!1?Xe(!0):!r||!i?[]:Xe(!1)}}class pb{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Tr[this.name];if(!r)throw new Error("Unrecognized function: "+this.name);return r(t,n,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class mb{constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const i=r[0].value;if(typeof i!="number")throw new Error("Invalid indexer expression: should return integer}");const s=this.left.eval(t,n);return i in s?[s[i]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const GU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class WU{constructor(t,n,r,i){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!i?.dateTimeLiterals,this.symbolRegex=i?.symbolRegex??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
|
|
77
|
+
`))}consumeString(t){this.advance();const r=this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t).replace(/\\u([0-9a-fA-F]{4})/g,(s,c)=>String.fromCodePoint(parseInt(c,16))),i=this.buildToken(t==="`"?"Symbol":"String",r);return this.advance(),i}consumeQuotedSymbol(t){this.mark();const n=this.pos.index;this.advance(),this.consumeString(t);const r=this.str.substring(n,this.pos.index);return this.buildToken("Symbol",r)}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;if(this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.pos.index===t)throw new Error("Invalid DateTime literal");let i=this.str.substring(t,this.pos.index);return i.endsWith("T")?i=i.substring(0,i.length-1):!i.startsWith("T")&&n&&!r&&(i+="Z"),this.buildToken("DateTime",i)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&QU(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return this.prevToken()?.value!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
|
|
78
|
+
`?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function QU(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&GU.includes(e.value)))}const YU=["true","false"],KU=["!=","!~","<=",">=","{}","->"];function XU(e){return new WU(e,YU,KU).tokenize()}const Yt={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,Modulo:4,Add:5,Subtract:5,Ampersand:5,Is:6,As:6,Union:7,GreaterThan:8,GreaterThanOrEquals:8,LessThan:8,LessThanOrEquals:8,Equals:9,Equivalent:9,NotEquals:9,NotEquivalent:9,In:10,Contains:10,And:11,Xor:12,Or:12,Implies:13},ZU={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},JU={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new mb(t,n)},precedence:Yt.Indexer},eB={parse(e,t){if(!(t instanceof qh))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new pb(t.name,n)},precedence:Yt.FunctionCall};function tB(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r?.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function nB(){return new hz().registerPrefix("String",{parse:(e,t)=>new ec({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new ec({type:re.dateTime,value:Ch(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new ec({type:re.Quantity,value:tB(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new ec({type:t.value.includes(".")?re.decimal:re.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new ec({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new ec({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new qh(t.value)}).registerPrefix("{}",{parse:()=>new NU}).registerPrefix("(",ZU).registerInfix("[",JU).registerInfix("(",eB).prefix("+",Yt.UnaryAdd,(e,t)=>new OU("+",t,n=>n)).prefix("-",Yt.UnarySubtract,(e,t)=>new Do("-",t,t,(n,r)=>-r)).infixLeft(".",Yt.Dot,(e,t,n)=>new db(e,n)).infixLeft("/",Yt.Divide,(e,t,n)=>new Do("/",e,n,(r,i)=>r/i)).infixLeft("*",Yt.Multiply,(e,t,n)=>new Do("*",e,n,(r,i)=>r*i)).infixLeft("+",Yt.Add,(e,t,n)=>new Do("+",e,n,(r,i)=>r+i)).infixLeft("-",Yt.Subtract,(e,t,n)=>new Do("-",e,n,(r,i)=>r-i)).infixLeft("|",Yt.Union,(e,t,n)=>new fb(e,n)).infixLeft("=",Yt.Equals,(e,t,n)=>new $U(e,n)).infixLeft("!=",Yt.NotEquals,(e,t,n)=>new zU(e,n)).infixLeft("~",Yt.Equivalent,(e,t,n)=>new UU(e,n)).infixLeft("!~",Yt.NotEquivalent,(e,t,n)=>new BU(e,n)).infixLeft("<",Yt.LessThan,(e,t,n)=>new Do("<",e,n,(r,i)=>r<i)).infixLeft("<=",Yt.LessThanOrEquals,(e,t,n)=>new Do("<=",e,n,(r,i)=>r<=i)).infixLeft(">",Yt.GreaterThan,(e,t,n)=>new Do(">",e,n,(r,i)=>r>i)).infixLeft(">=",Yt.GreaterThanOrEquals,(e,t,n)=>new Do(">=",e,n,(r,i)=>r>=i)).infixLeft("&",Yt.Ampersand,(e,t,n)=>new MU(e,n)).infixLeft("and",Yt.And,(e,t,n)=>new VU(e,n)).infixLeft("as",Yt.As,(e,t,n)=>new Hh(e,n)).infixLeft("contains",Yt.Contains,(e,t,n)=>new IU(e,n)).infixLeft("div",Yt.Divide,(e,t,n)=>new Do("div",e,n,(r,i)=>r/i|0)).infixLeft("in",Yt.In,(e,t,n)=>new LU(e,n)).infixLeft("is",Yt.Is,(e,t,n)=>new hb(e,n)).infixLeft("mod",Yt.Modulo,(e,t,n)=>new Do("mod",e,n,(r,i)=>r%i)).infixLeft("or",Yt.Or,(e,t,n)=>new FU(e,n)).infixLeft("xor",Yt.Xor,(e,t,n)=>new qU(e,n)).infixLeft("implies",Yt.Implies,(e,t,n)=>new HU(e,n))}const rB=nB();function gb(e){return new UD(e,rB.construct(XU(e)).consumeAndParse())}function oB(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const i=n[r];typeof i=="object"&&"type"in i&&"value"in i||(n[r]=Qr(n[r]))}return Ya(e,n).map(r=>r.value)}function Ya(e,t,n={},r=void 0){let i;if(typeof e=="string"){const s=r?.get(e);i=s??gb(e),r&&!s&&r.set(e,i)}else i=e;return i.eval({variables:n},t).map(s=>({type:s.type,value:s.value?.valueOf()}))}function iB(e){const t=[];for(const n of e){const r=ED(n.value);r&&t.push(r)}return t}function aB(e){const t=[];for(const n of e){const r=Hs(n);r&&t.push(r)}return t}function sB(e){const t=[];for(const n of e){const{value:r}=n;r&&(sU(r)?t.push(r):sa(r)?t.push(r.reference):RD(r)?t.push(Dt(r)):typeof r.identifier=="object"&&t.push(`identifier:${r.identifier.system}|${r.identifier.value}`))}return t}function lB(e,t={}){const n=[];for(const r of e)cB(t,n,r);return n}function cB(e,t,n){const{type:r,value:i}=n;switch(r){case re.Identifier:uB(t,e,i);break;case re.CodeableConcept:dB(t,e,i);break;case re.Coding:BD(t,e,i);break;case re.ContactPoint:fB(t,e,i);break;default:Ws(t,e,void 0,i?.toString())}}function uB(e,t,n){n?.type?.text&&Ws(e,t,t.textSearchSystem,n.type.text),Ws(e,t,n?.system,n?.value)}function dB(e,t,n){if(n?.text&&Ws(e,t,t.textSearchSystem,n.text),n?.coding)for(const r of n.coding)BD(e,t,r)}function BD(e,t,n){n&&(n.display&&Ws(e,t,t.textSearchSystem,n.display),Ws(e,t,n.system,n.code))}function fB(e,t,n){n&&Ws(e,t,n.system,n.value?.toLocaleLowerCase())}function Ws(e,t,n,r){(n||r)&&!e.some(i=>i.system===n&&i.value===r)&&e.push({system:n,value:r&&t.caseInsensitive?r.toLocaleLowerCase():r})}const sm=20,ue={EQUALS:"eq",NOT_EQUALS:"ne",GREATER_THAN:"gt",LESS_THAN:"lt",GREATER_THAN_OR_EQUALS:"ge",LESS_THAN_OR_EQUALS:"le",STARTS_AFTER:"sa",ENDS_BEFORE:"eb",APPROXIMATELY:"ap",CONTAINS:"contains",STARTS_WITH:"sw",EXACT:"exact",TEXT:"text",NOT:"not",ABOVE:"above",BELOW:"below",IN:"in",NOT_IN:"not-in",OF_TYPE:"of-type",MISSING:"missing",PRESENT:"present",IDENTIFIER:"identifier",ITERATE:"iterate"},VD={contains:ue.CONTAINS,exact:ue.EXACT,above:ue.ABOVE,below:ue.BELOW,text:ue.TEXT,not:ue.NOT,in:ue.IN,"not-in":ue.NOT_IN,"of-type":ue.OF_TYPE,missing:ue.MISSING,identifier:ue.IDENTIFIER,iterate:ue.ITERATE},vb={eq:ue.EQUALS,ne:ue.NOT_EQUALS,lt:ue.LESS_THAN,le:ue.LESS_THAN_OR_EQUALS,gt:ue.GREATER_THAN,ge:ue.GREATER_THAN_OR_EQUALS,sa:ue.STARTS_AFTER,eb:ue.ENDS_BEFORE,ap:ue.APPROXIMATELY,sw:ue.STARTS_WITH};function FD(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,d]=e.split("?");n=c,r=new URLSearchParams(d)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let i;n.includes("/")?i=n.split("/").filter(Boolean).pop():i=n;const s=[];return r&&s.push(...r.entries()),hB(i,s)}function hB(e,t){const n={resourceType:e};for(const[r,i]of t)pB(n,r,i);return n}function pB(e,t,n){let r,i;const s=t.indexOf(":");if(s>=0?(r=t.substring(0,s),i=t.substring(s+1)):(r=t,i=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Lu(e.filters,{code:t,operator:ue.EQUALS,value:n});return}switch(r){case"_sort":mB(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=parseInt(n,10);break;case"_offset":e.offset=parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const c=wE(n);i==="iterate"&&(c.modifier=ue.ITERATE),e.include=Lu(e.include,c);break}case"_revinclude":{const c=wE(n);i==="iterate"&&(c.modifier=ue.ITERATE),e.revInclude=Lu(e.revInclude,c);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const c=ui.types[e.resourceType]?.searchParams?.[r];c?e.filters=Lu(e.filters,vB(c,i,n)):e.filters=Lu(e.filters,yB(r,i,n))}}}}function mB(e,t){for(const n of t.split(",")){let r,i=!1;n.startsWith("-")?(r=n.substring(1),i=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:i})}}const gB=[ue.MISSING,ue.PRESENT];function vB(e,t,n){if(gB.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:i}=xB(n);if(!jE(e,i))throw new ut(oi(`Invalid format for ${e.type} search parameter: ${i}`));return{code:e.code,operator:r,value:i}}case"reference":case"string":case"token":case"uri":if(!jE(e,n))throw new ut(oi(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:bB(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function yB(e,t,n){let r=ue.EQUALS;if(t)r=t;else if(n.length>=2){const i=n.substring(0,2);i in vb&&(n.length===2||n.at(2)?.match(/\d/))&&(r=i,n=n.substring(i.length))}return{code:e,operator:r,value:n}}function xB(e){const t=e.substring(0,2),n=vb[t];return n?{operator:n,value:e.substring(2)}:{operator:ue.EQUALS,value:e}}function bB(e){return VD[e]??ue.EQUALS}function wE(e){const t=e.split(":");if(t.includes("*"))throw new ut(oi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new ut(oi(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new ut(oi(`Invalid include value '${e}'`))}function jE(e,t){switch(e.type){case"date":return rd(t);default:return!0}}function Ha(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(SB(n))),e.sortRules&&e.sortRules.length>0&&t.push(wB(e.sortRules)),e.cursor!==void 0&&t.push("_cursor="+encodeURIComponent(e.cursor)),e.offset!==void 0&&e.offset!==0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.types&&e.types.length>0&&t.push("_type="+e.types.join(",")),e.include&&e.include.forEach(n=>t.push(CE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(CE("_revinclude",n))),t.length===0?"":(od(t),"?"+t.join("&"))}function SB(e){const t=e.operator in VD?":"+e.operator:"",n=e.operator!==ue.EQUALS&&e.operator in vb?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function wB(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function CE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function lm(e){const t=[];let n="",r=!1;for(const i of e)r?(n+=i,r=!1):i==="\\"?r=!0:i===","?(t.push(n),n=""):n+=i;return t.push(n),t}function jB(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!CB(e,t,n))return!1}return!0}function CB(e,t,n){const r=ui.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const i=Ya(r.expression,[Qr(e)]);if(n.operator===ue.MISSING||n.operator===ue.PRESENT)return EB(i,n);switch(r.type){case"reference":return TB(i,n);case"string":case"uri":return DB(i,n);case"token":return RB(i,n);case"date":return PB(i,n);default:return!1}}function EB(e,t){const n=e.length>0;return(t.operator===ue.MISSING&&t.value==="false"||t.operator===ue.PRESENT&&t.value==="true")===n}function TB(e,t){const n=cm(t.operator);if(t.value===""&&e.length===0)return t.operator===ue.EQUALS;const r=sB(e);for(const i of lm(t.value)){let s=r.includes(i);if(!s&&t.code==="_compartment"&&(s=r.some(c=>c?.endsWith("/"+i))),s)return!n}return n}function RB(e,t){const n=lB(e),r=lm(t.value),i=cm(t.operator);for(const s of n)for(const c of r)if(_B(s,c))return!i;return i}function _B(e,t){if(t.includes("|")){const[n,r]=t.split("|").map(i=>i.toLowerCase());return!n&&!r?!1:n?e.system?.toLowerCase()===n&&(!r||e.value?.toLowerCase()===r):!e.system&&e.value?.toLowerCase()===r}return e.value?.toLowerCase()===t.toLowerCase()}function DB(e,t){const n=aB(e),r=lm(t.value),i=cm(t.operator);for(const s of n)for(const c of r)if(AB(s,c))return!i;return i}function AB(e,t){return e.toLowerCase().includes(t.toLowerCase())}function PB(e,t){const n=iB(e),r=lm(t.value),i=cm(t.operator);for(const s of n)for(const c of r)if(kB(s,t.operator,c))return!i;return i}function kB(e,t,n){if(!e)return!1;const r=ED(n);if(!r)return!1;const i=e.start??"0000",s=e.end??"9999",c=r.start,d=r.end;switch(t){case ue.APPROXIMATELY:case ue.EQUALS:case ue.NOT_EQUALS:return i<d&&s>c;case ue.LESS_THAN:return i<c;case ue.GREATER_THAN:return s>d;case ue.LESS_THAN_OR_EQUALS:return i<=d;case ue.GREATER_THAN_OR_EQUALS:return s>=c;case ue.STARTS_AFTER:return i>d;case ue.ENDS_BEFORE:return s<c;default:return!1}}function cm(e){return e===ue.NOT_EQUALS||e===ue.NOT}const NB={resourceType:"*"},OB=["DomainConfiguration","JsonWebKey","Login"],MB=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],Is={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},IB=[Is.READ,Is.VREAD,Is.HISTORY,Is.SEARCH];function LB(e,t){return OB.includes(t)?!1:$B(e,Is.UPDATE,t)}function $B(e,t,n){return!!e.resource?.some(r=>HD(r,n,t))}function qD(e,t,n){return n?n.resource?.find(r=>zB(e,t,r)):NB}function zB(e,t,n){const r=e.resourceType;return HD(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(i=>i.reference===n.compartment?.reference)||n.criteria&&!jB(e,FD(n.criteria))):!1}function HD(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||MB.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||IB.includes(n)}function UB(e){if(typeof window<"u"){const t=window.atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new window.TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function EE(e){if(typeof window<"u"){const t=new window.TextEncoder().encode(e),n=String.fromCharCode.apply(null,t);return window.btoa(n)}if(typeof Buffer<"u")return Buffer.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function BB(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return UB(t)}function TE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),cU(e.buffer)}async function VB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function GD(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function WD(e){const t={};e=Yr(e);for(const i of e.entry||[]){const s=i.resource;if(!s)continue;s.meta!==void 0&&(delete s.meta.author,delete s.meta.compartment,delete s.meta.lastUpdated,delete s.meta.project,delete s.meta.versionId,Object.keys(s.meta).length===0&&delete s.meta);const c=s?.id;c&&(t[c]=GD(),i.fullUrl="urn:uuid:"+t[c],delete i.resource?.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n?.map(i=>({fullUrl:i.fullUrl,request:{method:"POST",url:i.resource?.resourceType},resource:i.resource}))},(i,s)=>FB(i,s,t),2);return qB(JSON.parse(r))}function FB(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const i=n[r];if(i)return"urn:uuid:"+i}}return t}function qB(e){const t=GB(e),{sorted:n,cycles:r}=HB(t),i={};for(const c of e.entry??[])c.fullUrl&&(i[c.fullUrl]=c);const s=n.map(c=>i[c]);for(const c of r)for(const d of c){const f=i[d],p={...f,request:{...f.request,method:"PUT"}};s.push(p)}return{...e,entry:s}}const tc={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function HB(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=tc.NotVisited;function i(s,c){if(n[s]===tc.Visited)return!0;if(n[s]===tc.Visiting){const f=c.lastIndexOf(s);return f!==-1&&r.push(c.slice(f)),!0}n[s]=tc.Visiting,c.push(s);let d=!1;for(const f of e[s])i(f,c)||(d=!0);return n[s]=tc.Visited,c.pop(),t.unshift(s),!d}for(const s in e)n[s]===tc.NotVisited&&i(s,[]);return{sorted:t,cycles:r}}function QD(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(sa(r)){const i=r.reference;i.startsWith("urn:uuid:")&&t(i)}else QD(r,t)}}function GB(e){const t={};for(const n of e.entry||[])n.fullUrl&&(t[n.fullUrl]=[]);for(const n of e.entry||[]){const r=n.fullUrl;n.resource&&QD(n.resource,i=>{t[i]&&t[i].push(r)})}return t}const un={FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",JSON:"application/json",JSON_PATCH:"application/json-patch+json",TEXT:"text/plain",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml"};let WB=class{constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let i=0;i<r.length;i++)if(r[i]===n){r.splice(i,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}};class um{constructor(){this.emitter=new WB}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,n){this.emitter.addEventListener(t,n)}removeEventListener(t,n){this.emitter.removeEventListener(t,n)}removeAllListeners(){this.emitter.removeAllListeners()}}const Ky={"Patient-open":"Patient-open","Patient-close":"Patient-close","ImagingStudy-open":"ImagingStudy-open","ImagingStudy-close":"ImagingStudy-close","Encounter-open":"Encounter-open","Encounter-close":"Encounter-close","DiagnosticReport-open":"DiagnosticReport-open","DiagnosticReport-close":"DiagnosticReport-close","DiagnosticReport-select":"DiagnosticReport-select","DiagnosticReport-update":"DiagnosticReport-update",syncerror:"syncerror"},QB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],yb=["DiagnosticReport-update"];function YB(e){return yb.includes(e)}function KB(e){if(yb.includes(e))throw new ut(mn(`'context.version' is required for '${e}'.`))}const XB={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},select:{resourceType:"*",reference:!0,manyAllowed:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function ZB(e){return QB.includes(e)}function YD(e){return!!e.endpoint}function RE(e){if(!xb(e))throw new ut(mn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:i}=e,s={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":i.join(",")};return YD(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function xb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:i}=e;if(!(t&&n&&r&&i)||typeof r!="string"||typeof i!="object"||!Array.isArray(i)||i.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const s of i)if(!Ky[s])return!1;return!(YD(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function JB(e,t,n,r){if(typeof t!="object")throw new ut(mn(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new ut(mn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new ut(mn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const i=r.resourceType;if(i!=="*"){if(!ZB(t.resourceType))throw new ut(mn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(i&&t.resourceType!==i)throw new ut(mn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${i}.`))}}function eV(e,t,n,r,i){if(i.set(t.key,(i.get(t.key)??0)+1),r.reference){if(!sa(t.reference))throw new ut(mn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else JB(e,t.resource,n,r)}function tV(e,t){const n=new Map,r=XB[e];for(let i=0;i<t.length;i++){const s=t[i].key;if(!r[s])throw new ut(mn(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));eV(e,t[i],i,r[s],n)}for(const[i,s]of Object.entries(r)){if(!(s.optional||n.has(i)))throw new ut(mn(`Missing required key '${i}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(i)??0)>1)throw new ut(mn(`${n.get(i)} context entries with key '${i}' found for the '${e}' event when schema only allows for 1.`))}}function _E(e,t,n,r){if(!(e&&typeof e=="string"))throw new ut(mn("Must provide a topic."));if(!Ky[t])throw new ut(mn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Ky).join(", ")}`));if(typeof n!="object")throw new ut(mn("context must be a context object or array of context objects."));if(yb.includes(t)&&!r)throw new ut(mn(`The '${t}' event must contain a 'context.versionId'.`));const i=Array.isArray(n)?n:[n];return tV(t,i),{timestamp:new Date().toISOString(),id:GD(),event:{"hub.topic":e,"hub.event":t,context:i,...r?{"context.versionId":r}:{}}}}class nV extends um{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new ut(mn("Subscription request should contain an endpoint."));if(!xb(t))throw new ut(mn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const i=JSON.parse(r.data);if(i["hub.topic"])return;const s=i;s.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:s}),n.send(JSON.stringify({id:i?.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function rV(e){return JSON.parse(BB(e))}function oV(e){return e.split(".").length===3}function bb(e){const[t,n,r]=e.split(".");return rV(n)}function iV(e){try{return typeof bb(e).login_id=="string"}catch{return!1}}function aV(e){try{const n=bb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class sV{constructor(t){this.medplum=t}async get(t){return this.medplum.get(`keyvalue/v1/${t}`)}async set(t,n){await this.medplum.put(`keyvalue/v1/${t}`,n,un.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var KD;KD=Symbol.toStringTag;class Ao{constructor(t){this[KD]="ReadablePromise",this.status="pending",this.suspender=t.then(n=>(this.status="success",this.response=n,n),n=>{throw this.status="error",this.error=n,n})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,n){return this.suspender.then(t,n)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}class lV{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new cV)}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,n){n?this.storage.setItem(t,n):this.storage.removeItem(t)}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?Lo(n):void 0)}}class cV{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}/*!
|
|
79
|
+
* Reconnecting WebSocket
|
|
80
|
+
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
81
|
+
* https://github.com/pladaria/reconnecting-websocket
|
|
82
|
+
* License MIT
|
|
83
|
+
*
|
|
84
|
+
* Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
|
|
85
|
+
* https://github.com/partykit/partykit/blob/main/packages/partysocket
|
|
86
|
+
*/const uc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let DE=!1;function uV(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");uc.Event=globalThis.Event,uc.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},uc.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function dV(e,t){if(!e)throw new Error(t)}function lh(e){return new e.constructor(e.type,e)}const Cs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let AE=!1;class za extends um{constructor(t,n,r={}){DE||(uV(),DE=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=i=>{this._debug("open event");const{minUptime:s=Cs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),s),dV(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(c=>this._ws?.send(c)),this._messageQueue=[],this.onopen&&this.onopen(i),this.dispatchEvent(lh(i))},this._handleMessage=i=>{this._debug("message event"),this.onmessage&&this.onmessage(i),this.dispatchEvent(lh(i))},this._handleError=i=>{this._debug("error event",i.message),this._disconnect(void 0,i.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(i),this._debug("exec error listeners"),this.dispatchEvent(lh(i)),this._connect()},this._handleClose=i=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(i),this.dispatchEvent(lh(i))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return za.CONNECTING}get OPEN(){return za.OPEN}get CLOSING(){return za.CLOSING}get CLOSED(){return za.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((n,r)=>(typeof r=="string"?n+=r.length:r instanceof Blob?n+=r.size:n+=r.byteLength,n),0)+(this._ws?.bufferedAmount??0)}get extensions(){return this._ws?.extensions??""}get protocol(){return this._ws?.protocol??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?za.CLOSED:za.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=Cs.maxEnqueuedMessages}=this._options;this._messageQueue.length<n&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){const{reconnectionDelayGrowFactor:t=Cs.reconnectionDelayGrowFactor,minReconnectionDelay:n=Cs.minReconnectionDelay,maxReconnectionDelay:r=Cs.maxReconnectionDelay}=this._options;let i=0;return this._retryCount>0&&(i=n*Math.pow(t,this._retryCount-1),i>r&&(i=r)),this._debug("next delay",i),i}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Cs.maxRetries,connectionTimeout:n=Cs.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!AE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),AE=!0);const r=this._options.WebSocket||WebSocket;this._debug("connect",{url:this._url,protocols:this._protocols}),this._ws=this._protocols?new r(this._url,this._protocols):new r(this._url),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new uc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new uc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new uc.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}}const fV=5e3;class Xy extends um{constructor(...t){super(),this.criteria=new Set(t)}getCriteria(){return this.criteria}_addCriteria(t){this.criteria.add(t)}_removeCriteria(t){this.criteria.delete(t)}}class hV{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Xy(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class pV{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof ZD))throw new ut(mn("First arg of constructor should be a `MedplumClient`"));let i;try{i=new URL(n).toString()}catch{throw new ut(mn("Not a valid URL"))}const s=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(i,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new za(i,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new Xy,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??fV,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{try{const r=JSON.parse(n.data);if(r.type==="pong"){this.waitingForPong=!1;return}const i=r,s=i?.entry?.[0]?.resource;if(s.type==="heartbeat"){this.masterSubEmitter?.dispatchEvent({type:"heartbeat",payload:i});return}if(s.type==="handshake"){const d=qs(s.subscription),f={type:"connect",payload:{subscriptionId:d}};this.masterSubEmitter?.dispatchEvent(f);const p=this.criteriaEntriesBySubscriptionId.get(d);if(!p){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}p.connecting=!1,p.emitter.dispatchEvent({...f});return}this.masterSubEmitter?.dispatchEvent({type:"message",payload:i});const c=this.criteriaEntriesBySubscriptionId.get(qs(s.subscription));if(!c){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}c.emitter.dispatchEvent({type:"message",payload:i})}catch(r){console.error(r);const i={type:"error",payload:r};this.masterSubEmitter?.dispatchEvent(i);for(const s of this.getAllCriteriaEmitters())s.dispatchEvent({...i})}}),t.addEventListener("error",()=>{const n={type:"error",payload:new ut(Ez(new Error("WebSocket error")))};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n})}),t.addEventListener("close",()=>{const n={type:"close"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),this.masterSubEmitter?.removeAllListeners())}),t.addEventListener("open",()=>{const n={type:"open"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&this.currentProfile?.id!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){const r={type:"error",payload:n};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){const{subscriptionId:n}=t;if(n){const r={type:"disconnect",payload:{subscriptionId:n}};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){let n=t?.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${Dt(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),i=r?.find(c=>c.name==="token")?.valueString,s=r?.find(c=>c.name==="websocket-url")?.valueUrl;if(!i)throw new ut(mn("Failed to get token"));if(!s)throw new ut(mn("Failed to get URL from $get-ws-binding-token"));return[n,i]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const i of r.criteriaWithProps)if(ci(n,i.subscriptionProps))return i}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let i;this.criteriaEntries.has(n)?i=this.criteriaEntries.get(n):(i={criteriaWithProps:[]},this.criteriaEntries.set(n,i)),r?i.criteriaWithProps.push(t):i.bareCriteria=t}removeCriteriaEntry(t){const{criteria:n,subscriptionProps:r,subscriptionId:i,token:s}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(d=>{const f=d.subscriptionProps;return!ci(r,f)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),this.masterSubEmitter?._removeCriteria(n)),i&&this.criteriaEntriesBySubscriptionId.delete(i),s&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:s}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Ge(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const i=new hV(t,n);return this.addCriteriaEntry(i),this.subscribeToCriteria(i).catch(console.error),i.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new Xy(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const XD="4.3.13-84e25a9f9",mV=un.FHIR_JSON+", */*; q=0.1",gV="https://api.medplum.com/",vV=1e3,yV=6e4,xV=0,bV=3e5,SV="Binary/",PE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},nc={ClientCredentials:"client_credentials",AuthorizationCode:"authorization_code",RefreshToken:"refresh_token",JwtBearer:"urn:ietf:params:oauth:grant-type:jwt-bearer",TokenExchange:"urn:ietf:params:oauth:grant-type:token-exchange"},wV={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},jV={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class ZD extends um{constructor(t){if(super(),this.initComplete=!0,t?.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=t?.fetch??CV(),this.storage=t?.storage??new lV,this.createPdfImpl=t?.createPdf,this.baseUrl=cb(t?.baseUrl??gV),this.fhirBaseUrl=Zo(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=Zo(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=Zo(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=Zo(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=Zo(this.baseUrl,t?.fhircastHubUrl??"fhircast/STU3"),this.clientId=t?.clientId??"",this.clientSecret=t?.clientSecret??"",this.credentialsInHeader=t?.authCredentialsMethod==="header",this.defaultHeaders=t?.defaultHeaders??{},this.onUnauthenticated=t?.onUnauthenticated,this.refreshGracePeriod=t?.refreshGracePeriod??bV,this.cacheTime=t?.cacheTime??(typeof window>"u"?xV:yV),this.cacheTime>0?this.requestCache=new cD(t?.resourceCacheSize??vV):this.requestCache=void 0,t?.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t?.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t?.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve(),this.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t?.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}getFhircastHubUrl(){return this.fhircastHubUrl}getDefaultHeaders(){return this.defaultHeaders}clear(){this.storage.clear(),typeof window<"u"&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){this.storage.setString("activeLogin",void 0),this.requestCache?.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.refreshPromise=void 0,this.accessTokenExpires=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){t=t.toString(),this.requestCache?.delete(t)}invalidateAll(){this.requestCache?.clear()}invalidateSearches(t){const n=Zo(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let i;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?i=new Promise((c,d)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:d}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):i=this.request("GET",t,n);const s=new Ao(i);return this.setCacheEntry(t,s),s}post(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("POST",t,i)}put(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("PUT",t,i)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,un.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:i}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:i},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(window.location.search).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,i,s=!0){let c=i;s&&(c=await this.ensureCodeChallenge(i)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,c,s))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:nc.TokenExchange,subject_token_type:wV.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,i,s=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",i.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(i)),s){const{codeChallenge:d,codeChallengeMethod:f}=i;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!d)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",d)}return c.toString()}fhirUrl(...t){return new URL(Zo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=gU(n)),r}search(t,n,r){const i=this.fhirSearchUrl(t,n),s="search-"+i.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=this.getBundle(i,r);return this.setCacheEntry(s,d),d}searchOne(t,n,r){const i=this.fhirSearchUrl(t,n);i.searchParams.set("_count","1"),i.searchParams.sort();const s="searchOne-"+i.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Ao(this.search(t,i.searchParams,r).then(f=>f.entry?.[0]?.resource));return this.setCacheEntry(s,d),d}searchResources(t,n,r){const s="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Ao(this.search(t,n,r).then(OE));return this.setCacheEntry(s,d),d}async*searchResourcePages(t,n,r){let i=this.fhirSearchUrl(t,n);for(;i;){const s=new URL(i).searchParams;s.has("_count")||s.set("_count","1000");const c=await this.search(t,s,r),d=c.link?.find(f=>f.relation==="next");if(!c.entry?.length&&!d)break;yield OE(c),i=d?.url?new URL(d.url):void 0}}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){const r=this.requestCache?.get(this.fhirUrl(t,n).toString())?.value;return r?.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return PE;const[r,i]=n.split("/");if(!(!r||!i))return this.getCached(r,i)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new Ao(Promise.reject(new Error("Missing reference")));if(r==="system")return new Ao(Promise.resolve(PE));const[i,s]=r.split("/");return!i||!s?new Ao(Promise.reject(new Error("Invalid reference"))):this.readResource(i,s,n)}requestSchema(t){if(gD(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const i=new Ao((async()=>{const s=`{
|
|
87
|
+
StructureDefinitionList(_filter: "name eq ${t}") {
|
|
88
|
+
resourceType,
|
|
89
|
+
name,
|
|
90
|
+
kind,
|
|
91
|
+
description,
|
|
92
|
+
type,
|
|
93
|
+
url,
|
|
94
|
+
snapshot {
|
|
95
|
+
element {
|
|
96
|
+
id,
|
|
97
|
+
path,
|
|
98
|
+
definition,
|
|
99
|
+
min,
|
|
100
|
+
max,
|
|
101
|
+
base {
|
|
102
|
+
path,
|
|
103
|
+
min,
|
|
104
|
+
max
|
|
105
|
+
},
|
|
106
|
+
contentReference,
|
|
107
|
+
type {
|
|
108
|
+
code,
|
|
109
|
+
profile,
|
|
110
|
+
targetProfile
|
|
111
|
+
},
|
|
112
|
+
binding {
|
|
113
|
+
strength,
|
|
114
|
+
valueSet
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
SearchParameterList(base: "${t}", _count: 100) {
|
|
120
|
+
base,
|
|
121
|
+
code,
|
|
122
|
+
type,
|
|
123
|
+
expression,
|
|
124
|
+
target
|
|
125
|
+
}
|
|
126
|
+
}`.replace(/\s+/g," "),c=await this.graphql(s);fE(c.data.StructureDefinitionList);for(const d of c.data.SearchParameterList)RU(d)})());return this.setCacheEntry(n,i),i}requestProfileSchema(t,n){if(!n?.expandProfile&&ob(t))return Promise.resolve();const r=t+"-requestSchema"+(n?.expandProfile?"-nested":""),i=this.getCacheEntry(r,void 0);if(i)return i.value;const s=new Ao((async()=>{if(n?.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const d=await this.post(c.toString(),{});fE(d)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}mD(c)}})());return this.setCacheEntry(r,s),s}readHistory(t,n,r,i){const s=this.fhirUrl(t,n,"_history");return r?.count&&s.searchParams.set("_count",r.count.toString()),r?.offset&&s.searchParams.set("_offset",r.offset.toString()),this.get(s.toString(),i)}readVersion(t,n,r,i){return this.get(this.fhirUrl(t,n,"_history",r),i)}readPatientEverything(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$everything"),n)}readPatientSummary(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$summary"),n)}createResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,n)}async createResourceIfNoneExist(t,n,r){const i=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const s=await this.post(i,t,void 0,r);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async upsertResource(t,n,r){const i=this.fhirSearchUrl(t.resourceType,n);let s=await this.put(i,t,void 0,r);return s||(s=t),this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,i,s){let c=ME(t,n,r,i);if(c.contentType===un.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,x)=>{const b=new FileReader;b.onload=()=>{if(!b.result){x(new Error("Failed to load file"));return}g(b.result)},b.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?m=new TextDecoder().decode(p):m=p,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:un.CDA_XML})}const d=s??(typeof n=="object"?n:{}),f=await this.createBinary(c,d);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,i,s){const c=ME(t,n,r,i),d=s??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:x}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g?.reference&&this.setRequestHeader(d,"X-Security-Context",g.reference),x?this.uploadwithProgress(b,f,p,x,d):this.post(b,f,p,d)}uploadwithProgress(t,n,r,i,s){return new Promise((c,d)=>{const f=new XMLHttpRequest,p=()=>f.abort();s?.signal?.addEventListener("abort",p);const m=g=>{s?.signal?.removeEventListener("abort",p),g instanceof Error?d(g):c(g)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),i&&(f.upload.onprogress=g=>i(g),f.upload.onload=g=>i(g)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new ut(Ht(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),s?.headers){const g=s.headers;for(const[x,b]of Object.entries(g))f.setRequestHeader(x,b)}f.send(n)})}async createPdf(t,n,r,i){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=RV(t,n,r,i),c=typeof n=="object"?n:{},{docDefinition:d,tableLayouts:f,fonts:p,...m}=s,g=await this.createPdfImpl(d,f,p),x={...m,data:g,contentType:"application/pdf"};return this.createBinary(x,c)}createComment(t,n,r){const i=this.getProfile();let s,c;return t.resourceType==="Encounter"&&(s=qt(t),c=t.subject),t.resourceType==="ServiceRequest"&&(s=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=qt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[qt(t)],encounter:s,subject:c,sender:i?qt(i):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,i){const s=await this.patch(this.fhirUrl(t,n),r,i);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),s}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,i){let s;if(typeof t=="string"){const c=t;s=this.fhirUrl("Bot",c,"$execute")}else{const c=t;s=this.fhirUrl("Bot","$execute"),s.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(s,n,r,i)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,un.JSON,n)}graphql(t,n,r,i){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},un.JSON,i)}readResourceGraph(t,n,r,i){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,i)}pushToAgent(t,n,r,i,s,c){const{waitTimeout:d,...f}=c??{};return this.post(this.fhirUrl("Agent",qs(t),"$push"),{destination:typeof n=="string"?n:Dt(n),body:r,contentType:i,waitForResponse:s,...d!==void 0?{waitTimeout:d}:void 0},un.FHIR_JSON,f)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){(!this.sessionDetails?.profile||Dt(this.sessionDetails.profile)!==t.profile?.reference)&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=aV(t),this.medplumServer=iV(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>r.profile?.reference!==t.profile?.reference);n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{this.profilePromise=void 0;const i=this.sessionDetails?.profile?.id!==r.profile.id;this.sessionDetails=r,i&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!this.isInitialized||!!this.profilePromise&&!this.sessionDetails?.profile}isSuperAdmin(){return!!this.sessionDetails?.project.superAdmin}isProjectAdmin(){return!!this.sessionDetails?.membership.admin}getProject(){return this.sessionDetails?.project}getProjectMembership(){return this.sessionDetails?.membership}getProfile(){return this.sessionDetails?.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){return this.sessionDetails?.config}getAccessPolicy(){return this.sessionDetails?.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(SV)&&(t=this.fhirUrl(r));let i=n.headers;return i||(i={},n.headers=i),i.Accept||(i.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...i}=t,s=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});i.securityContext||(i.securityContext=qt(s));const c=await this.createAttachment(i,n);return this.updateResource({...s,status:"completed",content:c})}async uploadMedia(t,n,r,i,s){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:i},s)}async createDocumentReference(t,n){const{additionalFields:r,...i}=t,s=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});i.securityContext||(i.securityContext=qt(s));const c=await this.createAttachment(i,n);return this.updateResource({...s,content:[{attachment:c}]})}async bulkExport(t="",n,r,i){const s=t&&`${t}/`,c=this.fhirUrl(`${s}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),i)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new sV(this)),this.keyValueClient}getBundle(t,n){return new Ao((async()=>{const r=await this.get(t,n);if(r.entry)for(const i of r.entry)this.cacheResource(i.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||n?.cache==="no-cache"||n?.cache==="reload")return;const r=this.requestCache.get(t);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(t,n){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t){t?.id&&!t.meta?.tag?.some(n=>n.code==="SUBSETTED")&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Ao(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},i={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const s=await this.fetchWithRetry(n,r);if(s.status===401)return this.handleUnauthenticated(t,n,r);if(s.status===204||s.status===304)return;const d=s.headers.get("content-type")?.includes("json");if(s.status===404&&!d)throw new ut(jz);const f=await this.parseBody(s,d);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await NE(s,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const m=await NE(s,f)??i.statusUrl;if(m)return this.pollStatus(m,r,i)}if(s.status>=400)throw new ut(Ht(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(i){throw console.error("Error parsing response",t.status,i),i}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Zo(this.baseUrl,t));const r=n?.maxRetries??2;for(let i=0;i<=r;i++)try{this.options.verbose&&this.logRequest(t,n);const s=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(s),this.setCurrentRateLimit(s),i>=r||!_V(s))return s;const c=this.getRetryDelay(i),d=n.maxRetryTime??2e3;if(c>d)return s;await bE(c)}catch(s){if(s.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),s.name==="AbortError"||i===r)throw s}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const i of od(Object.keys(r)))console.log(`> ${i}: ${r[i]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){const n=t.headers?.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(/\s*;\s*/g).map(n=>{const r=n.split(/\s*,\s*/g);if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const i=r[0].substring(1,r[0].length-1),s=r.find(p=>p.startsWith("r=")),c=s?parseInt(s.substring(2),10):NaN,d=r.find(p=>p.startsWith("t=")),f=d?parseInt(d.substring(2),10):NaN;if(!i||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:i,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const i of n)i.remainingUnits||(r=Math.max(r,i.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const i={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(i.headers={...n.headers},delete i.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const s=n.pollStatusPeriod??1e3;await bE(s),r.pollCount++}return this.request("GET",t,i,r)}async executeAutoBatch(){if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const i=t[0];try{i.resolve(await this.request(i.method,Zo(this.fhirBaseUrl,i.url),i.options))}catch(s){i.reject(new ut(Ht(s)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(i=>({request:{method:i.method,url:i.url},resource:i.options.body?JSON.parse(i.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let i=0;i<t.length;i++){const s=t[i],c=r.entry?.[i];c?.response?.outcome&&!dD(c.response.outcome)?s.reject(new ut(c.response.outcome)):s.resolve(c?.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",mV,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",un.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,i=!1){t.headers||(t.headers={});const s=t.headers;i&&s[n]||(s[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||n?.constructor.name==="Blob")||typeof File<"u"&&(n instanceof File||n?.constructor.name==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||n?.constructor.name==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new ut(nd)))}async startPkce(){const t=TE();sessionStorage.setItem("pkceState",t);const n=TE().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await VB(n);return{codeChallengeMethod:"S256",codeChallenge:uU(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}}catch(r){return console.warn("Failed to hash code verifier. Falling back to 'plain' code challenge method",r),{codeChallengeMethod:"plain",codeChallenge:n}}}async requestAuthorization(t){const n=await this.ensureCodeChallenge(t??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",n.clientId??this.clientId),r.searchParams.set("redirect_uri",n.redirectUri??kE()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),window.location.assign(r.toString())}processCode(t,n){const r={grant_type:nc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??kE()};if(typeof sessionStorage<"u"){const i=sessionStorage.getItem("codeVerifier");i&&(r.code_verifier=i)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken)return this.refreshPromise=this.fetchTokens({grant_type:nc.RefreshToken,client_id:this.clientId??"",refresh_token:this.refreshToken}),this.refreshPromise;if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){return this.clientId=t,this.clientSecret=n,this.fetchTokens({grant_type:nc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:nc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:nc.ClientCredentials,client_assertion_type:jV.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=EE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new ut(mn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new ut(mn("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},s=(await this.post(this.fhircastHubUrl,RE(r),un.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!xb(t))throw new ut(mn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new ut(mn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,RE(t),un.FORM_URL_ENCODED)}fhircastConnect(t){return new nV(t)}async fhircastPublish(t,n,r,i){return YB(n)?this.post(this.fhircastHubUrl,_E(t,n,r,i),un.JSON):(KB(n),this.post(this.fhircastHubUrl,_E(t,n,r),un.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`,{cache:"no-cache"})}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":un.FORM_URL_ENCODED};this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`),this.credentialsInHeader&&(n.delete("client_id"),n.delete("client_secret"),!this.basicAuth&&t.client_id&&t.client_secret&&(r.Authorization=`Basic ${EE(t.client_id+":"+t.client_secret)}`));const i={method:"POST",headers:r,body:n.toString(),credentials:"include"};let s;try{s=await this.fetchWithRetry(this.tokenUrl,i)}catch(d){throw this.refreshPromise=void 0,d}if(!s.ok){this.clearActiveLogin();try{const d=await s.json();throw new ut(oi(d.error_description))}catch(d){throw new ut(oi("Failed to fetch tokens"),d)}}const c=await s.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(oV(n)){const r=bb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new ut(Cz);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new ut(uE)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new ut(uE)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){return this.sessionDetails&&t?t.profile?.reference?.endsWith(this.sessionDetails.profile.id)??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)window.location.reload();else if(t.key==="activeLogin"){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;n?.profile.reference!==r?.profile.reference||!this.checkSessionDetailsMatchLogin(r)?window.location.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new pV(this,mU(this.baseUrl,"/ws/subscriptions-r4"))),this.subscriptionManager}subscribeToCriteria(t,n){return this.getSubscriptionManager().addCriteria(t,n)}unsubscribeFromCriteria(t,n){this.subscriptionManager&&(this.subscriptionManager.removeCriteria(t,n),this.subscriptionManager.getCriteriaCount()===0&&this.subscriptionManager.closeWebSocket())}getMasterSubscriptionEmitter(){return this.getSubscriptionManager().getMasterEmitter()}}function CV(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function kE(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function NE(e,t){const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(rm(t)&&t.issue?.[0]?.diagnostics)return t.issue[0].diagnostics}function OE(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function EV(e){return ar(e)&&"data"in e&&"contentType"in e}function ME(e,t,n,r){return EV(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function TV(e){return ar(e)&&"docDefinition"in e}function RV(e,t,n,r){return TV(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function _V(e){return e.status===429||e.status>=500}function wc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:i,accessPolicyResource:s}){if(t===e?.path)return;i??=e?.debugMode??!1,s??=e?.accessPolicyResource;let c=DV(t,n,e,!!i);const d=Yy(t,".",2)[1];c=AV(c,s,d),c=PV(c,s,d);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const m=Object.create(null);p=g=>{const x=Yy(g,".",2)[1];if(x){if(!m[x]){const b=Gh(x,s?.hiddenFields);m[x]={hidden:b,readonly:b||Gh(x,s?.readonlyFields)}}return m[x]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:i,getExtendedProps:p,accessPolicyResource:s}}function DV(e,t,n,r){const i=Object.create(null);if(n)for(const[c,d]of Object.entries(n.elementsByPath)){const f=Os(e,c);f!==void 0&&(i[f]=d)}let s=!1;if(t)for(const[c,d]of Object.entries(t))c in i||(i[c]=d,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),i}function AV(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([i])=>!Gh(r+i,t.hiddenFields)))}function PV(e,t,n){if(!t?.readonlyFields?.length)return e;const r=Object.create(null),i=n?n+".":"";for(const[s,c]of Object.entries(e))Gh(i+s,t.readonlyFields)?r[s]={...c,readonly:!0}:r[s]=c;return r}function Gh(e,t){if(!t?.length)return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");if(t.includes(i))return!0}return!1}function JD(e){return e.type!==void 0&&e.type.length>0}function kV(e,t,n,r){const i=B8(e,t.path,{profileUrl:r});if(i){const s=n.typeSchema?.elements??n.elements;return i.some(c=>q8(c,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function eA(e,t,n,r){if(e)for(const i of t){const s={value:e,type:i.typeSchema?.type??i.type?.[0].code};if(n.every(c=>kV(s,c,i,i.typeSchema?.url??r)))return i.name}}class NV{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const i=wc({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(i===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[i],this.visitor=n}get elementsContext(){return this.elementsContextStack[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const i=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([s])=>s.startsWith(n)));this.crawlElementsImpl(i,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const i=this.prepareSlices(r.slices,r);if(!Tn(i.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(i.slices[0],n.path,i),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=OV(t);for(const i of r)this.crawlElementNode(i,n)}crawlElementNode(t,n){const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const i of t.children)this.crawlElementNode(i,n);Tn(t.element?.slicing?.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){const r=[];for(const s of t){if(!JD(s))continue;const c=s.type.find(d=>Tn(d.profile))?.profile?.[0];if(Tn(c)){const d=Ic(c);d&&(s.typeSchema=d)}r.push(s)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const i of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(i))&&this.crawlSliceImpl(i,n,r)}crawlSliceImpl(t,n,r){const i=t.typeSchema;i&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(i),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let s;const c=i?.elements??t.elements;Tn(c)&&(s=wc({path:n,parentContext:this.elementsContext,elements:c})),s&&this.elementsContextStack.push(s),this.crawlElementsImpl(c,n),s&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),i&&this.visitor.onExitSchema&&this.visitor.onExitSchema(i)}}function OV(e){const t=[];function n(s,c){return c.startsWith(s+".")}function r(s,c){for(const d of s.children)if(n(d.key,c.key)){r(d,c);return}s.children.push(c)}const i=Object.entries(e);i.sort((s,c)=>s[0].localeCompare(c[0]));for(const[s,c]of i){const d={key:s,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,s)){r(p,d),f=!0;break}f||t.push(d)}return t}const sy="__sliceName";function MV(e,t){const n=new IV(e,e.resourceType,"resource");return new NV(t,n).crawlResource(),n.getDefaultValue()}function IE(e,t,n){for(const[r,i]of Object.entries(t)){if(n===void 0||n===r){Wh(e,r,i,t);continue}const s=Os(n,r);s!==void 0&&Wh(e,s,i,t)}return e}class IV{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Yr(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const i=this.value.values,s=this.value.path,c=Os(s,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const d=[];for(const f of i){if(f===void 0)continue;const p=Os(r.path,s),m=Array.isArray(f)?f:[f];for(const g of m){LV(g,c,n,r.elements,p),Wh(g,c,n,r.elements);const x=Jy(g,c,r.elements,p);x!==void 0&&d.push(x)}}this.valueStack.push({type:"element",path:t,values:d})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const s=Os(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=Os(r.path,this.value.path);for(const d of this.value.values){const f=Jy(d,s,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];Tn(m)||f.splice(p,1)}xn(f)&&Zy(d,void 0,s,n)}}onEnterSlice(t,n,r){const i=this.value.values,s=[];for(const c of i)if(c!==void 0){const d=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(d,n,r);s.push(f)}this.valueStack.push({type:"slice",path:t,values:s})}getMatchingSliceValues(t,n,r){const i=[];for(const s of t)(s[sy]??eA(s,[n],r.discriminator,this.schema.url))===n.name&&i.push(s);for(let s=i.length;s<n.min;s++)if(lb(n.type[0].code)){const c=Object.create(null);i.push(c),t.push(c)}return i}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const i=n[r];sy in i&&delete i[sy]}}getDefaultValue(){return this.rootValue}}function LV(e,t,n,r,i){const s=Jy(e,t,r,i);n.min>0&&s===void 0&&lb(n.type[0].code)&&(n.isArray?Zy(e,[Object.create(null)],t,n):Zy(e,Object.create(null),t,n))}function Zy(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let i=n;if(n.includes("[x]")){const s=r.type[0].code;i=n.replace("[x]",In(s))}t===void 0?delete e[i]:e[i]=t}function Jy(e,t,n,r){const i=t.split(".");let s=e,c;for(let d=0;d<i.length;d++){let f=i[d];if(f.includes("[x]")){const p=(r?r+".":"")+i.slice(0,d+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",In(g))}if(d===i.length-1){Array.isArray(s)?c=s.map(p=>p[f]):c=s[f];continue}if(Array.isArray(s))s=s.map(p=>p[f]);else if(ar(s)){if(s[f]===void 0)return;s=s[f]}else return}return c}function Wh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(d=>Wh(d,t,n,r));e==null&&(e=Object.create(null));const i=e,s=t.split(".");let c=i;for(let d=0;d<s.length;d++){let f=s[d];if(f.includes("[x]")){const m=r[s.slice(0,d+1).join(".")].type[0].code;f=f.replace("[x]",In(m))}if(d===s.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??=n.fixed.value:n.pattern&&(m[f]=tA(m[f],n.pattern.value))}else{if(!(f in c)){const p=s.slice(0,d+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return i}function tA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:Yr(t);if(ar(t)&&(ar(e)&&!Array.isArray(e)||e===void 0)){const n=Yr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=tA(n[r],t[r]);return n}return e}const rr={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function dm(e,t){let n=ui.types[e]?.searchParamsDetails?.[t.code];return n||(n=zV(e,t)),n}function $V(e,t,n){let r=ui.types[e];r||(r={},ui.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function zV(e,t){const n=t.code,r=FV(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const d=Eh(c),f=hU(()=>d.join("."));d.length===1&&d[0]instanceof Or?i.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?i.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.clear(),i.propertyTypes.add("code")):nA(i,d,e,1),f().endsWith("extension.valueDateTime")&&(i.array=!1,i.propertyTypes.clear(),i.propertyTypes.add("dateTime"))}const s={type:VV(t,i.propertyTypes),elementDefinitions:i.elementDefinitions.map(c=>({...c,type:c.type?.filter(d=>i.propertyTypes.has(d.code))})).filter(c=>c.type&&c.type.length>0),parsedExpression:qV(e,t.expression),array:i.array};return $V(e,n,s),s}function nA(e,t,n,r){const i=t[r];if(i instanceof Hh){e.propertyTypes.add(i.right.toString());return}if(i instanceof pb){UV(e,i);return}const s=i.toString(),c=ts(n,s);if(!c)throw new Error(`Element definition not found for ${n} ${s}`);let d=!1,f=r+1;f<t.length&&t[f]instanceof mb&&(d=!0,f++);const p=t[f];if(c.isArray&&!d&&(e.array=!0),f===t.length-1&&p instanceof Hh){e.elementDefinitions.push(c),e.propertyTypes.add(p.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;BV(g)&&(g=c.type[0].code),nA(e,t,g,f)}}function UV(e,t){if(t.name==="as"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="ofType"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="resolve"){e.propertyTypes.add("string");return}if(t.name==="where"&&t.args[0]instanceof hb){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function BV(e){return e==="Element"||e==="BackboneElement"}function VV(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?rr.DATE:rr.DATETIME;case"number":return rr.NUMBER;case"quantity":return rr.QUANTITY;case"reference":return t.has(re.canonical)?rr.CANONICAL:rr.REFERENCE;case"token":return t.size===1&&t.has(re.boolean)?rr.BOOLEAN:rr.TEXT;default:return rr.TEXT}}function FV(e,t){const n=[],r=gb(t);return Qh(e,r.child,n),n}function qV(e,t){const n=[],r=gb(t);if(Qh(e,r.child,n),n.length===0)return r;let i=n[0];for(let s=1;s<n.length;s++)i=new fb(i,n[s]);return new UD("<original-not-available>",i)}function Qh(e,t,n){t instanceof fb?(Qh(e,t.left,n),Qh(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function Eh(e){if(e instanceof Hh||e instanceof mb)return[Eh(e.left),e].flat();if(e instanceof Or)return[e];if(e instanceof db)return[Eh(e.left),Eh(e.right)].flat();if(e instanceof pb){if(e.name==="where"&&!(e.args[0]instanceof hb))return[];if(e.name==="last")return[]}return[e]}const HV="https://meta.medplum.com/releases",ly=new Map;function GV(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!n?.length)throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function WV(e,t,n){let r=ly.get("latest");if(!r){const i="latest",s=new URL(`${HV}/${i}.json`);s.searchParams.set("a",e),s.searchParams.set("c",XD);const c=await fetch(s.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Ge(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const d=await c.json();GV(d),r=d,ly.set("latest",r),ly.set(r.tag_name.slice(1),r)}return r}async function QV(e){const t=await WV(e);if(!t.tag_name.startsWith("v"))throw new Error(`Invalid release name found. Release tag '${t.tag_name}' did not start with 'v'`);return t.tag_name.slice(1)}const rA=v.createContext(void 0);function fm(){return v.useContext(rA)}function Ae(){return fm().medplum}function hm(){return fm().navigate}function pm(){return fm().profile}const LE=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function YV(e){const t=e.medplum,n=e.navigate??KV,[r,i]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){i(d=>({...d,profile:t.getProfile(),loading:t.isLoading()}))}for(const d of LE)t.addEventListener(d,c);return()=>{for(const d of LE)t.removeEventListener(d,c)}},[t]);const s=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(rA.Provider,{value:s,children:e.children})}function KV(e){window.location.assign(e)}const $E=new Map,oA=e=>v.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const i=$E.get(t);if(i){const c=new URLSearchParams(new URL(i).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return i}return $E.set(t,e),e},[e]);function Gt(e,t){const n=Ae(),[r,i]=v.useState(()=>zE(n,e)),s=v.useCallback(c=>{ci(c,r)||i(c)},[r]);return v.useEffect(()=>{let c=!0;const d=zE(n,e);return!d&&sa(e)?n.readReference(e).then(f=>{c&&s(f)}).catch(f=>{c&&(s(void 0),t&&t(Ht(f)))}):s(d),(()=>c=!1)},[n,e,s,t]),r}function zE(e,t){if(t){if(mi(t))return t;if(sa(t))return e.getCachedReference(t)}}const wt={group:"group",display:"display",boolean:"boolean",decimal:"decimal",integer:"integer",date:"date",dateTime:"dateTime",time:"time",string:"string",text:"text",url:"url",choice:"choice",openChoice:"open-choice",attachment:"attachment",reference:"reference",quantity:"quantity"},Sb=`${Uo}/fhir/StructureDefinition/questionnaire-itemControl`,XV=`${Uo}/fhir/StructureDefinition/questionnaire-referenceFilter`,ex=`${Uo}/fhir/StructureDefinition/questionnaire-referenceResource`,ZV=`${Uo}/fhir/StructureDefinition/questionnaire-validationError`,JV=`${Uo}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,eF=`${Uo}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,tF=`${Uo}/fhir/StructureDefinition/questionnaire-signatureRequired`,Th=`${Uo}/fhir/StructureDefinition/questionnaireresponse-signature`;function nF(e){return e.type==="choice"||e.type==="open-choice"}function rF(e,t){const n=oF(e,t);return n!==void 0?n:iF(e,t)}function oF(e,t){const n=pi(e,JV);if(t&&n){const r=n.valueExpression?.expression;if(r){const i=Qr(t),s=Ya(r,[i],{"%resource":i});return ti(s)}}}function iF(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const i=sA(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!i?.length){if(n==="any")return!0;continue}const{anyMatch:s,allMatch:c}=dF(r,i,n);if(n==="any"&&s)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function iA(e,t,n=t.item){for(const r of e){const i=n?.find(s=>s.linkId===r.linkId);i&&(aF(t,r,i),r.item&&i.item&&iA(r.item,t,i.item))}}function aF(e,t,n){try{const r=cF(t,e);if(!r)return;const i=lF(t,r);if(!i)return;n.answer=[i]}catch(r){n.extension=[{url:ZV,valueString:`Expression evaluation failed: ${Ge(r)}`}]}}const sF={[wt.boolean]:[re.boolean],[wt.date]:[re.date],[wt.dateTime]:[re.dateTime],[wt.time]:[re.time],[wt.url]:[re.string,re.uri,re.url],[wt.attachment]:[re.Attachment],[wt.reference]:[re.Reference],[wt.quantity]:[re.Quantity],[wt.decimal]:[re.decimal,re.integer],[wt.integer]:[re.decimal,re.integer]};function lF(e,t){if(!e.type)return;if(e.type===wt.choice||e.type===wt.openChoice)return{[`value${In(t.type)}`]:t.value};if(e.type===wt.string||e.type===wt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(sF[e.type]?.includes(t.type))return{[`value${In(e.type)}`]:t.value}}function cF(e,t){if(!t)return;const n=pi(e,eF);if(n){const r=n.valueExpression?.expression;if(r){const i=Qr(t),s=Ya(r,[i],{"%resource":i});return s.length!==0?s[0]:void 0}}}function aA(e,t,n){const r=[];for(const i of e){const s=n.answerOption?.find(c=>Hs(di(c))===i);if(s){const c=di(s);c&&r.push({[t]:c.value})}}return r}function sA(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=sA(n.item,t);if(r)return r}}}function uF(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:i}]=Ya(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return i}else return!1}function dF(e,t,n){const r=t||[],i=pF(e);let s=!1,c=!0;for(const d of r){const f=mF(d),{operator:p}=e;if(uF(f,i,p)?s=!0:c=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:c}}function lA(e){const t=pi(e,ex);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function cy(e,t){const n=Yr(e);let r=pi(n,ex);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(i=>i!==r)),n):(r||(n.extension??=[],r={url:ex},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete r.valueCode),n)}function fF(e,t,n){const r=pi(e,XV);if(!r?.valueString)return;let i=r.valueString;t?.reference&&(i=i.replaceAll("$subj",t.reference)),n?.reference&&(i=i.replaceAll("$encounter",n.reference));const s={},c=i.split("&");for(const d of c){const[f,p]=Yy(d,"=",2);s[f]=p}return s}function UE(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??Dt(e),item:wb(e.item,t?.item),status:"in-progress"}}function wb(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===wt.display)continue;const i=t?.filter(s=>s.linkId===r.linkId);if(i&&i?.length>0)for(const s of i)s.id=s.id??uA(),s.text=s.text??r.text,s.item=wb(r.item,s.item),s.answer=dA(r,s),n.push(s);else n.push(cA(r))}return n}function cA(e){return{id:uA(),linkId:e.linkId,text:e.text,item:wb(e.item,void 0),answer:dA(e)}}let hF=1;function uA(){return"id-"+hF++}function dA(e,t){if(!(e.type===wt.display||e.type===wt.group)){if(t?.answer&&t.answer.length>0)return t.answer;if(e.initial&&e.initial.length>0)return e.initial.map(n=>({...n}));if(e.answerOption)return e.answerOption.filter(n=>n.initialSelected).map(n=>({...n,initialSelected:void 0}))}}function jb(e){return Dd({value:e},"value")}function di(e){return Dd({value:e},"value")}function pF(e){return Dd({value:e},"answer")}function mF(e){return Dd({value:e},"value")}function gF(e){const t=Gt(e.questionnaire),n=Gt(e.defaultValue),[,r]=v.useReducer(w=>w+1,0),i=v.useRef({activePage:0});if(!i.current.questionnaire&&t&&(i.current.questionnaire=t,i.current.pages=e.disablePagination?void 0:vF(t)),t&&e.defaultValue&&n&&!i.current.questionnaireResponse&&(i.current.questionnaireResponse=UE(t,n),b()),t&&!e.defaultValue&&!i.current.questionnaireResponse&&(i.current.questionnaireResponse=UE(t),b()),!i.current.questionnaire||!i.current.questionnaireResponse)return{loading:!0};function s(w,j){let C=i.current.questionnaireResponse;for(const T of w)C=C?.item?.find(E=>T.id?E.id===T.id:E.linkId===T.linkId);return j&&(C=C?.item?.find(T=>T.linkId===j.linkId)),C}function c(){i.current.activePage=(i.current.activePage??0)+1,r()}function d(){i.current.activePage=(i.current.activePage??0)-1,r()}function f(w,j){const C=s(w);C&&(C.item??=[],C.item.push(cA(j)),b())}function p(w,j){const C=s(w,j);C&&(C.answer??=[],C.answer.push({}),b())}function m(w,j,C){const T=s(w,j);T&&(T.answer=C,b())}function g(w){const j=i.current.questionnaireResponse;j&&(w?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==Th),j.extension.push({url:Th,valueSignature:w})):j.extension=j.extension?.filter(C=>C.url!==Th),b())}function x(){const w=i.current.questionnaire;if(w?.item){const j=i.current.questionnaireResponse;iA(w.item,j)}}function b(){const w=i.current.questionnaireResponse;w&&(x(),r(),e.onChange?.(w))}return{loading:!1,pagination:!!i.current.pages,questionnaire:i.current.questionnaire,questionnaireResponse:i.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:i.current.activePage,pages:i.current.pages,items:yF(i.current.questionnaire,i.current.pages,i.current.activePage),responseItems:xF(i.current.questionnaireResponse,i.current.pages,i.current.activePage),onNextPage:c,onPrevPage:d,onAddGroup:f,onAddAnswer:p,onChangeAnswer:m,onChangeSignature:g}}function vF(e){if(!(!e?.item||pi(e?.item?.[0],Sb)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function yF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function xF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function bF(e,t,n={leading:!1}){const[r,i]=v.useState(e),s=v.useRef(!1),c=v.useRef(void 0),d=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{s.current&&(!d.current&&n.leading?(d.current=!0,i(e)):(f(),c.current=setTimeout(()=>{d.current=!1,i(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(s.current=!0,f),[f]),[r,f]}const SF=250;function wF(e,t,n){return fA("searchOne",e,t)}function jc(e,t,n){return fA("searchResources",e,t)}function fA(e,t,n,r){const i=Ae(),[s,c]=v.useState(),[d,f]=v.useState(!0),[p,m]=v.useState(),[g,x]=v.useState(),b=i.fhirSearchUrl(t,n).toString(),[w]=bF(b,SF,{leading:!0});return v.useEffect(()=>{w!==s&&(c(w),i[e](t,n).then(j=>{f(!1),m(j),x(wz)}).catch(j=>{f(!1),m(void 0),x(Ht(j))}))},[i,e,t,n,s,w]),[p,d,g]}function jF(e){const t=e.value;return t?a.jsx(a.Fragment,{children:MD(t)}):null}const hA=["meta","implicitRules","contained","extension","modifierExtension"],pA=["language","text"],ln=v.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});ln.displayName="ElementsContext";const Cb=["extension","modifierExtension"],CF=["id",...hA].filter(e=>!Cb.includes(e));function EF(e){return Object.entries(e).filter(([n,r])=>!Tn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Cb.includes(n)&&!Tn(r.slicing?.slices)||CF.includes(n)?!1:!(pA.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function BE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function VE(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function TF(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:i}=v.useContext(ln),[s,c,d,f,p,m,g]=v.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(_=>i(e.path+"."+_)),[i,e.path]);function x(_){n(_),e.onChange&&e.onChange(_)}function b(_){x({...r.current,use:_})}function w(_){x({...r.current,type:_})}function j(_){x(VE(r.current||{},0,_))}function C(_){x(VE(r.current||{},1,_))}function T(_){x({...r.current,city:_})}function E(_){x({...r.current,state:_})}function R(_){x({...r.current,postalCode:_})}return a.jsxs(ye,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(sn,{disabled:e.disabled||s?.readonly,"data-testid":"address-use",defaultValue:t.use,onChange:_=>b(_.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(sn,{disabled:e.disabled||c?.readonly,"data-testid":"address-type",defaultValue:t.type,onChange:_=>w(_.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(ze,{disabled:e.disabled||d?.readonly,placeholder:"Line 1",defaultValue:BE(t,0),onChange:_=>j(_.currentTarget.value)}),a.jsx(ze,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:BE(t,1),onChange:_=>C(_.currentTarget.value)}),a.jsx(ze,{disabled:e.disabled||p?.readonly,placeholder:"City",defaultValue:t.city,onChange:_=>T(_.currentTarget.value)}),a.jsx(ze,{disabled:e.disabled||m?.readonly,placeholder:"State",defaultValue:t.state,onChange:_=>E(_.currentTarget.value)}),a.jsx(ze,{disabled:e.disabled||g?.readonly,placeholder:"Postal Code",defaultValue:t.postalCode,onChange:_=>R(_.currentTarget.value)})]})}function RF(e){const t=pm(),[n,r]=v.useState(e.defaultValue||{});function i(s){const c=s?{text:s,authorReference:t&&qt(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return a.jsx(ze,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:s=>i(s.currentTarget.value)})}/**
|
|
127
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the MIT license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/var _F={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
|
|
132
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the MIT license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const Be=(e,t,n,r)=>{const i=v.forwardRef(({color:s="currentColor",size:c=24,stroke:d=2,title:f,className:p,children:m,...g},x)=>v.createElement("svg",{ref:x,..._F[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:s}:{strokeWidth:d,stroke:s},...g},[f&&v.createElement("title",{key:"svg-title"},f),...r.map(([b,w])=>v.createElement(b,w)),...Array.isArray(m)?m:[m]]));return i.displayName=`${n}`,i};/**
|
|
137
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the MIT license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const DF=[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]],AF=Be("outline","adjustments-horizontal","AdjustmentsHorizontal",DF);/**
|
|
142
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the MIT license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const PF=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],al=Be("outline","alert-circle","AlertCircle",PF);/**
|
|
147
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the MIT license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const kF=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],NF=Be("outline","arrow-down","ArrowDown",kF);/**
|
|
152
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the MIT license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const OF=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],MF=Be("outline","arrow-up","ArrowUp",OF);/**
|
|
157
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the MIT license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const IF=[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]],LF=Be("outline","bleach-off","BleachOff",IF);/**
|
|
162
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the MIT license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const $F=[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]],zF=Be("outline","bleach","Bleach",$F);/**
|
|
167
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the MIT license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const UF=[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]],BF=Be("outline","box-multiple","BoxMultiple",UF);/**
|
|
172
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the MIT license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const VF=[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]],FF=Be("outline","brackets-contain","BracketsContain",VF);/**
|
|
177
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the MIT license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const qF=[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]],HF=Be("outline","brand-asana","BrandAsana",qF);/**
|
|
182
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the MIT license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const GF=[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],WF=Be("outline","bucket-off","BucketOff",GF);/**
|
|
187
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the MIT license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const QF=[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]],YF=Be("outline","bucket","Bucket",QF);/**
|
|
192
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the MIT license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const KF=[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]],XF=Be("outline","building","Building",KF);/**
|
|
197
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the MIT license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const ZF=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],Ia=Be("outline","calendar","Calendar",ZF);/**
|
|
202
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the MIT license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const JF=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],gi=Be("outline","check","Check",JF);/**
|
|
207
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the MIT license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const eq=[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]],tq=Be("outline","checkbox","Checkbox",eq);/**
|
|
212
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the MIT license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const nq=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Eb=Be("outline","chevron-down","ChevronDown",nq);/**
|
|
217
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the MIT license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const rq=[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]],oq=Be("outline","circle-check","CircleCheck",rq);/**
|
|
222
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the MIT license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const iq=[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]],Yh=Be("outline","circle-minus","CircleMinus",iq);/**
|
|
227
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the MIT license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const aq=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]],Kh=Be("outline","circle-plus","CirclePlus",aq);/**
|
|
232
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the MIT license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const sq=[["path",{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",key:"svg-0"}],["path",{d:"M9 15l3 -3l3 3",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}]],Tb=Be("outline","cloud-upload","CloudUpload",sq);/**
|
|
237
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the MIT license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const lq=[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]],cq=Be("outline","columns","Columns",lq);/**
|
|
242
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the MIT license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const uq=[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],Rb=Be("outline","copy","Copy",uq);/**
|
|
247
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the MIT license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const dq=[["path",{d:"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",key:"svg-0"}],["path",{d:"M12 3v3m0 12v3",key:"svg-1"}]],fq=Be("outline","currency-dollar","CurrencyDollar",dq);/**
|
|
252
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the MIT license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const hq=[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]],pq=Be("outline","device-floppy","DeviceFloppy",hq);/**
|
|
257
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the MIT license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const mq=[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],gq=Be("outline","dots","Dots",mq);/**
|
|
262
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the MIT license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const vq=[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],mA=Be("outline","edit","Edit",vq);/**
|
|
267
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the MIT license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const yq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],Pd=Be("outline","equal-not","EqualNot",yq);/**
|
|
272
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the MIT license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const xq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],kd=Be("outline","equal","Equal",xq);/**
|
|
277
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the MIT license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const bq=[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],Sq=Be("outline","eye-off","EyeOff",bq);/**
|
|
282
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the MIT license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const wq=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],jq=Be("outline","eye","Eye",wq);/**
|
|
287
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the MIT license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const Cq=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]],FE=Be("outline","file-alert","FileAlert",Cq);/**
|
|
292
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the MIT license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const Eq=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]],Tq=Be("outline","file-plus","FilePlus",Eq);/**
|
|
297
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the MIT license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const Rq=[["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",key:"svg-0"}]],_q=Be("outline","filter","Filter",Rq);/**
|
|
302
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the MIT license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/const Dq=[["path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3",key:"svg-0"}],["path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3",key:"svg-1"}],["path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7",key:"svg-2"}],["path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1",key:"svg-3"}],["path",{d:"M17 12h.01",key:"svg-4"}],["path",{d:"M13 12h.01",key:"svg-5"}]],Aq=Be("outline","forms","Forms",Dq);/**
|
|
307
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the MIT license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/const Pq=[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]],kq=Be("outline","id","Id",Pq);/**
|
|
312
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the MIT license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/const Nq=[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]],qE=Be("outline","list-details","ListDetails",Nq);/**
|
|
317
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the MIT license.
|
|
320
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
+
*/const Oq=[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]],Mq=Be("outline","lock-access","LockAccess",Oq);/**
|
|
322
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the MIT license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/const Iq=[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]],Lq=Be("outline","lock","Lock",Iq);/**
|
|
327
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
328
|
+
*
|
|
329
|
+
* This source code is licensed under the MIT license.
|
|
330
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
+
*/const $q=[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]],zq=Be("outline","logout","Logout",$q);/**
|
|
332
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the MIT license.
|
|
335
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/const Uq=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],gA=Be("outline","math-greater","MathGreater",Uq);/**
|
|
337
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
338
|
+
*
|
|
339
|
+
* This source code is licensed under the MIT license.
|
|
340
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
+
*/const Bq=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],vA=Be("outline","math-lower","MathLower",Bq);/**
|
|
342
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
343
|
+
*
|
|
344
|
+
* This source code is licensed under the MIT license.
|
|
345
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
+
*/const Vq=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]],Fq=Be("outline","message","Message",Vq);/**
|
|
347
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the MIT license.
|
|
350
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/const qq=[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]],Hq=Be("outline","microscope","Microscope",qq);/**
|
|
352
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the MIT license.
|
|
355
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
+
*/const Gq=[["path",{d:"M5 12l14 0",key:"svg-0"}]],Wq=Be("outline","minus","Minus",Gq);/**
|
|
357
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
358
|
+
*
|
|
359
|
+
* This source code is licensed under the MIT license.
|
|
360
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
+
*/const Qq=[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]],Yq=Be("outline","packages","Packages",Qq);/**
|
|
362
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the MIT license.
|
|
365
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
+
*/const Kq=[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]],Xq=Be("outline","pin","Pin",Kq);/**
|
|
367
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the MIT license.
|
|
370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/const Zq=[["path",{d:"M3 3l18 18",key:"svg-0"}],["path",{d:"M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",key:"svg-1"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-2"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-3"}]],Jq=Be("outline","pinned-off","PinnedOff",Zq);/**
|
|
372
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
373
|
+
*
|
|
374
|
+
* This source code is licensed under the MIT license.
|
|
375
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
+
*/const eH=[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]],tH=Be("outline","player-play","PlayerPlay",eH);/**
|
|
377
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
378
|
+
*
|
|
379
|
+
* This source code is licensed under the MIT license.
|
|
380
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
+
*/const nH=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],yA=Be("outline","plus","Plus",nH);/**
|
|
382
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
383
|
+
*
|
|
384
|
+
* This source code is licensed under the MIT license.
|
|
385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
+
*/const rH=[["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2",key:"svg-0"}]],oH=Be("outline","receipt","Receipt",rH);/**
|
|
387
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
388
|
+
*
|
|
389
|
+
* This source code is licensed under the MIT license.
|
|
390
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
+
*/const iH=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],xA=Be("outline","refresh","Refresh",iH);/**
|
|
392
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
393
|
+
*
|
|
394
|
+
* This source code is licensed under the MIT license.
|
|
395
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
+
*/const aH=[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]],sH=Be("outline","repeat","Repeat",aH);/**
|
|
397
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
398
|
+
*
|
|
399
|
+
* This source code is licensed under the MIT license.
|
|
400
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
+
*/const lH=[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]],cH=Be("outline","report-medical","ReportMedical",lH);/**
|
|
402
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
403
|
+
*
|
|
404
|
+
* This source code is licensed under the MIT license.
|
|
405
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
+
*/const uH=[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]],dH=Be("outline","router","Router",uH);/**
|
|
407
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
408
|
+
*
|
|
409
|
+
* This source code is licensed under the MIT license.
|
|
410
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
+
*/const fH=[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],hH=Be("outline","search","Search",fH);/**
|
|
412
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
413
|
+
*
|
|
414
|
+
* This source code is licensed under the MIT license.
|
|
415
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
+
*/const pH=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],tx=Be("outline","settings","Settings",pH);/**
|
|
417
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
418
|
+
*
|
|
419
|
+
* This source code is licensed under the MIT license.
|
|
420
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
+
*/const mH=[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]],_b=Be("outline","sort-ascending","SortAscending",mH);/**
|
|
422
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
423
|
+
*
|
|
424
|
+
* This source code is licensed under the MIT license.
|
|
425
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
+
*/const gH=[["path",{d:"M4 6l9 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l7 0",key:"svg-2"}],["path",{d:"M15 15l3 3l3 -3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]],Db=Be("outline","sort-descending","SortDescending",gH);/**
|
|
427
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
428
|
+
*
|
|
429
|
+
* This source code is licensed under the MIT license.
|
|
430
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
+
*/const vH=[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]],yH=Be("outline","square","Square",vH);/**
|
|
432
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the MIT license.
|
|
435
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
+
*/const xH=[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]],bH=Be("outline","star","Star",xH);/**
|
|
437
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
438
|
+
*
|
|
439
|
+
* This source code is licensed under the MIT license.
|
|
440
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
+
*/const SH=[["path",{d:"M16 3l4 4l-4 4",key:"svg-0"}],["path",{d:"M10 7l10 0",key:"svg-1"}],["path",{d:"M8 13l-4 4l4 4",key:"svg-2"}],["path",{d:"M4 17l9 0",key:"svg-3"}]],wH=Be("outline","switch-horizontal","SwitchHorizontal",SH);/**
|
|
442
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
443
|
+
*
|
|
444
|
+
* This source code is licensed under the MIT license.
|
|
445
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
+
*/const jH=[["path",{d:"M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-4"}]],CH=Be("outline","table-export","TableExport",jH);/**
|
|
447
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
448
|
+
*
|
|
449
|
+
* This source code is licensed under the MIT license.
|
|
450
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
+
*/const EH=[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]],TH=Be("outline","text-recognition","TextRecognition",EH);/**
|
|
452
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
453
|
+
*
|
|
454
|
+
* This source code is licensed under the MIT license.
|
|
455
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
+
*/const RH=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],mm=Be("outline","trash","Trash",RH);/**
|
|
457
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
458
|
+
*
|
|
459
|
+
* This source code is licensed under the MIT license.
|
|
460
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
+
*/const _H=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],HE=Be("outline","upload","Upload",_H);/**
|
|
462
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
463
|
+
*
|
|
464
|
+
* This source code is licensed under the MIT license.
|
|
465
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
+
*/const DH=[["path",{d:"M4.876 13.61a4 4 0 1 0 6.124 3.39h6",key:"svg-0"}],["path",{d:"M15.066 20.502a4 4 0 1 0 1.934 -7.502c-.706 0 -1.424 .179 -2 .5l-3 -5.5",key:"svg-1"}],["path",{d:"M16 8a4 4 0 1 0 -8 0c0 1.506 .77 2.818 2 3.5l-3 5.5",key:"svg-2"}]],AH=Be("outline","webhook","Webhook",DH);/**
|
|
467
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
468
|
+
*
|
|
469
|
+
* This source code is licensed under the MIT license.
|
|
470
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
+
*/const PH=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Qs=Be("outline","x","X",PH);/**
|
|
472
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
473
|
+
*
|
|
474
|
+
* This source code is licensed under the MIT license.
|
|
475
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
+
*/const kH=[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]],NH=Be("filled","circle-filled","CircleFilled",kH);class bA extends v.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(ra,{icon:a.jsx(al,{size:16}),title:"Something went wrong",color:"red",children:Ge(this.state.error)}):this.props.children}}function yo(){return a.jsx(Jn,{style:{width:"100%",height:"100vh"},children:a.jsx(Pr,{})})}const OH="_main_6f7o5_1",MH={main:OH};function dn(e){e.preventDefault(),e.stopPropagation()}function SA(e){return e.button===1||e.ctrlKey||e.metaKey}function wA(e){if(GE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&GE(t[0]))return!0}return!1}function GE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Wu(e,t){return new Promise((n,r)=>{const i=new MessageChannel;i.port1.onmessage=({data:s})=>{i.port1.close(),s.error?r(s.error):n(s.result)},e.contentWindow?.postMessage(t,new URL(e.src).origin,[i.port2])})}function jA(e,t){const n=new Blob([e],{type:un.JSON}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r;const s=t??new Date().toISOString().replace(/\D/g,"");i.download=`${s}.json`,document.body.appendChild(i),i.click(),URL.revokeObjectURL(r)}function vt(e){const t=hm(),{to:n,suffix:r,label:i,onClick:s,children:c,...d}=e;let f=IH(n);return r&&(f+="/"+r),a.jsx(At,{href:f,"aria-label":i,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),s?(p.preventDefault(),s(p)):n&&(SA(p)||(p.preventDefault(),t(f)))},...d,children:c})}function IH(e){if(e){if(typeof e=="string")return LH(e);if(mi(e))return $H(e);if(sa(e))return zH(e)}return"#"}function LH(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function $H(e){return`/${e.resourceType}/${e.id}`}function zH(e){return`/${e.reference}`}function UH(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t[t.length-1][0]:t.length===1?t[0][0]:""}function ns(e){const t=Gt(e.value),n=t?Ki(t):e.alt??"",r=UH(n),i=(t&&J8(t))??e.src,s=oA(i??void 0),c=e.radius??"xl",d={...e,value:void 0,link:void 0};return e.link?a.jsx(vt,{to:t,children:a.jsx(Bs,{src:s,alt:n,radius:c,...d,children:r})}):a.jsx(Bs,{src:s,alt:n,radius:c,...d,children:r})}const BH="_logoButton_189g3_1",VH="_user_189g3_11",FH="_userName_189g3_21",qH="_userActive_189g3_31",ch={logoButton:BH,user:VH,userName:FH,userActive:qH};function Ab(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Lc(t,e.options)}):null}function HH(e){const t=fm(),{medplum:n,profile:r,navigate:i}=t,s=n.getLogins(),{colorScheme:c,setColorScheme:d}=R3();return a.jsxs(a.Fragment,{children:[a.jsxs(Ue,{align:"center",p:"xl",children:[a.jsx(ns,{size:"xl",radius:100,value:t.profile}),a.jsx(Ab,{value:t.profile?.name?.[0]}),a.jsx(De,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),s.length>1&&a.jsx(Ce.Divider,{}),s.map(f=>f.profile.reference!==Dt(t.profile)&&a.jsx(Ce.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:a.jsxs(ye,{children:[a.jsx(Bs,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(De,{size:"sm",fw:500,children:f.profile.display}),a.jsx(De,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),a.jsx(Ce.Divider,{}),a.jsx(ye,{justify:"center",children:a.jsx(Cd,{size:"xs",value:c,onChange:f=>d(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(wH,{size:14,stroke:1.5}),onClick:()=>i("/signin"),children:"Add another account"}),a.jsx(Ce.Item,{leftSection:a.jsx(tx,{size:14,stroke:1.5}),onClick:()=>i(`/${Dt(r)}`),children:"Account settings"}),a.jsx(Ce.Item,{leftSection:a.jsx(zq,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),i("/signin")},children:"Sign out"}),a.jsx(De,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const WE={selectedItems:"selected-items",options:"options"};function Pb(e){const t=yd({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:i,error:s,defaultValue:c,toOption:d,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:x,onCreate:b,creatable:w,clearable:j,required:C,placeholder:T,leftSection:E,maxValues:R,optionsDropdownMaxHeight:_=320,minInputLength:P=0,...A}=e,k=A.disabled,I=GH(c),[B,q]=v.useState(""),[Z,K]=v.useState(),[Q,V]=v.useState(),[W,O]=v.useState(),[L,$]=v.useState(I.map(d)),[H,M]=v.useState([]),F=p??WH,te=m??QH,ae=g??YH,je=v.useRef(B);je.current=B;const xe=v.useRef(void 0),we=v.useRef(void 0),We=v.useRef(Z);We.current=Z;const Ee=v.useRef(Q);Ee.current=Q;const ot=v.useRef(W);ot.current=W;const tt=v.useRef(H);tt.current=H;const Ct=v.useCallback(()=>{if(K(void 0),je.current===we.current&&f===xe.current||(je.current?.length??0)<P)return;we.current=je.current,xe.current=f;const _e=new AbortController;V(_e),f(je.current??"",_e.signal).then(he=>{_e.signal.aborted||(M(he.map(d)),ot.current?(he.length>0&&x(he.slice(0,1)),O(!1)):he.length>0&&t.openDropdown())}).catch(he=>{_e.signal.aborted||he.message.includes("aborted")||Ne({color:"red",message:Ge(he)})}).finally(()=>{_e.signal.aborted||V(void 0)})},[t,f,x,d,P]),Ot=v.useCallback(_e=>{(H&&H.length>0||w)&&t.openDropdown(),t.updateSelectedOptionIndex(),q(_e.currentTarget.value),Ee.current&&(Ee.current.abort(),V(void 0)),We.current!==void 0&&window.clearTimeout(We.current);const he=window.setTimeout(()=>Ct(),100);K(he)},[t,H,w,Ct]),Mt=v.useCallback(_e=>{const he=L.some(be=>be.value===_e),Se=he?L.filter(be=>be.value!==_e):[...L];let $e=H?.find(be=>be.value===_e);if(!$e&&w!==!1&&b){const be=b(_e);$e=d(be)}if($e){if(R===0){x([$e.resource]),L.length>0&&$([]);return}he||Se.push($e)}if(R!==void 0)for(;Se.length>R;)Se.shift();x(Se.map(be=>be.resource)),$(Se)},[w,H,L,R,x,b,d]),pt=v.useMemo(()=>{if(!k)return _e=>{k||(R===1&&(q(""),M([]),t.closeDropdown()),we.current=void 0,_e==="$create"?(q(""),Mt(B)):Mt(_e))}},[Mt,t,k,R,B]),Rt=v.useCallback(_e=>{const he=L.filter(Se=>Se.value!==_e.value);x(he.map(Se=>Se.resource)),$(he)},[L,x]),tn=v.useCallback(_e=>{_e.key==="Enter"?(Z||Q)&&O(!0):_e.key==="Backspace"&&B.length===0&&(dn(_e),Rt(L[L.length-1]))},[Q,Rt,B.length,L,Z]);v.useEffect(()=>()=>{Ee.current&&Ee.current.abort()},[]);const Re=!k&&j&&L.length>0&&a.jsx(st.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{q(""),$([]),x([]),t.closeDropdown()}}),Pe=w&&B.trim().length>0,Ke=H.length>0||Pe;return a.jsxs(st,{store:t,onOptionSubmit:pt,withinPortal:!0,shadow:"xl",...A,children:[a.jsx(st.DropdownTarget,{children:a.jsx(xc,{label:r,description:i,error:s,className:e.className,leftSection:E,rightSection:Q?a.jsx(Pr,{size:16}):Re,required:C,disabled:k,children:a.jsxs(Vs.Group,{"data-testid":WE.selectedItems,children:[L.map(_e=>a.jsx(te,{item:_e,disabled:k,onRemove:()=>Rt(_e)},_e.value)),!k&&(R===void 0||R===0||L.length<R)&&a.jsx(st.EventsTarget,{children:a.jsx(xc.Field,{role:"searchbox",name:n,value:B,placeholder:T,onFocus:Ot,onBlur:()=>{t.closeDropdown(),q("")},onKeyDown:tn,onChange:Ot})})]})})}),a.jsx(st.Dropdown,{hidden:!Ke,"data-testid":WE.options,children:a.jsx(st.Options,{children:a.jsxs(Ep,{type:"scroll",mah:_,children:[H.map(_e=>{const he=L.some(Se=>Se.value===_e.value);return a.jsx(st.Option,{value:_e.value,active:he,children:a.jsx(F,{..._e,active:he})},_e.value)}),Pe&&a.jsxs(st.Option,{value:"$create",children:["+ Create ",B]}),!w&&B.trim().length>0&&H.length===0&&a.jsx(ae,{search:B})]})})})]})}function GH(e){return e?Array.isArray(e)?e:[e]:[]}function WH(e){return a.jsxs(ye,{gap:"xs",children:[e.active&&a.jsx(gi,{size:12}),a.jsx("span",{children:e.label})]})}function QH({item:e,disabled:t,onRemove:n}){return a.jsx(Vs,{withRemoveButton:!t,onRemove:n,children:e.label})}function YH(){return a.jsx(st.Empty,{children:"Nothing found"})}const KH="_searchInput_dick8_1",XH={searchInput:KH};function ZH(e){return{value:e.id,label:Ki(e),resource:e}}function JH(e){const t=hm(),n=Ae(),r=v.useCallback(async(s,c)=>{const d=tG(s),f={signal:c},p=await n.graphql(d,void 0,void 0,f);return nG(p,s)},[n]),i=v.useCallback(s=>{s.length>0&&t(`/${Dt(s[0])}`)},[t]);return a.jsx(Pb,{size:"sm",radius:"md",className:XH.searchInput,leftSection:a.jsx(hH,{size:16}),placeholder:"Search",itemComponent:eG,toOption:ZH,onChange:i,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const eG=v.forwardRef(({resource:e,active:t,...n},r)=>{let i;return e.resourceType==="Patient"?i=e.birthDate:e.resourceType==="ServiceRequest"&&(i=e.subject?.display),a.jsx("div",{ref:r,...n,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(ns,{value:e}),a.jsxs("div",{children:[a.jsx(De,{children:Ki(e)}),a.jsx(De,{size:"xs",c:"dimmed",children:i})]})]})})});function tG(e){const t=JSON.stringify(e);return DD(e)?`{
|
|
477
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
478
|
+
resourceType
|
|
479
|
+
id
|
|
480
|
+
identifier {
|
|
481
|
+
system
|
|
482
|
+
value
|
|
483
|
+
}
|
|
484
|
+
name {
|
|
485
|
+
given
|
|
486
|
+
family
|
|
487
|
+
}
|
|
488
|
+
birthDate
|
|
489
|
+
}
|
|
490
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
491
|
+
resourceType
|
|
492
|
+
id
|
|
493
|
+
identifier {
|
|
494
|
+
system
|
|
495
|
+
value
|
|
496
|
+
}
|
|
497
|
+
subject {
|
|
498
|
+
display
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}`.replace(/\s+/g," "):`{
|
|
502
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
503
|
+
resourceType
|
|
504
|
+
id
|
|
505
|
+
identifier {
|
|
506
|
+
system
|
|
507
|
+
value
|
|
508
|
+
}
|
|
509
|
+
name {
|
|
510
|
+
given
|
|
511
|
+
family
|
|
512
|
+
}
|
|
513
|
+
birthDate
|
|
514
|
+
}
|
|
515
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
516
|
+
resourceType
|
|
517
|
+
id
|
|
518
|
+
identifier {
|
|
519
|
+
system
|
|
520
|
+
value
|
|
521
|
+
}
|
|
522
|
+
name {
|
|
523
|
+
given
|
|
524
|
+
family
|
|
525
|
+
}
|
|
526
|
+
birthDate
|
|
527
|
+
}
|
|
528
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
529
|
+
resourceType
|
|
530
|
+
id
|
|
531
|
+
identifier {
|
|
532
|
+
system
|
|
533
|
+
value
|
|
534
|
+
}
|
|
535
|
+
subject {
|
|
536
|
+
display
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}`.replace(/\s+/g," ")}function nG(e,t){const n=[];return e.data.Patients1&&n.push(...e.data.Patients1),e.data.Patients2&&n.push(...e.data.Patients2),e.data.ServiceRequestList&&n.push(...e.data.ServiceRequestList),oG(rG(n),t).slice(0,5)}function rG(e){const t=new Set,n=[];for(const r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n}function oG(e,t){return e.sort((n,r)=>QE(r,t)-QE(n,t))}function QE(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,YE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,YE(Lc(r),t));return n}function YE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function iG(e){const t=pm(),[n,r]=v.useState(!1);return a.jsx(Ar.Header,{p:8,style:{zIndex:101},children:a.jsxs(ye,{justify:"space-between",children:[a.jsxs(ye,{gap:"xs",children:[a.jsx(er,{className:ch.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(JH,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(ye,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(Ce,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[a.jsx(Ce.Target,{children:a.jsx(er,{className:It(ch.user,{[ch.userActive]:n}),onClick:()=>r(i=>!i),children:a.jsxs(ye,{gap:7,children:[a.jsx(ns,{value:t,radius:"xl",size:24}),a.jsx(De,{size:"sm",className:ch.userName,children:Lc(t?.name?.[0])}),a.jsx(Eb,{size:12,stroke:1.5})]})})}),a.jsx(Ce.Dropdown,{children:a.jsx(HH,{version:e.version})})]})]})]})})}const kb=v.createContext({submitting:!1});kb.displayName="FormContext";function aG(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?sG(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&lG(t,n);return t}function sG(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function lG(e,t){e[t.name]=t.value}function dt(e){const[t,n]=v.useState(!1);return a.jsx(kb.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const i=aG(r.target);if(e.onSubmit){n(!0);const s=e.onSubmit(i);s?.then?s.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function yr(e){const{children:t,...n}=e,{submitting:r}=v.useContext(kb);return a.jsx(ke,{type:"submit",loading:r,...n,children:t})}function cG(e){const t=Ae(),n=t.getUserConfiguration();function r(i){const{menuname:s,bookmarkname:c}=i,d=`${e.pathname}?${e.searchParams.toString()}`,f=Yr(n);f.menu?.find(({title:m})=>m===s)?.link?.push({name:c,target:d}),t.updateResource(f).then(m=>{n.menu=m.menu,t.dispatchEvent({type:"change"}),Ne({color:"green",message:"Success"}),e.onOk()}).catch(m=>{Ne({color:"red",message:Ge(m)})})}return a.jsx(Vn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(dt,{onSubmit:r,children:a.jsxs(Ue,{children:[a.jsx(uG,{config:n}),a.jsx(ze,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yr,{mt:"sm",children:"OK"})})]})})})}function uG(e){function t(r){return r?.menu?.map(i=>i.title)}const n=t(e.config);return a.jsx(sn,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function CA(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function dG(e){return typeof e.display=="string"?e.display:CA(e)}function fG(e){return{value:CA(e),label:dG(e),resource:e}}function hG(e){return{code:e,display:e}}function gm(e){const t=Ae(),{binding:n,creatable:r,clearable:i,expandParams:s,withHelpText:c,...d}=e,f=v.useCallback(async(p,m)=>{if(!n)return[];const x=(await t.valueSetExpand({...s,url:n,filter:p,count:10},{signal:m})).expansion?.contains??[],b=[];for(const w of x)w.code&&!b.some(j=>j.code===w.code)&&b.push(w);return b},[t,s,n]);return a.jsx(Pb,{...d,creatable:r??!0,clearable:i??!0,toOption:fG,loadOptions:f,onCreate:hG,itemComponent:c?pG:void 0})}const pG=v.forwardRef(({label:e,resource:t,active:n,...r},i)=>a.jsx("div",{ref:i,...r,children:a.jsxs(ye,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(gi,{size:12}),a.jsxs("div",{children:[a.jsx(De,{children:e}),a.jsx(De,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function EA(e){const{defaultValue:t,onChange:n,withHelpText:r,...i}=e,[s,c]=v.useState(t);function d(f){const p=f[0],m=gG(p);c(m),n&&n(m)}return a.jsx(gm,{defaultValue:mG(s),onChange:d,withHelpText:r??!0,...i})}function mG(e){return e?{code:e}:void 0}function gG(e){return e?.code}function Nb(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,i=v.useCallback(s=>{n(s),r&&r(s)},[r]);return a.jsx(EA,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:i,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const vG="_menuTitle_9g6l5_1",yG="_link_9g6l5_9",xG="_linkActive_9g6l5_38",nx={menuTitle:vG,link:yG,linkActive:xG};function bG(e){const t=hm(),n=jG(e.pathname,e.searchParams,e.menus),[r,i]=v.useState(!1);function s(d,f){d.stopPropagation(),d.preventDefault(),t(f),window.innerWidth<768&&e.closeNavbar()}function c(d){d&&t(`/${d}`)}return a.jsxs(a.Fragment,{children:[a.jsx(Ar.Navbar,{children:a.jsxs(Xr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(Ar.Section,{mb:"sm",children:a.jsx(Nb,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:d=>c(d)},window.location.pathname)}),a.jsxs(Ar.Section,{grow:!0,children:[e.menus?.map(d=>a.jsxs(v.Fragment,{children:[a.jsx(De,{className:nx.menuTitle,children:d.title}),d.links?.map(f=>a.jsxs(SG,{to:f.href,active:f.href===n?.href,onClick:p=>s(p,f.href),children:[a.jsx(wG,{icon:f.icon}),a.jsx("span",{children:f.label})]},f.href))]},`menu-${d.title}`)),e.displayAddBookmark&&a.jsx(ke,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(yA,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(cG,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function SG(e){return a.jsx(vt,{onClick:e.onClick,to:e.to,className:It(nx.link,{[nx.linkActive]:e.active}),children:e.children})}function wG(e){return e.icon?e.icon:a.jsx(tm,{w:30})}function jG(e,t,n){if(!e||!t||!n)return;let r,i=0;for(const s of n)if(s.links)for(const c of s.links){const d=CG(e,t,c.href);d>i&&(i=d,r=c)}return r}function CG(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const i=["_count","_offset"];for(const[c,d]of r.searchParams.entries())if(!i.includes(c)&&t.get(c)!==d)return 0;let s=1;for(const[c,d]of t.entries())i.includes(c)||r.searchParams.get(c)===d&&s++;return s}function EG(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),r=Ae(),i=pm();v.useEffect(()=>{function f(){Ne({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",f),()=>r.removeEventListener("offline",f)},[r]);function s(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){s(!1)}function d(){s(!t)}return r.isLoading()?a.jsx(yo,{}):a.jsxs(Ar,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!i||!t,mobile:!i||!t}},padding:0,children:[i&&a.jsx(iG,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:d,notifications:e.notifications}),i&&t?a.jsx(bG,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(Ar.Main,{className:MH.main,children:a.jsx(bA,{children:a.jsx(v.Suspense,{fallback:a.jsx(yo,{}),children:e.children})})})]})}const TG="https://ccda.medplum.com",RG="https://ccda-validator.medplum.com/";function _G(e){const{url:t}=e,[n,r]=v.useState(!1),i=v.useRef(null),[s,c]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{t&&n&&i.current&&(Wu(i.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),w=new FormData;w.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${RG}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:w,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const T=await C.json();c(T)}catch(x){c(void 0),console.error("CCDA validation error:",x)}finally{f(!1)}},m=()=>{if(!s)return;const x=JSON.stringify(s,null,2);jA(x,"ccda-validation-results")},g=()=>s?s.resultsMetaData.resultMetaData.filter(x=>x?.type.includes("Error")).reduce((x,b)=>x+(b.count||0),0):0;return t?a.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[a.jsx("div",{style:{minHeight:400},children:a.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:i,src:TG,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),a.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[a.jsx(ke,{type:"button",onClick:p,disabled:d,children:d?"Validating...":"Validate"}),s&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{marginLeft:"15px"},children:[a.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),a.jsx(ke,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function Nd(e){const{contentType:t,url:n,title:r}=e.value??{},i=oA(n);return i?a.jsxs("div",{"data-testid":"attachment-display",children:[t?.startsWith("image/")&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:i,alt:r}),t?.startsWith("video/")&&a.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:a.jsx("source",{type:t,src:i})}),(t?.startsWith("text/")||t==="application/json"||t==="application/pdf")&&a.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:a.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:i+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===un.CDA_XML&&a.jsx(_G,{url:i}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(At,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:DG(r),children:r||"Download"})})]}):null}function DG(e){return e?.includes(".")?e:void 0}const AG="_root_17n8t_1",PG="_compact_17n8t_25",KE={root:AG,compact:PG};function vm(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:It(KE.root,{[KE.compact]:n}),children:t})}function mo(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function kG(e){const t=e.values?.map((r,i)=>a.jsx("div",{children:a.jsx(Nd,{value:r,maxWidth:e.maxWidth})},"attatchment-"+i));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!Tn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const r=e.path.split(".").pop();n=a.jsx(mo,{term:Gs(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function Ob(e){const t=Ae(),n=v.useRef(null);function r(c){dn(c),n.current?.click()}function i(c){dn(c);const d=c.target.files;d&&Array.from(d).forEach(s)}function s(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Ht(f))}))}return a.jsxs(a.Fragment,{children:[a.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>i(c)}),e.children({onClick:r,disabled:e.disabled})]})}function NG(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function i(s){n(s),e.onChange&&e.onChange(s)}return a.jsxs("table",{style:{width:"100%"},children:[a.jsxs("colgroup",{children:[a.jsx("col",{width:"97%"}),a.jsx("col",{width:"3%"})]}),a.jsxs("tbody",{children:[t.map((s,c)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Nd,{value:s,maxWidth:200})}),a.jsx("td",{children:a.jsx(bn,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:d=>{dn(d);const f=t.slice();f.splice(c,1),i(f)},children:a.jsx(Yh,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(Ob,{disabled:e.disabled,onUpload:s=>{i([...r.current,s])},children:s=>a.jsx(bn,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:a.jsx(Tb,{})})})})]})]})]})}function TA(e){const[t,n]=v.useState(e.defaultValue);function r(i){n(i),e.onChange&&e.onChange(i)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Nd,{value:t,maxWidth:200}),a.jsx(ke,{disabled:e.disabled,onClick:i=>{dn(i),r(void 0)},children:"Remove"})]}):a.jsx(Ob,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:i=>a.jsx(ke,{...i,children:"Upload..."})})}function Co(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180 180",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#9c36b5",d:"M84 56c-3-15-15-24-23-28l5-10c8 2 14 8 20 14 0-12 1-16 5-21 8-9 13-9 41-9 0 7 1 18-3 24-7 9-16 7-41 8 5 8 7 14 8 22 36-24 74-7 74 39 0 42-40 83-80 83s-80-41-80-83c0-46 38-63 74-39Zm-3 43H65c-4 0-7 3-7 7v4c0 4 3 7 7 7h16v16c0 4 3 7 7 7h4c4 0 7-3 7-7v-16h16c4 0 7-3 7-7v-4c0-4-3-7-7-7H99V83c0-4-3-7-7-7h-4c-4 0-7 3-7 7z"})]})}function Xh(e){const[t,n]=v.useState();return a.jsx(dt,{onSubmit:r=>{n(void 0),e.onSubmit(r)?.catch(i=>n(Ge(i)))},children:a.jsxs(Ue,{children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:e.title})]}),t&&a.jsx(ra,{icon:a.jsx(al,{size:16}),title:"Error",color:"red",children:t}),e.qrCodeUrl&&a.jsxs(Ue,{align:"center",children:[a.jsx(De,{children:"Scan this QR code with your authenticator app."}),a.jsx("img",{src:e.qrCodeUrl,alt:"Multi Factor Auth QR Code"})]}),a.jsx(Ue,{children:a.jsx(ze,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(yr,{children:e.buttonText})})]})})}const OG="_root_1vii2_1",MG={root:OG};function Od(e){const{children:t,...n}=e;return a.jsx(xd,{className:MG.root,...n,children:t})}const IG="_paper_1igaj_1",LG="_fill_1igaj_20",XE={paper:IG,fill:LG};function $c(e){const{width:t,fill:n,className:r,children:i,...s}=e,c=t?{maxWidth:t}:void 0;return a.jsx(mr,{className:It(XE.paper,n&&XE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...s,children:i})}function lt(e){const{children:t,...n}=e;return a.jsx(Od,{children:a.jsx($c,{...n,children:t})})}function Pt(e,t){return e?.issue?.filter(n=>RA(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
|
|
540
|
+
`)}function zc(e,t){return e?.issue?.filter(n=>RA(n.expression?.[0],t))}const uh=/\[\d+\]/;function RA(e,t){const n=typeof e=="string"&&uh.test(e),r=typeof t=="string"&&uh.test(t);if(n!==r&&(e=e?.replace(uh,""),t=t?.replace(uh,"")),e===t)return!0;if(!e||!t)return!1;const i=e.indexOf(".");if(i>=0&&e.substring(i+1)===t)return!0;const s=t.indexOf(".");return s>=0&&t.substring(s+1)===e}function _A(e){const t=Ae(),[n,r]=v.useState();return a.jsxs(dt,{onSubmit:async i=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:i.projectName}))}catch(s){r(Ht(s))}},children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Create project"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(ze,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Pt(n,"projectName")}),a.jsxs(De,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(At,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(At,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(yr,{children:"Create project"})})]})}function DA(e,t){const n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.async=!0,r.src=e,r.onload=t??null,n.appendChild(r)}function AA(e){const t=Ae(),{googleClientId:n,handleGoogleCredential:r}=e,i=v.useRef(null),[s,c]=v.useState(typeof google<"u"),[d,f]=v.useState(!1),[p,m]=v.useState(!1);return v.useEffect(()=>{if(typeof google>"u"){DA("https://accounts.google.com/gsi/client",()=>c(!0));return}d||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),i.current&&!p&&(google.accounts.id.renderButton(i.current,{}),m(!0))},[t,n,d,s,i,p,r]),n?a.jsx("div",{ref:i}):null}function PA(e){if(e)return e;if(typeof window<"u"){const t=window.location.protocol+"//"+window.location.host;if([].includes(t))return"__GOOGLE_CLIENT_ID__"}}function xr(e){const t=e.outcome?.issue||e.issues;return!t||t.length===0?null:a.jsx(ra,{icon:a.jsx(al,{size:16}),color:"red",children:t.map(n=>a.jsx("div",{"data-testid":"text-field-error",children:hD(n)},n.details?.text))})}function kA(e){typeof grecaptcha>"u"&&DA("https://www.google.com/recaptcha/api.js?render="+e)}function NA(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function $G(e){const t=PA(e.googleClientId),n=e.recaptchaSiteKey,r=Ae(),[i,s]=v.useState(),c=zc(i,void 0);return v.useEffect(()=>{n&&kA(n)},[n]),a.jsxs(dt,{onSubmit:async d=>{s(void 0);try{let f="";n&&(f=await NA(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:d.firstName,lastName:d.lastName,email:d.email,password:d.password,remember:d.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){s(Ht(f))}},children:[a.jsx(Jn,{style:{flexDirection:"column"},children:e.children}),a.jsx(xr,{issues:c}),t&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(AA,{googleClientId:t,handleGoogleCredential:async d=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:d.clientId,googleCredential:d.credential,projectId:e.projectId,createUser:!0}))}catch(f){s(Ht(f))}}})}),a.jsx(yn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(ze,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Pt(i,"firstName")}),a.jsx(ze,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Pt(i,"lastName")}),a.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Pt(i,"email")}),a.jsx(Oo,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Pt(i,"password")}),a.jsxs(De,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(At,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(At,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(De,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(At,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(At,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(ye,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Dn,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(yr,{children:"Create account"})]})]})}function zG(e){const{type:t,projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:s,onSuccess:c}=e,d=Ae(),[f,p]=v.useState(),[m,g]=v.useState();v.useEffect(()=>{t==="patient"&&f&&d.startNewPatient({login:f,projectId:n}).then(b=>d.processCode(b.code)).then(()=>c()).catch(b=>g(Ht(b)))},[d,t,n,f,c]);function x(b){b.code?d.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return a.jsxs(lt,{width:450,children:[m&&a.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&a.jsx($G,{projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:s,handleAuthResponse:x,children:e.children}),f&&t==="project"&&a.jsx(_A,{login:f,handleAuthResponse:x})]})}function UG(e){const[t,n]=v.useState();return t?a.jsx(VG,{email:t,...e}):a.jsx(BG,{setEmail:n,...e})}function BG(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:i,disableEmailAuth:s,...c}=e,d=Ae(),f=!e.disableGoogleAuth&&PA(e.googleClientId),[p,m]=v.useState(),g=zc(p,void 0),x=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await d.ensureCodeChallenge(c),domain:j.domain}),T=new URL(j.authorizeUrl);return T.searchParams.set("state",C),window.location.assign(T.toString()),!0},[d,c]),b=v.useCallback(async j=>{const C=await d.post("auth/method",{email:j.email});await x(C)||t(j.email)},[d,x,t]),w=v.useCallback(async j=>{try{const C=await d.startGoogleLogin({...c,googleCredential:j.credential});await x(C)||r(C)}catch(C){m(Ht(C))}},[d,c,x,r]);return a.jsxs(dt,{onSubmit:b,children:[a.jsx(Jn,{style:{flexDirection:"column"},children:i}),a.jsx(xr,{issues:g}),f&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(AA,{googleClientId:f,handleGoogleCredential:w})}),!s&&a.jsx(yn,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&a.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Pt(p,"email")}),a.jsxs(ye,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(At,{component:"button",type:"button",c:"dimmed",onClick:n,size:"xs","data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:"Register"})}),!s&&a.jsx(yr,{children:"Next"})]})]})}function VG(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...i}=e,s=Ae(),[c,d]=v.useState(),f=zc(c,void 0),p=v.useCallback(m=>{s.startLogin({...i,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>d(Ht(g)))},[s,i,n]);return a.jsxs(dt,{onSubmit:p,children:[a.jsx(Jn,{style:{flexDirection:"column"},children:r}),a.jsx(xr,{issues:f}),a.jsx(Ue,{gap:"xl",children:a.jsx(Oo,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Pt(c,"password")})}),a.jsxs(ye,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(At,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx(Dn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(yr,{children:"Sign in"})]})]})}function FG(e){const t=Ae(),n=yd(),[r,i]=v.useState(""),[s,c]=v.useState();function d(g){return!!g?.toLowerCase()?.includes(r.toLowerCase())}function f(g){return d(g.profile?.display)||d(g.project?.display)}function p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(x=>c(Ht(x)))}const m=e.memberships.filter(f).slice(0,10).map(g=>a.jsx(st.Option,{value:g.id,children:a.jsx(qG,{...g})},g.id));return a.jsxs(Ue,{children:[a.jsxs(li,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Co,{size:32}),a.jsx(Ie,{order:3,children:"Choose profile"})]}),a.jsx(xr,{outcome:s}),a.jsxs(st,{store:n,onOptionSubmit:p,children:[a.jsx(st.EventsTarget,{children:a.jsx(ze,{placeholder:"Search",value:r,onChange:g=>{i(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(st.Options,{children:m.length>0?m:a.jsx(st.Empty,{children:"Nothing found..."})})})]})]})}function qG(e){return a.jsxs(ye,{children:[a.jsx(Bs,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(De,{fz:"sm",fw:500,children:e.profile?.display}),a.jsx(De,{fz:"xs",opacity:.6,children:e.project?.display})]})]})}const HG=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,GG="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",WG="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",QG="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",YG=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,KG="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",XG="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",ZG="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",JG="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",eW="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",tW="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function nW(e){const t=Ae();return a.jsx(dt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Ue,{children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Choose scope"})]}),a.jsx(Ue,{children:(e.scope??"openid").split(" ").map(n=>{let r;return HG.test(n)?r=[n+GG,n+WG,n+QG]:YG.test(n)&&(r=[n+KG,n+XG,n+ZG,n+JG,n+eW,n+tW]),a.jsxs(a.Fragment,{children:[a.jsx(Dn,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(i=>a.jsx(Dn,{id:i,name:i,label:i},i))]},n+"_group")})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(yr,{children:"Set scope"})})]})})}function OA(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:i,onRegister:s,onCode:c,...d}=e,f=Ae(),[p,m]=v.useState(),g=v.useRef(!1),[x,b]=v.useState(!1),[w,j]=v.useState(),[C,T]=v.useState(!1),[E,R]=v.useState(),_=v.useCallback(k=>{c?c(k):f.processCode(k).then(()=>{r&&r()}).catch(I=>Ne({color:"red",message:Ge(I)}))},[f,c,r]),P=v.useCallback(k=>{b(!!k.mfaEnrollRequired),j(k.enrollQrCode),T(!!k.mfaRequired),k.login&&m(k.login),k.memberships&&R(k.memberships),k.code&&(n?R(void 0):_(k.code))},[n,_]),A=v.useCallback(k=>{_(k.code)},[_]);return v.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(P).catch(k=>Ne({color:"red",message:Ge(k)})))},[f,t,g,p,P]),a.jsx(lt,{width:450,px:"sm",py:"md",children:p?x&&w?a.jsx(Xh,{title:"Enroll in MFA",buttonText:"Enroll",qrCodeUrl:w,onSubmit:async k=>{const I=await f.post("auth/mfa/login-enroll",{login:p,token:k.token});P(I)}}):C?a.jsx(Xh,{title:"Enter MFA code",buttonText:"Submit code",onSubmit:async k=>{const I=await f.post("auth/mfa/verify",{login:p,token:k.token});P(I)}}):E?a.jsx(FG,{login:p,memberships:E,handleAuthResponse:P}):e.projectId==="new"?a.jsx(_A,{login:p,handleAuthResponse:P}):e.chooseScopes?a.jsx(nW,{login:p,scope:e.scope,handleAuthResponse:A}):a.jsx("div",{children:"Success"}):a.jsx(UG,{onForgotPassword:i,onRegister:s,handleAuthResponse:P,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...d,children:e.children})})}function ii(e){return a.jsx(a.Fragment,{children:Qa(e.value)})}function rW(e){return a.jsx(a.Fragment,{children:Ad(e.value)})}function MA(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function oW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(MA,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function ym(e,t,n){const r=Sc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function iW(e,t,n){const r=xD(e,t,n);return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function aW(e){const{elementDefinitionType:t}=e,n=Ae(),r=v.useContext(ln),[i,s]=v.useState(vD("Extension")),c=v.useMemo(()=>{if(Tn(t?.profile))return t.profile[0]},[t]),[d,f]=v.useState(c!==void 0);if(v.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=Ic(c);f(!1),g&&s(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(d||!ob(c)))return a.jsx("div",{children:"Loading..."});if(i.elements["value[x]"]?.max!==0){const[g,x]=ym({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx($o,{propertyType:x,value:g})}return a.jsx(Jh,{path:e.path,value:{type:i.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function sW(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function lW(e){return a.jsx(a.Fragment,{children:EU(e.value)})}function sd(e){return a.jsx(a.Fragment,{children:Ms(e.value)})}function Mb(e){return a.jsx(a.Fragment,{children:id(e.value)})}function cW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(sd,{value:t.numerator})," / ",a.jsx(sd,{value:t.denominator})]}):null}function Zh(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Lo(e.value);return e.link!==!1&&e.value.reference?a.jsx(vt,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function IA(e,t,n,r){if(!Tn(n?.slices))return[e];const i=new Array(t.length+1);for(let s=0;s<i.length;s++)i[s]=[];for(const s of e){const c=eA(s,t,n.discriminator,r);let d=c?t.findIndex(f=>f.name===c):-1;d===-1&&(d=t.length),i[d].push(s)}return i}async function LA({medplum:e,property:t}){return new Promise((n,r)=>{if(!t.slicing){n([]);return}const i=[],s=[],c=[];for(const d of t.slicing.slices){if(!JD(d)){console.debug("Unsupported slice definition",d);continue}let f;Tn(d.elements)||(f=d.type[0]?.profile?.[0]),i.push(d),s.push(f),f&&c.push(e.requestProfileSchema(f))}Promise.all(c).then(()=>{for(let d=0;d<i.length;d++){const f=i[d],p=s[d];if(p){const m=Ic(p);f.typeSchema=m}}n(i)}).catch(r)})}function xm(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function uW(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,i=v.useContext(ln),s=v.useMemo(()=>{if(Tn(r))return wc({parentContext:i,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[i,e.path,t.typeSchema?.url,r]);return xm(ln.Provider,s,a.jsx(a.Fragment,{children:e.value.map((c,d)=>a.jsx("div",{children:a.jsx($o,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${d}-${e.value.length}`))}))}const ZE=50;function dW(e){const{property:t,propertyType:n}=e,r=Ae(),i=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[s,c]=v.useState(!0),[d,f]=v.useState([]),[p,m]=v.useState(()=>[i]),[g,x]=v.useState(0),b=v.useContext(ln);if(v.useEffect(()=>{LA({medplum:r,property:t}).then(C=>{x(i.length),f(C);const T=i.slice(0,ZE),E=IA(T,C,t.slicing,b.profileUrl);m(E),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,b.profileUrl,m,i]),s)return a.jsx("div",{children:"Loading..."});let w;if(t.type[0]?.code!=="Extension"){const C=p[d.length],T=C.map((E,R)=>a.jsx("div",{children:a.jsx($o,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:E,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${R}-${C.length}`));if(e.includeDescriptionListEntry){if(!Tn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const E=e.path.split(".").pop();w=a.jsx(mo,{term:Gs(E),children:T})}else w=a.jsx(a.Fragment,{children:T})}return a.jsxs(a.Fragment,{children:[d.map((C,T)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let E=a.jsx(uW,{path:e.path,slice:C,property:t,value:p[T],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(E=a.jsx(mo,{term:Gs(C.name),children:E},C.name)),E}),w,g>ZE&&a.jsx(ye,{justify:"right",children:a.jsxs(De,{children:["... ",g," total values"]})})]})}function $o(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(li,{gap:3,align:"center",children:[r,!xn(r)&&a.jsx(j0,{value:r,timeout:2e3,children:({copied:s,copy:c})=>a.jsx(Qi,{label:s?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(bn,{variant:"subtle",color:s?"teal":"gray",onClick:c,children:s?a.jsx(gi,{size:"1rem"}):a.jsx(Rb,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?a.jsx(kG,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(dW,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case re.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case re.SystemString:case re.string:return e.property?.path?.toLowerCase().includes("secret")?a.jsx(fW,{value:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case re.code:case re.date:case re.decimal:case re.id:case re.integer:case re.positiveInt:case re.unsignedInt:case re.uri:case re.url:return a.jsx(a.Fragment,{children:r});case re.canonical:return a.jsx(Zh,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return a.jsx(a.Fragment,{children:sr(r)});case re.markdown:return a.jsx("pre",{children:r});case re.Address:return a.jsx(jF,{value:r});case re.Annotation:return a.jsx(a.Fragment,{children:r?.text});case re.Attachment:return a.jsx(Nd,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return a.jsx(ii,{value:r});case re.Coding:return a.jsx(rW,{value:r});case re.ContactDetail:return a.jsx(oW,{value:r});case re.ContactPoint:return a.jsx(MA,{value:r});case re.HumanName:return a.jsx(Ab,{value:r});case re.Identifier:return a.jsx(sW,{value:r});case re.Money:return a.jsx(lW,{value:r});case re.Period:return a.jsx(a.Fragment,{children:bU(r)});case re.Quantity:case re.Duration:return a.jsx(sd,{value:r});case re.Range:return a.jsx(Mb,{value:r});case re.Ratio:return a.jsx(cW,{value:r});case re.Reference:return a.jsx(Zh,{value:r,link:e.link});case re.Timing:return a.jsx(a.Fragment,{children:ID(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Jh,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case re.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(aW,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Jh,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function fW(e){const[t,n]=v.useState(!1),r=e.value??"",i=!xn(r),s="•".repeat(8);return a.jsxs(li,{gap:3,align:"center",children:[t?a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},"aria-hidden":"true",children:i?s:""}),i&&a.jsxs(a.Fragment,{children:[a.jsx(j0,{value:e.value,timeout:2e3,children:({copied:c,copy:d})=>a.jsx(Qi,{label:c?"Copied":"Copy secret",withArrow:!0,position:"right",children:a.jsx(bn,{variant:"subtle",color:c?"teal":"gray",onClick:d,"aria-label":c?"Copied":"Copy secret",children:c?a.jsx(gi,{size:"1rem"}):a.jsx(Rb,{size:"1rem"})})})}),a.jsx(Qi,{label:t?"Hide secret":"Show secret",withArrow:!0,position:"right",children:a.jsx(bn,{variant:"subtle",color:"gray",onClick:()=>n(!t),"aria-label":t?"Hide secret":"Show secret",children:t?a.jsx(Sq,{size:"1rem"}):a.jsx(jq,{size:"1rem"})})})]})]})}const $A=["extension","modifierExtension"],hW=hA.filter(e=>!$A.includes(e));function Jh(e){const t=e.value,{value:n,type:r}=t,i=v.useContext(ln),s=e.profileUrl??i?.profileUrl,c=v.useMemo(()=>om(r,s),[s,r]),d=v.useMemo(()=>{if(c)return wc({parentContext:i,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,i,e.path,e.accessPolicyResource]);if(xn(n))return null;if(!c)return a.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return a.jsx("div",{children:n.name});const f=d??i;return xm(ln.Provider,d,a.jsx(vm,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{if($A.includes(p)&&xn(m.slicing?.slices))return null;if(hW.includes(p))return null;if(pA.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,x]=ym(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&xn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,w=a.jsx($o,{property:m,propertyType:x,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?w:a.jsx(mo,{term:Gs(p),children:w},p)})}))}const pW="_dimmed_11me5_1",mW="_preserveBreaks_11me5_5",rx={dimmed:pW,preserveBreaks:mW},zA="Read Only";function UA(e,t){return e?a.jsx(Qi.Floating,{label:e,children:t}):t}function BA(e){const{debugMode:t}=v.useContext(ln);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,UA(e?.readonly?zA:void 0,a.jsxs(ye,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e?.readonly?rx.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Nt(e){const{debugMode:t}=v.useContext(ln);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,UA(e?.readonly?zA:void 0,a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:It({[rx.dimmed]:e?.readonly},rx.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Pt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function gW(e,t,n,r,i){const s=r.type;if(s.length>1)for(const c of s){const d=t.replace("[x]",In(c.code));d in e&&delete e[d]}return xn(i)?e[n]=void 0:e[n]=i,e}function vW(e){return!!e&&!xn(e.url)&&!xn(e.name)}function yW(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:i,path:s,valuePath:c,...d}=e,[f,p]=v.useState(t);function m(g){const x=bW(g);p(x),n&&n(x)}return a.jsx(gm,{defaultValue:f&&xW(f),onChange:m,withHelpText:r??!0,...d})}function xW(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function bW(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function SW(e){const{defaultValue:t,onChange:n,withHelpText:r,response:i,...s}=e,[c,d]=v.useState(i?.answer?.[0]?.valueCoding??t);function f(p){const m=p[0],g=m&&jW(m);d(g),n&&n(g)}return a.jsx(gm,{defaultValue:c?wW(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...s})}function wW(e){return{system:e.system,code:e.code,display:e.display}}function jW(e){return{system:e.system,code:e.code,display:e.display}}function VA(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:i}=v.useContext(ln),[s,c]=v.useState(e.defaultValue),d=v.useRef(s);d.current=s;const[f,p,m]=v.useMemo(()=>["system","use","value"].map(R=>r[t+"."+R]),[r,t]),[g,x,b]=v.useMemo(()=>["system","use","value"].map(R=>i(t+"."+R)),[i,t]);function w(R){R&&Object.keys(R).length===0&&(R=void 0),c(R),e.onChange&&e.onChange(R)}function j(R){const _={...d.current,system:R};R||delete _.system,w(_)}function C(R){const _={...d.current,use:R};R||delete _.use,w(_)}function T(R){const _={...d.current,value:R};R||delete _.value,w(_)}const E=e.valuePath??t;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(sn,{disabled:e.disabled||g?.readonly,"data-testid":"system",defaultValue:s?.system,required:(f?.min??0)>0,onChange:R=>j(R.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Pt(n,E+".system")}),a.jsx(sn,{disabled:e.disabled||x?.readonly,"data-testid":"use",defaultValue:s?.use,required:(p?.min??0)>0,onChange:R=>C(R.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Pt(n,E+".use")}),a.jsx(ze,{disabled:e.disabled||b?.readonly,placeholder:"Value",defaultValue:s?.value,required:(m?.min??0)>0,onChange:R=>T(R.currentTarget.value),error:Pt(n,E+".value")})]})}function CW(e){const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:i}=v.useContext(ln),[s,c]=v.useMemo(()=>["name","telecom"].map(m=>i(e.path+"."+m)),[i,e.path]);function d(m){n(m),e.onChange&&e.onChange(m)}function f(m){const g={...r.current,name:m};m||delete g.name,d(g)}function p(m){const g={...r.current,telecom:m&&[m]};m||delete g.telecom,d(g)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ze,{disabled:e.disabled||s?.readonly,"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t?.name,onChange:m=>f(m.currentTarget.value)}),a.jsx(VA,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:p,outcome:e.outcome})]})}function EW(e){if(!e)return"";const t=new Date(e);return am(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function Ib(e){if(!e)return"";const t=new Date(e);return am(t)?t.toISOString():""}function ai(e){return a.jsx(ze,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:TW(),step:1,defaultValue:EW(e.defaultValue),autoFocus:e.autoFocus,error:Pt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(Ib(n))}}})}function TW(){return"datetime-local"}function RW(e){const{propertyType:t}=e,n=Ae(),r=v.useMemo(()=>{if(Tn(t.profile))return t.profile[0]},[t]),[i,s]=v.useState(r!==void 0);return v.useEffect(()=>{r&&(s(!0),n.requestProfileSchema(r).then(()=>s(!1)).catch(c=>{s(!1),console.warn(c)}))},[n,r]),r&&(i||!ob(r))?a.jsx("div",{children:"Loading..."}):a.jsx(Ub,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function _W(e){const{outcome:t,path:n}=e,[r,i]=v.useState(e.defaultValue),{getExtendedProps:s}=v.useContext(ln),[c,d,f,p,m]=v.useMemo(()=>["use","prefix","given","family","suffix"].map(E=>s(e.path+"."+E)),[s,e.path]);function g(E){i(E),e.onChange&&e.onChange(E)}function x(E){g({...r,use:E||void 0})}function b(E){g({...r,prefix:E?E.split(" "):void 0})}function w(E){g({...r,given:E?E.split(" "):void 0})}function j(E){g({...r,family:E||void 0})}function C(E){g({...r,suffix:E?E.split(" "):void 0})}const T=e.valuePath??n;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(sn,{disabled:e.disabled||c?.readonly,defaultValue:r?.use,name:e.name+"-use","data-testid":"use",onChange:E=>x(E.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Pt(t,T+".use")}),a.jsx(ze,{disabled:e.disabled||d?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:E=>b(E.currentTarget.value),error:Pt(t,T+".prefix")}),a.jsx(ze,{disabled:e.disabled||f?.readonly,placeholder:"Given",name:e.name+"-given",defaultValue:r?.given?.join(" "),onChange:E=>w(E.currentTarget.value),error:Pt(t,T+".given")}),a.jsx(ze,{disabled:e.disabled||p?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:E=>j(E.currentTarget.value),error:Pt(t,T+".family")}),a.jsx(ze,{disabled:e.disabled||m?.readonly,placeholder:"Suffix",name:e.name+"-suffix",defaultValue:r?.suffix?.join(" "),onChange:E=>C(E.currentTarget.value),error:Pt(t,T+".suffix")})]})}function DW(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:i}=v.useContext(ln),[s,c]=v.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[d,f]=v.useMemo(()=>["system","value"].map(g=>i(e.path+"."+g)),[i,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(ze,{disabled:e.disabled||d?.readonly,placeholder:"System",required:(s?.min??0)>0,defaultValue:t?.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:Pt(e.outcome,m+".system")}),a.jsx(ze,{disabled:e.disabled||f?.readonly,placeholder:"Value",required:(c?.min??0)>0,defaultValue:t?.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:Pt(e.outcome,m+".value")})]})}const AW=["USD","EUR","CAD","GBP","AUD"];function PW(e){const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:i}=v.useContext(ln),[s,c]=v.useMemo(()=>["currency","value"].map(g=>i(e.path+"."+g)),[i,e.path]),d=v.useCallback(g=>{r(g),t&&t(g)},[t]),f=v.useCallback(g=>{d({...n,currency:g.currentTarget.value})},[n,d]),p=v.useCallback(g=>{d({...n,value:g.currentTarget.valueAsNumber})},[n,d]),m=a.jsx(sn,{disabled:e.disabled||s?.readonly,defaultValue:n?.currency,data:AW,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return a.jsx(ze,{disabled:e.disabled||c?.readonly,type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:n?.value?.toString()??"USD",leftSection:a.jsx(fq,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function kW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[i,s]=v.useMemo(()=>["start","end"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ai,{disabled:e.disabled||i?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:d=>c({...t,start:d})}),a.jsx(ai,{disabled:e.disabled||s?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:d=>c({...t,end:d})})]})}function Ys(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[i,s,c]=v.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function d(f){n(f),e.onChange&&e.onChange(f)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(sn,{disabled:e.disabled||i?.readonly,style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t?.comparator,data:["","<","<=",">=",">"],onChange:f=>d({...t,comparator:f.currentTarget.value})}),a.jsx(ze,{disabled:e.disabled||s?.readonly,id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t?.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{d({...t,value:NW(f.currentTarget.value)})}}),a.jsx(ze,{disabled:e.disabled||c?.readonly,placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t?.unit,onChange:f=>d({...t,unit:f.currentTarget.value})})]})}function NW(e){if(e)return parseFloat(e)}function Lb(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[i,s]=v.useMemo(()=>["low","high"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ys,{path:e.path+".low",disabled:e.disabled||i?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:d=>c({...t,low:d})}),a.jsx(Ys,{path:e.path+".high",disabled:e.disabled||s?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:d=>c({...t,high:d})})]})}function OW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[i,s]=v.useMemo(()=>["numerator","denominator"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ys,{path:e.path+".numerator",disabled:e.disabled||i?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:d=>c({...t,numerator:d})}),a.jsx(Ys,{path:e.path+".denominator",disabled:e.disabled||s?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:d=>c({...t,denominator:d})})]})}const MW={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},IW=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","CareTeam","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","Group","HealthcareService","ImplementationGuide","InsurancePlan","Library","Location","Measure","MedicinalProduct","MessageDefinition","NamingSystem","OperationDefinition","Organization","Patient","Person","PlanDefinition","Practitioner","Project","Questionnaire","RelatedPerson","ResearchDefinition","ResearchElementDefinition","ResearchStudy","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function LW(e){return{value:Dt(e)??"",label:Ki(e),resource:e}}function sl(e){const t=Ae(),{resourceType:n,searchCriteria:r}=e,[i,s]=v.useState(),c=Gt(e.defaultValue,s),d=e.itemComponent??$W,f=e.onChange,p=v.useCallback(async(g,x)=>{const b=zW(n),w=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,w,{signal:x})},[t,n,r]),m=v.useCallback(g=>{f&&f(g[0])},[f]);return Tn(e.defaultValue)&&!i&&!c?null:a.jsx(Pb,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:d,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:LW,loadOptions:p,onChange:m,clearable:!0})}const $W=v.forwardRef(({label:e,resource:t,active:n,...r},i)=>a.jsx("div",{ref:i,...r,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(ns,{value:t}),a.jsxs("div",{children:[a.jsx(De,{children:e}),a.jsx(De,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function zW(e){return MW[e]??(IW.includes(e)?"name":"_id")}function Ga(e){const{onChange:t}=e,n=Ae(),[r,i]=v.useState(e.defaultValue),[s,c]=v.useState(()=>UW(e.targetTypes)),[d,f]=v.useState(()=>BW(e.defaultValue,s)),p=v.useRef(new cD),m=v.useMemo(()=>d?.type==="profile"?{...e.searchCriteria,_profile:d.value}:e.searchCriteria,[e.searchCriteria,d]);v.useEffect(()=>{let b=!1;const w=s?.map(j=>{if(!FW(j))return Promise.resolve(j);b=!0;const C=j.value,T=p.current.get(C);if(T)return T;const E=VW(n,j.value).then(_=>{const P={...j};return _?Tn(_.type)?(P.resourceType=_.type,P.name=_.name,P.title=_.title):(console.error(`StructureDefinition.type missing for ${j.value}`),P.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),P.error="StructureDefinition not found"),P}).catch(_=>(console.error(_),{...j,error:_})),R=new Ao(E);return p.current.set(C,R),R});!w||!b||Promise.all(w).then(j=>{if(c(j),!d)return;const C=j.findIndex(T=>T.value===d.value||T.resourceType===d.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${d.resourceType}`);return}f(j[C])}).catch(console.error)},[n,d,s]);const g=v.useCallback(b=>{const w=b?qt(b):void 0;i(w),t&&t(w)},[t]),x=v.useMemo(()=>s?s.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[s]);return a.jsxs(a.Fragment,{children:[e.name&&a.jsx("input",{type:"hidden",name:e.name,value:r?.reference??""}),a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[s&&s.length>1&&a.jsx(sn,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:d?.resourceType,autoFocus:e.autoFocus,onChange:b=>{const w=b.currentTarget.value,j=s.find(C=>C.value===w);f(j)},data:x}),!s&&a.jsx(Nb,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:d?.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(sl,{resourceType:d?.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function UW(e){if(!e||e.length===0||e.length===1&&e[0]==="Resource")return;const t=[];for(const n of e)n.includes("/")?t.push({type:"profile",value:n}):t.push({type:"resourceType",value:n,resourceType:n});return t}function BW(e,t){const n=e?.reference?.split("/")[0];if(n){const r=t?.find(i=>i.resourceType===n);return r||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function VW(e,t){const n=Ic(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
541
|
+
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
542
|
+
type,
|
|
543
|
+
name,
|
|
544
|
+
title,
|
|
545
|
+
}
|
|
546
|
+
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function FW(e){return e.type==="profile"&&!e?.error&&xn(e.resourceType)}function qW(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const HW="_indented_ldk1d_1",FA={indented:HW};function $b({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(ke,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(Kh,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(bn,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(Kh,{size:"1.25rem"})})}function qA({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(bn,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(Yh,{size:"1.25rem"})})}function GW(e){const{slice:t,property:n}=e,[r,i]=v.useState(e.defaultValue),s=t.typeSchema?.elements??t.elements,c=v.useContext(ln),d=v.useMemo(()=>{if(Tn(s))return wc({parentContext:c,elements:s,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,s]);function f(b){i(b),e.onChange&&e.onChange(b)}const p=t.min>0,m=xn(t.elements),g=zD(t.name),x=e.property.readonly&&r.length===0;return xm(ln.Provider,d,a.jsx(Nt,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:x?a.jsx(De,{c:"dimmed",children:"(empty)"}):a.jsxs(Ue,{className:m?FA.indented:void 0,children:[r.map((b,w)=>a.jsxs(ye,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${w}`,children:a.jsx(zb,{elementDefinitionType:t.type[0],name:t.name,defaultValue:b,onChange:j=>{const C=[...r];C[w]=j,f(C)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&a.jsx(qA,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${w}`,onClick:j=>{dn(j);const C=[...r];C.splice(w,1),f(C)}})]},`${w}-${r.length}`)),!e.property.readonly&&r.length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx($b,{propertyDisplayName:g,onClick:b=>{dn(b);const w=[...r,void 0];f(w)},testId:e.testId&&`${e.testId}-add`})})]})}))}function WW(e){const{property:t}=e,n=Ae(),[r,i]=v.useState(!0),[s,c]=v.useState([]),[d]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=v.useState(()=>[d]),m=v.useContext(ln),g=t.type[0]?.code;v.useEffect(()=>{LA({medplum:n,property:t}).then(E=>{c(E);const R=IA(d,E,t.slicing,m.profileUrl);QW(R,E),p(R),i(!1)}).catch(E=>{console.error(E),i(!1)})},[n,t,d,m.profileUrl,p]);function x(E,R){const _=[...f];if(_[R]=E,p(_),e.onChange){const P=_.flat().filter(A=>A!==void 0);e.onChange(P)}}if(r)return a.jsx("div",{children:"Loading..."});const b=s.length,w=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&s.length>0)),C=Gs(t.path),T=e.property.readonly&&s.length===0&&d.length===0;return a.jsxs(Ue,{className:e.indent?FA.indented:void 0,children:[T&&a.jsx(De,{c:"dimmed",children:"(empty)"}),s.map((E,R)=>a.jsx(GW,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[R],onChange:_=>{x(_,R)},testId:`slice-${E.name}`},E.name)),j&&w.map((E,R)=>a.jsxs(ye,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(Md,{arrayElement:!0,property:e.property,name:e.name+"."+R,path:e.path,valuePath:qW(e.path,e.valuePath,R),defaultValue:E,onChange:_=>{const P=[...w];P[R]=_,x(P,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(qA,{propertyDisplayName:C,testId:`nonsliced-remove-${R}`,onClick:_=>{dn(_);const P=[...w];P.splice(R,1),x(P,b)}})]},`${R}-${w.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx($b,{propertyDisplayName:C,onClick:E=>{dn(E);const R=[...w];R.push(void 0),x(R,b)},testId:"nonsliced-add"})})]})}function QW(e,t){for(let n=0;n<t.length;n++){const r=t[n],i=e[n];for(;i.length<r.min;)i.push(void 0)}}function YW(e){const[t,n]=v.useState(!1),r=xR(),i=v.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),a.jsxs(li,{gap:"xs",children:[a.jsx(rl,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:i,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(bn,{title:"Copy secret",onClick:()=>{r.copy(i.current?.value),Ne({color:"green",message:"Copied"})},children:a.jsx(Rb,{})})]})}const KW=["sun","mon","tue","wed","thu","fri","sat"];function XW(e){const[t,n]=v.useState(e.defaultValue),[r,i]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),s=v.useRef(t);return s.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:ID(s.current)||"No repeat"}),a.jsx(ke,{disabled:e.disabled,onClick:()=>i(!0),children:"Edit"})]}),!e.disabled&&a.jsx(ZW,{path:e.path,visible:r,defaultValue:s.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),i(!1)},onCancel:()=>i(!1)})]})}const JE={repeat:{period:1,periodUnit:"d"}};function ZW(e){const[t,n]=v.useState(e.defaultValue||JE),{getExtendedProps:r}=v.useContext(ln),[i,s,c,d,f]=v.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),p=v.useRef(t);p.current=t;function m(j){n({...p.current,event:[j]})}function g(j){n({...p.current,repeat:j})}function x(j){g({...p.current?.repeat,period:j})}function b(j){g({...p.current?.repeat,periodUnit:j})}function w(j){g({...p.current?.repeat,dayOfWeek:j})}return a.jsx(Vn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(ai,{disabled:i?.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),a.jsx(Ed,{disabled:s?.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?JE.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(Nt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ze,{disabled:c?.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>x(parseInt(j.currentTarget.value,10)||1)}),a.jsx(sn,{disabled:d?.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&a.jsx(Nt,{title:"Repeat on",children:a.jsx(Ju.Group,{multiple:!0,onChange:w,children:a.jsx(ye,{justify:"space-between",mt:"md",gap:"xs",children:KW.map(j=>a.jsx(Ju,{value:j,size:"xs",radius:"xl",disabled:f?.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Md(e){const{property:t,name:n,onChange:r,defaultValue:i}=e,s=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(s===re.Attachment)return a.jsx(NG,{name:n,defaultValue:i,onChange:r,disabled:t.readonly});const d=c[0]?.code!==re.Extension;return a.jsx(WW,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:i,indent:d,onChange:r,outcome:e.outcome})}else return c.length>1?a.jsx(JW,{elementDefinitionTypes:c,...e}):a.jsx(zb,{name:n,defaultValue:i,onChange:d=>{if(e.onChange){const f=e.name.replace("[x]",In(c[0].code));e.onChange(d,f)}},outcome:e.outcome,elementDefinitionType:c[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function JW(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(s=>s.code===e.defaultPropertyType)),n||(n=t[0]);const[r,i]=v.useState(n);return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(sn,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:s=>{i(t.find(c=>c.code===s.currentTarget.value))},data:t.map(s=>({value:s.code,label:s.code}))}),a.jsx(zb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:s=>{e.onChange&&e.onChange(s,e.name.replace("[x]",In(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath,readOnly:e.property.readonly})]})}function zb(e){const{name:t,onChange:n,outcome:r,binding:i,path:s,valuePath:c,readOnly:d}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=v.useContext(ln),g=v.useMemo(()=>{if(!lb(p)||!xn(e.defaultValue))return e.defaultValue;const w=Object.create(null);if(m.path===e.path)IE(w,m.elements);else{const j=Os(m.path,e.path);if(j===void 0)return e.defaultValue;IE(w,m.elements,j)}return Tn(w)?w:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return a.jsx("div",{children:"Property type not specified "});function x(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:s,valuePath:c,disabled:d}}function b(){const w=Pt(e.outcome,c??s);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:w,disabled:d}}switch(p){case re.SystemString:case re.canonical:case re.string:case re.time:case re.uri:case re.url:return e.path==="Project.secret.value[x]"?a.jsx(YW,{...b(),onChange:w=>{e.onChange&&e.onChange(w.currentTarget.value)}}):a.jsx(ze,{...b(),onChange:w=>{n&&n(w.currentTarget.value)}});case re.date:return a.jsx(ze,{...b(),type:"date",onChange:w=>{n&&n(w.currentTarget.value)}});case re.dateTime:case re.instant:return a.jsx(ai,{...b(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return a.jsx(ze,{...b(),type:"number",step:p===re.decimal?"any":"1",onChange:w=>{if(n){const j=w.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case re.code:return a.jsx(EA,{...b(),error:void 0,onChange:n,binding:i?.valueSet,creatable:!0,maxValues:1});case re.boolean:return a.jsx(Dn,{...b(),defaultChecked:!!g,onChange:w=>{n&&n(w.currentTarget.checked)}});case re.base64Binary:case re.markdown:return a.jsx(rl,{...b(),spellCheck:p!==re.base64Binary,onChange:w=>{n&&n(w.currentTarget.value)}});case re.Address:return a.jsx(TF,{...x()});case re.Annotation:return a.jsx(RF,{...x()});case re.Attachment:return a.jsx(TA,{...x()});case re.CodeableConcept:return a.jsx(yW,{binding:i?.valueSet,...x()});case re.Coding:return a.jsx(SW,{binding:i?.valueSet,...x()});case re.ContactDetail:return a.jsx(CW,{...x()});case re.ContactPoint:return a.jsx(VA,{...x()});case re.Extension:return a.jsx(RW,{...x(),propertyType:e.elementDefinitionType});case re.HumanName:return a.jsx(_W,{...x()});case re.Identifier:return a.jsx(DW,{...x()});case re.Money:return a.jsx(PW,{...x()});case re.Period:return a.jsx(kW,{...x()});case re.Duration:case re.Quantity:return a.jsx(Ys,{...x()});case re.Range:return a.jsx(Lb,{...x()});case re.Ratio:return a.jsx(OW,{...x()});case re.Reference:return a.jsx(Ga,{...x(),targetTypes:tQ(e.elementDefinitionType)});case re.Timing:return a.jsx(XW,{...x()});case re.Dosage:case re.UsageContext:default:return a.jsx(Ub,{...x(),typeName:p})}}const eQ=[`${Uo}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function tQ(e){return e?.targetProfile?.map(t=>{const n=eQ.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function nQ(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(ln),i=v.useMemo(()=>EF(r.elements),[r.elements]);function s(d){n(d),e.onChange&&e.onChange(d)}const c={type:e.type,value:t};return a.jsx(Ue,{style:{flexGrow:1},"data-testid":e.testId,children:i.map(([d,f])=>{const[p,m]=iW(c,d,f),g=f.min!==void 0&&f.min>0,x=e.valuePath?e.valuePath+"."+d:void 0,b=a.jsx(Md,{property:f,name:d,path:e.path+"."+d,valuePath:x,defaultValue:p,defaultPropertyType:m,onChange:(w,j)=>{s(gW({...t},d,j??d,f,w))},outcome:e.outcome},d);return e.type==="Extension"||Cb.includes(d)?b:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(BA,{title:Gs(d),description:f.description,htmlFor:d,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},d):a.jsx(Nt,{title:Gs(d),description:f.description,withAsterisk:g,htmlFor:d,outcome:e.outcome,fhirPath:f.path,errorExpression:x,readonly:f.readonly,children:b},d)})})}function Ub(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(ln),r=e.profileUrl??n?.profileUrl,i=v.useMemo(()=>om(e.typeName,r),[e.typeName,r]),s=i?.type??e.typeName,c=v.useMemo(()=>{if(i)return wc({parentContext:n,elements:i.elements,path:e.path,profileUrl:i.url,accessPolicyResource:e.accessPolicyResource})},[i,n,e.path,e.accessPolicyResource]);return i?xm(ln.Provider,c,a.jsx(nQ,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):a.jsxs("div",{children:[s," not implemented"]})}const rQ="_noteCite_10swh_5",oQ="_noteRoot_10swh_10",eT={noteCite:rQ,noteRoot:oQ};function HA({value:e}){return e?a.jsx(Ue,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(b0,{classNames:{cite:eT.noteCite,root:eT.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function ll(e){const{value:t,link:n,...r}=e,[i,s]=v.useState(),c=Gt(t,s);let d;if(i&&!dD(i))d=`[${Ge(i)}]`;else if(c)d=Ki(c);else return null;return n?a.jsx(vt,{to:t,...r,children:d}):a.jsx(De,{component:"span",...r,children:d})}function dc(e){return a.jsxs(ye,{gap:"xs",children:[a.jsx(ns,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(ll,{value:e.value,link:e.link})]})}const iQ={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red","not-done":"red",connected:"green",disconnected:"red",finished:"green",planned:"gray"};function bm(e){const{status:t,...n}=e;return a.jsx(Op,{color:e.color||iQ[t],...n,children:t.replace(/-/g," ")})}const aQ="_table_pe9td_1",sQ="_criticalRow_pe9td_12",GA={table:aQ,criticalRow:sQ};Bb.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function Bb(e){const t=Ae(),n=Gt(e.value),[r,i]=v.useState();if(v.useEffect(()=>{n?.specimen&&Promise.allSettled(n.specimen.map(c=>t.readReference(c))).then(c=>c.filter(d=>d.status==="fulfilled").map(d=>d.value)).then(i).catch(console.error)},[t,n]),!n)return null;const s=r?.flatMap(c=>c.note||[])||[];if(n.presentedForm&&n.presentedForm.length>0){const c=n.presentedForm[0];c.contentType?.startsWith("text/plain")&&c.data&&s.push({text:window.atob(c.data)})}return a.jsxs(Ue,{children:[a.jsx(Ie,{children:"Diagnostic Report"}),a.jsx(lQ,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&cQ(r),n.result&&a.jsx(uQ,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&a.jsx(HA,{value:s})]})}function lQ({value:e,hideSubject:t=!1}){return a.jsxs(ye,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(dc,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(dc,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(dc,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(De,{children:sr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(bm,{status:e.status})]})]})}function cQ(e){return a.jsxs(Ue,{gap:"xs",children:[a.jsx(Ie,{order:2,size:"h6",children:"Specimens"}),a.jsx(pr,{type:"ordered",children:e?.map(t=>a.jsx(pr.Item,{ml:"sm",children:a.jsxs(ye,{gap:20,children:[a.jsxs(ye,{gap:5,children:[a.jsx(De,{fw:500,children:"Collected:"})," ",sr(t.collection?.collectedDateTime)]}),a.jsxs(ye,{gap:5,children:[a.jsx(De,{fw:500,children:"Received:"})," ",sr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function uQ(e){return a.jsxs("table",{className:GA.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Test"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Reference Range"}),a.jsx("th",{children:"Interpretation"}),a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Performer"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:a.jsx(WA,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function WA(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(dQ,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${sa(t)?t.reference:t.id}`))})}function dQ(e){const t=Gt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=pQ(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:It({[GA.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(vt,{to:t,children:a.jsx(ii,{value:t.code})})}),a.jsx("td",{children:a.jsx(fQ,{value:t})}),a.jsx("td",{children:a.jsx(hQ,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(ii,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(i=>a.jsx("div",{children:a.jsx(ii,{value:i})},`category-${Qa(i)}`))})}),a.jsx("td",{children:t.performer?.map(i=>a.jsx(Zh,{value:i},i.reference))}),a.jsx("td",{children:t.status&&a.jsx(bm,{status:t.status})})]}),t.hasMember&&a.jsx(WA,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,children:a.jsx(HA,{value:t.note})})})]})}function fQ(e){const t=e.value;return a.jsx(a.Fragment,{children:LD(t)})}function hQ(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?a.jsx(a.Fragment,{children:t.text}):a.jsx(Mb,{value:t}):null}function pQ(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var uy={},Bi={},tT;function QA(){if(tT)return Bi;tT=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.Pointer=Bi.escapeToken=Bi.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}Bi.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}Bi.escapeToken=t;var n=(function(){function r(i){i===void 0&&(i=[""]),this.tokens=i}return r.fromJSON=function(i){var s=i.split("/").map(e);if(s[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(i));return new r(s)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(i){for(var s=null,c="",d=i,f=1,p=this.tokens.length;f<p;f++)s=d,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(d=(s||{})[c]);return{parent:s,key:c,value:d}},r.prototype.get=function(i){return this.evaluate(i).value},r.prototype.set=function(i,s){var c=this.evaluate(i);c.parent&&(c.parent[c.key]=s)},r.prototype.push=function(i){this.tokens.push(i)},r.prototype.add=function(i){var s=this.tokens.concat(String(i));return new r(s)},r})();return Bi.Pointer=n,Bi}var hn={},dy={},nT;function YA(){return nT||(nT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(i){return i===void 0?"undefined":i===null?"null":Array.isArray(i)?"array":typeof i}e.objectType=t;function n(i){return i!=null&&typeof i=="object"}function r(i){if(!n(i))return i;if(i.constructor==Array){for(var s=i.length,c=new Array(s),d=0;d<s;d++)c[d]=r(i[d]);return c}if(i.constructor==Date){var f=new Date(+i);return f}var p={};for(var m in i)e.hasOwnProperty.call(i,m)&&(p[m]=r(i[m]));return p}e.clone=r})(dy)),dy}var fr={},rT;function KA(){if(rT)return fr;rT=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.diffAny=fr.diffObjects=fr.diffArrays=fr.intersection=fr.subtract=fr.isDestructive=void 0;var e=YA();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}fr.isDestructive=t;function n(m,g){var x={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(x[b]=1);for(var w in g)e.hasOwnProperty.call(g,w)&&g[w]!==void 0&&delete x[w];return Object.keys(x)}fr.subtract=n;function r(m){for(var g=m.length,x={},b=0;b<g;b++){var w=m[b];for(var j in w)e.hasOwnProperty.call(w,j)&&w[j]!==void 0&&(x[j]=(x[j]||0)+1)}for(var j in x)x[j]<g&&delete x[j];return Object.keys(x)}fr.intersection=r;function i(m){return m.op==="add"}function s(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function d(m,g,x,b){b===void 0&&(b=p);var w={"0,0":{operations:[],cost:0}};function j(_,P){var A="".concat(_,",").concat(P),k=w[A];if(k===void 0){if(_>0&&P>0&&!b(m[_-1],g[P-1],x.add(String(_-1))).length)k=j(_-1,P-1);else{var I=[];if(_>0){var B=j(_-1,P),q={op:"remove",index:_-1};I.push(c(B,q))}if(P>0){var Z=j(_,P-1),K={op:"add",index:_-1,value:g[P-1]};I.push(c(Z,K))}if(_>0&&P>0){var Q=j(_-1,P-1),V={op:"replace",index:_-1,original:m[_-1],value:g[P-1]};I.push(c(Q,V))}var W=I.sort(function(O,L){return O.cost-L.cost})[0];k=W}w[A]=k}return k}var C=isNaN(m.length)||m.length<=0?0:m.length,T=isNaN(g.length)||g.length<=0?0:g.length,E=j(C,T).operations,R=E.reduce(function(_,P){var A=_[0],k=_[1];if(i(P)){var I=P.index+1+k,B=I<C+k?String(I):"-",q={op:P.op,path:x.add(B).toString(),value:P.value};return[A.concat(q),k+1]}else if(s(P)){var q={op:P.op,path:x.add(String(P.index+k)).toString()};return[A.concat(q),k-1]}else{var Z=x.add(String(P.index+k)),K=b(P.original,P.value,Z);return[A.concat.apply(A,K),k]}},[[],0])[0];return R}fr.diffArrays=d;function f(m,g,x,b){b===void 0&&(b=p);var w=[];return n(m,g).forEach(function(j){w.push({op:"remove",path:x.add(j).toString()})}),n(g,m).forEach(function(j){w.push({op:"add",path:x.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){w.push.apply(w,b(m[j],g[j],x.add(j)))}),w}fr.diffObjects=f;function p(m,g,x,b){if(b===void 0&&(b=p),m===g)return[];var w=(0,e.objectType)(m),j=(0,e.objectType)(g);return w=="array"&&j=="array"?d(m,g,x,b):w=="object"&&j=="object"?f(m,g,x,b):[{op:"replace",path:x.toString(),value:g}]}return fr.diffAny=p,fr}var oT;function mQ(){if(oT)return hn;oT=1;var e=hn&&hn.__extends||(function(){var C=function(T,E){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,_){R.__proto__=_}||function(R,_){for(var P in _)Object.prototype.hasOwnProperty.call(_,P)&&(R[P]=_[P])},C(T,E)};return function(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");C(T,E);function R(){this.constructor=T}T.prototype=E===null?Object.create(E):(R.prototype=E.prototype,new R)}})();Object.defineProperty(hn,"__esModule",{value:!0}),hn.apply=hn.InvalidOperationError=hn.test=hn.copy=hn.move=hn.replace=hn.remove=hn.add=hn.TestError=hn.MissingError=void 0;var t=QA(),n=YA(),r=KA(),i=(function(C){e(T,C);function T(E){var R=C.call(this,"Value required at path: ".concat(E))||this;return R.path=E,R.name="MissingError",R}return T})(Error);hn.MissingError=i;var s=(function(C){e(T,C);function T(E,R){var _=C.call(this,"Test failed: ".concat(E," != ").concat(R))||this;return _.actual=E,_.expected=R,_.name="TestError",_}return T})(Error);hn.TestError=s;function c(C,T,E){if(Array.isArray(C))if(T=="-")C.push(E);else{var R=parseInt(T,10);C.splice(R,0,E)}else C[T]=E}function d(C,T){if(Array.isArray(C)){var E=parseInt(T,10);C.splice(E,1)}else delete C[T]}function f(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new i(T.path):(c(E.parent,E.key,(0,n.clone)(T.value)),null)}hn.add=f;function p(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.value===void 0?new i(T.path):(d(E.parent,E.key),null)}hn.remove=p;function m(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);if(E.parent===null)return new i(T.path);if(Array.isArray(E.parent)){if(parseInt(E.key,10)>=E.parent.length)return new i(T.path)}else if(E.value===void 0)return new i(T.path);return E.parent[E.key]=(0,n.clone)(T.value),null}hn.replace=m;function g(C,T){var E=t.Pointer.fromJSON(T.from).evaluate(C);if(E.value===void 0)return new i(T.from);var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.parent===void 0?new i(T.path):(d(E.parent,E.key),c(R.parent,R.key,E.value),null)}hn.move=g;function x(C,T){var E=t.Pointer.fromJSON(T.from).evaluate(C);if(E.value===void 0)return new i(T.from);var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.parent===void 0?new i(T.path):(c(R.parent,R.key,(0,n.clone)(E.value)),null)}hn.copy=x;function b(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return(0,r.diffAny)(E.value,T.value,new t.Pointer).length?new s(E.value,T.value):null}hn.test=b;var w=(function(C){e(T,C);function T(E){var R=C.call(this,"Invalid operation: ".concat(E.op))||this;return R.operation=E,R.name="InvalidOperationError",R}return T})(Error);hn.InvalidOperationError=w;function j(C,T){switch(T.op){case"add":return f(C,T);case"remove":return p(C,T);case"replace":return m(C,T);case"move":return g(C,T);case"copy":return x(C,T);case"test":return b(C,T)}return new w(T)}return hn.apply=j,hn}var iT;function gQ(){return iT||(iT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=QA();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=mQ(),r=KA();function i(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=i;function s(p){function m(g,x,b){var w=p(g,x,b);return Array.isArray(w)?w:(0,r.diffAny)(g,x,b,m)}return m}function c(p,m,g){var x=new t.Pointer;return(g?s(g):r.diffAny)(p,m,x)}e.createPatch=c;function d(p,m){var g=t.Pointer.fromJSON(m).evaluate(p);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(p,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(x){var b=d(p,x.path);if(b&&g.push(b),"from"in x){var w=d(p,x.from);w&&g.push(w)}}),g}e.createTests=f})(uy)),uy}var XA=gQ();const vQ="_removed_el5zk_1",yQ="_added_el5zk_6",aT={removed:vQ,added:yQ};function xQ(e){const{name:t,path:n,property:r,originalValue:i,revisedValue:s}=e,c=!!r?.type?.find(m=>m.code==="Attachment"),[d,f]=v.useState(c),p=()=>f(m=>!m);return a.jsx(a.Fragment,{children:c&&!d||!c?a.jsx(a.Fragment,{children:a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:t}),a.jsx(ve.Td,{className:aT.removed,children:i&&a.jsx($o,{path:n,property:r,propertyType:i.type,value:i.value,ignoreMissingValues:!0})}),a.jsx(ve.Td,{className:aT.added,children:s&&a.jsx($o,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:t}),a.jsx(ve.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(ke,{onClick:p,variant:"light",children:"Expand"})})]})})}const bQ="_root_15xvr_1",SQ={root:bQ};function wQ(e){const t=Ae(),{original:n,revised:r}=e,[i,s]=v.useState(!1);v.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>s(!0)).catch(console.log)},[t,e.original.resourceType]);const c=v.useMemo(()=>{if(!i)return null;const d=[Qr(n)],f=[Qr(r)],p=[],m=jQ(XA.createPatch(n,r));for(const g of m){const x=g.path,b=CQ(x),w=EQ(n.resourceType,b),j=g.op==="add"?void 0:Ya(b,d),C=g.op==="remove"?void 0:Ya(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${In(g.op)} ${b}`,path:w?.path??n.resourceType+"."+b,property:w,originalValue:sT(w,j),revisedValue:sT(w,C)})}return p},[i,n,r]);return c?a.jsxs(ve,{className:SQ.root,children:[a.jsx(ve.Thead,{children:a.jsxs(ve.Tr,{children:[a.jsx(ve.Th,{}),a.jsx(ve.Th,{children:"Before"}),a.jsx(ve.Th,{children:"After"})]})}),a.jsx(ve.Tbody,{children:c.map(d=>{const{key:f,...p}=d;return a.jsx(xQ,{...p},f)})})]}):null}function jQ(e){const t=[];for(const n of e){const{op:r,path:i}=n;if(i.startsWith("/meta/author")||i.startsWith("/meta/compartment")||i.startsWith("/meta/lastUpdated")||i.startsWith("/meta/versionId"))continue;const s=e.filter(d=>d.op===r&&d.path===i).length,c={op:r,path:i};s>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(i)&&(c.op="replace",c.path=i.replace(/\/[^/]+$/,"")),t.some(d=>d.op===c.op&&d.path===c.path)||t.push(c)}return t}function CQ(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const i=t[r];i==="-"?n+=".last()":/^\d+$/.test(i)?n+=`[${i}]`:(r>0&&(n+="."),n+=i)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function EQ(e,t){return dm(e,{code:e+"."+t,expression:e+"."+t})?.elementDefinitions?.[0]}function sT(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:TQ(t,!!e?.isArray)}}function TQ(e,t){const n=fU(e).flatMap(r=>r.value);return t?n:n[0]}function Vb(e){const{profileUrl:t}=e,n=Ae(),r=n.getAccessPolicy(),i=Gt(e.value),[s,c]=v.useState(!1);v.useEffect(()=>{if(i)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Ic(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=i.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,i]);const d=v.useMemo(()=>i&&qD(i,Is.READ,r),[r,i]);return!s||!i?null:a.jsx(Jh,{path:i.resourceType,value:{type:i.resourceType,value:e.forceUseInput?e.value:i},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:d})}const RQ="_item_5q6yx_1",_Q="_itemPadding_5q6yx_5",lT={item:RQ,itemPadding:_Q};function DQ(e){return a.jsx(Od,{children:e.children})}function Ks(e){const{resource:t,profile:n,padding:r,popupMenuItems:i,...s}=e,c=n??t.meta?.author,d=e.dateTime??t.meta?.lastUpdated;return a.jsxs($c,{"data-testid":"timeline-item",fill:!0,...s,children:[a.jsxs(ye,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(ns,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(De,{size:"sm",children:a.jsx(ll,{c:"dark",fw:500,value:c,link:!0})}),a.jsxs(De,{size:"xs",children:[a.jsx(vt,{c:"dimmed",to:e.resource,children:sr(d)}),a.jsx(De,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(vt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),i&&a.jsxs(Ce,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(Ce.Target,{children:a.jsx(bn,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Dt(e.resource)}`,children:a.jsx(gq,{})})}),i]})]}),a.jsx(bA,{children:a.jsx("div",{className:It(lT.item,{[lT.itemPadding]:r}),children:e.children})})]})}function ZA(e,t){e.sort((n,r)=>{const i=cT(n,t),s=cT(r,t);return i>s?1:i<s?-1:uT(n,t)-uT(r,t)})}function cT(e,t){if(!JA(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function uT(e,t){if(!JA(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const n=e.meta?.lastUpdated;return n?new Date(n).getTime():0}function JA(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const AQ="_pinnedComment_u08s5_1",PQ={pinnedComment:AQ};function Sm(e){const t=Ae(),n=t.getProfile(),r=v.useRef(null),i=Gt(e.value),[s,c]=v.useState(),[d,f]=v.useState([]),[p,m]=v.useState(10),g=e.loadTimelineResources,x=v.useRef(d);x.current=d;const b=v.useCallback(k=>{ZA(k,i),k.reverse(),f(k)},[i]),w=v.useCallback(k=>{const I=[];for(const B of k){if(B.status!=="fulfilled")continue;const q=B.value;if(q.type==="history"&&c(q),q.entry)for(const Z of q.entry)I.push(Z.resource)}b(I)},[b]),j=v.useCallback(k=>b([...x.current,k]),[b]),C=v.useCallback(()=>{let k,I;"resourceType"in e.value?(k=e.value.resourceType,I=e.value.id):[k,I]=e.value.reference?.split("/"),g(t,k,I).then(w).catch(console.error)},[t,e.value,g,w]);v.useEffect(()=>C(),[C]);function T(k){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,k)).then(I=>j(I)).catch(console.error)}function E(k){!i||!e.createMedia||t.createResource(e.createMedia(i,n,k)).then(I=>j(I)).then(()=>ks({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(gi,{size:16}),autoClose:2e3})).catch(I=>ks({id:"upload-notification",color:"red",title:"Upload error",message:Ge(I),icon:a.jsx(FE,{size:16}),autoClose:2e3}))}function R(){Ne({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(k){ks({id:"upload-notification",loading:!0,title:"Uploading...",message:$Q(k),autoClose:!1,withCloseButton:!1})}function P(k){ks({id:"upload-notification",color:"red",title:"Upload error",message:Ge(k),icon:a.jsx(FE,{size:16}),autoClose:2e3})}if(!i)return a.jsx(Jn,{style:{width:"100%",height:"100%"},children:a.jsx(Pr,{})});const A=d.filter(k=>k).slice(0,p);return a.jsxs(DQ,{children:[e.createCommunication&&a.jsx($c,{children:a.jsx(dt,{testid:"timeline-form",onSubmit:k=>{T(k.text);const I=r.current;I&&(I.value="",I.focus())},children:a.jsxs(ye,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(ns,{value:n}),a.jsx(ze,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(bn,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(Fq,{size:16})}),a.jsx(Ob,{securityContext:qt(i),onUpload:E,onUploadStart:R,onUploadProgress:_,onUploadError:P,children:k=>a.jsx(bn,{...k,radius:"xl",color:"blue",variant:"filled",children:a.jsx(Tb,{size:16})})})]})})}),A.map(k=>{const I=`${k.resourceType}/${k.id}/${k.meta?.versionId}`,B=e.getMenu?e.getMenu({primaryResource:i,currentResource:k,reloadTimeline:C}):void 0;if(k.resourceType===i.resourceType&&k.id===i.id)return a.jsx(kQ,{history:s,resource:k,popupMenuItems:B},I);switch(k.resourceType){case"AuditEvent":return a.jsx(IQ,{resource:k,popupMenuItems:B},I);case"Communication":return a.jsx(OQ,{resource:k,popupMenuItems:B},I);case"DiagnosticReport":return a.jsx(LQ,{resource:k,popupMenuItems:B},I);case"Media":return a.jsx(MQ,{resource:k,popupMenuItems:B},I);default:return a.jsx(Ks,{resource:k,padding:!0,children:a.jsx(Vb,{value:k,ignoreMissingValues:!0})},I)}}),p<d.length&&a.jsx(ye,{justify:"center",pb:"lg",children:a.jsx(ke,{onClick:()=>m(p+10),children:"Show More"})})]})}function kQ(e){const{history:t,resource:n,...r}=e,i=NQ(t,n);return i?a.jsx(Ks,{resource:n,padding:!0,...r,children:a.jsx(wQ,{original:i,revised:e.resource})}):a.jsxs(Ks,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx(Vb,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function NQ(e,t){const n=e.entry??[],r=n.findIndex(i=>i.resource?.meta?.versionId===t.meta?.versionId);if(!(r>=n.length-1))return n[r+1].resource}function OQ(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:PQ.pinnedComment;return a.jsx(Ks,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:a.jsx("p",{children:e.resource.payload?.[0]?.contentString})})}function MQ(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(Ks,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(Nd,{value:e.resource.content})})}function IQ(e){return a.jsx(Ks,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Xr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function LQ(e){return a.jsx(Ks,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Bb,{value:e.resource})})}function $Q(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${fy(e.loaded)} / ${fy(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${fy(e.loaded)}`}function fy(e){if(e===0)return"0.00 B";const t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP".charAt(t)+"B"}function zQ(e){const{resource:t,...n}=e;return a.jsx(Sm,{value:t,loadTimelineResources:async(r,i,s)=>{const c=`${i}/${s}`;return Promise.allSettled([r.readHistory(i,s),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function UQ(e){const{encounter:t,...n}=e;return a.jsx(Sm,{value:t,loadTimelineResources:async(r,i,s)=>Promise.allSettled([r.readHistory("Encounter",s),r.search("Communication","encounter=Encounter/"+s),r.search("Media","encounter=Encounter/"+s)]),createCommunication:(r,i,s)=>({resourceType:"Communication",status:"completed",encounter:qt(r),subject:r.subject,sender:qt(i),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,i,s)=>({resourceType:"Media",status:"completed",encounter:qt(r),subject:r.subject,operator:qt(i),issued:new Date().toISOString(),content:s}),...n})}function BQ(e){let t;try{t=oB(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return a.jsx($o,{value:t[0]||"",propertyType:e.propertyType})}function VQ(e){return a.jsxs(Vn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(dT,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(dT,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(De,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function dT(e){return a.jsx(ke,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const FQ={string:[ue.EQUALS,ue.NOT,ue.CONTAINS,ue.EXACT],fulltext:[ue.EQUALS,ue.NOT,ue.CONTAINS,ue.EXACT],token:[ue.EQUALS,ue.NOT],reference:[ue.EQUALS,ue.NOT],numeric:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS],quantity:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS],date:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS,ue.STARTS_AFTER,ue.ENDS_BEFORE,ue.APPROXIMATELY],datetime:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS,ue.STARTS_AFTER,ue.ENDS_BEFORE,ue.APPROXIMATELY],uri:[ue.EQUALS,ue.NOT,ue.ABOVE,ue.BELOW]},qQ={eq:"equals",ne:"not equals",gt:"greater than",lt:"less than",ge:"greater than or equals",le:"less than or equals",sa:"starts after",eb:"ends before",ap:"approximately",sw:"starts with",contains:"contains",exact:"exact",text:"text",not:"not",above:"above",below:"below",in:"in","not-in":"not in","of-type":"of type",missing:"missing",present:"present",identifier:"identifier",iterate:"iterate"};function Fb(e,t){return{...e,filters:t,offset:0,name:void 0}}function eP(e,t){return Fb(e,(e.filters??[]).filter(n=>n.code!==t))}function wm(e,t,n,r,i){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),Fb(e,s)}function HQ(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function GQ(e,t){return qb(e,t,-1)}function WQ(e,t){return qb(e,t,0)}function QQ(e,t){return qb(e,t,1)}function qb(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setDate(i.getDate()+1),i.setTime(i.getTime()-1),jm(e,t,r,i)}function YQ(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return jm(e,t,n,r)}function KQ(e,t){return Hb(e,t,-1)}function XQ(e,t){return Hb(e,t,0)}function ZQ(e,t){return Hb(e,t,1)}function Hb(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setMonth(i.getMonth()+1),i.setDate(1),i.setHours(0,0,0,0),i.setTime(i.getTime()-1),jm(e,t,r,i)}function JQ(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),jm(e,t,n,new Date)}function jm(e,t,n,r){return e=eP(e,t),e=fT(e,t,ue.GREATER_THAN_OR_EQUALS,n),e=fT(e,t,ue.LESS_THAN_OR_EQUALS,r),e}function fT(e,t,n,r){return wm(e,t,n,r.toISOString())}function hT(e,t,n=!0){return wm(e,t,ue.MISSING,n.toString())}function eY(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function tY(e,t){const n=e.count??sm,r=(t-1)*n;return eY(e,r)}function nY(e,t,n){return t===rY(e)&&n!==void 0&&n===oY(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function rY(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function oY(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function iY(e){return FQ[e.type]}function tP(e){return qQ[e]??""}function Xs(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replace(/([A-Z])/g," $1"),t=t.replace(/[-_]/g," "),t=t.replace(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(In).join(" "))}function aY(e,t){const n=t.name;return n==="id"?a.jsx(vt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?e.meta?.versionId:n==="_lastUpdated"?sr(e.meta?.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?sY(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?lY(e,t.searchParams[0]):null}function sY(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,i]=ym({type:e.resourceType,value:e},n);return r?a.jsx($o,{path:t.path,property:t,propertyType:i,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function lY(e,t){const n=Ya(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,i)=>a.jsx($o,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${i}-${n.length}`))})}function cY(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(Lo(e.search))}),[i,s]=v.useState(!1);v.useEffect(()=>{r({search:e.search})},[e.search]);const c=v.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,p=vD(f),m=ub(f);return od(uY(p,m)).map(g=>({value:g,label:Xs(g)}))},[e.visible,e.search.resourceType]);function d(f){r({search:{...n.search,fields:f}})}return a.jsx(Vn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=i},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(Ue,{children:[a.jsx(Hp,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:d,onDropdownOpen:()=>s(!0),onDropdownClose:()=>s(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function uY(e,t){const n=[],r=new Set,i=new Set;for(const s of Object.keys(e.elements))n.push(s),r.add(s.toLowerCase()),i.add(Xs(s));if(t)for(const s of Object.keys(t)){const c=Xs(s);!r.has(s)&&!i.has(c)&&(n.push(s),r.add(s),i.add(c))}return n}function nP(e){const t=dm(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case rr.REFERENCE:return a.jsx(Ga,{name:n,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(r.reference):e.onChange("")}});case rr.BOOLEAN:return a.jsx(Dn,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.checked.toString())});case rr.DATE:return a.jsx(ze,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case rr.DATETIME:return a.jsx(ai,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case rr.NUMBER:return a.jsx(ze,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case rr.QUANTITY:return a.jsx(Ys,{name:n,path:"",defaultValue:dY(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(ze,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value),placeholder:"Search value"})}}function dY(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function fY(e){const[t,n]=v.useState(Yr(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(Yr(e.search))},[e.search]);function i(f){n(wm(r.current,f.code,f.operator,f.value))}const s=e.search.resourceType,c=ub(s)??{},d=t.filters||[];return a.jsx(Vn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:a.jsxs(dt,{onSubmit:()=>e.onOk(r.current),children:[a.jsxs("div",{children:[a.jsxs("table",{children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:380}}),a.jsx("col",{style:{width:40}})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Field"}),a.jsx("th",{children:"Operation"}),a.jsx("th",{children:"Value"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:d.map((f,p)=>a.jsx(hY,{id:`filter-${p}-row`,resourceType:s,searchParams:c,value:f,onChange:m=>{const g=[...d];g[p]=m,n(Fb(r.current,g))},onDelete:()=>n(HQ(r.current,p))},`filter-${p}-row`))})]}),a.jsx($b,{propertyDisplayName:"Filter",onClick:()=>i({})})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(yr,{children:"OK"})})]})})}function hY(e){const t=e.value,n=v.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=ue.EQUALS,n.current.value="",e.onChange(n.current)}function i(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function s(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],d=c&&iY(c);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(sn,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:f=>r(f.currentTarget.value),data:["",...Object.keys(e.searchParams).map(f=>({value:f,label:Xs(f)}))]})}),a.jsx("td",{children:d&&a.jsx(sn,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>i(f.currentTarget.value),data:["",...d.map(f=>({value:f,label:tP(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(nP,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:s},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),a.jsx("td",{children:e.onDelete&&a.jsx(bn,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:a.jsx(Qs,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function pY(e){const[t,n]=v.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx(Vn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(dt,{onSubmit:r,children:a.jsxs(ir,{children:[a.jsx(ir.Col,{span:10,children:a.jsx(nP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(ir.Col,{span:2,children:a.jsx(ke,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function mY(e){const{resourceType:t,filter:n}=e,r=ui.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===ue.EQUALS||n.operator===ue.NOT_EQUALS))return a.jsx(ll,{value:{reference:n.value}});const i=dm(t,r);if(n.code==="_lastUpdated"||i.type===rr.DATETIME)return a.jsx(a.Fragment,{children:sr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function gY(e){if(!e.searchParams)return null;function t(s,c){i(nY(e.search,s.code,c))}function n(s){i(eP(e.search,s.code))}function r(s,c){e.onPrompt(s,{code:s.code,operator:c,value:""})}function i(s){e.onChange(s)}return e.searchParams.length===1?a.jsx(vY,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:i,onClear:n}):a.jsx(Ce.Dropdown,{children:e.searchParams.map(s=>a.jsx(Ce.Item,{children:Xs(s.code)},s.code))})}function vY(e){switch(e.searchParam.type){case"date":return a.jsx(yY,{...e});case"number":case"quantity":return a.jsx(xY,{...e});case"reference":return a.jsx(bY,{...e});case"string":return a.jsx(SY,{...e});case"token":case"uri":return a.jsx(wY,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function yY(e){const{searchParam:t}=e,n=t.code;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(_b,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(Ce.Item,{leftSection:a.jsx(Db,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(vA,{size:14}),onClick:()=>e.onPrompt(t,ue.ENDS_BEFORE),children:"Before..."}),a.jsx(Ce.Item,{leftSection:a.jsx(gA,{size:14}),onClick:()=>e.onPrompt(t,ue.STARTS_AFTER),children:"After..."}),a.jsx(Ce.Item,{leftSection:a.jsx(FF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Between..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Ia,{size:14}),onClick:()=>e.onChange(QQ(e.search,n)),children:"Tomorrow"}),a.jsx(Ce.Item,{leftSection:a.jsx(Ia,{size:14}),onClick:()=>e.onChange(WQ(e.search,n)),children:"Today"}),a.jsx(Ce.Item,{leftSection:a.jsx(Ia,{size:14}),onClick:()=>e.onChange(GQ(e.search,n)),children:"Yesterday"}),a.jsx(Ce.Item,{leftSection:a.jsx(Ia,{size:14}),onClick:()=>e.onChange(YQ(e.search,n)),children:"Next 24 Hours"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Ia,{size:14}),onClick:()=>e.onChange(ZQ(e.search,n)),children:"Next Month"}),a.jsx(Ce.Item,{leftSection:a.jsx(Ia,{size:14}),onClick:()=>e.onChange(XQ(e.search,n)),children:"This Month"}),a.jsx(Ce.Item,{leftSection:a.jsx(Ia,{size:14}),onClick:()=>e.onChange(KQ(e.search,n)),children:"Last Month"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Ia,{size:14}),onClick:()=>e.onChange(JQ(e.search,n)),children:"Year to date"}),a.jsx(Id,{...e})]})}function xY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(_b,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(Ce.Item,{leftSection:a.jsx(Db,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(gA,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN),children:"Greater than..."}),a.jsx(Ce.Item,{leftSection:a.jsx(tx,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(Ce.Item,{leftSection:a.jsx(vA,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN),children:"Less than..."}),a.jsx(Ce.Item,{leftSection:a.jsx(tx,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Id,{...e})]})}function bY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Id,{...e})]})}function SY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(_b,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(Ce.Item,{leftSection:a.jsx(Db,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(YF,{size:14}),onClick:()=>e.onPrompt(t,ue.CONTAINS),children:"Contains..."}),a.jsx(Ce.Item,{leftSection:a.jsx(WF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Does not contain..."}),a.jsx(Id,{...e})]})}function wY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Id,{...e})]})}function Id(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(zF,{size:14}),onClick:()=>e.onChange(hT(e.search,n)),children:"Missing"}),a.jsx(Ce.Item,{leftSection:a.jsx(LF,{size:14}),onClick:()=>e.onChange(hT(e.search,n,!1)),children:"Not missing"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Qs,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function rP(e){switch(e){case"next":return{"aria-label":"Next page"};case"previous":return{"aria-label":"Previous page"};case"first":return{"aria-label":"First page"};case"last":return{"aria-label":"Last page"};default:return{}}}const jY="_root_vlout_1",CY="_table_vlout_8",EY="_tr_vlout_12",TY="_control_vlout_22",RY="_icon_vlout_31",$u={root:jY,table:CY,tr:EY,control:TY,icon:RY};function _Y(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(DY(t,r));return n}function DY(e,t){if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const n=ts(e,t),r=DU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=ub(e);let s;if(i){const c=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(i).filter(d=>!!d.expression&&c.test(d?.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const i=dm(e,r);return{name:t,elementDefinition:i.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class AY extends Event{constructor(t){super("change"),this.definition=t}}class PY extends Event{constructor(t){super("load"),this.response=t}}class ep extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function Uc(e){const t=Ae(),[n,r]=v.useState(),{search:i,onLoad:s}=e,[c,d]=v.useState(i);ci(i,c)||d(i);const[f,p]=v.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=v.useRef(f);m.current=f;const g=c.total??"accurate",x=v.useCallback(V=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,Ha({...c,total:g,fields:void 0}),V)).then(W=>{p({...m.current,searchResponse:W}),s&&s(new PY(W))}).catch(W=>{p({...m.current,searchResponse:void 0}),r(Ht(W))})},[t,c,g,s]),b=v.useCallback(()=>{p({...m.current,searchResponse:void 0}),x({cache:"reload"})},[x]);v.useEffect(()=>{x()},[x]);function w(V,W){V.stopPropagation();const L=V.target.checked,$={...m.current.selected};L?$[W]=!0:delete $[W],p({...m.current,selected:$})}function j(V){V.stopPropagation();const O=V.target.checked,L={},$=m.current.searchResponse;O&&$?.entry&&$.entry.forEach(H=>{H.resource?.id&&(L[H.resource.id]=!0)}),p({...m.current,selected:L})}function C(){const V=m.current;if(!V.searchResponse?.entry||V.searchResponse.entry.length===0)return!1;for(const W of V.searchResponse.entry)if(W.resource?.id&&!V.selected[W.resource.id])return!1;return!0}function T(V){e.onChange&&e.onChange(new AY(V))}function E(V,W){if(wA(V.target)||V.button===2)return;dn(V);const O=SA(V);!O&&e.onClick&&e.onClick(new ep(W,V)),O&&e.onAuxClick&&e.onAuxClick(new ep(W,V))}function R(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(xr,{outcome:n});if(!gD(c.resourceType))return a.jsx(Jn,{style:{width:"100%",height:"100%"},children:a.jsx(Pr,{})});const _=e.checkboxesEnabled,P=_Y(c),A=c.resourceType,k=f.searchResponse,B=k?.entry?.map(V=>V.resource),q="subtle",Z="gray",K=16,Q=window.innerWidth<768;return a.jsxs("div",{className:$u.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(ye,{justify:"space-between",mb:"xl",children:[a.jsxs(ye,{gap:2,children:[a.jsx(ke,{size:"compact-md",variant:q,color:Z,leftSection:a.jsx(cq,{size:K}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(ke,{size:"compact-md",variant:q,color:Z,leftSection:a.jsx(_q,{size:K}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(ke,{size:"compact-md",variant:q,color:Z,leftSection:a.jsx(Tq,{size:K}),onClick:e.onNew,children:"New..."}),!Q&&R()&&a.jsx(ke,{size:"compact-md",variant:q,color:Z,leftSection:a.jsx(CH,{size:K}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!Q&&e.onDelete&&a.jsx(ke,{size:"compact-md",variant:q,color:Z,leftSection:a.jsx(mm,{size:K}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!Q&&e.onBulk&&a.jsx(ke,{size:"compact-md",variant:q,color:Z,leftSection:a.jsx(BF,{size:K}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(ye,{gap:2,children:[k&&a.jsxs(De,{size:"xs",c:"dimmed","data-testid":"count-display",children:[oP(c,k).toLocaleString(),"-",IY(c,k).toLocaleString(),k.total!==void 0&&` of ${c.total==="estimate"?"~":""}${k.total?.toLocaleString()}`]}),a.jsx(bn,{variant:q,color:Z,title:"Refresh",onClick:b,children:a.jsx(xA,{size:K})})]})]}),a.jsxs(ve,{className:$u.table,children:[a.jsxs(ve.Thead,{children:[a.jsxs(ve.Tr,{children:[_&&a.jsx(ve.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:V=>j(V)})}),P.map(V=>a.jsx(ve.Th,{children:a.jsxs(Ce,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(Ce.Target,{children:a.jsx(er,{className:$u.control,p:2,children:a.jsxs(ye,{justify:"space-between",wrap:"nowrap",children:[a.jsx(De,{fw:500,children:Xs(V.name)}),a.jsx(Jn,{className:$u.icon,children:a.jsx(AF,{size:14,stroke:1.5})})]})})}),a.jsx(gY,{search:c,searchParams:V.searchParams,onPrompt:(W,O)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:W,filterDialogFilter:O,dialogOpenTime:Date.now()})},onChange:W=>{T(W)}})]})},V.name))]}),!e.hideFilters&&a.jsxs(ve.Tr,{children:[_&&a.jsx(ve.Th,{}),P.map(V=>a.jsx(ve.Th,{children:V.searchParams&&a.jsx(NY,{resourceType:A,searchParams:V.searchParams,filters:c.filters})},V.name))]})]}),a.jsx(ve.Tbody,{children:B?.map(V=>V&&a.jsxs(ve.Tr,{className:$u.tr,"data-testid":"search-control-row",onClick:W=>E(W,V),onAuxClick:W=>E(W,V),children:[_&&a.jsx(ve.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${V.id}`,checked:!!f.selected[V.id],onChange:W=>w(W,V.id)})}),P.map(W=>a.jsx(ve.Td,{children:aY(V,W)},W.name))]},V.id))})]}),!B?.length&&a.jsx(Od,{children:a.jsx(Jn,{style:{height:150},children:a.jsx(De,{size:"xl",c:"dimmed",children:"No results"})})}),k&&a.jsx(Jn,{m:"md",p:"md",children:a.jsx(jo,{value:OY(c),total:MY(c,k),onChange:V=>T(tY(c,V)),getControlProps:rP})}),a.jsx(cY,{search:c,visible:m.current.fieldEditorVisible,onOk:V=>{T(V),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(fY,{search:c,visible:m.current.filterEditorVisible,onOk:V=>{T(V),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(VQ,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(pY,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?Xs(f.filterDialogSearchParam.code):"",resourceType:A,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:V=>{T(wm(c,V.code,V.operator,V.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const kY=Uc;function NY(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?a.jsx("span",{children:"no filters"}):a.jsx(a.Fragment,{children:t.map(n=>a.jsxs("div",{children:[tP(n.operator)," ",a.jsx(mY,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function OY(e){return Math.floor((e.offset??0)/(e.count??sm))+1}function MY(e,t){const n=e.count??sm,r=iP(e,t);return Math.ceil(r/n)}function oP(e,t){return Math.min(iP(e,t),(e.offset??0)+1)}function IY(e,t){return Math.max(oP(e,t)+(t.entry?.length??0)-1,0)}function iP(e,t){let n=t.total;return n===void 0&&(n=(e.offset??0)+(t.entry?.length??0)+(t.link?.some(r=>r.relation==="next")?1:0)),n}function LY(e){const t=Ae(),[n,r]=v.useState(!1),[i,s]=v.useState(),{query:c,fields:d}=e,[f,p]=v.useState(),[m,g]=v.useState({}),x=v.useRef(f);x.current=f;const b=v.useRef({});b.current=m,v.useEffect(()=>{s(void 0),t.graphql(c).then(p).catch(R=>s(Ht(R)))},[t,c]);function w(R,_){R.stopPropagation();const A=R.target.checked,k={...b.current};A?k[_]=!0:delete k[_],g(k)}function j(R){R.stopPropagation();const P=R.target.checked,A={},k=x.current?.data.ResourceList;P&&k&&k.forEach(I=>{I.id&&(A[I.id]=!0)}),g(A)}function C(){const R=x.current?.data.ResourceList;if(!R||R.length===0)return!1;for(const _ of R)if(_.id&&!b.current[_.id])return!1;return!0}function T(R,_){wA(R.target)||(dn(R),R.button!==1&&e.onClick&&e.onClick(new ep(_,R)),R.button===1&&e.onAuxClick&&e.onAuxClick(new ep(_,R)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(Pr,{});const E=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:R=>dn(R),"data-testid":"search-control",children:[a.jsxs(ve,{children:[a.jsx(ve.Thead,{children:a.jsxs(ve.Tr,{children:[E&&a.jsx(ve.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:R=>j(R)})}),d.map(R=>a.jsx(ve.Th,{children:R.name},R.name))]})}),a.jsx(ve.Tbody,{children:f?.data.ResourceList.map(R=>R&&a.jsxs(ve.Tr,{"data-testid":"search-control-row",onClick:_=>T(_,R),onAuxClick:_=>T(_,R),children:[E&&a.jsx(ve.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!m[R.id],onChange:_=>w(_,R.id)})}),d.map(_=>a.jsx(ve.Td,{children:a.jsx(BQ,{propertyType:_.propertyType,path:_.fhirPath,resource:R})},_.name))]},R.id))})]}),f?.data.ResourceList.length===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),i&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),e.onBulk&&a.jsx(ke,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const $Y=v.memo(LY),zY="_root_1fbwr_1",UY="_entry_1fbwr_8",BY="_key_1fbwr_13",VY="_value_1fbwr_20",Cm={root:zY,entry:UY,key:BY,value:VY};function ht(e){return a.jsx(Xr,{children:a.jsx("div",{className:Cm.root,children:e.children})})}ht.Entry=function(t){return a.jsx("div",{className:Cm.entry,children:t.children})};ht.Key=function(t){return a.jsx("div",{className:Cm.key,children:t.children})};ht.Value=function(t){return a.jsx("div",{className:Cm.value,children:t.children})};function FY(e){const{group:t}=e;return a.jsx(mr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(ye,{children:[t.measureScore&&a.jsx(GY,{group:t}),!t.measureScore&&a.jsx(HY,{group:t})]})})}function qY(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(De,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(De,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function HY(e){const{group:t}=e,n=t.population,r=n?.find(f=>Qa(f.code)==="numerator"),i=n?.find(f=>Qa(f.code)==="denominator"),s=r?.count,c=i?.count;if(c===0)return a.jsxs(ce,{children:[a.jsx(Ie,{order:3,children:"Not Applicable"}),a.jsx(De,{children:`Denominator: ${c}`})]});if(s===void 0||c===void 0)return a.jsxs(ce,{children:[a.jsx(Ie,{order:3,children:"Insufficient Data"}),a.jsx(De,{children:`Numerator: ${s}`}),a.jsx(De,{children:`Denominator: ${c}`})]});const d=s/c*100;return a.jsx(Jp,{size:120,thickness:12,roundCaps:!0,sections:[{value:d,color:aP(d)}],label:a.jsx(li,{justify:"center",children:a.jsxs(De,{fw:700,fz:18,children:[s," / ",c]})})})}function GY(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(Jp,{size:120,thickness:12,roundCaps:!0,sections:[{value:WY(t),color:aP(t?.measureScore?.value??0)}],label:a.jsx(li,{justify:"center",children:a.jsx(De,{fw:700,fz:18,children:a.jsx(sd,{value:t.measureScore})})})}):a.jsx(li,{h:120,align:"center",children:a.jsx(Ie,{order:3,children:a.jsx(sd,{value:t.measureScore})})})})}function WY(e){const t=e.measureScore?.value,n=e.measureScore?.unit;return t?t<=1&&n==="%"?t*100:t:0}function aP(e){return e<=33?"red":e<=67?"yellow":"green"}function QY(e){const t=Gt(e.measureReport),[n]=wF("Measure",{url:t?.measure});return t?a.jsxs(ce,{children:[n&&a.jsx(qY,{measure:n}),a.jsx(em,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,i)=>a.jsx(FY,{group:r},r.id??i))})]}):null}const hy="patient-export",py="Patient Export",YY={everything:{operation:"$everything",extension:"json",contentType:un.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:un.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:un.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:un.CDA_XML}};function KY(e){const t=Ae(),{patient:n}=e,r=v.useCallback(async i=>{const s=qs(n),c=i.format,{operation:d,type:f,contentType:p,extension:m}=YY[c],g=t.fhirUrl("Patient",s,d),x={};f&&(x.type=f),i.author&&(x.author={reference:i.author}),i.authoredOn&&(x.authoredOn=Ib(i.authoredOn)),i.startDate&&(x.start=i.startDate),i.endDate&&(x.end=i.endDate),ho.show({id:hy,title:py,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,x,void 0,{cache:"no-cache",headers:{Accept:p}}),w=`Patient-export-${s}-${new Date().toISOString().replaceAll(":","-")}.${m}`;XY(b,w,p),ho.update({id:hy,title:py,color:"green",message:"Done",icon:a.jsx(gi,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){ho.update({id:hy,title:py,color:"red",message:Ge(b),icon:a.jsx(Qs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(dt,{onSubmit:r,children:a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(Cd,{name:"format",data:[{label:"FHIR Everything",value:"everything"},{label:"Patient Summary",value:"summary"},{label:"C-CDA",value:"ccda"},{label:"C-CDA Referral",value:"ccdaReferral"}],fullWidth:!0})}),a.jsx(Nt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(Ga,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx(Nt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(ai,{name:"authoredOn",placeholder:"Authored on"})}),a.jsx(Nt,{title:"Start Date",description:"The start date of care. If no start date is provided, all records prior to the end date are in scope.",children:a.jsx(ai,{name:"startDate",placeholder:"Start date"})}),a.jsx(Nt,{title:"End Date",description:"The end date of care. If no end date is provided, all records subsequent to the start date are in scope.",children:a.jsx(ai,{name:"endDate",placeholder:"End date"})}),a.jsx(ye,{justify:"right",children:a.jsx(yr,{children:"Request Export"})})]})})}function XY(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),i=new Blob([r],{type:n}),s=window.URL.createObjectURL(i),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=s,c.download=t,c.click(),window.URL.revokeObjectURL(s)}function ZY(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function sP(e){const t=Gt(e.patient);return t?a.jsxs(ht,{children:[a.jsx(ns,{value:t,size:"lg",color:ZY(t)}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Name"}),a.jsx(ht.Value,{children:a.jsx(vt,{to:t,fw:500,children:t.name?a.jsx(Ab,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"DoB"}),a.jsx(ht.Value,{children:t.birthDate})]}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Age"}),a.jsx(ht.Value,{children:eU(t.birthDate)})]})]}),t.gender&&a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Gender"}),a.jsx(ht.Value,{children:t.gender})]}),t.address&&a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"State"}),a.jsx(ht.Value,{children:t.address[0]?.state})]}),t.identifier?.map(n=>a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:n?.system}),a.jsx(ht.Value,{children:n?.value})]},`${n?.system}-${n?.value}`))]}):null}function JY(e){const{patient:t,...n}=e,r=v.useCallback((i,s,c)=>{const d=`${s}/${c}`,f=100;return Promise.allSettled([i.readHistory("Patient",c),i.search("Communication",{subject:d,_count:f}),i.search("Device",{patient:d,_count:f}),i.search("DeviceRequest",{patient:d,_count:f}),i.search("DiagnosticReport",{subject:d,_count:f}),i.search("Media",{subject:d,_count:f}),i.search("ServiceRequest",{subject:d,_count:f}),i.search("Task",{subject:d,_count:f})])},[]);return a.jsx(Sm,{value:t,loadTimelineResources:r,createCommunication:(i,s,c)=>({resourceType:"Communication",status:"completed",subject:qt(i),sender:qt(s),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(i,s,c)=>({resourceType:"Media",status:"completed",subject:qt(i),operator:qt(s),issued:new Date().toISOString(),content:c}),...n})}const eK="_section_pqpwm_1",tK="_hovering_pqpwm_7",ox={section:eK,hovering:tK};function nK(e){const t=Ae(),n=Gt(e.value),[r,i]=v.useState(!1),[s,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){f(void 0)}function x(){c(void 0)}const b=v.useRef(p);if(b.current=p,v.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>i(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(sK(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",x),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",x)}),[n]),!r||!p)return null;function w(j,C){m({...b.current,[j]:C})}return a.jsx("div",{children:a.jsxs(dt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[a.jsx(ze,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>w("title",j.currentTarget.value)}),a.jsx(rK,{actions:p.action||[],selectedKey:s,setSelectedKey:c,hoverKey:d,setHoverKey:f,onChange:j=>w("action",j)}),a.jsx(yr,{children:"Save"})]})})}function rK(e){const t=v.useRef(e.actions);t.current=e.actions;function n(s){e.onChange(t.current.map(c=>c.id===s.id?s:c))}function r(s){e.onChange([...t.current,s]),e.setSelectedKey(s.id)}function i(s){e.onChange(t.current.filter(c=>c!==s))}return a.jsxs(Ue,{gap:"md",className:ox.section,children:[e.actions.map(s=>a.jsx(oK,{action:s,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(s)},s.id)),a.jsx("div",{children:a.jsx(ke,{variant:"outline",onClick:s=>{dn(s),r({id:lP()})},children:"Add action"})})]})}function oK(e){const{action:t}=e,n=aK(t);function r(s){s.stopPropagation(),e.setSelectedKey(e.action.id)}function i(s){dn(s),e.setHoverKey(e.action.id)}return a.jsx("div",{onClick:r,onMouseOver:i,onFocus:i,children:a.jsx(iK,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function iK(e){const{action:t}=e,[n,r]=v.useState(e.actionType),i=e.selectedKey===e.action.id,s=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const d=It(ox.section,{[ox.hovering]:s&&!i});return a.jsxs(mr,{"data-testid":t.id,className:d,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(li,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[a.jsx(ze,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),a.jsx(Ja,{"data-testid":"close-button",onClick:e.onRemove})]}),i&&a.jsxs(Ue,{gap:"xl",p:"md",children:[a.jsx(ce,{children:a.jsx(ze,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),a.jsx(ce,{children:a.jsx(sn,{label:"Type of Action",value:n,onChange:f=>{const p=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(p),e.onChange({...e.action,definitionCanonical:p==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&a.jsxs(Ue,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(De,{fw:600,children:"Select questionnaire"}),a.jsx(De,{c:"red",children:"*"})]}),a.jsxs(De,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",a.jsx(At,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),a.jsx(pT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&a.jsxs(Ue,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(De,{fw:600,children:"Select activity definition"}),a.jsx(De,{c:"red",children:"*"})]}),a.jsxs(De,{size:"sm",c:"dimmed",mb:"sm",children:["ActivityDefinition.kind resource to be shown in the task in Encounter view. You can create new one from"," ",a.jsx(At,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),a.jsx(pT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function pT(e){const{id:t,definitionCanonical:n}=e.action,r=n?.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(sl,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:i=>{i?e.onChange({...e.action,definitionCanonical:Dt(i)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function aK(e){return e.definitionCanonical?.startsWith("Questionnaire")?"questionnaire":e.definitionCanonical?.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let my=1;function lP(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(my=Math.max(my,t+1))}return e}return"id-"+my++}function sK(e){return{...e,action:cP(e.action)}}function cP(e){if(e)return e.map(t=>({...t,id:lP(t.id),action:cP(t.action)}))}const zs=30,tp=50;function np(e){const t=e.formState,n=e.item,r=e.responseItem;function i(g){t&&e.context&&t.onChangeAnswer(e.context,e.item,g)}const s=n.type;if(!s)return null;const c=n.linkId;if(!c)return null;let d;n.initial&&n.initial.length>0?d=n.initial[0]:n.answerOption&&n.answerOption.length>0&&(d=n.answerOption.find(g=>g.initialSelected));const f=Wb(r,e.index)??jb(d),p=pi(r,`${Uo}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(s){case wt.display:m=a.jsx("p",{children:e.item.text},e.item.linkId);break;case wt.boolean:m=a.jsx(BA,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(Dn,{id:e.item.linkId,name:e.item.linkId,required:e.required??n.required,defaultChecked:f?.value,onChange:g=>i([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case wt.decimal:m=a.jsx(ze,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i(g.currentTarget.value===""?[]:[{valueDecimal:g.currentTarget.valueAsNumber}])});break;case wt.integer:m=a.jsx(ze,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i(g.currentTarget.value===""?[]:[{valueInteger:g.currentTarget.valueAsNumber}])});break;case wt.date:m=a.jsx(ze,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i([{valueDate:g.currentTarget.value}])});break;case wt.dateTime:m=a.jsx(ai,{name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i([{valueDateTime:g}])});break;case wt.time:m=a.jsx(ze,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i([{valueTime:g.currentTarget.value}])});break;case wt.string:case wt.url:m=a.jsx(ze,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const x=g.currentTarget.value;i(x===""?[]:[{valueString:x}])}});break;case wt.text:m=a.jsx(rl,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const x=g.currentTarget.value;i(x===""?[]:[{valueString:x}])}});break;case wt.attachment:m=a.jsx(ye,{py:4,children:a.jsx(TA,{path:"",name:c,defaultValue:f?.value,onChange:g=>i([{valueAttachment:g}])})});break;case wt.reference:m=a.jsx(Ga,{name:c,required:e.required??n.required,targetTypes:lA(n),searchCriteria:fF(n,t?.subject,t?.encounter),defaultValue:f?.value,onChange:g=>i([{valueReference:g}])});break;case wt.quantity:m=a.jsx(Ys,{path:"",name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i([{valueQuantity:g}]),disableWheel:!0});break;case wt.choice:case wt.openChoice:pK(n)?m=a.jsx(dK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>i(g)}):hK(n)||n.answerValueSet&&!mK(n)?m=a.jsx(lK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>i(g)}):m=a.jsx(uK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>i(g)});break;default:return null}return a.jsxs(a.Fragment,{children:[m,p?.valueString&&a.jsx(De,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function lK(e){const{name:t,item:n,required:r,initial:i,onChangeAnswer:s,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(Gb,{});const d=jb(i),f=Wb(c)??d,p=fP(c),m=n.repeats||gK(n);if(n.answerValueSet)return a.jsx(gm,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:m?void 0:1,required:r,onChange:g=>{m?g.length===0?s([{}]):s(g.map(x=>({valueCoding:x}))):s([{valueCoding:g[0]}])},defaultValue:f?.value});if(m){const{propertyName:g,data:x}=vK(n);return a.jsx(Hp,{data:x,placeholder:"Select items",searchable:!0,defaultValue:p||[Hs(d)],required:r,onChange:b=>{if(b.length===0)s([{}]);else{const w=aA(b,g,n);s(w)}}})}else{const g=[""];if(n.answerOption)for(const x of n.answerOption){const b=di(x);g.push(Hs(b))}return a.jsx(sn,{id:t,name:t,required:r,onChange:x=>{const b=x.currentTarget.selectedIndex;if(b===0){s([{}]);return}const w=n.answerOption[b-1],j=di(w),C="value"+In(j.type);s([{[C]:j.value}])},defaultValue:Ad(f?.value)||f?.value,data:g})}}function cK(e,t){return e?t.valueSetExpand({url:e,count:zs+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function uP(e){const t=Ae(),[n,r]=v.useState([]),[i,s]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){s(!0);try{const d=await cK(e,t);r(d)}catch(d){console.error("Error loading value set:",d)}finally{s(!1)}}}c().catch(console.error)},[e,t]),[n,i]}function dP(e,t){return e.map((n,r)=>{const i=`${t}-valueset-${r}`,s={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[i,s]})}function uK(e){const{name:t,item:n,required:r,initial:i,onChangeAnswer:s,response:c}=e,d=ts("QuestionnaireItemAnswerOption","value[x]"),f=jb(i),[p,m]=uP(n.answerValueSet),g=[];let x;if(n.answerValueSet)g.push(...dP(p,t));else if(n.answerOption){const C=n.answerOption.slice(0,tp).map((T,E)=>{const R=`${t}-option-${E}`,_=di(T);return _?.value?(f&&Lo(_)===Lo(f)&&(x=R),[R,_]):null}).filter(T=>T!==null);g.push(...C)}const b=Wb(c),w=fK(g,b);if(m)return a.jsx(De,{children:"Loading options..."});if(g.length===0)return a.jsx(Gb,{});const j=g.slice(0,zs);return a.jsxs(a.Fragment,{children:[a.jsx(Fs.Group,{name:t,value:w??x,required:r,onChange:C=>{const T=g.find(E=>E[0]===C);if(T){const E=T[1],R="value"+In(E.type);s([{[R]:E.value}])}},children:j.map(([C,T])=>a.jsx(Fs,{id:C,value:C,py:4,required:r,label:a.jsx($o,{property:d,propertyType:T.type,value:T.value})},C))}),(n.answerValueSet&&g.length>zs||n.answerOption&&g.length>tp)&&a.jsxs(De,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",zs," options"]})]})}function dK(e){const{name:t,item:n,onChangeAnswer:r,response:i}=e,s=ts("QuestionnaireItemAnswerOption","value[x]"),[c,d]=uP(n.answerValueSet),f=n.answerValueSet?(i?.answer?.map(w=>w.valueCoding)||[]).filter(w=>w!==void 0):fP(i),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...dP(c,t));else if(n.answerOption){const w=n.answerOption.slice(0,tp).map((j,C)=>{const T=`${t}-option-${C}`,E=di(j);return E?.value?[T,E]:null}).filter(j=>j!==null);g.push(...w)}if(d)return a.jsx(De,{children:"Loading options..."});if(g.length===0)return a.jsx(Gb,{});const x=g.slice(0,zs),b=(w,j)=>{if(n.answerValueSet){const C=p;let T;j?T=[...C,w.value]:T=C.filter(E=>!ci(E,w.value)),m(T),T.length===0?r([{}]):r(T.map(E=>({valueCoding:E})))}else{const C=p,T=Hs(w);let E;if(j?E=[...C,T]:E=C.filter(R=>R!==T),m(E),E.length===0)r([{}]);else{const R=aA(E,"value"+In(w.type),n);r(R)}}};return a.jsxs(ye,{style:{flexDirection:"column",alignItems:"flex-start"},children:[x.map(([w,j])=>{const C=Hs(j),T=n.answerValueSet?p.some(E=>ci(E,j.value)):p.includes(C);return a.jsx(Dn,{id:w,label:a.jsx($o,{property:s,propertyType:j.type,value:j.value}),checked:T,onChange:E=>b(j,E.currentTarget.checked)},w)}),(n.answerValueSet&&g.length>zs||n.answerOption&&g.length>tp)&&a.jsxs(De,{size:"sm",c:"dimmed",children:["Showing first ",zs," options"]})]})}function Gb(){return a.jsx(ze,{disabled:!0,placeholder:"No Answers Defined"})}function Wb(e,t=0){return di(e?.answer?.[t]??{})}function fP(e){const t=e?.answer;return t?t.map(r=>di(r)).map(r=>Ad(r?.value)||r?.value).filter(Boolean):[]}function fK(e,t){return e.find(n=>ci(n[1].value,t?.value))?.[0]}function Em(e,t){return!!e.extension?.some(n=>n.url===Sb&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function hK(e){return Em(e,"drop-down")}function pK(e){return Em(e,"check-box")}function mK(e){return Em(e,"radio-button")}function gK(e){return Em(e,"multi-select")}function vK(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=di(t),r="value"+In(n.type),i=(e.answerOption??[]).map(s=>{const c=di(s),d=Hs(c);return{value:d,label:d}});return{propertyName:r,data:i}}const yK="_section_my8o4_1",xK="_hovering_my8o4_10",bK="_editing_my8o4_14",SK="_questionBody_my8o4_20",wK="_topActions_my8o4_24",jK="_bottomActions_my8o4_33",CK="_movementActions_my8o4_44",EK="_movementIcons_my8o4_56",TK="_columnAlignment_my8o4_60",RK="_linkIdInput_my8o4_65",_K="_typeSelect_my8o4_70",DK="_preserveBreaks_my8o4_74",Hr={section:yK,hovering:xK,editing:bK,questionBody:SK,topActions:wK,bottomActions:jK,movementActions:CK,movementIcons:EK,columnAlignment:TK,linkIdInput:RK,typeSelect:_K,preserveBreaks:DK};function AK(e){const t=Ae(),n=Gt(e.questionnaire),[r,i]=v.useState(!1),[s,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){m(void 0)}function x(){f(void 0)}v.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>i(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(OK(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",x),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",x)}),[n]);const b=(w,j)=>{c(w),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(w)};return!r||!s?null:a.jsx("div",{children:a.jsxs(dt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[a.jsx(hP,{item:s,selectedKey:d,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),a.jsx(yr,{children:"Save"})]})})}function hP(e){const t=e.item,n=e.item,r=mi(e.item),i=r||n.type===wt.group,s=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,d=e.hoverKey===e.item.id,f=v.useRef(e.item);f.current=e.item;function p(R){dn(R),e.setSelectedKey(e.item.id)}function m(R){dn(R),e.setHoverKey(e.item.id)}function g(R){const _=f.current;e.onChange({..._,item:_.item?.map(P=>P.id===R.id?R:P)})}function x(R,_){e.onChange({...e.item,item:[...e.item.item??[],R]},_)}function b(R){e.onChange({...e.item,item:e.item.item?.filter(_=>_!==R)})}function w(R,_){e.onChange({...f.current,[R]:_})}function j(R){e.onChange({...e.item,...R})}function C(R){e.onChange({...e.item,item:e.item.item?.map(_=>_===R?{..._,repeats:!_.repeats}:_)})}function T(R,_){const P=LK(e.item.item,R,_);e.onChange({...e.item,item:P})}const E=It(Hr.section,{[Hr.editing]:c,[Hr.hovering]:d&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:E,onClick:p,onMouseOver:m,onFocus:m,children:[a.jsx("div",{className:Hr.questionBody,children:c?a.jsxs(a.Fragment,{children:[r&&a.jsx(ze,{size:"xl",defaultValue:t.title,onBlur:R=>w("title",R.currentTarget.value)}),!r&&a.jsx(rl,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:R=>w("text",R.currentTarget.value)}),n.type==="reference"&&a.jsx(NK,{item:n,onChange:j}),nF(n)&&a.jsx(PK,{item:n,onChange:R=>j(R)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(Ie,{children:t.title}),n.text&&a.jsx("div",{className:Hr.preserveBreaks,children:n.text}),!i&&a.jsx(np,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((R,_)=>a.jsx("div",{children:a.jsx(hP,{item:R,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(R),onRepeatable:C,onMoveUp:()=>T(_,-1),onMoveDown:()=>T(_,1)})},R.id)),!i&&a.jsx("div",{className:Hr.topActions,children:c?a.jsxs(a.Fragment,{children:[a.jsx(ze,{size:"xs",className:Hr.linkIdInput,defaultValue:n.linkId,onBlur:R=>w("linkId",R.currentTarget.value)}),!i&&a.jsx(sn,{size:"xs",className:Hr.typeSelect,defaultValue:n.type,onChange:R=>w("type",R.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):a.jsx("div",{children:s})}),!r&&a.jsx(ce,{className:Hr.movementActions,children:a.jsxs(ce,{className:Hr.columnAlignment,children:[!e.isFirst&&a.jsx(At,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(MF,{"data-testid":"up-button",size:15,className:Hr.movementIcons})}),!e.isLast&&a.jsx(At,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(NF,{"data-testid":"down-button",size:15,className:Hr.movementIcons})})]})}),a.jsxs("div",{className:Hr.bottomActions,children:[i&&a.jsxs(a.Fragment,{children:[a.jsx(At,{href:"#",onClick:R=>{R.preventDefault(),x({id:Zs(),linkId:sx("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(At,{href:"#",onClick:R=>{R.preventDefault(),x({id:Zs(),linkId:sx("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(At,{href:"#",onClick:R=>{R.preventDefault(),x(IK(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(At,{href:"#",onClick:R=>{R.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(At,{href:"#",onClick:R=>{R.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function PK(e){const t=ts("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(ze,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(kK,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(ce,{display:"flex",children:[a.jsx(At,{href:"#",onClick:r=>{dn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Zs()}]})},children:"Add choice"}),a.jsx(tm,{w:"lg"}),a.jsx(At,{href:"#",onClick:r=>{dn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function kK(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=ym({type:"QuestionnaireItemAnswerOption",value:t},"value");return a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[a.jsx("div",{children:a.jsx(Md,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(i,s)=>{const c=[...e.options],d=c.findIndex(f=>f.id===t.id);c[d]={id:t.id,[s]:i},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(At,{href:"#",onClick:i=>{dn(i),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function NK(e){const t=lA(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(ye,{children:[a.jsx(Nb,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:i=>{e.onChange(cy(e.item,t.map(s=>s===n?i:s)))}}),a.jsx(At,{href:"#",onClick:i=>{dn(i),e.onChange(cy(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(At,{href:"#",onClick:n=>{dn(n),e.onChange(cy(e.item,[...t,""]))},children:"Add Resource Type"})]})}let ix=1,ax=1;function sx(e){return e+ix++}function Zs(){return"id-"+ax++}function OK(e){return{...e,id:e.id||Zs(),item:pP(e.item)}}function pP(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(ax=Math.max(ax,parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(ix=Math.max(ix,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Zs(),item:pP(t.item),answerOption:MK(t.answerOption)}))}function MK(e){if(e)return e.map(t=>({...t,id:t.id||Zs()}))}function IK(){return{id:Zs(),linkId:sx("s"),type:"group",text:"New Page",extension:[{url:Sb,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function LK(e,t,n){const r=e??[],i=t+n;if(i<0||i>=r.length)return r;const s=[...r];return[s[t],s[i]]=[s[i],s[t]],s}/*!
|
|
547
|
+
* Signature Pad v5.1.0 | https://github.com/szimek/signature_pad
|
|
548
|
+
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
549
|
+
*/var rp=class{x;y;pressure;time;constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}},$K=class mP{constructor(t,n,r,i,s,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=i,this.startWidth=s,this.endWidth=c}static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,i=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new mP(t[1],r,i,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const i=t.x-n.x,s=t.y-n.y,c=n.x-r.x,d=n.y-r.y,f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},p={x:(n.x+r.x)/2,y:(n.y+r.y)/2},m=Math.sqrt(i*i+s*s),g=Math.sqrt(c*c+d*d),x=f.x-p.x,b=f.y-p.y,w=m+g==0?0:g/(m+g),j={x:p.x+x*w,y:p.y+b*w},C=n.x-j.x,T=n.y-j.y;return{c1:new rp(f.x+C,f.y+T),c2:new rp(p.x+C,p.y+T)}}length(){let n=0,r,i;for(let s=0;s<=10;s+=1){const c=s/10,d=this.point(c,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),f=this.point(c,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const p=d-r,m=f-i;n+=Math.sqrt(p*p+m*m)}r=d,i=f}return n}point(t,n,r,i,s){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*i*(1-t)*t*t+s*t*t*t}},zK=class{_et;constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}};function UK(e,t=250){let n=0,r=null,i,s,c;const d=()=>{n=Date.now(),r=null,i=e.apply(s,c),r||(s=null,c=[])};return function(...p){const m=Date.now(),g=t-(m-n);return s=this,c=p,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,i=e.apply(s,c),r||(s=null,c=[])):r||(r=window.setTimeout(d,g)),i}}var BK=class lx extends zK{constructor(t,n={}){super(),this.canvas=t,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=n.throttle??16,this.minDistance=n.minDistance??5,this.dotSize=n.dotSize||0,this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=n.compositeOperation||"source-over",this.canvasContextOptions=n.canvasContextOptions??{},this._strokeMoveUpdate=this.throttle?UK(lx.prototype._strokeUpdate,this.throttle):lx.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}dotSize;minWidth;maxWidth;penColor;minDistance;velocityFilterWeight;compositeOperation;backgroundColor;throttle;canvasContextOptions;_ctx;_drawingStroke=!1;_isEmpty=!0;_dataUrl;_dataUrlOptions;_lastPoints=[];_data=[];_lastVelocity=0;_lastWidth=0;_strokeMoveUpdate;_strokePointerId;clear(){const{_ctx:t,canvas:n}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,n.width,n.height),t.fillRect(0,0,n.width,n.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._dataUrl=void 0,this._dataUrlOptions=void 0,this._strokePointerId=void 0}redraw(){const t=this._data,n=this._dataUrl,r=this._dataUrlOptions;this.clear(),n&&this.fromDataURL(n,r),this.fromData(t,{clear:!1})}fromDataURL(t,n={}){return new Promise((r,i)=>{const s=new Image,c=n.ratio||window.devicePixelRatio||1,d=n.width||this.canvas.width/c,f=n.height||this.canvas.height/c,p=n.xOffset||0,m=n.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,p,m,d,f),r()},s.onerror=g=>{i(g)},s.crossOrigin="anonymous",s.src=t,this._isEmpty=!1,this._dataUrl=t,this._dataUrlOptions={...n}})}toDataURL(t="image/png",n){switch(t){case"image/svg+xml":return typeof n!="object"&&(n=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(n))}`;default:return typeof n!="number"&&(n=void 0),this.canvas.toDataURL(t,n)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){const t=window.document===this.canvas.ownerDocument?window:this.canvas.ownerDocument.defaultView??this.canvas.ownerDocument;return{addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:n=!0}={}){n&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,n){return n?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const n=t.changedTouches[0];return{event:t,type:t.type,x:n.clientX,y:n.clientY,pressure:n.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,n=!1){return typeof this._strokePointerId>"u"?n:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:r}=this._getListenerFunctions();switch(t.event.type){case"mousedown":r("mousemove",this._handleMouseMove,{passive:!1}),r("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":r("touchmove",this._handleTouchMove,{passive:!1}),r("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const i=this._getPointGroupOptions(),s={...i,points:[]};this._data.push(s),this._reset(i),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const n=this._createPoint(t.x,t.y,t.pressure),r=this._data[this._data.length-1],i=r.points,s=i.length>0&&i[i.length-1],c=s?n.distanceTo(s)<=this.minDistance:!1,d=this._getPointGroupOptions(r);if(!s||!(s&&c)){const f=this._addPoint(n,d);s?f&&this._drawCurve(f,d):this._drawDot(n,d),i.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,n=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(n&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,n,r){const i=this.canvas.getBoundingClientRect();return new rp(t-i.left,n-i.top,r,new Date().getTime())}_addPoint(t,n){const{_lastPoints:r}=this;if(r.push(t),r.length>2){r.length===3&&r.unshift(r[0]);const i=this._calculateCurveWidths(r[1],r[2],n),s=$K.fromPoints(r,i);return r.shift(),s}return null}_calculateCurveWidths(t,n,r){const i=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(i,r),c={end:s,start:this._lastWidth};return this._lastVelocity=i,this._lastWidth=s,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const i=this._ctx;i.moveTo(t,n),i.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,i=t.endWidth-t.startWidth,s=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=n.penColor;for(let c=0;c<s;c+=1){const d=c/s,f=d*d,p=f*d,m=1-d,g=m*m,x=g*m;let b=x*t.startPoint.x;b+=3*g*d*t.control1.x,b+=3*m*f*t.control2.x,b+=p*t.endPoint.x;let w=x*t.startPoint.y;w+=3*g*d*t.control1.y,w+=3*m*f*t.control2.y,w+=p*t.endPoint.y;const j=Math.min(t.startWidth+p*i,n.maxWidth);this._drawCurveSegment(b,w,j)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,i=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,i),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const i of t){const{points:s}=i,c=this._getPointGroupOptions(i);if(s.length>1)for(let d=0;d<s.length;d+=1){const f=s[d],p=new rp(f.x,f.y,f.pressure,f.time);d===0&&this._reset(c);const m=this._addPoint(p,c);m&&n(m,c)}else this._reset(c),r(s[0],c)}}toSVG({includeBackgroundColor:t=!1,includeDataUrl:n=!1}={}){const r=this._data,i=Math.max(window.devicePixelRatio||1,1),s=0,c=0,d=this.canvas.width/i,f=this.canvas.height/i,p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),p.setAttribute("viewBox",`${s} ${c} ${d} ${f}`),p.setAttribute("width",d.toString()),p.setAttribute("height",f.toString()),t&&this.backgroundColor){const m=document.createElement("rect");m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("fill",this.backgroundColor),p.appendChild(m)}if(n&&this._dataUrl){const m=this._dataUrlOptions?.ratio||window.devicePixelRatio||1,g=this._dataUrlOptions?.width||this.canvas.width/m,x=this._dataUrlOptions?.height||this.canvas.height/m,b=this._dataUrlOptions?.xOffset||0,w=this._dataUrlOptions?.yOffset||0,j=document.createElement("image");j.setAttribute("x",b.toString()),j.setAttribute("y",w.toString()),j.setAttribute("width",g.toString()),j.setAttribute("height",x.toString()),j.setAttribute("preserveAspectRatio","none"),j.setAttribute("href",this._dataUrl),p.appendChild(j)}return this._fromData(r,(m,{penColor:g})=>{const x=document.createElement("path");if(!isNaN(m.control1.x)&&!isNaN(m.control1.y)&&!isNaN(m.control2.x)&&!isNaN(m.control2.y)){const b=`M ${m.startPoint.x.toFixed(3)},${m.startPoint.y.toFixed(3)} C ${m.control1.x.toFixed(3)},${m.control1.y.toFixed(3)} ${m.control2.x.toFixed(3)},${m.control2.y.toFixed(3)} ${m.endPoint.x.toFixed(3)},${m.endPoint.y.toFixed(3)}`;x.setAttribute("d",b),x.setAttribute("stroke-width",(m.endWidth*2.25).toFixed(3)),x.setAttribute("stroke",g),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),p.appendChild(x)}},(m,{penColor:g,dotSize:x,minWidth:b,maxWidth:w})=>{const j=document.createElement("circle"),C=x>0?x:(b+w)/2;j.setAttribute("r",C.toString()),j.setAttribute("cx",m.x.toString()),j.setAttribute("cy",m.y.toString()),j.setAttribute("fill",g),p.appendChild(j)}),p.outerHTML}};function VK(e){const t=Ae(),{width:n=500,height:r=200,defaultValue:i,who:s,onChange:c,...d}=e,f=v.useRef(null),p=v.useRef(null),m=v.useRef(c);m.current=c,v.useEffect(()=>{function x(){m.current?.({type:[{system:Uo+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:s??qt(t.getProfile()),data:p.current?.toDataURL()})}if(f.current){const b=new BK(f.current);i?.data&&b.fromDataURL(i.data).catch(console.error),b.addEventListener("endStroke",x),p.current=b}return()=>{p.current&&p.current.removeEventListener("beginStroke",x)}},[t,i,s]);const g=()=>{p.current&&p.current.clear(),m.current?.(void 0)};return a.jsxs(mr,{withBorder:!0,p:0,w:n,h:r,pos:"relative",...d,children:[a.jsx("canvas",{ref:f,width:n,height:r,"aria-label":"Signature input area"}),a.jsx(ke,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:a.jsx(mm,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function gP(e){const t=[...e.context,e.responseItem];return a.jsxs("div",{children:[e.item.text&&a.jsx(Ie,{order:3,mb:"md",children:e.item.text}),a.jsx(cx,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function FK(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx(gP,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),a.jsx(At,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function qK(e){const{formState:t,context:n,item:r,responseItem:i}=e,s=r.type!==wt.choice&&r.type!==wt.openChoice,c=i.answer&&i.answer.length>0?i.answer:[{}];return a.jsxs(Nt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[a.jsx(Ue,{gap:"xs",children:c?.map((d,f)=>a.jsx(np,{formState:t,context:n,item:r,responseItem:i,index:f},`${r.linkId}-${f}`))}),s&&a.jsx(At,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function cx(e){const{formState:t,context:n,items:r,responseItems:i}=e;return a.jsx(Ue,{children:r.map((s,c)=>{if(!rF(s,t.questionnaireResponse))return null;if(s.type===wt.display)return a.jsx("p",{children:s.text},`display-${s.id}-${c}`);const d=i.filter(f=>f.linkId===s.linkId);return s.type===wt.group&&s.repeats?a.jsx(FK,{formState:t,context:n,item:s,responseItems:d},`repeating-group-${s.id}-${c}`):s.type===wt.group?a.jsx(gP,{formState:t,context:n,item:s,responseItem:d[0]},`group-${s.id}-${c}`):s.type===wt.boolean?a.jsx(np,{formState:t,context:n,item:s,responseItem:d[0],index:0},`boolean-item-${s.id}-${c}`):s.repeats?a.jsx(qK,{formState:t,context:n,item:s,responseItem:d[0]},`repeating-item-${s.id}-${c}`):a.jsx(Nt,{htmlFor:s.linkId,title:s.text,withAsterisk:s.required,children:a.jsx(np,{formState:t,context:n,item:s,responseItem:d[0],index:0})},`repeating-item-${s.id}-${c}`)})})}function HK(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:i}=e,s=t.pages,c=t.activePage,d=c>0,f=c<s.length-1,p=c===s.length-1;return a.jsxs(a.Fragment,{children:[a.jsx(bc,{active:c,allowNextStepsSelect:!1,p:6,children:s.map((m,g)=>a.jsx(bc.Step,{label:m.title,children:g===c&&i},m.linkId))}),!r&&a.jsxs(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:[d&&a.jsx(ke,{onClick:t.onPrevPage,children:"Back"}),f&&a.jsx(ke,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),p&&a.jsx(yr,{children:n??"Submit"})]})]})}function vP(e){const t=Ae(),[n,r]=v.useState(!1),i=v.useRef(e);i.current=e;const s=v.useCallback(g=>{r(!1),i.current.onChange?.(g)},[]),c=gF({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:s}),d=v.useRef(c);d.current=c;const f=v.useMemo(()=>c.loading?!1:!!pi(c.questionnaire,tF),[c]),p=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===Th),[c]),m=v.useCallback(()=>{const g=d.current;if(g.loading)return;const x=i.current.onSubmit;if(!x)return;if(f&&!p){r(!0);return}const b=g.questionnaire,w=g.questionnaireResponse,j=i.current.subject;let C=i.current.source;if(!C){const T=t.getProfile();T&&(C=qt(T))}x({...w,questionnaire:b.url??Dt(b),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,p]);return c.loading?null:a.jsxs(dt,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&a.jsx(Ie,{children:c.questionnaire.title}),c.pagination?a.jsx(HK,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(cx,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(cx,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs(Ue,{mt:"md",gap:0,children:[a.jsx(De,{size:"sm",fw:500,children:"Signature"}),a.jsx(VK,{onChange:c.onChangeSignature}),!p&&n&&a.jsx(De,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(yr,{children:e.submitButtonText??"Submit"})})]})]})}const GK="_section_4m5it_1",WK={section:GK},QK=["gender","age","gestationalAge","context","appliesTo","category"],YK={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function KK(e){e=Object.assign(YK,e);const t=e.definition,[n,r]=v.useState([]),[i,s]=v.useState(1),[c,d]=v.useState(1);return v.useEffect(()=>{const w=JK(t,d);r(eX(w.qualifiedInterval||[],s))},[t]),a.jsxs(dt,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx(Ue,{children:n.map(w=>a.jsx(XK,{unit:nX(t.quantitativeDetails?.unit),onChange:g,onAdd:x,onRemove:b,onRemoveGroup:m,intervalGroup:w},`group-${w.id}`))}),a.jsx(bn,{title:"Add Group",variant:"subtle",size:"sm",onClick:w=>{dn(w),p({id:`group-id-${i}`,filters:{},intervals:[]}),s(j=>j+1)},children:a.jsx(Kh,{})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yr,{children:"Save"})})]});function f(){const w=n.flatMap(j=>j.intervals).filter(j=>!rX(j));e.onSubmit({...t,qualifiedInterval:w})}function p(w){r(j=>[...j,w])}function m(w){r(j=>j.filter(C=>C.id!==w.id))}function g(w,j){r(C=>{C=[...C];const T=C.find(R=>R.id===w),E=T?.intervals.findIndex(R=>R.id===j.id);return E!==void 0&&T?.intervals[E]&&(T.intervals[E]=j),C})}function x(w,j){j.id===void 0&&(j.id=`id-${c}`,d(C=>C+1)),r(C=>{C=[...C];const T=C.findIndex(E=>E.id===w);if(T!==-1){const E={...C[T]};j={...j,...E.filters},E.intervals=[...E.intervals,j],C[T]=E}return C})}function b(w,j){r(C=>{C=[...C];const T=C.find(E=>E.id===w);return T&&(T.intervals=T.intervals.filter(E=>E.id!==j.id)),C})}}function XK(e){const{intervalGroup:t,unit:n}=e;return a.jsx(Od,{"data-testid":t.id,className:WK.section,children:a.jsxs(Ue,{gap:"lg",children:[a.jsx(ye,{justify:"flex-end",children:a.jsx(bn,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{dn(r),e.onRemoveGroup(t)},children:a.jsx(Yh,{})},`remove-group-button-${t.id}`)}),a.jsx(ZK,{intervalGroup:t,onChange:e.onChange}),a.jsx(yn,{}),t.intervals.map(r=>a.jsxs(Ue,{gap:"xs",children:[a.jsxs(ye,{children:[a.jsx(ze,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:i=>{dn(i),e.onChange(t.id,{...r,condition:i.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(bn,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:i=>{dn(i),e.onRemove(t.id,r)},children:a.jsx(Yh,{})},`remove-interval-${r.id}`)]}),a.jsx(Lb,{path:"",onChange:i=>{e.onChange(t.id,{...r,range:i})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(bn,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{dn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(Kh,{})})]})})}function ZK(e){const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const r of["low","high"])t.filters.age[r]?.unit||(t.filters.age[r]={...t.filters.age[r],unit:"years",system:"http://unitsofmeasure.org"});return a.jsxs(Ue,{style:{maxWidth:"50%"},children:[a.jsx(ye,{children:a.jsx(sn,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:r=>{for(const i of t.intervals){let s=r.currentTarget.value;s===""&&(s=void 0),n(t.id,{...i,gender:s})}}})}),a.jsxs(ye,{gap:"xs",children:[a.jsx(De,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(Lb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:r=>{for(const i of t.intervals)n(t.id,{...i,age:r})}},`age-${t.id}`)})]}),a.jsx(sn,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:t.filters.context?.text||"",onChange:r=>{for(const i of t.intervals){let s=r.currentTarget.value;s===""?(s=void 0,n(t.id,{...i,context:void 0})):n(t.id,{...i,context:{text:s,coding:[{code:s,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(sn,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:r=>{for(const i of t.intervals){const s=r.currentTarget.value;s===""?n(t.id,{...i,category:void 0}):n(t.id,{...i,category:s})}}})]})}function JK(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(i=>{const s=parseInt(i.id?.substring(3)||"",10);return isNaN(s)?Number.NEGATIVE_INFINITY:s}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(i=>({...i,id:i.id||`id-${r++}`}))},t(r),e}function eX(e,t){let n=1;const r={};for(const i of e){const s=tX(i);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(QK.map(c=>[c,i[c]])),intervals:[]}),r[s].intervals.push(i)}return t(n),Object.values(r)}function tX(e){return[`gender=${e.gender}`,`age=${id(e.age)}`,`gestationalAge=${id(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function nX(e){return e&&(dU(e,"http://unitsofmeasure.org")||e.text)}function rX(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function oX(e){const t=Ae(),n=Gt(e.value),[r,i]=v.useState(!1),[s,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(d(n)).then(c).catch(console.log),i(!0))},[t,n,r]),!n||!s)return null;return a.jsx(ir,{children:n.action?.map((p,m)=>{const g=p.resource&&f(p.resource),x=g?.input?.[0]?.valueReference,b=g?.output?.[0]?.valueReference;return a.jsxs(v.Fragment,{children:[a.jsx(ir.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(tq,{}):a.jsx(yH,{color:"gray"})}),a.jsxs(ir.Col,{span:9,p:"xs",children:[a.jsx(De,{fw:500,children:p.title}),p.description&&a.jsx("div",{children:p.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(ll,{value:g?.meta?.author})," on ",sr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(bm,{status:g?.status||"unknown"})]})]}),a.jsxs(ir.Col,{span:2,p:"md",children:[x&&!b&&a.jsx(ke,{onClick:()=>e.onStart(g,x),children:"Start"}),x&&b&&a.jsx(ke,{onClick:()=>e.onEdit(g,x,b),children:"Edit"})]})]},`action-${m}`)})});function d(p){const m=[];if(p.action)for(const g of p.action)g.resource?.reference&&m.push({request:{method:"GET",url:g.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function f(p){for(const m of s?.entry??[])if(m.resource&&p.reference===Dt(m.resource))return m.resource}}function yP(e,t){const n=iX(e,t);return aX(n,e,t)}function iX(e,t){const n=e.length,r=t.length,i=n+r+1,s=1+2*i,c=s/2|0,d=new Array(s);d[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<i;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,x=m-1,b=d[g],w=d[x];let j,C=0;p===-f||p!==f&&w.i<b.i?(C=b.i,j=b):(C=w.i+1,j=w),d[x]=void 0;let T=C-p,E={i:C,j:T,prev:sX(j),snake:!1};for(;C<n&&T<r&&e[C]===t[T];)C++,T++;if(C>E.i&&(E={i:C,j:T,prev:E,snake:!0}),d[m]=E,C>=n&&T>=r)return d[m]}d[c+f-1]=void 0}}function aX(e,t,n){const r=[];let i=e;for(i.snake&&(i=i.prev);i?.prev&&i.prev.j>=0;){const s=i.i,c=i.j;i=i.prev;const d=i.i,f=i.j,p={position:d,lines:t.slice(d,s)},m={position:f,lines:n.slice(f,c)};let g;p.lines.length===0&&m.lines.length>0?g="insert":p.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:p,revised:m,type:g}),i.snake&&(i=i.prev)}return r}function sX(e){return e&&!e.snake&&e.prev?e.prev:e}function lX(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:Lo(r.resource,!0).match(/[^\r\n]+/g)})).sort((r,i)=>r.meta.lastUpdated.localeCompare(i.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return cX(n,t),uX(n),n}function cX(e,t){for(let n=1;n<t.length;n++){const r=yP(t[n-1].lines,t[n].lines);for(const i of r){const s=i.original.position,c=i.original.lines,d=i.revised.lines;if((i.type==="delete"||i.type==="change")&&e.splice(s,c.length),i.type==="insert"||i.type==="change")for(let f=0;f<i.revised.lines.length;f++)e.splice(s+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:d[f],span:1})}}}function uX(e){let t=0;for(;t<e.length;){let n=t;for(;n<e.length&&e[n].id===e[t].id;)e[n].span=-1,n++;e[t].span=n-t,t=n}}const dX="_container_1tyf3_1",fX="_root_1tyf3_5",hX="_startRow_1tyf3_20",pX="_normalRow_1tyf3_25",mX="_author_1tyf3_30",gX="_dateTime_1tyf3_34",vX="_lineNumber_1tyf3_40",yX="_line_1tyf3_40",xX="_pre_1tyf3_55",Vi={container:dX,root:fX,startRow:hX,normalRow:pX,author:mX,dateTime:gX,lineNumber:vX,line:yX,pre:xX};function bX(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function SX(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return rc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return rc(r,"month");const i=Math.floor(t/86400);if(i>0)return rc(i,"day");const s=Math.floor(t/3600);if(s>0)return rc(s,"hour");const c=Math.floor(t/60);return c>0?rc(c,"minute"):rc(t,"second")}function rc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function wX(e){const t=Ae(),[n,r]=v.useState(e.history);if(v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return a.jsx("div",{children:"Loading..."});const i=n.entry?.[0]?.resource;if(!i)return null;const s=lX(n);return a.jsx("div",{className:Vi.container,children:a.jsx("table",{className:Vi.root,children:a.jsx("tbody",{children:s.map((c,d)=>a.jsxs("tr",{className:c.span>0?Vi.startRow:Vi.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:Vi.author,rowSpan:c.span,children:a.jsx(ll,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:Vi.dateTime,rowSpan:c.span,children:a.jsx(vt,{to:bX(i,c.meta.versionId),fz:"xs",children:SX(c.meta.lastUpdated)})})]}),a.jsx("td",{className:Vi.lineNumber,children:d+1}),a.jsx("td",{className:Vi.line,children:a.jsx("pre",{className:Vi.pre,children:c.value})})]},"row-"+d))})})})}const jX="_removed_el5zk_1",CX="_added_el5zk_6",mT={removed:jX,added:CX};function EX(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Lo(t,!0).match(/[^\r\n]+/g),i=Lo(n,!0).match(/[^\r\n]+/g),s=yP(r,i);return a.jsx("pre",{style:{color:"gray"},children:s.map((c,d)=>a.jsx(TX,{delta:c},"delta"+d))})}function TX(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:mT.removed,children:e.delta.original.lines.join(`
|
|
550
|
+
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:mT.added,children:e.delta.revised.lines.join(`
|
|
551
|
+
`)}),"...",a.jsx("br",{})]})}const RX="_splitButton_1i0gi_1",_X="_menuControl_1i0gi_6",gT={splitButton:RX,menuControl:_X};function op(e){const{outcome:t}=e,n=Ae(),r=Gt(e.defaultValue),i=r?.resourceType,[s,c]=v.useState(!1),[d,f]=v.useState(),p=n.getAccessPolicy(),m=Sn();v.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const w=Ic(b);if(w){c(!0);const j=MV(r,w);f(j)}else console.error(`Schema not found for ${b}`)}).catch(w=>{console.error("Error in requestProfileSchema",w)})}else n.requestSchema(i).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,i,e.profileUrl]);const g=v.useMemo(()=>r&&qD(r,Is.READ,p),[p,r]),x=v.useMemo(()=>n.isSuperAdmin()||!p||!Tn(d?.resourceType)?!0:LB(p,d?.resourceType),[n,p,d?.resourceType]);return!s||!d?a.jsx("div",{children:"Loading..."}):x?a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(d)},children:[a.jsxs(Ue,{mb:"xl",children:[a.jsx(Nt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(ze,{name:"resourceType",defaultValue:d.resourceType,disabled:!0})}),a.jsx(Nt,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(ze,{name:"id",defaultValue:d.id,disabled:!0})})]}),a.jsx(Ub,{path:d.resourceType,valuePath:d.resourceType,typeName:i,defaultValue:d,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),a.jsxs(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[a.jsx(ke,{type:"submit",className:It((e.onPatch||e.onDelete)&&gT.splitButton),children:r?.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&a.jsxs(Ce,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[a.jsx(Ce.Target,{children:a.jsx(bn,{variant:"filled",color:m.primaryColor,size:36,className:gT.menuControl,"aria-label":"More actions",children:a.jsx(Eb,{size:14,stroke:1.5})})}),a.jsxs(Ce.Dropdown,{children:[e.onPatch&&a.jsx(Ce.Item,{leftSection:a.jsx(mA,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(d)},children:"Patch"}),e.onDelete&&a.jsx(Ce.Item,{color:"red",leftSection:a.jsx(mm,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(d)},children:"Delete"})]})]})]})]}):a.jsxs(ra,{color:"red",title:"Permission denied",icon:a.jsx(al,{}),children:["Your access level prevents you from editing and creating ",d.resourceType," resources."]})}function DX(e){const t=Ae(),[n,r]=v.useState(e.history);return v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?a.jsxs(ve,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(ve.Thead,{children:a.jsxs(ve.Tr,{children:[a.jsx(ve.Th,{children:"Author"}),a.jsx(ve.Th,{children:"Date"}),a.jsx(ve.Th,{children:"Version"})]})}),a.jsx(ve.Tbody,{children:n.entry?.map((i,s)=>a.jsx(AX,{entry:i},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function AX(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:a.jsx(dc,{value:n.meta?.author,link:!0})}),a.jsx(ve.Td,{children:sr(n.meta?.lastUpdated)}),a.jsx(ve.Td,{children:a.jsx(vt,{to:PX(n),children:n.meta?.versionId})})]}):a.jsx(ve.Tr,{children:a.jsx(ve.Td,{colSpan:3,children:Ge(t?.outcome)})})}function PX(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function kX(e){const{serviceRequest:t,...n}=e;return a.jsx(Sm,{value:t,loadTimelineResources:async(r,i,s)=>{const c=`${i}/${s}`,d=100;return Promise.allSettled([r.readHistory("ServiceRequest",s),r.search("Communication",{"based-on":c,_count:d}),r.search("DiagnosticReport",{"based-on":c,_count:d}),r.search("Media",{"based-on":c,_count:d}),r.search("DocumentReference",{related:c,_count:d}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:d})])},createCommunication:(r,i,s)=>({resourceType:"Communication",status:"completed",basedOn:[qt(r)],subject:r.subject,sender:qt(i),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,i,s)=>({resourceType:"Media",status:"completed",basedOn:[qt(r)],subject:r.subject,operator:qt(i),issued:new Date().toISOString(),content:s}),...n})}function NX(e){const t=Ae(),{client:n,patient:r,encounter:i,children:s,...c}=e;function d(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:i}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",cb(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),window.location.assign(p.toString())}).catch(f=>Ne({color:"red",message:Ge(f),autoClose:!1}))}return a.jsx(At,{onClick:()=>d(),...c,children:s})}var gy={exports:{}},zu={},vy={exports:{}},yy={};/**
|
|
552
|
+
* @license React
|
|
553
|
+
* scheduler.production.js
|
|
554
|
+
*
|
|
555
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
556
|
+
*
|
|
557
|
+
* This source code is licensed under the MIT license found in the
|
|
558
|
+
* LICENSE file in the root directory of this source tree.
|
|
559
|
+
*/var vT;function OX(){return vT||(vT=1,(function(e){function t(O,L){var $=O.length;O.push(L);e:for(;0<$;){var H=$-1>>>1,M=O[H];if(0<i(M,L))O[H]=L,O[$]=M,$=H;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var L=O[0],$=O.pop();if($!==L){O[0]=$;e:for(var H=0,M=O.length,F=M>>>1;H<F;){var te=2*(H+1)-1,ae=O[te],je=te+1,xe=O[je];if(0>i(ae,$))je<M&&0>i(xe,ae)?(O[H]=xe,O[je]=$,H=je):(O[H]=ae,O[te]=$,H=te);else if(je<M&&0>i(xe,$))O[H]=xe,O[je]=$,H=je;else break e}}return L}function i(O,L){var $=O.sortIndex-L.sortIndex;return $!==0?$:O.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],p=[],m=1,g=null,x=3,b=!1,w=!1,j=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function _(O){for(var L=n(p);L!==null;){if(L.callback===null)r(p);else if(L.startTime<=O)r(p),L.sortIndex=L.expirationTime,t(f,L);else break;L=n(p)}}function P(O){if(j=!1,_(O),!w)if(n(f)!==null)w=!0,A||(A=!0,K());else{var L=n(p);L!==null&&W(P,L.startTime-O)}}var A=!1,k=-1,I=5,B=-1;function q(){return C?!0:!(e.unstable_now()-B<I)}function Z(){if(C=!1,A){var O=e.unstable_now();B=O;var L=!0;try{e:{w=!1,j&&(j=!1,E(k),k=-1),b=!0;var $=x;try{t:{for(_(O),g=n(f);g!==null&&!(g.expirationTime>O&&q());){var H=g.callback;if(typeof H=="function"){g.callback=null,x=g.priorityLevel;var M=H(g.expirationTime<=O);if(O=e.unstable_now(),typeof M=="function"){g.callback=M,_(O),L=!0;break t}g===n(f)&&r(f),_(O)}else r(f);g=n(f)}if(g!==null)L=!0;else{var F=n(p);F!==null&&W(P,F.startTime-O),L=!1}}break e}finally{g=null,x=$,b=!1}L=void 0}}finally{L?K():A=!1}}}var K;if(typeof R=="function")K=function(){R(Z)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,V=Q.port2;Q.port1.onmessage=Z,K=function(){V.postMessage(null)}}else K=function(){T(Z,0)};function W(O,L){k=T(function(){O(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(O){switch(x){case 1:case 2:case 3:var L=3;break;default:L=x}var $=x;x=L;try{return O()}finally{x=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,L){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var $=x;x=O;try{return L()}finally{x=$}},e.unstable_scheduleCallback=function(O,L,$){var H=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?H+$:H):$=H,O){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=$+M,O={id:m++,callback:L,priorityLevel:O,startTime:$,expirationTime:M,sortIndex:-1},$>H?(O.sortIndex=$,t(p,O),n(f)===null&&O===n(p)&&(j?(E(k),k=-1):j=!0,W(P,$-H))):(O.sortIndex=M,t(f,O),w||b||(w=!0,A||(A=!0,K()))),O},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(O){var L=x;return function(){var $=x;x=L;try{return O.apply(this,arguments)}finally{x=$}}}})(yy)),yy}var yT;function MX(){return yT||(yT=1,vy.exports=OX()),vy.exports}/**
|
|
560
|
+
* @license React
|
|
561
|
+
* react-dom-client.production.js
|
|
562
|
+
*
|
|
563
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
564
|
+
*
|
|
565
|
+
* This source code is licensed under the MIT license found in the
|
|
566
|
+
* LICENSE file in the root directory of this source tree.
|
|
567
|
+
*/var xT;function IX(){if(xT)return zu;xT=1;var e=MX(),t=wx(),n=zR();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var l=o,u=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(u=l.return),o=l.return;while(o)}return l.tag===3?u:null}function c(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function d(o){if(s(o)!==o)throw Error(r(188))}function f(o){var l=o.alternate;if(!l){if(l=s(o),l===null)throw Error(r(188));return l!==o?null:o}for(var u=o,h=l;;){var y=u.return;if(y===null)break;var S=y.alternate;if(S===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===u)return d(y),o;if(S===h)return d(y),l;S=S.sibling}throw Error(r(188))}if(u.return!==h.return)u=y,h=S;else{for(var D=!1,N=y.child;N;){if(N===u){D=!0,u=y,h=S;break}if(N===h){D=!0,h=y,u=S;break}N=N.sibling}if(!D){for(N=S.child;N;){if(N===u){D=!0,u=S,h=y;break}if(N===h){D=!0,h=S,u=y;break}N=N.sibling}if(!D)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?o:l}function p(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=p(o),l!==null)return l;o=o.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function K(o){return o===null||typeof o!="object"?null:(o=Z&&o[Z]||o["@@iterator"],typeof o=="function"?o:null)}var Q=Symbol.for("react.client.reference");function V(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===Q?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case w:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case R:return(o.displayName||"Context")+".Provider";case E:return(o._context.displayName||"Context")+".Consumer";case _:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case k:return l=o.displayName||null,l!==null?l:V(o.type)||"Memo";case I:l=o._payload,o=o._init;try{return V(o(l))}catch{}}return null}var W=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},H=[],M=-1;function F(o){return{current:o}}function te(o){0>M||(o.current=H[M],H[M]=null,M--)}function ae(o,l){M++,H[M]=o.current,o.current=l}var je=F(null),xe=F(null),we=F(null),We=F(null);function Ee(o,l){switch(ae(we,l),ae(xe,o),ae(je,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?gj(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=gj(l),o=vj(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}te(je),ae(je,o)}function ot(){te(je),te(xe),te(we)}function tt(o){o.memoizedState!==null&&ae(We,o);var l=je.current,u=vj(l,o.type);l!==u&&(ae(xe,o),ae(je,u))}function Ct(o){xe.current===o&&(te(je),te(xe)),We.current===o&&(te(We),_u._currentValue=$)}var Ot=Object.prototype.hasOwnProperty,Mt=e.unstable_scheduleCallback,pt=e.unstable_cancelCallback,Rt=e.unstable_shouldYield,tn=e.unstable_requestPaint,Re=e.unstable_now,Pe=e.unstable_getCurrentPriorityLevel,Ke=e.unstable_ImmediatePriority,_e=e.unstable_UserBlockingPriority,he=e.unstable_NormalPriority,Se=e.unstable_LowPriority,$e=e.unstable_IdlePriority,be=e.log,Oe=e.unstable_setDisableYieldValue,_t=null,bt=null;function nn(o){if(typeof be=="function"&&Oe(o),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(_t,o)}catch{}}var Lt=Math.clz32?Math.clz32:Vo,Ln=Math.log,An=Math.LN2;function Vo(o){return o>>>=0,o===0?32:31-(Ln(o)/An|0)|0}var Eo=256,yi=4194304;function Ir(o){var l=o&42;if(l!==0)return l;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function xi(o,l,u){var h=o.pendingLanes;if(h===0)return 0;var y=0,S=o.suspendedLanes,D=o.pingedLanes;o=o.warmLanes;var N=h&134217727;return N!==0?(h=N&~S,h!==0?y=Ir(h):(D&=N,D!==0?y=Ir(D):u||(u=N&~o,u!==0&&(y=Ir(u))))):(N=h&~S,N!==0?y=Ir(N):D!==0?y=Ir(D):u||(u=h&~o,u!==0&&(y=Ir(u)))),y===0?0:l!==0&&l!==y&&(l&S)===0&&(S=y&-y,u=l&-l,S>=u||S===32&&(u&4194048)!==0)?l:y}function Zr(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function fl(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bi(){var o=Eo;return Eo<<=1,(Eo&4194048)===0&&(Eo=256),o}function ca(){var o=yi;return yi<<=1,(yi&62914560)===0&&(yi=4194304),o}function Fo(o){for(var l=[],u=0;31>u;u++)l.push(o);return l}function br(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Hn(o,l,u,h,y,S){var D=o.pendingLanes;o.pendingLanes=u,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=u,o.entangledLanes&=u,o.errorRecoveryDisabledLanes&=u,o.shellSuspendCounter=0;var N=o.entanglements,z=o.expirationTimes,ee=o.hiddenUpdates;for(u=D&~u;0<u;){var de=31-Lt(u),pe=1<<de;N[de]=0,z[de]=-1;var ne=ee[de];if(ne!==null)for(ee[de]=null,de=0;de<ne.length;de++){var ie=ne[de];ie!==null&&(ie.lane&=-536870913)}u&=~pe}h!==0&&Si(o,h,0),S!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=S&~(D&~l))}function Si(o,l,u){o.pendingLanes|=l,o.suspendedLanes&=~l;var h=31-Lt(l);o.entangledLanes|=l,o.entanglements[h]=o.entanglements[h]|1073741824|u&4194090}function ua(o,l){var u=o.entangledLanes|=l;for(o=o.entanglements;u;){var h=31-Lt(u),y=1<<h;y&l|o[h]&l&&(o[h]|=l),u&=~y}}function is(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function as(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function U(){var o=L.p;return o!==0?o:(o=window.event,o===void 0?32:Ij(o.type))}function X(o,l){var u=L.p;try{return L.p=o,l()}finally{L.p=u}}var oe=Math.random().toString(36).slice(2),me="__reactFiber$"+oe,Te="__reactProps$"+oe,Ve="__reactContainer$"+oe,Qe="__reactEvents$"+oe,Fe="__reactListeners$"+oe,Ze="__reactHandles$"+oe,rt="__reactResources$"+oe,qe="__reactMarker$"+oe;function Ye(o){delete o[me],delete o[Te],delete o[Qe],delete o[Fe],delete o[Ze]}function ft(o){var l=o[me];if(l)return l;for(var u=o.parentNode;u;){if(l=u[Ve]||u[me]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(o=Sj(o);o!==null;){if(u=o[me])return u;o=Sj(o)}return l}o=u,u=o.parentNode}return null}function Je(o){if(o=o[me]||o[Ve]){var l=o.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return o}return null}function Kt(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function gn(o){var l=o[rt];return l||(l=o[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function mt(o){o[qe]=!0}var Xt=new Set,qo={};function Lr(o,l){cr(o,l),cr(o+"Capture",l)}function cr(o,l){for(qo[o]=l,o=0;o<l.length;o++)Xt.add(l[o])}var Jr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),hl={},da={};function wi(o){return Ot.call(da,o)?!0:Ot.call(hl,o)?!1:Jr.test(o)?da[o]=!0:(hl[o]=!0,!1)}function ji(o,l,u){if(wi(l))if(u===null)o.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+u)}}function Ci(o,l,u){if(u===null)o.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+u)}}function gt(o,l,u,h){if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttributeNS(l,u,""+h)}}var $n,Ei;function Sr(o){if($n===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);$n=l&&l[1]||"",Ei=-1<u.stack.indexOf(`
|
|
568
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
569
|
+
`+$n+o+Ei}var jn=!1;function fa(o,l){if(!o||jn)return"";jn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ie){var ne=ie}Reflect.construct(o,[],pe)}else{try{pe.call()}catch(ie){ne=ie}o.call(pe.prototype)}}else{try{throw Error()}catch(ie){ne=ie}(pe=o())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ie){if(ie&&ne&&typeof ie.stack=="string")return[ie.stack,ne.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=h.DetermineComponentFrameRoot(),D=S[0],N=S[1];if(D&&N){var z=D.split(`
|
|
570
|
+
`),ee=N.split(`
|
|
571
|
+
`);for(y=h=0;h<z.length&&!z[h].includes("DetermineComponentFrameRoot");)h++;for(;y<ee.length&&!ee[y].includes("DetermineComponentFrameRoot");)y++;if(h===z.length||y===ee.length)for(h=z.length-1,y=ee.length-1;1<=h&&0<=y&&z[h]!==ee[y];)y--;for(;1<=h&&0<=y;h--,y--)if(z[h]!==ee[y]){if(h!==1||y!==1)do if(h--,y--,0>y||z[h]!==ee[y]){var de=`
|
|
572
|
+
`+z[h].replace(" at new "," at ");return o.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",o.displayName)),de}while(1<=h&&0<=y);break}}}finally{jn=!1,Error.prepareStackTrace=u}return(u=o?o.displayName||o.name:"")?Sr(u):""}function Vd(o){switch(o.tag){case 26:case 27:case 5:return Sr(o.type);case 16:return Sr("Lazy");case 13:return Sr("Suspense");case 19:return Sr("SuspenseList");case 0:case 15:return fa(o.type,!1);case 11:return fa(o.type.render,!1);case 1:return fa(o.type,!0);case 31:return Sr("Activity");default:return""}}function Fd(o){try{var l="";do l+=Vd(o),o=o.return;while(o);return l}catch(u){return`
|
|
573
|
+
Error generating stack: `+u.message+`
|
|
574
|
+
`+u.stack}}function eo(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function dS(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function hk(o){var l=dS(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),h=""+o[l];if(!o.hasOwnProperty(l)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,S=u.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return y.call(this)},set:function(D){h=""+D,S.call(this,D)}}),Object.defineProperty(o,l,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(D){h=""+D},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function qd(o){o._valueTracker||(o._valueTracker=hk(o))}function fS(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return o&&(h=dS(o)?o.checked?"true":"false":o.value),o=h,o!==u?(l.setValue(o),!0):!1}function Hd(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var pk=/[\n"\\]/g;function to(o){return o.replace(pk,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Dm(o,l,u,h,y,S,D,N){o.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?o.type=D:o.removeAttribute("type"),l!=null?D==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+eo(l)):o.value!==""+eo(l)&&(o.value=""+eo(l)):D!=="submit"&&D!=="reset"||o.removeAttribute("value"),l!=null?Am(o,D,eo(l)):u!=null?Am(o,D,eo(u)):h!=null&&o.removeAttribute("value"),y==null&&S!=null&&(o.defaultChecked=!!S),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?o.name=""+eo(N):o.removeAttribute("name")}function hS(o,l,u,h,y,S,D,N){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(o.type=S),l!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||l!=null))return;u=u!=null?""+eo(u):"",l=l!=null?""+eo(l):u,N||l===o.value||(o.value=l),o.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=N?o.checked:!!h,o.defaultChecked=!!h,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(o.name=D)}function Am(o,l,u){l==="number"&&Hd(o.ownerDocument)===o||o.defaultValue===""+u||(o.defaultValue=""+u)}function pl(o,l,u,h){if(o=o.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<o.length;u++)y=l.hasOwnProperty("$"+o[u].value),o[u].selected!==y&&(o[u].selected=y),y&&h&&(o[u].defaultSelected=!0)}else{for(u=""+eo(u),l=null,y=0;y<o.length;y++){if(o[y].value===u){o[y].selected=!0,h&&(o[y].defaultSelected=!0);return}l!==null||o[y].disabled||(l=o[y])}l!==null&&(l.selected=!0)}}function pS(o,l,u){if(l!=null&&(l=""+eo(l),l!==o.value&&(o.value=l),u==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=u!=null?""+eo(u):""}function mS(o,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(r(92));if(W(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=eo(l),o.defaultValue=u,h=o.textContent,h===u&&h!==""&&h!==null&&(o.value=h)}function ml(o,l){if(l){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=l;return}}o.textContent=l}var mk=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gS(o,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":h?o.setProperty(l,u):typeof u!="number"||u===0||mk.has(l)?l==="float"?o.cssFloat=u:o[l]=(""+u).trim():o[l]=u+"px"}function vS(o,l,u){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?o.setProperty(h,""):h==="float"?o.cssFloat="":o[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&u[y]!==h&&gS(o,y,h)}else for(var S in l)l.hasOwnProperty(S)&&gS(o,S,l[S])}function Pm(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gk=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vk=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Gd(o){return vk.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}var km=null;function Nm(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var gl=null,vl=null;function yS(o){var l=Je(o);if(l&&(o=l.stateNode)){var u=o[Te]||null;e:switch(o=l.stateNode,l.type){case"input":if(Dm(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+to(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==o&&h.form===o.form){var y=h[Te]||null;if(!y)throw Error(r(90));Dm(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===o.form&&fS(h)}break e;case"textarea":pS(o,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&pl(o,!!u.multiple,l,!1)}}}var Om=!1;function xS(o,l,u){if(Om)return o(l,u);Om=!0;try{var h=o(l);return h}finally{if(Om=!1,(gl!==null||vl!==null)&&(kf(),gl&&(l=gl,o=vl,vl=gl=null,yS(l),o)))for(l=0;l<o.length;l++)yS(o[l])}}function Bc(o,l){var u=o.stateNode;if(u===null)return null;var h=u[Te]||null;if(h===null)return null;u=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(u&&typeof u!="function")throw Error(r(231,l,typeof u));return u}var Ti=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mm=!1;if(Ti)try{var Vc={};Object.defineProperty(Vc,"passive",{get:function(){Mm=!0}}),window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch{Mm=!1}var ha=null,Im=null,Wd=null;function bS(){if(Wd)return Wd;var o,l=Im,u=l.length,h,y="value"in ha?ha.value:ha.textContent,S=y.length;for(o=0;o<u&&l[o]===y[o];o++);var D=u-o;for(h=1;h<=D&&l[u-h]===y[S-h];h++);return Wd=y.slice(o,1<h?1-h:void 0)}function Qd(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Yd(){return!0}function SS(){return!1}function wr(o){function l(u,h,y,S,D){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=S,this.target=D,this.currentTarget=null;for(var N in o)o.hasOwnProperty(N)&&(u=o[N],this[N]=u?u(S):S[N]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Yd:SS,this.isPropagationStopped=SS,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Yd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Yd)},persist:function(){},isPersistent:Yd}),l}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kd=wr(ss),Fc=m({},ss,{view:0,detail:0}),yk=wr(Fc),Lm,$m,qc,Xd=m({},Fc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Um,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==qc&&(qc&&o.type==="mousemove"?(Lm=o.screenX-qc.screenX,$m=o.screenY-qc.screenY):$m=Lm=0,qc=o),Lm)},movementY:function(o){return"movementY"in o?o.movementY:$m}}),wS=wr(Xd),xk=m({},Xd,{dataTransfer:0}),bk=wr(xk),Sk=m({},Fc,{relatedTarget:0}),zm=wr(Sk),wk=m({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),jk=wr(wk),Ck=m({},ss,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),Ek=wr(Ck),Tk=m({},ss,{data:0}),jS=wr(Tk),Rk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_k={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Dk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ak(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=Dk[o])?!!l[o]:!1}function Um(){return Ak}var Pk=m({},Fc,{key:function(o){if(o.key){var l=Rk[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Qd(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?_k[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Um,charCode:function(o){return o.type==="keypress"?Qd(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Qd(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),kk=wr(Pk),Nk=m({},Xd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),CS=wr(Nk),Ok=m({},Fc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Um}),Mk=wr(Ok),Ik=m({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lk=wr(Ik),$k=m({},Xd,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),zk=wr($k),Uk=m({},ss,{newState:0,oldState:0}),Bk=wr(Uk),Vk=[9,13,27,32],Bm=Ti&&"CompositionEvent"in window,Hc=null;Ti&&"documentMode"in document&&(Hc=document.documentMode);var Fk=Ti&&"TextEvent"in window&&!Hc,ES=Ti&&(!Bm||Hc&&8<Hc&&11>=Hc),TS=" ",RS=!1;function _S(o,l){switch(o){case"keyup":return Vk.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function DS(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var yl=!1;function qk(o,l){switch(o){case"compositionend":return DS(l);case"keypress":return l.which!==32?null:(RS=!0,TS);case"textInput":return o=l.data,o===TS&&RS?null:o;default:return null}}function Hk(o,l){if(yl)return o==="compositionend"||!Bm&&_S(o,l)?(o=bS(),Wd=Im=ha=null,yl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return ES&&l.locale!=="ko"?null:l.data;default:return null}}var Gk={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function AS(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!Gk[o.type]:l==="textarea"}function PS(o,l,u,h){gl?vl?vl.push(h):vl=[h]:gl=h,l=$f(l,"onChange"),0<l.length&&(u=new Kd("onChange","change",null,u,h),o.push({event:u,listeners:l}))}var Gc=null,Wc=null;function Wk(o){dj(o,0)}function Zd(o){var l=Kt(o);if(fS(l))return o}function kS(o,l){if(o==="change")return l}var NS=!1;if(Ti){var Vm;if(Ti){var Fm="oninput"in document;if(!Fm){var OS=document.createElement("div");OS.setAttribute("oninput","return;"),Fm=typeof OS.oninput=="function"}Vm=Fm}else Vm=!1;NS=Vm&&(!document.documentMode||9<document.documentMode)}function MS(){Gc&&(Gc.detachEvent("onpropertychange",IS),Wc=Gc=null)}function IS(o){if(o.propertyName==="value"&&Zd(Wc)){var l=[];PS(l,Wc,o,Nm(o)),xS(Wk,l)}}function Qk(o,l,u){o==="focusin"?(MS(),Gc=l,Wc=u,Gc.attachEvent("onpropertychange",IS)):o==="focusout"&&MS()}function Yk(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Zd(Wc)}function Kk(o,l){if(o==="click")return Zd(l)}function Xk(o,l){if(o==="input"||o==="change")return Zd(l)}function Zk(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var $r=typeof Object.is=="function"?Object.is:Zk;function Qc(o,l){if($r(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var u=Object.keys(o),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!Ot.call(l,y)||!$r(o[y],l[y]))return!1}return!0}function LS(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function $S(o,l){var u=LS(o);o=0;for(var h;u;){if(u.nodeType===3){if(h=o+u.textContent.length,o<=l&&h>=l)return{node:u,offset:l-o};o=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=LS(u)}}function zS(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?zS(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function US(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Hd(o.document);l instanceof o.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)o=l.contentWindow;else break;l=Hd(o.document)}return l}function qm(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var Jk=Ti&&"documentMode"in document&&11>=document.documentMode,xl=null,Hm=null,Yc=null,Gm=!1;function BS(o,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Gm||xl==null||xl!==Hd(h)||(h=xl,"selectionStart"in h&&qm(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Yc&&Qc(Yc,h)||(Yc=h,h=$f(Hm,"onSelect"),0<h.length&&(l=new Kd("onSelect","select",null,l,u),o.push({event:l,listeners:h}),l.target=xl)))}function ls(o,l){var u={};return u[o.toLowerCase()]=l.toLowerCase(),u["Webkit"+o]="webkit"+l,u["Moz"+o]="moz"+l,u}var bl={animationend:ls("Animation","AnimationEnd"),animationiteration:ls("Animation","AnimationIteration"),animationstart:ls("Animation","AnimationStart"),transitionrun:ls("Transition","TransitionRun"),transitionstart:ls("Transition","TransitionStart"),transitioncancel:ls("Transition","TransitionCancel"),transitionend:ls("Transition","TransitionEnd")},Wm={},VS={};Ti&&(VS=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function cs(o){if(Wm[o])return Wm[o];if(!bl[o])return o;var l=bl[o],u;for(u in l)if(l.hasOwnProperty(u)&&u in VS)return Wm[o]=l[u];return o}var FS=cs("animationend"),qS=cs("animationiteration"),HS=cs("animationstart"),eN=cs("transitionrun"),tN=cs("transitionstart"),nN=cs("transitioncancel"),GS=cs("transitionend"),WS=new Map,Qm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Qm.push("scrollEnd");function To(o,l){WS.set(o,l),Lr(l,[o])}var QS=new WeakMap;function no(o,l){if(typeof o=="object"&&o!==null){var u=QS.get(o);return u!==void 0?u:(l={value:o,source:l,stack:Fd(l)},QS.set(o,l),l)}return{value:o,source:l,stack:Fd(l)}}var ro=[],Sl=0,Ym=0;function Jd(){for(var o=Sl,l=Ym=Sl=0;l<o;){var u=ro[l];ro[l++]=null;var h=ro[l];ro[l++]=null;var y=ro[l];ro[l++]=null;var S=ro[l];if(ro[l++]=null,h!==null&&y!==null){var D=h.pending;D===null?y.next=y:(y.next=D.next,D.next=y),h.pending=y}S!==0&&YS(u,y,S)}}function ef(o,l,u,h){ro[Sl++]=o,ro[Sl++]=l,ro[Sl++]=u,ro[Sl++]=h,Ym|=h,o.lanes|=h,o=o.alternate,o!==null&&(o.lanes|=h)}function Km(o,l,u,h){return ef(o,l,u,h),tf(o)}function wl(o,l){return ef(o,null,null,l),tf(o)}function YS(o,l,u){o.lanes|=u;var h=o.alternate;h!==null&&(h.lanes|=u);for(var y=!1,S=o.return;S!==null;)S.childLanes|=u,h=S.alternate,h!==null&&(h.childLanes|=u),S.tag===22&&(o=S.stateNode,o===null||o._visibility&1||(y=!0)),o=S,S=S.return;return o.tag===3?(S=o.stateNode,y&&l!==null&&(y=31-Lt(u),o=S.hiddenUpdates,h=o[y],h===null?o[y]=[l]:h.push(l),l.lane=u|536870912),S):null}function tf(o){if(50<bu)throw bu=0,nv=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var jl={};function rN(o,l,u,h){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zr(o,l,u,h){return new rN(o,l,u,h)}function Xm(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Ri(o,l){var u=o.alternate;return u===null?(u=zr(o.tag,l,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=l,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&65011712,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,l=o.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u.refCleanup=o.refCleanup,u}function KS(o,l){o.flags&=65011714;var u=o.alternate;return u===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=u.childLanes,o.lanes=u.lanes,o.child=u.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,o.type=u.type,l=u.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function nf(o,l,u,h,y,S){var D=0;if(h=o,typeof o=="function")Xm(o)&&(D=1);else if(typeof o=="string")D=i4(o,u,je.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case B:return o=zr(31,u,l,y),o.elementType=B,o.lanes=S,o;case w:return us(u.children,y,S,l);case j:D=8,y|=24;break;case C:return o=zr(12,u,l,y|2),o.elementType=C,o.lanes=S,o;case P:return o=zr(13,u,l,y),o.elementType=P,o.lanes=S,o;case A:return o=zr(19,u,l,y),o.elementType=A,o.lanes=S,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case T:case R:D=10;break e;case E:D=9;break e;case _:D=11;break e;case k:D=14;break e;case I:D=16,h=null;break e}D=29,u=Error(r(130,o===null?"null":typeof o,"")),h=null}return l=zr(D,u,l,y),l.elementType=o,l.type=h,l.lanes=S,l}function us(o,l,u,h){return o=zr(7,o,h,l),o.lanes=u,o}function Zm(o,l,u){return o=zr(6,o,null,l),o.lanes=u,o}function Jm(o,l,u){return l=zr(4,o.children!==null?o.children:[],o.key,l),l.lanes=u,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var Cl=[],El=0,rf=null,of=0,oo=[],io=0,ds=null,_i=1,Di="";function fs(o,l){Cl[El++]=of,Cl[El++]=rf,rf=o,of=l}function XS(o,l,u){oo[io++]=_i,oo[io++]=Di,oo[io++]=ds,ds=o;var h=_i;o=Di;var y=32-Lt(h)-1;h&=~(1<<y),u+=1;var S=32-Lt(l)+y;if(30<S){var D=y-y%5;S=(h&(1<<D)-1).toString(32),h>>=D,y-=D,_i=1<<32-Lt(l)+y|u<<y|h,Di=S+o}else _i=1<<S|u<<y|h,Di=o}function eg(o){o.return!==null&&(fs(o,1),XS(o,1,0))}function tg(o){for(;o===rf;)rf=Cl[--El],Cl[El]=null,of=Cl[--El],Cl[El]=null;for(;o===ds;)ds=oo[--io],oo[io]=null,Di=oo[--io],oo[io]=null,_i=oo[--io],oo[io]=null}var ur=null,Rn=null,Vt=!1,hs=null,Ho=!1,ng=Error(r(519));function ps(o){var l=Error(r(418,""));throw Zc(no(l,o)),ng}function ZS(o){var l=o.stateNode,u=o.type,h=o.memoizedProps;switch(l[me]=o,l[Te]=h,u){case"dialog":Tt("cancel",l),Tt("close",l);break;case"iframe":case"object":case"embed":Tt("load",l);break;case"video":case"audio":for(u=0;u<wu.length;u++)Tt(wu[u],l);break;case"source":Tt("error",l);break;case"img":case"image":case"link":Tt("error",l),Tt("load",l);break;case"details":Tt("toggle",l);break;case"input":Tt("invalid",l),hS(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),qd(l);break;case"select":Tt("invalid",l);break;case"textarea":Tt("invalid",l),mS(l,h.value,h.defaultValue,h.children),qd(l)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||mj(l.textContent,u)?(h.popover!=null&&(Tt("beforetoggle",l),Tt("toggle",l)),h.onScroll!=null&&Tt("scroll",l),h.onScrollEnd!=null&&Tt("scrollend",l),h.onClick!=null&&(l.onclick=zf),l=!0):l=!1,l||ps(o)}function JS(o){for(ur=o.return;ur;)switch(ur.tag){case 5:case 13:Ho=!1;return;case 27:case 3:Ho=!0;return;default:ur=ur.return}}function Kc(o){if(o!==ur)return!1;if(!Vt)return JS(o),Vt=!0,!1;var l=o.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=o.type,u=!(u!=="form"&&u!=="button")||yv(o.type,o.memoizedProps)),u=!u),u&&Rn&&ps(o),JS(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8)if(u=o.data,u==="/$"){if(l===0){Rn=_o(o.nextSibling);break e}l--}else u!=="$"&&u!=="$!"&&u!=="$?"||l++;o=o.nextSibling}Rn=null}}else l===27?(l=Rn,Da(o.type)?(o=wv,wv=null,Rn=o):Rn=l):Rn=ur?_o(o.stateNode.nextSibling):null;return!0}function Xc(){Rn=ur=null,Vt=!1}function e1(){var o=hs;return o!==null&&(Er===null?Er=o:Er.push.apply(Er,o),hs=null),o}function Zc(o){hs===null?hs=[o]:hs.push(o)}var rg=F(null),ms=null,Ai=null;function pa(o,l,u){ae(rg,l._currentValue),l._currentValue=u}function Pi(o){o._currentValue=rg.current,te(rg)}function og(o,l,u){for(;o!==null;){var h=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),o===u)break;o=o.return}}function ig(o,l,u,h){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var S=y.dependencies;if(S!==null){var D=y.child;S=S.firstContext;e:for(;S!==null;){var N=S;S=y;for(var z=0;z<l.length;z++)if(N.context===l[z]){S.lanes|=u,N=S.alternate,N!==null&&(N.lanes|=u),og(S.return,u,o),h||(D=null);break e}S=N.next}}else if(y.tag===18){if(D=y.return,D===null)throw Error(r(341));D.lanes|=u,S=D.alternate,S!==null&&(S.lanes|=u),og(D,u,o),D=null}else D=y.child;if(D!==null)D.return=y;else for(D=y;D!==null;){if(D===o){D=null;break}if(y=D.sibling,y!==null){y.return=D.return,D=y;break}D=D.return}y=D}}function Jc(o,l,u,h){o=null;for(var y=l,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var D=y.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var N=y.type;$r(y.pendingProps.value,D.value)||(o!==null?o.push(N):o=[N])}}else if(y===We.current){if(D=y.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(_u):o=[_u])}y=y.return}o!==null&&ig(l,o,u,h),l.flags|=262144}function af(o){for(o=o.firstContext;o!==null;){if(!$r(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function gs(o){ms=o,Ai=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function tr(o){return t1(ms,o)}function sf(o,l){return ms===null&&gs(o),t1(o,l)}function t1(o,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},Ai===null){if(o===null)throw Error(r(308));Ai=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Ai=Ai.next=l;return u}var oN=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(u,h){o.push(h)}};this.abort=function(){l.aborted=!0,o.forEach(function(u){return u()})}},iN=e.unstable_scheduleCallback,aN=e.unstable_NormalPriority,Fn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ag(){return{controller:new oN,data:new Map,refCount:0}}function eu(o){o.refCount--,o.refCount===0&&iN(aN,function(){o.controller.abort()})}var tu=null,sg=0,Tl=0,Rl=null;function sN(o,l){if(tu===null){var u=tu=[];sg=0,Tl=cv(),Rl={status:"pending",value:void 0,then:function(h){u.push(h)}}}return sg++,l.then(n1,n1),l}function n1(){if(--sg===0&&tu!==null){Rl!==null&&(Rl.status="fulfilled");var o=tu;tu=null,Tl=0,Rl=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function lN(o,l){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return o.then(function(){h.status="fulfilled",h.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var r1=O.S;O.S=function(o,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&sN(o,l),r1!==null&&r1(o,l)};var vs=F(null);function lg(){var o=vs.current;return o!==null?o:cn.pooledCache}function lf(o,l){l===null?ae(vs,vs.current):ae(vs,l.pool)}function o1(){var o=lg();return o===null?null:{parent:Fn._currentValue,pool:o}}var nu=Error(r(460)),i1=Error(r(474)),cf=Error(r(542)),cg={then:function(){}};function a1(o){return o=o.status,o==="fulfilled"||o==="rejected"}function uf(){}function s1(o,l,u){switch(u=o[u],u===void 0?o.push(l):u!==l&&(l.then(uf,uf),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,c1(o),o;default:if(typeof l.status=="string")l.then(uf,uf);else{if(o=cn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(h){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=h}},function(h){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,c1(o),o}throw ru=l,nu}}var ru=null;function l1(){if(ru===null)throw Error(r(459));var o=ru;return ru=null,o}function c1(o){if(o===nu||o===cf)throw Error(r(483))}var ma=!1;function ug(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dg(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function ga(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function va(o,l,u){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(Wt&2)!==0){var y=h.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),h.pending=l,l=tf(o),YS(o,null,u),l}return ef(o,h,l,u),tf(o)}function ou(o,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=o.pendingLanes,u|=h,l.lanes=u,ua(o,u)}}function fg(o,l){var u=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var D={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=D:S=S.next=D,u=u.next}while(u!==null);S===null?y=S=l:S=S.next=l}else y=S=l;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:h.shared,callbacks:h.callbacks},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=l:o.next=l,u.lastBaseUpdate=l}var hg=!1;function iu(){if(hg){var o=Rl;if(o!==null)throw o}}function au(o,l,u,h){hg=!1;var y=o.updateQueue;ma=!1;var S=y.firstBaseUpdate,D=y.lastBaseUpdate,N=y.shared.pending;if(N!==null){y.shared.pending=null;var z=N,ee=z.next;z.next=null,D===null?S=ee:D.next=ee,D=z;var de=o.alternate;de!==null&&(de=de.updateQueue,N=de.lastBaseUpdate,N!==D&&(N===null?de.firstBaseUpdate=ee:N.next=ee,de.lastBaseUpdate=z))}if(S!==null){var pe=y.baseState;D=0,de=ee=z=null,N=S;do{var ne=N.lane&-536870913,ie=ne!==N.lane;if(ie?(kt&ne)===ne:(h&ne)===ne){ne!==0&&ne===Tl&&(hg=!0),de!==null&&(de=de.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ct=o,it=N;ne=l;var en=u;switch(it.tag){case 1:if(ct=it.payload,typeof ct=="function"){pe=ct.call(en,pe,ne);break e}pe=ct;break e;case 3:ct.flags=ct.flags&-65537|128;case 0:if(ct=it.payload,ne=typeof ct=="function"?ct.call(en,pe,ne):ct,ne==null)break e;pe=m({},pe,ne);break e;case 2:ma=!0}}ne=N.callback,ne!==null&&(o.flags|=64,ie&&(o.flags|=8192),ie=y.callbacks,ie===null?y.callbacks=[ne]:ie.push(ne))}else ie={lane:ne,tag:N.tag,payload:N.payload,callback:N.callback,next:null},de===null?(ee=de=ie,z=pe):de=de.next=ie,D|=ne;if(N=N.next,N===null){if(N=y.shared.pending,N===null)break;ie=N,N=ie.next,ie.next=null,y.lastBaseUpdate=ie,y.shared.pending=null}}while(!0);de===null&&(z=pe),y.baseState=z,y.firstBaseUpdate=ee,y.lastBaseUpdate=de,S===null&&(y.shared.lanes=0),Ea|=D,o.lanes=D,o.memoizedState=pe}}function u1(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function d1(o,l){var u=o.callbacks;if(u!==null)for(o.callbacks=null,o=0;o<u.length;o++)u1(u[o],l)}var _l=F(null),df=F(0);function f1(o,l){o=$i,ae(df,o),ae(_l,l),$i=o|l.baseLanes}function pg(){ae(df,$i),ae(_l,_l.current)}function mg(){$i=df.current,te(_l),te(df)}var ya=0,St=null,Zt=null,zn=null,ff=!1,Dl=!1,ys=!1,hf=0,su=0,Al=null,cN=0;function Pn(){throw Error(r(321))}function gg(o,l){if(l===null)return!1;for(var u=0;u<l.length&&u<o.length;u++)if(!$r(o[u],l[u]))return!1;return!0}function vg(o,l,u,h,y,S){return ya=S,St=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,O.H=o===null||o.memoizedState===null?Y1:K1,ys=!1,S=u(h,y),ys=!1,Dl&&(S=p1(l,u,h,y)),h1(o),S}function h1(o){O.H=xf;var l=Zt!==null&&Zt.next!==null;if(ya=0,zn=Zt=St=null,ff=!1,su=0,Al=null,l)throw Error(r(300));o===null||Gn||(o=o.dependencies,o!==null&&af(o)&&(Gn=!0))}function p1(o,l,u,h){St=o;var y=0;do{if(Dl&&(Al=null),su=0,Dl=!1,25<=y)throw Error(r(301));if(y+=1,zn=Zt=null,o.updateQueue!=null){var S=o.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}O.H=gN,S=l(u,h)}while(Dl);return S}function uN(){var o=O.H,l=o.useState()[0];return l=typeof l.then=="function"?lu(l):l,o=o.useState()[0],(Zt!==null?Zt.memoizedState:null)!==o&&(St.flags|=1024),l}function yg(){var o=hf!==0;return hf=0,o}function xg(o,l,u){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~u}function bg(o){if(ff){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}ff=!1}ya=0,zn=Zt=St=null,Dl=!1,su=hf=0,Al=null}function jr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?St.memoizedState=zn=o:zn=zn.next=o,zn}function Un(){if(Zt===null){var o=St.alternate;o=o!==null?o.memoizedState:null}else o=Zt.next;var l=zn===null?St.memoizedState:zn.next;if(l!==null)zn=l,Zt=o;else{if(o===null)throw St.alternate===null?Error(r(467)):Error(r(310));Zt=o,o={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},zn===null?St.memoizedState=zn=o:zn=zn.next=o}return zn}function Sg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lu(o){var l=su;return su+=1,Al===null&&(Al=[]),o=s1(Al,o,l),l=St,(zn===null?l.memoizedState:zn.next)===null&&(l=l.alternate,O.H=l===null||l.memoizedState===null?Y1:K1),o}function pf(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return lu(o);if(o.$$typeof===R)return tr(o)}throw Error(r(438,String(o)))}function wg(o){var l=null,u=St.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=St.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=Sg(),St.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(o),h=0;h<o;h++)u[h]=q;return l.index++,u}function ki(o,l){return typeof l=="function"?l(o):l}function mf(o){var l=Un();return jg(l,Zt,o)}function jg(o,l,u){var h=o.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var y=o.baseQueue,S=h.pending;if(S!==null){if(y!==null){var D=y.next;y.next=S.next,S.next=D}l.baseQueue=y=S,h.pending=null}if(S=o.baseState,y===null)o.memoizedState=S;else{l=y.next;var N=D=null,z=null,ee=l,de=!1;do{var pe=ee.lane&-536870913;if(pe!==ee.lane?(kt&pe)===pe:(ya&pe)===pe){var ne=ee.revertLane;if(ne===0)z!==null&&(z=z.next={lane:0,revertLane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),pe===Tl&&(de=!0);else if((ya&ne)===ne){ee=ee.next,ne===Tl&&(de=!0);continue}else pe={lane:0,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},z===null?(N=z=pe,D=S):z=z.next=pe,St.lanes|=ne,Ea|=ne;pe=ee.action,ys&&u(S,pe),S=ee.hasEagerState?ee.eagerState:u(S,pe)}else ne={lane:pe,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},z===null?(N=z=ne,D=S):z=z.next=ne,St.lanes|=pe,Ea|=pe;ee=ee.next}while(ee!==null&&ee!==l);if(z===null?D=S:z.next=N,!$r(S,o.memoizedState)&&(Gn=!0,de&&(u=Rl,u!==null)))throw u;o.memoizedState=S,o.baseState=D,o.baseQueue=z,h.lastRenderedState=S}return y===null&&(h.lanes=0),[o.memoizedState,h.dispatch]}function Cg(o){var l=Un(),u=l.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=o;var h=u.dispatch,y=u.pending,S=l.memoizedState;if(y!==null){u.pending=null;var D=y=y.next;do S=o(S,D.action),D=D.next;while(D!==y);$r(S,l.memoizedState)||(Gn=!0),l.memoizedState=S,l.baseQueue===null&&(l.baseState=S),u.lastRenderedState=S}return[S,h]}function m1(o,l,u){var h=St,y=Un(),S=Vt;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=l();var D=!$r((Zt||y).memoizedState,u);D&&(y.memoizedState=u,Gn=!0),y=y.queue;var N=y1.bind(null,h,y,o);if(cu(2048,8,N,[o]),y.getSnapshot!==l||D||zn!==null&&zn.memoizedState.tag&1){if(h.flags|=2048,Pl(9,gf(),v1.bind(null,h,y,u,l),null),cn===null)throw Error(r(349));S||(ya&124)!==0||g1(h,l,u)}return u}function g1(o,l,u){o.flags|=16384,o={getSnapshot:l,value:u},l=St.updateQueue,l===null?(l=Sg(),St.updateQueue=l,l.stores=[o]):(u=l.stores,u===null?l.stores=[o]:u.push(o))}function v1(o,l,u,h){l.value=u,l.getSnapshot=h,x1(l)&&b1(o)}function y1(o,l,u){return u(function(){x1(l)&&b1(o)})}function x1(o){var l=o.getSnapshot;o=o.value;try{var u=l();return!$r(o,u)}catch{return!0}}function b1(o){var l=wl(o,2);l!==null&&qr(l,o,2)}function Eg(o){var l=jr();if(typeof o=="function"){var u=o;if(o=u(),ys){nn(!0);try{u()}finally{nn(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:o},l}function S1(o,l,u,h){return o.baseState=u,jg(o,Zt,typeof h=="function"?h:ki)}function dN(o,l,u,h,y){if(yf(o))throw Error(r(485));if(o=l.action,o!==null){var S={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){S.listeners.push(D)}};O.T!==null?u(!0):S.isTransition=!1,h(S),u=l.pending,u===null?(S.next=l.pending=S,w1(l,S)):(S.next=u.next,l.pending=u.next=S)}}function w1(o,l){var u=l.action,h=l.payload,y=o.state;if(l.isTransition){var S=O.T,D={};O.T=D;try{var N=u(y,h),z=O.S;z!==null&&z(D,N),j1(o,l,N)}catch(ee){Tg(o,l,ee)}finally{O.T=S}}else try{S=u(y,h),j1(o,l,S)}catch(ee){Tg(o,l,ee)}}function j1(o,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){C1(o,l,h)},function(h){return Tg(o,l,h)}):C1(o,l,u)}function C1(o,l,u){l.status="fulfilled",l.value=u,E1(l),o.state=u,l=o.pending,l!==null&&(u=l.next,u===l?o.pending=null:(u=u.next,l.next=u,w1(o,u)))}function Tg(o,l,u){var h=o.pending;if(o.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,E1(l),l=l.next;while(l!==h)}o.action=null}function E1(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function T1(o,l){return l}function R1(o,l){if(Vt){var u=cn.formState;if(u!==null){e:{var h=St;if(Vt){if(Rn){t:{for(var y=Rn,S=Ho;y.nodeType!==8;){if(!S){y=null;break t}if(y=_o(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){Rn=_o(y.nextSibling),h=y.data==="F!";break e}}ps(h)}h=!1}h&&(l=u[0])}}return u=jr(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:T1,lastRenderedState:l},u.queue=h,u=G1.bind(null,St,h),h.dispatch=u,h=Eg(!1),S=Pg.bind(null,St,!1,h.queue),h=jr(),y={state:l,dispatch:null,action:o,pending:null},h.queue=y,u=dN.bind(null,St,y,S,u),y.dispatch=u,h.memoizedState=o,[l,u,!1]}function _1(o){var l=Un();return D1(l,Zt,o)}function D1(o,l,u){if(l=jg(o,l,T1)[0],o=mf(ki)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=lu(l)}catch(D){throw D===nu?cf:D}else h=l;l=Un();var y=l.queue,S=y.dispatch;return u!==l.memoizedState&&(St.flags|=2048,Pl(9,gf(),fN.bind(null,y,u),null)),[h,S,o]}function fN(o,l){o.action=l}function A1(o){var l=Un(),u=Zt;if(u!==null)return D1(l,u,o);Un(),l=l.memoizedState,u=Un();var h=u.queue.dispatch;return u.memoizedState=o,[l,h,!1]}function Pl(o,l,u,h){return o={tag:o,create:u,deps:h,inst:l,next:null},l=St.updateQueue,l===null&&(l=Sg(),St.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=o.next=o:(h=u.next,u.next=o,o.next=h,l.lastEffect=o),o}function gf(){return{destroy:void 0,resource:void 0}}function P1(){return Un().memoizedState}function vf(o,l,u,h){var y=jr();h=h===void 0?null:h,St.flags|=o,y.memoizedState=Pl(1|l,gf(),u,h)}function cu(o,l,u,h){var y=Un();h=h===void 0?null:h;var S=y.memoizedState.inst;Zt!==null&&h!==null&&gg(h,Zt.memoizedState.deps)?y.memoizedState=Pl(l,S,u,h):(St.flags|=o,y.memoizedState=Pl(1|l,S,u,h))}function k1(o,l){vf(8390656,8,o,l)}function N1(o,l){cu(2048,8,o,l)}function O1(o,l){return cu(4,2,o,l)}function M1(o,l){return cu(4,4,o,l)}function I1(o,l){if(typeof l=="function"){o=o();var u=l(o);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function L1(o,l,u){u=u!=null?u.concat([o]):null,cu(4,4,I1.bind(null,l,o),u)}function Rg(){}function $1(o,l){var u=Un();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&gg(l,h[1])?h[0]:(u.memoizedState=[o,l],o)}function z1(o,l){var u=Un();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&gg(l,h[1]))return h[0];if(h=o(),ys){nn(!0);try{o()}finally{nn(!1)}}return u.memoizedState=[h,l],h}function _g(o,l,u){return u===void 0||(ya&1073741824)!==0?o.memoizedState=l:(o.memoizedState=u,o=Vw(),St.lanes|=o,Ea|=o,u)}function U1(o,l,u,h){return $r(u,l)?u:_l.current!==null?(o=_g(o,u,h),$r(o,l)||(Gn=!0),o):(ya&42)===0?(Gn=!0,o.memoizedState=u):(o=Vw(),St.lanes|=o,Ea|=o,l)}function B1(o,l,u,h,y){var S=L.p;L.p=S!==0&&8>S?S:8;var D=O.T,N={};O.T=N,Pg(o,!1,l,u);try{var z=y(),ee=O.S;if(ee!==null&&ee(N,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var de=lN(z,h);uu(o,l,de,Fr(o))}else uu(o,l,h,Fr(o))}catch(pe){uu(o,l,{then:function(){},status:"rejected",reason:pe},Fr())}finally{L.p=S,O.T=D}}function hN(){}function Dg(o,l,u,h){if(o.tag!==5)throw Error(r(476));var y=V1(o).queue;B1(o,y,l,$,u===null?hN:function(){return F1(o),u(h)})}function V1(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:$},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:u},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function F1(o){var l=V1(o).next.queue;uu(o,l,{},Fr())}function Ag(){return tr(_u)}function q1(){return Un().memoizedState}function H1(){return Un().memoizedState}function pN(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var u=Fr();o=ga(u);var h=va(l,o,u);h!==null&&(qr(h,l,u),ou(h,l,u)),l={cache:ag()},o.payload=l;return}l=l.return}}function mN(o,l,u){var h=Fr();u={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},yf(o)?W1(l,u):(u=Km(o,l,u,h),u!==null&&(qr(u,o,h),Q1(u,l,h)))}function G1(o,l,u){var h=Fr();uu(o,l,u,h)}function uu(o,l,u,h){var y={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(yf(o))W1(l,y);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=l.lastRenderedReducer,S!==null))try{var D=l.lastRenderedState,N=S(D,u);if(y.hasEagerState=!0,y.eagerState=N,$r(N,D))return ef(o,l,y,0),cn===null&&Jd(),!1}catch{}finally{}if(u=Km(o,l,y,h),u!==null)return qr(u,o,h),Q1(u,l,h),!0}return!1}function Pg(o,l,u,h){if(h={lane:2,revertLane:cv(),action:h,hasEagerState:!1,eagerState:null,next:null},yf(o)){if(l)throw Error(r(479))}else l=Km(o,u,h,2),l!==null&&qr(l,o,2)}function yf(o){var l=o.alternate;return o===St||l!==null&&l===St}function W1(o,l){Dl=ff=!0;var u=o.pending;u===null?l.next=l:(l.next=u.next,u.next=l),o.pending=l}function Q1(o,l,u){if((u&4194048)!==0){var h=l.lanes;h&=o.pendingLanes,u|=h,l.lanes=u,ua(o,u)}}var xf={readContext:tr,use:pf,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useLayoutEffect:Pn,useInsertionEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useSyncExternalStore:Pn,useId:Pn,useHostTransitionStatus:Pn,useFormState:Pn,useActionState:Pn,useOptimistic:Pn,useMemoCache:Pn,useCacheRefresh:Pn},Y1={readContext:tr,use:pf,useCallback:function(o,l){return jr().memoizedState=[o,l===void 0?null:l],o},useContext:tr,useEffect:k1,useImperativeHandle:function(o,l,u){u=u!=null?u.concat([o]):null,vf(4194308,4,I1.bind(null,l,o),u)},useLayoutEffect:function(o,l){return vf(4194308,4,o,l)},useInsertionEffect:function(o,l){vf(4,2,o,l)},useMemo:function(o,l){var u=jr();l=l===void 0?null:l;var h=o();if(ys){nn(!0);try{o()}finally{nn(!1)}}return u.memoizedState=[h,l],h},useReducer:function(o,l,u){var h=jr();if(u!==void 0){var y=u(l);if(ys){nn(!0);try{u(l)}finally{nn(!1)}}}else y=l;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=mN.bind(null,St,o),[h.memoizedState,o]},useRef:function(o){var l=jr();return o={current:o},l.memoizedState=o},useState:function(o){o=Eg(o);var l=o.queue,u=G1.bind(null,St,l);return l.dispatch=u,[o.memoizedState,u]},useDebugValue:Rg,useDeferredValue:function(o,l){var u=jr();return _g(u,o,l)},useTransition:function(){var o=Eg(!1);return o=B1.bind(null,St,o.queue,!0,!1),jr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,u){var h=St,y=jr();if(Vt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=l(),cn===null)throw Error(r(349));(kt&124)!==0||g1(h,l,u)}y.memoizedState=u;var S={value:u,getSnapshot:l};return y.queue=S,k1(y1.bind(null,h,S,o),[o]),h.flags|=2048,Pl(9,gf(),v1.bind(null,h,S,u,l),null),u},useId:function(){var o=jr(),l=cn.identifierPrefix;if(Vt){var u=Di,h=_i;u=(h&~(1<<32-Lt(h)-1)).toString(32)+u,l="«"+l+"R"+u,u=hf++,0<u&&(l+="H"+u.toString(32)),l+="»"}else u=cN++,l="«"+l+"r"+u.toString(32)+"»";return o.memoizedState=l},useHostTransitionStatus:Ag,useFormState:R1,useActionState:R1,useOptimistic:function(o){var l=jr();l.memoizedState=l.baseState=o;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Pg.bind(null,St,!0,u),u.dispatch=l,[o,l]},useMemoCache:wg,useCacheRefresh:function(){return jr().memoizedState=pN.bind(null,St)}},K1={readContext:tr,use:pf,useCallback:$1,useContext:tr,useEffect:N1,useImperativeHandle:L1,useInsertionEffect:O1,useLayoutEffect:M1,useMemo:z1,useReducer:mf,useRef:P1,useState:function(){return mf(ki)},useDebugValue:Rg,useDeferredValue:function(o,l){var u=Un();return U1(u,Zt.memoizedState,o,l)},useTransition:function(){var o=mf(ki)[0],l=Un().memoizedState;return[typeof o=="boolean"?o:lu(o),l]},useSyncExternalStore:m1,useId:q1,useHostTransitionStatus:Ag,useFormState:_1,useActionState:_1,useOptimistic:function(o,l){var u=Un();return S1(u,Zt,o,l)},useMemoCache:wg,useCacheRefresh:H1},gN={readContext:tr,use:pf,useCallback:$1,useContext:tr,useEffect:N1,useImperativeHandle:L1,useInsertionEffect:O1,useLayoutEffect:M1,useMemo:z1,useReducer:Cg,useRef:P1,useState:function(){return Cg(ki)},useDebugValue:Rg,useDeferredValue:function(o,l){var u=Un();return Zt===null?_g(u,o,l):U1(u,Zt.memoizedState,o,l)},useTransition:function(){var o=Cg(ki)[0],l=Un().memoizedState;return[typeof o=="boolean"?o:lu(o),l]},useSyncExternalStore:m1,useId:q1,useHostTransitionStatus:Ag,useFormState:A1,useActionState:A1,useOptimistic:function(o,l){var u=Un();return Zt!==null?S1(u,Zt,o,l):(u.baseState=o,[o,u.queue.dispatch])},useMemoCache:wg,useCacheRefresh:H1},kl=null,du=0;function bf(o){var l=du;return du+=1,kl===null&&(kl=[]),s1(kl,o,l)}function fu(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function Sf(o,l){throw l.$$typeof===g?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function X1(o){var l=o._init;return l(o._payload)}function Z1(o){function l(Y,G){if(o){var J=Y.deletions;J===null?(Y.deletions=[G],Y.flags|=16):J.push(G)}}function u(Y,G){if(!o)return null;for(;G!==null;)l(Y,G),G=G.sibling;return null}function h(Y){for(var G=new Map;Y!==null;)Y.key!==null?G.set(Y.key,Y):G.set(Y.index,Y),Y=Y.sibling;return G}function y(Y,G){return Y=Ri(Y,G),Y.index=0,Y.sibling=null,Y}function S(Y,G,J){return Y.index=J,o?(J=Y.alternate,J!==null?(J=J.index,J<G?(Y.flags|=67108866,G):J):(Y.flags|=67108866,G)):(Y.flags|=1048576,G)}function D(Y){return o&&Y.alternate===null&&(Y.flags|=67108866),Y}function N(Y,G,J,fe){return G===null||G.tag!==6?(G=Zm(J,Y.mode,fe),G.return=Y,G):(G=y(G,J),G.return=Y,G)}function z(Y,G,J,fe){var He=J.type;return He===w?de(Y,G,J.props.children,fe,J.key):G!==null&&(G.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===I&&X1(He)===G.type)?(G=y(G,J.props),fu(G,J),G.return=Y,G):(G=nf(J.type,J.key,J.props,null,Y.mode,fe),fu(G,J),G.return=Y,G)}function ee(Y,G,J,fe){return G===null||G.tag!==4||G.stateNode.containerInfo!==J.containerInfo||G.stateNode.implementation!==J.implementation?(G=Jm(J,Y.mode,fe),G.return=Y,G):(G=y(G,J.children||[]),G.return=Y,G)}function de(Y,G,J,fe,He){return G===null||G.tag!==7?(G=us(J,Y.mode,fe,He),G.return=Y,G):(G=y(G,J),G.return=Y,G)}function pe(Y,G,J){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Zm(""+G,Y.mode,J),G.return=Y,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case x:return J=nf(G.type,G.key,G.props,null,Y.mode,J),fu(J,G),J.return=Y,J;case b:return G=Jm(G,Y.mode,J),G.return=Y,G;case I:var fe=G._init;return G=fe(G._payload),pe(Y,G,J)}if(W(G)||K(G))return G=us(G,Y.mode,J,null),G.return=Y,G;if(typeof G.then=="function")return pe(Y,bf(G),J);if(G.$$typeof===R)return pe(Y,sf(Y,G),J);Sf(Y,G)}return null}function ne(Y,G,J,fe){var He=G!==null?G.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return He!==null?null:N(Y,G,""+J,fe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===He?z(Y,G,J,fe):null;case b:return J.key===He?ee(Y,G,J,fe):null;case I:return He=J._init,J=He(J._payload),ne(Y,G,J,fe)}if(W(J)||K(J))return He!==null?null:de(Y,G,J,fe,null);if(typeof J.then=="function")return ne(Y,G,bf(J),fe);if(J.$$typeof===R)return ne(Y,G,sf(Y,J),fe);Sf(Y,J)}return null}function ie(Y,G,J,fe,He){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return Y=Y.get(J)||null,N(G,Y,""+fe,He);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return Y=Y.get(fe.key===null?J:fe.key)||null,z(G,Y,fe,He);case b:return Y=Y.get(fe.key===null?J:fe.key)||null,ee(G,Y,fe,He);case I:var jt=fe._init;return fe=jt(fe._payload),ie(Y,G,J,fe,He)}if(W(fe)||K(fe))return Y=Y.get(J)||null,de(G,Y,fe,He,null);if(typeof fe.then=="function")return ie(Y,G,J,bf(fe),He);if(fe.$$typeof===R)return ie(Y,G,J,sf(G,fe),He);Sf(G,fe)}return null}function ct(Y,G,J,fe){for(var He=null,jt=null,et=G,at=G=0,Qn=null;et!==null&&at<J.length;at++){et.index>at?(Qn=et,et=null):Qn=et.sibling;var $t=ne(Y,et,J[at],fe);if($t===null){et===null&&(et=Qn);break}o&&et&&$t.alternate===null&&l(Y,et),G=S($t,G,at),jt===null?He=$t:jt.sibling=$t,jt=$t,et=Qn}if(at===J.length)return u(Y,et),Vt&&fs(Y,at),He;if(et===null){for(;at<J.length;at++)et=pe(Y,J[at],fe),et!==null&&(G=S(et,G,at),jt===null?He=et:jt.sibling=et,jt=et);return Vt&&fs(Y,at),He}for(et=h(et);at<J.length;at++)Qn=ie(et,Y,at,J[at],fe),Qn!==null&&(o&&Qn.alternate!==null&&et.delete(Qn.key===null?at:Qn.key),G=S(Qn,G,at),jt===null?He=Qn:jt.sibling=Qn,jt=Qn);return o&&et.forEach(function(Oa){return l(Y,Oa)}),Vt&&fs(Y,at),He}function it(Y,G,J,fe){if(J==null)throw Error(r(151));for(var He=null,jt=null,et=G,at=G=0,Qn=null,$t=J.next();et!==null&&!$t.done;at++,$t=J.next()){et.index>at?(Qn=et,et=null):Qn=et.sibling;var Oa=ne(Y,et,$t.value,fe);if(Oa===null){et===null&&(et=Qn);break}o&&et&&Oa.alternate===null&&l(Y,et),G=S(Oa,G,at),jt===null?He=Oa:jt.sibling=Oa,jt=Oa,et=Qn}if($t.done)return u(Y,et),Vt&&fs(Y,at),He;if(et===null){for(;!$t.done;at++,$t=J.next())$t=pe(Y,$t.value,fe),$t!==null&&(G=S($t,G,at),jt===null?He=$t:jt.sibling=$t,jt=$t);return Vt&&fs(Y,at),He}for(et=h(et);!$t.done;at++,$t=J.next())$t=ie(et,Y,at,$t.value,fe),$t!==null&&(o&&$t.alternate!==null&&et.delete($t.key===null?at:$t.key),G=S($t,G,at),jt===null?He=$t:jt.sibling=$t,jt=$t);return o&&et.forEach(function(v4){return l(Y,v4)}),Vt&&fs(Y,at),He}function en(Y,G,J,fe){if(typeof J=="object"&&J!==null&&J.type===w&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case x:e:{for(var He=J.key;G!==null;){if(G.key===He){if(He=J.type,He===w){if(G.tag===7){u(Y,G.sibling),fe=y(G,J.props.children),fe.return=Y,Y=fe;break e}}else if(G.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===I&&X1(He)===G.type){u(Y,G.sibling),fe=y(G,J.props),fu(fe,J),fe.return=Y,Y=fe;break e}u(Y,G);break}else l(Y,G);G=G.sibling}J.type===w?(fe=us(J.props.children,Y.mode,fe,J.key),fe.return=Y,Y=fe):(fe=nf(J.type,J.key,J.props,null,Y.mode,fe),fu(fe,J),fe.return=Y,Y=fe)}return D(Y);case b:e:{for(He=J.key;G!==null;){if(G.key===He)if(G.tag===4&&G.stateNode.containerInfo===J.containerInfo&&G.stateNode.implementation===J.implementation){u(Y,G.sibling),fe=y(G,J.children||[]),fe.return=Y,Y=fe;break e}else{u(Y,G);break}else l(Y,G);G=G.sibling}fe=Jm(J,Y.mode,fe),fe.return=Y,Y=fe}return D(Y);case I:return He=J._init,J=He(J._payload),en(Y,G,J,fe)}if(W(J))return ct(Y,G,J,fe);if(K(J)){if(He=K(J),typeof He!="function")throw Error(r(150));return J=He.call(J),it(Y,G,J,fe)}if(typeof J.then=="function")return en(Y,G,bf(J),fe);if(J.$$typeof===R)return en(Y,G,sf(Y,J),fe);Sf(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,G!==null&&G.tag===6?(u(Y,G.sibling),fe=y(G,J),fe.return=Y,Y=fe):(u(Y,G),fe=Zm(J,Y.mode,fe),fe.return=Y,Y=fe),D(Y)):u(Y,G)}return function(Y,G,J,fe){try{du=0;var He=en(Y,G,J,fe);return kl=null,He}catch(et){if(et===nu||et===cf)throw et;var jt=zr(29,et,null,Y.mode);return jt.lanes=fe,jt.return=Y,jt}finally{}}}var Nl=Z1(!0),J1=Z1(!1),ao=F(null),Go=null;function xa(o){var l=o.alternate;ae(qn,qn.current&1),ae(ao,o),Go===null&&(l===null||_l.current!==null||l.memoizedState!==null)&&(Go=o)}function ew(o){if(o.tag===22){if(ae(qn,qn.current),ae(ao,o),Go===null){var l=o.alternate;l!==null&&l.memoizedState!==null&&(Go=o)}}else ba()}function ba(){ae(qn,qn.current),ae(ao,ao.current)}function Ni(o){te(ao),Go===o&&(Go=null),te(qn)}var qn=F(0);function wf(o){for(var l=o;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||Sv(u)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function kg(o,l,u,h){l=o.memoizedState,u=u(h,l),u=u==null?l:m({},l,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var Ng={enqueueSetState:function(o,l,u){o=o._reactInternals;var h=Fr(),y=ga(h);y.payload=l,u!=null&&(y.callback=u),l=va(o,y,h),l!==null&&(qr(l,o,h),ou(l,o,h))},enqueueReplaceState:function(o,l,u){o=o._reactInternals;var h=Fr(),y=ga(h);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=va(o,y,h),l!==null&&(qr(l,o,h),ou(l,o,h))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var u=Fr(),h=ga(u);h.tag=2,l!=null&&(h.callback=l),l=va(o,h,u),l!==null&&(qr(l,o,u),ou(l,o,u))}};function tw(o,l,u,h,y,S,D){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,S,D):l.prototype&&l.prototype.isPureReactComponent?!Qc(u,h)||!Qc(y,S):!0}function nw(o,l,u,h){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==o&&Ng.enqueueReplaceState(l,l.state,null)}function xs(o,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(o=o.defaultProps){u===l&&(u=m({},u));for(var y in o)u[y]===void 0&&(u[y]=o[y])}return u}var jf=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)};function rw(o){jf(o)}function ow(o){console.error(o)}function iw(o){jf(o)}function Cf(o,l){try{var u=o.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function aw(o,l,u){try{var h=o.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Og(o,l,u){return u=ga(u),u.tag=3,u.payload={element:null},u.callback=function(){Cf(o,l)},u}function sw(o){return o=ga(o),o.tag=3,o}function lw(o,l,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=h.value;o.payload=function(){return y(S)},o.callback=function(){aw(l,u,h)}}var D=u.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(o.callback=function(){aw(l,u,h),typeof y!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})})}function vN(o,l,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&Jc(l,u,y,!0),u=ao.current,u!==null){switch(u.tag){case 13:return Go===null?ov():u.alternate===null&&_n===0&&(_n=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===cg?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),av(o,h,y)),!1;case 22:return u.flags|=65536,h===cg?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([h]):u.add(h)),av(o,h,y)),!1}throw Error(r(435,u.tag))}return av(o,h,y),ov(),!1}if(Vt)return l=ao.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==ng&&(o=Error(r(422),{cause:h}),Zc(no(o,u)))):(h!==ng&&(l=Error(r(423),{cause:h}),Zc(no(l,u))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,h=no(h,u),y=Og(o.stateNode,h,y),fg(o,y),_n!==4&&(_n=2)),!1;var S=Error(r(520),{cause:h});if(S=no(S,u),xu===null?xu=[S]:xu.push(S),_n!==4&&(_n=2),l===null)return!0;h=no(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,o=y&-y,u.lanes|=o,o=Og(u.stateNode,h,o),fg(u,o),!1;case 1:if(l=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ta===null||!Ta.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=sw(y),lw(y,o,u,h),fg(u,y),!1}u=u.return}while(u!==null);return!1}var cw=Error(r(461)),Gn=!1;function Kn(o,l,u,h){l.child=o===null?J1(l,null,u,h):Nl(l,o.child,u,h)}function uw(o,l,u,h,y){u=u.render;var S=l.ref;if("ref"in h){var D={};for(var N in h)N!=="ref"&&(D[N]=h[N])}else D=h;return gs(l),h=vg(o,l,u,D,S,y),N=yg(),o!==null&&!Gn?(xg(o,l,y),Oi(o,l,y)):(Vt&&N&&eg(l),l.flags|=1,Kn(o,l,h,y),l.child)}function dw(o,l,u,h,y){if(o===null){var S=u.type;return typeof S=="function"&&!Xm(S)&&S.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=S,fw(o,l,S,h,y)):(o=nf(u.type,null,h,l,l.mode,y),o.ref=l.ref,o.return=l,l.child=o)}if(S=o.child,!Vg(o,y)){var D=S.memoizedProps;if(u=u.compare,u=u!==null?u:Qc,u(D,h)&&o.ref===l.ref)return Oi(o,l,y)}return l.flags|=1,o=Ri(S,h),o.ref=l.ref,o.return=l,l.child=o}function fw(o,l,u,h,y){if(o!==null){var S=o.memoizedProps;if(Qc(S,h)&&o.ref===l.ref)if(Gn=!1,l.pendingProps=h=S,Vg(o,y))(o.flags&131072)!==0&&(Gn=!0);else return l.lanes=o.lanes,Oi(o,l,y)}return Mg(o,l,u,h,y)}function hw(o,l,u){var h=l.pendingProps,y=h.children,S=o!==null?o.memoizedState:null;if(h.mode==="hidden"){if((l.flags&128)!==0){if(h=S!==null?S.baseLanes|u:u,o!==null){for(y=l.child=o.child,S=0;y!==null;)S=S|y.lanes|y.childLanes,y=y.sibling;l.childLanes=S&~h}else l.childLanes=0,l.child=null;return pw(o,l,h,u)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&lf(l,S!==null?S.cachePool:null),S!==null?f1(l,S):pg(),ew(l);else return l.lanes=l.childLanes=536870912,pw(o,l,S!==null?S.baseLanes|u:u,u)}else S!==null?(lf(l,S.cachePool),f1(l,S),ba(),l.memoizedState=null):(o!==null&&lf(l,null),pg(),ba());return Kn(o,l,y,u),l.child}function pw(o,l,u,h){var y=lg();return y=y===null?null:{parent:Fn._currentValue,pool:y},l.memoizedState={baseLanes:u,cachePool:y},o!==null&&lf(l,null),pg(),ew(l),o!==null&&Jc(o,l,h,!0),null}function Ef(o,l){var u=l.ref;if(u===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(o===null||o.ref!==u)&&(l.flags|=4194816)}}function Mg(o,l,u,h,y){return gs(l),u=vg(o,l,u,h,void 0,y),h=yg(),o!==null&&!Gn?(xg(o,l,y),Oi(o,l,y)):(Vt&&h&&eg(l),l.flags|=1,Kn(o,l,u,y),l.child)}function mw(o,l,u,h,y,S){return gs(l),l.updateQueue=null,u=p1(l,h,u,y),h1(o),h=yg(),o!==null&&!Gn?(xg(o,l,S),Oi(o,l,S)):(Vt&&h&&eg(l),l.flags|=1,Kn(o,l,u,S),l.child)}function gw(o,l,u,h,y){if(gs(l),l.stateNode===null){var S=jl,D=u.contextType;typeof D=="object"&&D!==null&&(S=tr(D)),S=new u(h,S),l.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Ng,l.stateNode=S,S._reactInternals=l,S=l.stateNode,S.props=h,S.state=l.memoizedState,S.refs={},ug(l),D=u.contextType,S.context=typeof D=="object"&&D!==null?tr(D):jl,S.state=l.memoizedState,D=u.getDerivedStateFromProps,typeof D=="function"&&(kg(l,u,D,h),S.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(D=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),D!==S.state&&Ng.enqueueReplaceState(S,S.state,null),au(l,h,S,y),iu(),S.state=l.memoizedState),typeof S.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(o===null){S=l.stateNode;var N=l.memoizedProps,z=xs(u,N);S.props=z;var ee=S.context,de=u.contextType;D=jl,typeof de=="object"&&de!==null&&(D=tr(de));var pe=u.getDerivedStateFromProps;de=typeof pe=="function"||typeof S.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,de||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(N||ee!==D)&&nw(l,S,h,D),ma=!1;var ne=l.memoizedState;S.state=ne,au(l,h,S,y),iu(),ee=l.memoizedState,N||ne!==ee||ma?(typeof pe=="function"&&(kg(l,u,pe,h),ee=l.memoizedState),(z=ma||tw(l,u,z,h,ne,ee,D))?(de||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(l.flags|=4194308)):(typeof S.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=ee),S.props=h,S.state=ee,S.context=D,h=z):(typeof S.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{S=l.stateNode,dg(o,l),D=l.memoizedProps,de=xs(u,D),S.props=de,pe=l.pendingProps,ne=S.context,ee=u.contextType,z=jl,typeof ee=="object"&&ee!==null&&(z=tr(ee)),N=u.getDerivedStateFromProps,(ee=typeof N=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(D!==pe||ne!==z)&&nw(l,S,h,z),ma=!1,ne=l.memoizedState,S.state=ne,au(l,h,S,y),iu();var ie=l.memoizedState;D!==pe||ne!==ie||ma||o!==null&&o.dependencies!==null&&af(o.dependencies)?(typeof N=="function"&&(kg(l,u,N,h),ie=l.memoizedState),(de=ma||tw(l,u,de,h,ne,ie,z)||o!==null&&o.dependencies!==null&&af(o.dependencies))?(ee||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,ie,z),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,ie,z)),typeof S.componentDidUpdate=="function"&&(l.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof S.componentDidUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(l.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ie),S.props=h,S.state=ie,S.context=z,h=de):(typeof S.componentDidUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(l.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(l.flags|=1024),h=!1)}return S=h,Ef(o,l),h=(l.flags&128)!==0,S||h?(S=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:S.render(),l.flags|=1,o!==null&&h?(l.child=Nl(l,o.child,null,y),l.child=Nl(l,null,u,y)):Kn(o,l,u,y),l.memoizedState=S.state,o=l.child):o=Oi(o,l,y),o}function vw(o,l,u,h){return Xc(),l.flags|=256,Kn(o,l,u,h),l.child}var Ig={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lg(o){return{baseLanes:o,cachePool:o1()}}function $g(o,l,u){return o=o!==null?o.childLanes&~u:0,l&&(o|=so),o}function yw(o,l,u){var h=l.pendingProps,y=!1,S=(l.flags&128)!==0,D;if((D=S)||(D=o!==null&&o.memoizedState===null?!1:(qn.current&2)!==0),D&&(y=!0,l.flags&=-129),D=(l.flags&32)!==0,l.flags&=-33,o===null){if(Vt){if(y?xa(l):ba(),Vt){var N=Rn,z;if(z=N){e:{for(z=N,N=Ho;z.nodeType!==8;){if(!N){N=null;break e}if(z=_o(z.nextSibling),z===null){N=null;break e}}N=z}N!==null?(l.memoizedState={dehydrated:N,treeContext:ds!==null?{id:_i,overflow:Di}:null,retryLane:536870912,hydrationErrors:null},z=zr(18,null,null,0),z.stateNode=N,z.return=l,l.child=z,ur=l,Rn=null,z=!0):z=!1}z||ps(l)}if(N=l.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return Sv(N)?l.lanes=32:l.lanes=536870912,null;Ni(l)}return N=h.children,h=h.fallback,y?(ba(),y=l.mode,N=Tf({mode:"hidden",children:N},y),h=us(h,y,u,null),N.return=l,h.return=l,N.sibling=h,l.child=N,y=l.child,y.memoizedState=Lg(u),y.childLanes=$g(o,D,u),l.memoizedState=Ig,h):(xa(l),zg(l,N))}if(z=o.memoizedState,z!==null&&(N=z.dehydrated,N!==null)){if(S)l.flags&256?(xa(l),l.flags&=-257,l=Ug(o,l,u)):l.memoizedState!==null?(ba(),l.child=o.child,l.flags|=128,l=null):(ba(),y=h.fallback,N=l.mode,h=Tf({mode:"visible",children:h.children},N),y=us(y,N,u,null),y.flags|=2,h.return=l,y.return=l,h.sibling=y,l.child=h,Nl(l,o.child,null,u),h=l.child,h.memoizedState=Lg(u),h.childLanes=$g(o,D,u),l.memoizedState=Ig,l=y);else if(xa(l),Sv(N)){if(D=N.nextSibling&&N.nextSibling.dataset,D)var ee=D.dgst;D=ee,h=Error(r(419)),h.stack="",h.digest=D,Zc({value:h,source:null,stack:null}),l=Ug(o,l,u)}else if(Gn||Jc(o,l,u,!1),D=(u&o.childLanes)!==0,Gn||D){if(D=cn,D!==null&&(h=u&-u,h=(h&42)!==0?1:is(h),h=(h&(D.suspendedLanes|u))!==0?0:h,h!==0&&h!==z.retryLane))throw z.retryLane=h,wl(o,h),qr(D,o,h),cw;N.data==="$?"||ov(),l=Ug(o,l,u)}else N.data==="$?"?(l.flags|=192,l.child=o.child,l=null):(o=z.treeContext,Rn=_o(N.nextSibling),ur=l,Vt=!0,hs=null,Ho=!1,o!==null&&(oo[io++]=_i,oo[io++]=Di,oo[io++]=ds,_i=o.id,Di=o.overflow,ds=l),l=zg(l,h.children),l.flags|=4096);return l}return y?(ba(),y=h.fallback,N=l.mode,z=o.child,ee=z.sibling,h=Ri(z,{mode:"hidden",children:h.children}),h.subtreeFlags=z.subtreeFlags&65011712,ee!==null?y=Ri(ee,y):(y=us(y,N,u,null),y.flags|=2),y.return=l,h.return=l,h.sibling=y,l.child=h,h=y,y=l.child,N=o.child.memoizedState,N===null?N=Lg(u):(z=N.cachePool,z!==null?(ee=Fn._currentValue,z=z.parent!==ee?{parent:ee,pool:ee}:z):z=o1(),N={baseLanes:N.baseLanes|u,cachePool:z}),y.memoizedState=N,y.childLanes=$g(o,D,u),l.memoizedState=Ig,h):(xa(l),u=o.child,o=u.sibling,u=Ri(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,o!==null&&(D=l.deletions,D===null?(l.deletions=[o],l.flags|=16):D.push(o)),l.child=u,l.memoizedState=null,u)}function zg(o,l){return l=Tf({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Tf(o,l){return o=zr(22,o,null,l),o.lanes=0,o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},o}function Ug(o,l,u){return Nl(l,o.child,null,u),o=zg(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function xw(o,l,u){o.lanes|=l;var h=o.alternate;h!==null&&(h.lanes|=l),og(o.return,l,u)}function Bg(o,l,u,h,y){var S=o.memoizedState;S===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y}:(S.isBackwards=l,S.rendering=null,S.renderingStartTime=0,S.last=h,S.tail=u,S.tailMode=y)}function bw(o,l,u){var h=l.pendingProps,y=h.revealOrder,S=h.tail;if(Kn(o,l,h.children,u),h=qn.current,(h&2)!==0)h=h&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&xw(o,u,l);else if(o.tag===19)xw(o,u,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}h&=1}switch(ae(qn,h),y){case"forwards":for(u=l.child,y=null;u!==null;)o=u.alternate,o!==null&&wf(o)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),Bg(l,!1,y,u,S);break;case"backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(o=y.alternate,o!==null&&wf(o)===null){l.child=y;break}o=y.sibling,y.sibling=u,u=y,y=o}Bg(l,!0,u,null,S);break;case"together":Bg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Oi(o,l,u){if(o!==null&&(l.dependencies=o.dependencies),Ea|=l.lanes,(u&l.childLanes)===0)if(o!==null){if(Jc(o,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,u=Ri(o,o.pendingProps),l.child=u,u.return=l;o.sibling!==null;)o=o.sibling,u=u.sibling=Ri(o,o.pendingProps),u.return=l;u.sibling=null}return l.child}function Vg(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&af(o)))}function yN(o,l,u){switch(l.tag){case 3:Ee(l,l.stateNode.containerInfo),pa(l,Fn,o.memoizedState.cache),Xc();break;case 27:case 5:tt(l);break;case 4:Ee(l,l.stateNode.containerInfo);break;case 10:pa(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(xa(l),l.flags|=128,null):(u&l.child.childLanes)!==0?yw(o,l,u):(xa(l),o=Oi(o,l,u),o!==null?o.sibling:null);xa(l);break;case 19:var y=(o.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(Jc(o,l,u,!1),h=(u&l.childLanes)!==0),y){if(h)return bw(o,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),ae(qn,qn.current),h)break;return null;case 22:case 23:return l.lanes=0,hw(o,l,u);case 24:pa(l,Fn,o.memoizedState.cache)}return Oi(o,l,u)}function Sw(o,l,u){if(o!==null)if(o.memoizedProps!==l.pendingProps)Gn=!0;else{if(!Vg(o,u)&&(l.flags&128)===0)return Gn=!1,yN(o,l,u);Gn=(o.flags&131072)!==0}else Gn=!1,Vt&&(l.flags&1048576)!==0&&XS(l,of,l.index);switch(l.lanes=0,l.tag){case 16:e:{o=l.pendingProps;var h=l.elementType,y=h._init;if(h=y(h._payload),l.type=h,typeof h=="function")Xm(h)?(o=xs(h,o),l.tag=1,l=gw(null,l,h,o,u)):(l.tag=0,l=Mg(null,l,h,o,u));else{if(h!=null){if(y=h.$$typeof,y===_){l.tag=11,l=uw(null,l,h,o,u);break e}else if(y===k){l.tag=14,l=dw(null,l,h,o,u);break e}}throw l=V(h)||h,Error(r(306,l,""))}}return l;case 0:return Mg(o,l,l.type,l.pendingProps,u);case 1:return h=l.type,y=xs(h,l.pendingProps),gw(o,l,h,y,u);case 3:e:{if(Ee(l,l.stateNode.containerInfo),o===null)throw Error(r(387));h=l.pendingProps;var S=l.memoizedState;y=S.element,dg(o,l),au(l,h,null,u);var D=l.memoizedState;if(h=D.cache,pa(l,Fn,h),h!==S.cache&&ig(l,[Fn],u,!0),iu(),h=D.element,S.isDehydrated)if(S={element:h,isDehydrated:!1,cache:D.cache},l.updateQueue.baseState=S,l.memoizedState=S,l.flags&256){l=vw(o,l,h,u);break e}else if(h!==y){y=no(Error(r(424)),l),Zc(y),l=vw(o,l,h,u);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Rn=_o(o.firstChild),ur=l,Vt=!0,hs=null,Ho=!0,u=J1(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Xc(),h===y){l=Oi(o,l,u);break e}Kn(o,l,h,u)}l=l.child}return l;case 26:return Ef(o,l),o===null?(u=Ej(l.type,null,l.pendingProps,null))?l.memoizedState=u:Vt||(u=l.type,o=l.pendingProps,h=Uf(we.current).createElement(u),h[me]=l,h[Te]=o,Zn(h,u,o),mt(h),l.stateNode=h):l.memoizedState=Ej(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return tt(l),o===null&&Vt&&(h=l.stateNode=wj(l.type,l.pendingProps,we.current),ur=l,Ho=!0,y=Rn,Da(l.type)?(wv=y,Rn=_o(h.firstChild)):Rn=y),Kn(o,l,l.pendingProps.children,u),Ef(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Vt&&((y=h=Rn)&&(h=GN(h,l.type,l.pendingProps,Ho),h!==null?(l.stateNode=h,ur=l,Rn=_o(h.firstChild),Ho=!1,y=!0):y=!1),y||ps(l)),tt(l),y=l.type,S=l.pendingProps,D=o!==null?o.memoizedProps:null,h=S.children,yv(y,S)?h=null:D!==null&&yv(y,D)&&(l.flags|=32),l.memoizedState!==null&&(y=vg(o,l,uN,null,null,u),_u._currentValue=y),Ef(o,l),Kn(o,l,h,u),l.child;case 6:return o===null&&Vt&&((o=u=Rn)&&(u=WN(u,l.pendingProps,Ho),u!==null?(l.stateNode=u,ur=l,Rn=null,o=!0):o=!1),o||ps(l)),null;case 13:return yw(o,l,u);case 4:return Ee(l,l.stateNode.containerInfo),h=l.pendingProps,o===null?l.child=Nl(l,null,h,u):Kn(o,l,h,u),l.child;case 11:return uw(o,l,l.type,l.pendingProps,u);case 7:return Kn(o,l,l.pendingProps,u),l.child;case 8:return Kn(o,l,l.pendingProps.children,u),l.child;case 12:return Kn(o,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,pa(l,l.type,h.value),Kn(o,l,h.children,u),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,gs(l),y=tr(y),h=h(y),l.flags|=1,Kn(o,l,h,u),l.child;case 14:return dw(o,l,l.type,l.pendingProps,u);case 15:return fw(o,l,l.type,l.pendingProps,u);case 19:return bw(o,l,u);case 31:return h=l.pendingProps,u=l.mode,h={mode:h.mode,children:h.children},o===null?(u=Tf(h,u),u.ref=l.ref,l.child=u,u.return=l,l=u):(u=Ri(o.child,h),u.ref=l.ref,l.child=u,u.return=l,l=u),l;case 22:return hw(o,l,u);case 24:return gs(l),h=tr(Fn),o===null?(y=lg(),y===null&&(y=cn,S=ag(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),l.memoizedState={parent:h,cache:y},ug(l),pa(l,Fn,y)):((o.lanes&u)!==0&&(dg(o,l),au(l,null,null,u),iu()),y=o.memoizedState,S=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),pa(l,Fn,h)):(h=S.cache,pa(l,Fn,h),h!==y.cache&&ig(l,[Fn],u,!0))),Kn(o,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Mi(o){o.flags|=4}function ww(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Aj(l)){if(l=ao.current,l!==null&&((kt&4194048)===kt?Go!==null:(kt&62914560)!==kt&&(kt&536870912)===0||l!==Go))throw ru=cg,i1;o.flags|=8192}}function Rf(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?ca():536870912,o.lanes|=l,Ll|=l)}function hu(o,l){if(!Vt)switch(o.tailMode){case"hidden":l=o.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function Cn(o){var l=o.alternate!==null&&o.alternate.child===o.child,u=0,h=0;if(l)for(var y=o.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=h,o.childLanes=u,l}function xN(o,l,u){var h=l.pendingProps;switch(tg(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cn(l),null;case 1:return Cn(l),null;case 3:return u=l.stateNode,h=null,o!==null&&(h=o.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Pi(Fn),ot(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(o===null||o.child===null)&&(Kc(l)?Mi(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,e1())),Cn(l),null;case 26:return u=l.memoizedState,o===null?(Mi(l),u!==null?(Cn(l),ww(l,u)):(Cn(l),l.flags&=-16777217)):u?u!==o.memoizedState?(Mi(l),Cn(l),ww(l,u)):(Cn(l),l.flags&=-16777217):(o.memoizedProps!==h&&Mi(l),Cn(l),l.flags&=-16777217),null;case 27:Ct(l),u=we.current;var y=l.type;if(o!==null&&l.stateNode!=null)o.memoizedProps!==h&&Mi(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return Cn(l),null}o=je.current,Kc(l)?ZS(l):(o=wj(y,h,u),l.stateNode=o,Mi(l))}return Cn(l),null;case 5:if(Ct(l),u=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==h&&Mi(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return Cn(l),null}if(o=je.current,Kc(l))ZS(l);else{switch(y=Uf(we.current),o){case 1:o=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:o=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":o=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":o=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":o=y.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?o.multiple=!0:h.size&&(o.size=h.size);break;default:o=typeof h.is=="string"?y.createElement(u,{is:h.is}):y.createElement(u)}}o[me]=l,o[Te]=h;e:for(y=l.child;y!==null;){if(y.tag===5||y.tag===6)o.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===l)break e;for(;y.sibling===null;){if(y.return===null||y.return===l)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}l.stateNode=o;e:switch(Zn(o,u,h),u){case"button":case"input":case"select":case"textarea":o=!!h.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Mi(l)}}return Cn(l),l.flags&=-16777217,null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==h&&Mi(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(o=we.current,Kc(l)){if(o=l.stateNode,u=l.memoizedProps,h=null,y=ur,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[me]=l,o=!!(o.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||mj(o.nodeValue,u)),o||ps(l)}else o=Uf(o).createTextNode(h),o[me]=l,l.stateNode=o}return Cn(l),null;case 13:if(h=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Kc(l),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[me]=l}else Xc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Cn(l),y=!1}else y=e1(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Ni(l),l):(Ni(l),null)}if(Ni(l),(l.flags&128)!==0)return l.lanes=u,l;if(u=h!==null,o=o!==null&&o.memoizedState!==null,u){h=l.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var S=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(S=h.memoizedState.cachePool.pool),S!==y&&(h.flags|=2048)}return u!==o&&u&&(l.child.flags|=8192),Rf(l,l.updateQueue),Cn(l),null;case 4:return ot(),o===null&&hv(l.stateNode.containerInfo),Cn(l),null;case 10:return Pi(l.type),Cn(l),null;case 19:if(te(qn),y=l.memoizedState,y===null)return Cn(l),null;if(h=(l.flags&128)!==0,S=y.rendering,S===null)if(h)hu(y,!1);else{if(_n!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(S=wf(o),S!==null){for(l.flags|=128,hu(y,!1),o=S.updateQueue,l.updateQueue=o,Rf(l,o),l.subtreeFlags=0,o=u,u=l.child;u!==null;)KS(u,o),u=u.sibling;return ae(qn,qn.current&1|2),l.child}o=o.sibling}y.tail!==null&&Re()>Af&&(l.flags|=128,h=!0,hu(y,!1),l.lanes=4194304)}else{if(!h)if(o=wf(S),o!==null){if(l.flags|=128,h=!0,o=o.updateQueue,l.updateQueue=o,Rf(l,o),hu(y,!0),y.tail===null&&y.tailMode==="hidden"&&!S.alternate&&!Vt)return Cn(l),null}else 2*Re()-y.renderingStartTime>Af&&u!==536870912&&(l.flags|=128,h=!0,hu(y,!1),l.lanes=4194304);y.isBackwards?(S.sibling=l.child,l.child=S):(o=y.last,o!==null?o.sibling=S:l.child=S,y.last=S)}return y.tail!==null?(l=y.tail,y.rendering=l,y.tail=l.sibling,y.renderingStartTime=Re(),l.sibling=null,o=qn.current,ae(qn,h?o&1|2:o&1),l):(Cn(l),null);case 22:case 23:return Ni(l),mg(),h=l.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(u&536870912)!==0&&(l.flags&128)===0&&(Cn(l),l.subtreeFlags&6&&(l.flags|=8192)):Cn(l),u=l.updateQueue,u!==null&&Rf(l,u.retryQueue),u=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),o!==null&&te(vs),null;case 24:return u=null,o!==null&&(u=o.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),Pi(Fn),Cn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function bN(o,l){switch(tg(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Pi(Fn),ot(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return Ct(l),null;case 13:if(Ni(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Xc()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return te(qn),null;case 4:return ot(),null;case 10:return Pi(l.type),null;case 22:case 23:return Ni(l),mg(),o!==null&&te(vs),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Pi(Fn),null;case 25:return null;default:return null}}function jw(o,l){switch(tg(l),l.tag){case 3:Pi(Fn),ot();break;case 26:case 27:case 5:Ct(l);break;case 4:ot();break;case 13:Ni(l);break;case 19:te(qn);break;case 10:Pi(l.type);break;case 22:case 23:Ni(l),mg(),o!==null&&te(vs);break;case 24:Pi(Fn)}}function pu(o,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&o)===o){h=void 0;var S=u.create,D=u.inst;h=S(),D.destroy=h}u=u.next}while(u!==y)}}catch(N){rn(l,l.return,N)}}function Sa(o,l,u){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var S=y.next;h=S;do{if((h.tag&o)===o){var D=h.inst,N=D.destroy;if(N!==void 0){D.destroy=void 0,y=l;var z=u,ee=N;try{ee()}catch(de){rn(y,z,de)}}}h=h.next}while(h!==S)}}catch(de){rn(l,l.return,de)}}function Cw(o){var l=o.updateQueue;if(l!==null){var u=o.stateNode;try{d1(l,u)}catch(h){rn(o,o.return,h)}}}function Ew(o,l,u){u.props=xs(o.type,o.memoizedProps),u.state=o.memoizedState;try{u.componentWillUnmount()}catch(h){rn(o,l,h)}}function mu(o,l){try{var u=o.ref;if(u!==null){switch(o.tag){case 26:case 27:case 5:var h=o.stateNode;break;case 30:h=o.stateNode;break;default:h=o.stateNode}typeof u=="function"?o.refCleanup=u(h):u.current=h}}catch(y){rn(o,l,y)}}function Wo(o,l){var u=o.ref,h=o.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){rn(o,l,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){rn(o,l,y)}else u.current=null}function Tw(o){var l=o.type,u=o.memoizedProps,h=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){rn(o,o.return,y)}}function Fg(o,l,u){try{var h=o.stateNode;BN(h,o.type,u,l),h[Te]=l}catch(y){rn(o,o.return,y)}}function Rw(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Da(o.type)||o.tag===4}function qg(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Rw(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Da(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Hg(o,l,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(o,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(o),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=zf));else if(h!==4&&(h===27&&Da(o.type)&&(u=o.stateNode,l=null),o=o.child,o!==null))for(Hg(o,l,u),o=o.sibling;o!==null;)Hg(o,l,u),o=o.sibling}function _f(o,l,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?u.insertBefore(o,l):u.appendChild(o);else if(h!==4&&(h===27&&Da(o.type)&&(u=o.stateNode),o=o.child,o!==null))for(_f(o,l,u),o=o.sibling;o!==null;)_f(o,l,u),o=o.sibling}function _w(o){var l=o.stateNode,u=o.memoizedProps;try{for(var h=o.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Zn(l,h,u),l[me]=o,l[Te]=u}catch(S){rn(o,o.return,S)}}var Ii=!1,kn=!1,Gg=!1,Dw=typeof WeakSet=="function"?WeakSet:Set,Wn=null;function SN(o,l){if(o=o.containerInfo,gv=Gf,o=US(o),qm(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,S=h.focusNode;h=h.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var D=0,N=-1,z=-1,ee=0,de=0,pe=o,ne=null;t:for(;;){for(var ie;pe!==u||y!==0&&pe.nodeType!==3||(N=D+y),pe!==S||h!==0&&pe.nodeType!==3||(z=D+h),pe.nodeType===3&&(D+=pe.nodeValue.length),(ie=pe.firstChild)!==null;)ne=pe,pe=ie;for(;;){if(pe===o)break t;if(ne===u&&++ee===y&&(N=D),ne===S&&++de===h&&(z=D),(ie=pe.nextSibling)!==null)break;pe=ne,ne=pe.parentNode}pe=ie}u=N===-1||z===-1?null:{start:N,end:z}}else u=null}u=u||{start:0,end:0}}else u=null;for(vv={focusedElem:o,selectionRange:u},Gf=!1,Wn=l;Wn!==null;)if(l=Wn,o=l.child,(l.subtreeFlags&1024)!==0&&o!==null)o.return=l,Wn=o;else for(;Wn!==null;){switch(l=Wn,S=l.alternate,o=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((o&1024)!==0&&S!==null){o=void 0,u=l,y=S.memoizedProps,S=S.memoizedState,h=u.stateNode;try{var ct=xs(u.type,y,u.elementType===u.type);o=h.getSnapshotBeforeUpdate(ct,S),h.__reactInternalSnapshotBeforeUpdate=o}catch(it){rn(u,u.return,it)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,u=o.nodeType,u===9)bv(o);else if(u===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":bv(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Wn=o;break}Wn=l.return}}function Aw(o,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:wa(o,u),h&4&&pu(5,u);break;case 1:if(wa(o,u),h&4)if(o=u.stateNode,l===null)try{o.componentDidMount()}catch(D){rn(u,u.return,D)}else{var y=xs(u.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(y,l,o.__reactInternalSnapshotBeforeUpdate)}catch(D){rn(u,u.return,D)}}h&64&&Cw(u),h&512&&mu(u,u.return);break;case 3:if(wa(o,u),h&64&&(o=u.updateQueue,o!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{d1(o,l)}catch(D){rn(u,u.return,D)}}break;case 27:l===null&&h&4&&_w(u);case 26:case 5:wa(o,u),l===null&&h&4&&Tw(u),h&512&&mu(u,u.return);break;case 12:wa(o,u);break;case 13:wa(o,u),h&4&&Nw(o,u),h&64&&(o=u.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(u=AN.bind(null,u),QN(o,u))));break;case 22:if(h=u.memoizedState!==null||Ii,!h){l=l!==null&&l.memoizedState!==null||kn,y=Ii;var S=kn;Ii=h,(kn=l)&&!S?ja(o,u,(u.subtreeFlags&8772)!==0):wa(o,u),Ii=y,kn=S}break;case 30:break;default:wa(o,u)}}function Pw(o){var l=o.alternate;l!==null&&(o.alternate=null,Pw(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Ye(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var vn=null,Cr=!1;function Li(o,l,u){for(u=u.child;u!==null;)kw(o,l,u),u=u.sibling}function kw(o,l,u){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(_t,u)}catch{}switch(u.tag){case 26:kn||Wo(u,l),Li(o,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:kn||Wo(u,l);var h=vn,y=Cr;Da(u.type)&&(vn=u.stateNode,Cr=!1),Li(o,l,u),Cu(u.stateNode),vn=h,Cr=y;break;case 5:kn||Wo(u,l);case 6:if(h=vn,y=Cr,vn=null,Li(o,l,u),vn=h,Cr=y,vn!==null)if(Cr)try{(vn.nodeType===9?vn.body:vn.nodeName==="HTML"?vn.ownerDocument.body:vn).removeChild(u.stateNode)}catch(S){rn(u,l,S)}else try{vn.removeChild(u.stateNode)}catch(S){rn(u,l,S)}break;case 18:vn!==null&&(Cr?(o=vn,bj(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,u.stateNode),ku(o)):bj(vn,u.stateNode));break;case 4:h=vn,y=Cr,vn=u.stateNode.containerInfo,Cr=!0,Li(o,l,u),vn=h,Cr=y;break;case 0:case 11:case 14:case 15:kn||Sa(2,u,l),kn||Sa(4,u,l),Li(o,l,u);break;case 1:kn||(Wo(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&Ew(u,l,h)),Li(o,l,u);break;case 21:Li(o,l,u);break;case 22:kn=(h=kn)||u.memoizedState!==null,Li(o,l,u),kn=h;break;default:Li(o,l,u)}}function Nw(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{ku(o)}catch(u){rn(l,l.return,u)}}function wN(o){switch(o.tag){case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new Dw),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new Dw),l;default:throw Error(r(435,o.tag))}}function Wg(o,l){var u=wN(o);l.forEach(function(h){var y=PN.bind(null,o,h);u.has(h)||(u.add(h),h.then(y,y))})}function Ur(o,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],S=o,D=l,N=D;e:for(;N!==null;){switch(N.tag){case 27:if(Da(N.type)){vn=N.stateNode,Cr=!1;break e}break;case 5:vn=N.stateNode,Cr=!1;break e;case 3:case 4:vn=N.stateNode.containerInfo,Cr=!0;break e}N=N.return}if(vn===null)throw Error(r(160));kw(S,D,y),vn=null,Cr=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Ow(l,o),l=l.sibling}var Ro=null;function Ow(o,l){var u=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Ur(l,o),Br(o),h&4&&(Sa(3,o,o.return),pu(3,o),Sa(5,o,o.return));break;case 1:Ur(l,o),Br(o),h&512&&(kn||u===null||Wo(u,u.return)),h&64&&Ii&&(o=o.updateQueue,o!==null&&(h=o.callbacks,h!==null&&(u=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=Ro;if(Ur(l,o),Br(o),h&512&&(kn||u===null||Wo(u,u.return)),h&4){var S=u!==null?u.memoizedState:null;if(h=o.memoizedState,u===null)if(h===null)if(o.stateNode===null){e:{h=o.type,u=o.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":S=y.getElementsByTagName("title")[0],(!S||S[qe]||S[me]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(h),y.head.insertBefore(S,y.querySelector("head > title"))),Zn(S,h,u),S[me]=o,mt(S),h=S;break e;case"link":var D=_j("link","href",y).get(h+(u.href||""));if(D){for(var N=0;N<D.length;N++)if(S=D[N],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){D.splice(N,1);break t}}S=y.createElement(h),Zn(S,h,u),y.head.appendChild(S);break;case"meta":if(D=_j("meta","content",y).get(h+(u.content||""))){for(N=0;N<D.length;N++)if(S=D[N],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){D.splice(N,1);break t}}S=y.createElement(h),Zn(S,h,u),y.head.appendChild(S);break;default:throw Error(r(468,h))}S[me]=o,mt(S),h=S}o.stateNode=h}else Dj(y,o.type,o.stateNode);else o.stateNode=Rj(y,h,o.memoizedProps);else S!==h?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,h===null?Dj(y,o.type,o.stateNode):Rj(y,h,o.memoizedProps)):h===null&&o.stateNode!==null&&Fg(o,o.memoizedProps,u.memoizedProps)}break;case 27:Ur(l,o),Br(o),h&512&&(kn||u===null||Wo(u,u.return)),u!==null&&h&4&&Fg(o,o.memoizedProps,u.memoizedProps);break;case 5:if(Ur(l,o),Br(o),h&512&&(kn||u===null||Wo(u,u.return)),o.flags&32){y=o.stateNode;try{ml(y,"")}catch(ie){rn(o,o.return,ie)}}h&4&&o.stateNode!=null&&(y=o.memoizedProps,Fg(o,y,u!==null?u.memoizedProps:y)),h&1024&&(Gg=!0);break;case 6:if(Ur(l,o),Br(o),h&4){if(o.stateNode===null)throw Error(r(162));h=o.memoizedProps,u=o.stateNode;try{u.nodeValue=h}catch(ie){rn(o,o.return,ie)}}break;case 3:if(Ff=null,y=Ro,Ro=Bf(l.containerInfo),Ur(l,o),Ro=y,Br(o),h&4&&u!==null&&u.memoizedState.isDehydrated)try{ku(l.containerInfo)}catch(ie){rn(o,o.return,ie)}Gg&&(Gg=!1,Mw(o));break;case 4:h=Ro,Ro=Bf(o.stateNode.containerInfo),Ur(l,o),Br(o),Ro=h;break;case 12:Ur(l,o),Br(o);break;case 13:Ur(l,o),Br(o),o.child.flags&8192&&o.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Jg=Re()),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Wg(o,h)));break;case 22:y=o.memoizedState!==null;var z=u!==null&&u.memoizedState!==null,ee=Ii,de=kn;if(Ii=ee||y,kn=de||z,Ur(l,o),kn=de,Ii=ee,Br(o),h&8192)e:for(l=o.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||z||Ii||kn||bs(o)),u=null,l=o;;){if(l.tag===5||l.tag===26){if(u===null){z=u=l;try{if(S=z.stateNode,y)D=S.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{N=z.stateNode;var pe=z.memoizedProps.style,ne=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(ie){rn(z,z.return,ie)}}}else if(l.tag===6){if(u===null){z=l;try{z.stateNode.nodeValue=y?"":z.memoizedProps}catch(ie){rn(z,z.return,ie)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=o.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Wg(o,u))));break;case 19:Ur(l,o),Br(o),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Wg(o,h)));break;case 30:break;case 21:break;default:Ur(l,o),Br(o)}}function Br(o){var l=o.flags;if(l&2){try{for(var u,h=o.return;h!==null;){if(Rw(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,S=qg(o);_f(o,S,y);break;case 5:var D=u.stateNode;u.flags&32&&(ml(D,""),u.flags&=-33);var N=qg(o);_f(o,N,D);break;case 3:case 4:var z=u.stateNode.containerInfo,ee=qg(o);Hg(o,ee,z);break;default:throw Error(r(161))}}catch(de){rn(o,o.return,de)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function Mw(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;Mw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function wa(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Aw(o,l.alternate,l),l=l.sibling}function bs(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Sa(4,l,l.return),bs(l);break;case 1:Wo(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&Ew(l,l.return,u),bs(l);break;case 27:Cu(l.stateNode);case 26:case 5:Wo(l,l.return),bs(l);break;case 22:l.memoizedState===null&&bs(l);break;case 30:bs(l);break;default:bs(l)}o=o.sibling}}function ja(o,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=o,S=l,D=S.flags;switch(S.tag){case 0:case 11:case 15:ja(y,S,u),pu(4,S);break;case 1:if(ja(y,S,u),h=S,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ee){rn(h,h.return,ee)}if(h=S,y=h.updateQueue,y!==null){var N=h.stateNode;try{var z=y.shared.hiddenCallbacks;if(z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<z.length;y++)u1(z[y],N)}catch(ee){rn(h,h.return,ee)}}u&&D&64&&Cw(S),mu(S,S.return);break;case 27:_w(S);case 26:case 5:ja(y,S,u),u&&h===null&&D&4&&Tw(S),mu(S,S.return);break;case 12:ja(y,S,u);break;case 13:ja(y,S,u),u&&D&4&&Nw(y,S);break;case 22:S.memoizedState===null&&ja(y,S,u),mu(S,S.return);break;case 30:break;default:ja(y,S,u)}l=l.sibling}}function Qg(o,l){var u=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==u&&(o!=null&&o.refCount++,u!=null&&eu(u))}function Yg(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&eu(o))}function Qo(o,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Iw(o,l,u,h),l=l.sibling}function Iw(o,l,u,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:Qo(o,l,u,h),y&2048&&pu(9,l);break;case 1:Qo(o,l,u,h);break;case 3:Qo(o,l,u,h),y&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&eu(o)));break;case 12:if(y&2048){Qo(o,l,u,h),o=l.stateNode;try{var S=l.memoizedProps,D=S.id,N=S.onPostCommit;typeof N=="function"&&N(D,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(z){rn(l,l.return,z)}}else Qo(o,l,u,h);break;case 13:Qo(o,l,u,h);break;case 23:break;case 22:S=l.stateNode,D=l.alternate,l.memoizedState!==null?S._visibility&2?Qo(o,l,u,h):gu(o,l):S._visibility&2?Qo(o,l,u,h):(S._visibility|=2,Ol(o,l,u,h,(l.subtreeFlags&10256)!==0)),y&2048&&Qg(D,l);break;case 24:Qo(o,l,u,h),y&2048&&Yg(l.alternate,l);break;default:Qo(o,l,u,h)}}function Ol(o,l,u,h,y){for(y=y&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var S=o,D=l,N=u,z=h,ee=D.flags;switch(D.tag){case 0:case 11:case 15:Ol(S,D,N,z,y),pu(8,D);break;case 23:break;case 22:var de=D.stateNode;D.memoizedState!==null?de._visibility&2?Ol(S,D,N,z,y):gu(S,D):(de._visibility|=2,Ol(S,D,N,z,y)),y&&ee&2048&&Qg(D.alternate,D);break;case 24:Ol(S,D,N,z,y),y&&ee&2048&&Yg(D.alternate,D);break;default:Ol(S,D,N,z,y)}l=l.sibling}}function gu(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=o,h=l,y=h.flags;switch(h.tag){case 22:gu(u,h),y&2048&&Qg(h.alternate,h);break;case 24:gu(u,h),y&2048&&Yg(h.alternate,h);break;default:gu(u,h)}l=l.sibling}}var vu=8192;function Ml(o){if(o.subtreeFlags&vu)for(o=o.child;o!==null;)Lw(o),o=o.sibling}function Lw(o){switch(o.tag){case 26:Ml(o),o.flags&vu&&o.memoizedState!==null&&s4(Ro,o.memoizedState,o.memoizedProps);break;case 5:Ml(o);break;case 3:case 4:var l=Ro;Ro=Bf(o.stateNode.containerInfo),Ml(o),Ro=l;break;case 22:o.memoizedState===null&&(l=o.alternate,l!==null&&l.memoizedState!==null?(l=vu,vu=16777216,Ml(o),vu=l):Ml(o));break;default:Ml(o)}}function $w(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function yu(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wn=h,Uw(h,o)}$w(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)zw(o),o=o.sibling}function zw(o){switch(o.tag){case 0:case 11:case 15:yu(o),o.flags&2048&&Sa(9,o,o.return);break;case 3:yu(o);break;case 12:yu(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Df(o)):yu(o);break;default:yu(o)}}function Df(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wn=h,Uw(h,o)}$w(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Sa(8,l,l.return),Df(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Df(l));break;default:Df(l)}o=o.sibling}}function Uw(o,l){for(;Wn!==null;){var u=Wn;switch(u.tag){case 0:case 11:case 15:Sa(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:eu(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Wn=h;else e:for(u=o;Wn!==null;){h=Wn;var y=h.sibling,S=h.return;if(Pw(h),h===u){Wn=null;break e}if(y!==null){y.return=S,Wn=y;break e}Wn=S}}}var jN={getCacheForType:function(o){var l=tr(Fn),u=l.data.get(o);return u===void 0&&(u=o(),l.data.set(o,u)),u}},CN=typeof WeakMap=="function"?WeakMap:Map,Wt=0,cn=null,Et=null,kt=0,Qt=0,Vr=null,Ca=!1,Il=!1,Kg=!1,$i=0,_n=0,Ea=0,Ss=0,Xg=0,so=0,Ll=0,xu=null,Er=null,Zg=!1,Jg=0,Af=1/0,Pf=null,Ta=null,Xn=0,Ra=null,$l=null,zl=0,ev=0,tv=null,Bw=null,bu=0,nv=null;function Fr(){if((Wt&2)!==0&&kt!==0)return kt&-kt;if(O.T!==null){var o=Tl;return o!==0?o:cv()}return U()}function Vw(){so===0&&(so=(kt&536870912)===0||Vt?bi():536870912);var o=ao.current;return o!==null&&(o.flags|=32),so}function qr(o,l,u){(o===cn&&(Qt===2||Qt===9)||o.cancelPendingCommit!==null)&&(Ul(o,0),_a(o,kt,so,!1)),br(o,u),((Wt&2)===0||o!==cn)&&(o===cn&&((Wt&2)===0&&(Ss|=u),_n===4&&_a(o,kt,so,!1)),Yo(o))}function Fw(o,l,u){if((Wt&6)!==0)throw Error(r(327));var h=!u&&(l&124)===0&&(l&o.expiredLanes)===0||Zr(o,l),y=h?RN(o,l):iv(o,l,!0),S=h;do{if(y===0){Il&&!h&&_a(o,l,0,!1);break}else{if(u=o.current.alternate,S&&!EN(u)){y=iv(o,l,!1),S=!1;continue}if(y===2){if(S=l,o.errorRecoveryDisabledLanes&S)var D=0;else D=o.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){l=D;e:{var N=o;y=xu;var z=N.current.memoizedState.isDehydrated;if(z&&(Ul(N,D).flags|=256),D=iv(N,D,!1),D!==2){if(Kg&&!z){N.errorRecoveryDisabledLanes|=S,Ss|=S,y=4;break e}S=Er,Er=y,S!==null&&(Er===null?Er=S:Er.push.apply(Er,S))}y=D}if(S=!1,y!==2)continue}}if(y===1){Ul(o,0),_a(o,l,0,!0);break}e:{switch(h=o,S=y,S){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:_a(h,l,so,!Ca);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(y=Jg+300-Re(),10<y)){if(_a(h,l,so,!Ca),xi(h,0,!0)!==0)break e;h.timeoutHandle=yj(qw.bind(null,h,u,Er,Pf,Zg,l,so,Ss,Ll,Ca,S,2,-0,0),y);break e}qw(h,u,Er,Pf,Zg,l,so,Ss,Ll,Ca,S,0,-0,0)}}break}while(!0);Yo(o)}function qw(o,l,u,h,y,S,D,N,z,ee,de,pe,ne,ie){if(o.timeoutHandle=-1,pe=l.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(Ru={stylesheets:null,count:0,unsuspend:a4},Lw(l),pe=l4(),pe!==null)){o.cancelPendingCommit=pe(Xw.bind(null,o,l,S,u,h,y,D,N,z,de,1,ne,ie)),_a(o,S,D,!ee);return}Xw(o,l,S,u,h,y,D,N,z)}function EN(o){for(var l=o;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],S=y.getSnapshot;y=y.value;try{if(!$r(S(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function _a(o,l,u,h){l&=~Xg,l&=~Ss,o.suspendedLanes|=l,o.pingedLanes&=~l,h&&(o.warmLanes|=l),h=o.expirationTimes;for(var y=l;0<y;){var S=31-Lt(y),D=1<<S;h[S]=-1,y&=~D}u!==0&&Si(o,u,l)}function kf(){return(Wt&6)===0?(Su(0),!1):!0}function rv(){if(Et!==null){if(Qt===0)var o=Et.return;else o=Et,Ai=ms=null,bg(o),kl=null,du=0,o=Et;for(;o!==null;)jw(o.alternate,o),o=o.return;Et=null}}function Ul(o,l){var u=o.timeoutHandle;u!==-1&&(o.timeoutHandle=-1,FN(u)),u=o.cancelPendingCommit,u!==null&&(o.cancelPendingCommit=null,u()),rv(),cn=o,Et=u=Ri(o.current,null),kt=l,Qt=0,Vr=null,Ca=!1,Il=Zr(o,l),Kg=!1,Ll=so=Xg=Ss=Ea=_n=0,Er=xu=null,Zg=!1,(l&8)!==0&&(l|=l&32);var h=o.entangledLanes;if(h!==0)for(o=o.entanglements,h&=l;0<h;){var y=31-Lt(h),S=1<<y;l|=o[y],h&=~S}return $i=l,Jd(),u}function Hw(o,l){St=null,O.H=xf,l===nu||l===cf?(l=l1(),Qt=3):l===i1?(l=l1(),Qt=4):Qt=l===cw?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Vr=l,Et===null&&(_n=1,Cf(o,no(l,o.current)))}function Gw(){var o=O.H;return O.H=xf,o===null?xf:o}function Ww(){var o=O.A;return O.A=jN,o}function ov(){_n=4,Ca||(kt&4194048)!==kt&&ao.current!==null||(Il=!0),(Ea&134217727)===0&&(Ss&134217727)===0||cn===null||_a(cn,kt,so,!1)}function iv(o,l,u){var h=Wt;Wt|=2;var y=Gw(),S=Ww();(cn!==o||kt!==l)&&(Pf=null,Ul(o,l)),l=!1;var D=_n;e:do try{if(Qt!==0&&Et!==null){var N=Et,z=Vr;switch(Qt){case 8:rv(),D=6;break e;case 3:case 2:case 9:case 6:ao.current===null&&(l=!0);var ee=Qt;if(Qt=0,Vr=null,Bl(o,N,z,ee),u&&Il){D=0;break e}break;default:ee=Qt,Qt=0,Vr=null,Bl(o,N,z,ee)}}TN(),D=_n;break}catch(de){Hw(o,de)}while(!0);return l&&o.shellSuspendCounter++,Ai=ms=null,Wt=h,O.H=y,O.A=S,Et===null&&(cn=null,kt=0,Jd()),D}function TN(){for(;Et!==null;)Qw(Et)}function RN(o,l){var u=Wt;Wt|=2;var h=Gw(),y=Ww();cn!==o||kt!==l?(Pf=null,Af=Re()+500,Ul(o,l)):Il=Zr(o,l);e:do try{if(Qt!==0&&Et!==null){l=Et;var S=Vr;t:switch(Qt){case 1:Qt=0,Vr=null,Bl(o,l,S,1);break;case 2:case 9:if(a1(S)){Qt=0,Vr=null,Yw(l);break}l=function(){Qt!==2&&Qt!==9||cn!==o||(Qt=7),Yo(o)},S.then(l,l);break e;case 3:Qt=7;break e;case 4:Qt=5;break e;case 7:a1(S)?(Qt=0,Vr=null,Yw(l)):(Qt=0,Vr=null,Bl(o,l,S,7));break;case 5:var D=null;switch(Et.tag){case 26:D=Et.memoizedState;case 5:case 27:var N=Et;if(!D||Aj(D)){Qt=0,Vr=null;var z=N.sibling;if(z!==null)Et=z;else{var ee=N.return;ee!==null?(Et=ee,Nf(ee)):Et=null}break t}}Qt=0,Vr=null,Bl(o,l,S,5);break;case 6:Qt=0,Vr=null,Bl(o,l,S,6);break;case 8:rv(),_n=6;break e;default:throw Error(r(462))}}_N();break}catch(de){Hw(o,de)}while(!0);return Ai=ms=null,O.H=h,O.A=y,Wt=u,Et!==null?0:(cn=null,kt=0,Jd(),_n)}function _N(){for(;Et!==null&&!Rt();)Qw(Et)}function Qw(o){var l=Sw(o.alternate,o,$i);o.memoizedProps=o.pendingProps,l===null?Nf(o):Et=l}function Yw(o){var l=o,u=l.alternate;switch(l.tag){case 15:case 0:l=mw(u,l,l.pendingProps,l.type,void 0,kt);break;case 11:l=mw(u,l,l.pendingProps,l.type.render,l.ref,kt);break;case 5:bg(l);default:jw(u,l),l=Et=KS(l,$i),l=Sw(u,l,$i)}o.memoizedProps=o.pendingProps,l===null?Nf(o):Et=l}function Bl(o,l,u,h){Ai=ms=null,bg(l),kl=null,du=0;var y=l.return;try{if(vN(o,y,l,u,kt)){_n=1,Cf(o,no(u,o.current)),Et=null;return}}catch(S){if(y!==null)throw Et=y,S;_n=1,Cf(o,no(u,o.current)),Et=null;return}l.flags&32768?(Vt||h===1?o=!0:Il||(kt&536870912)!==0?o=!1:(Ca=o=!0,(h===2||h===9||h===3||h===6)&&(h=ao.current,h!==null&&h.tag===13&&(h.flags|=16384))),Kw(l,o)):Nf(l)}function Nf(o){var l=o;do{if((l.flags&32768)!==0){Kw(l,Ca);return}o=l.return;var u=xN(l.alternate,l,$i);if(u!==null){Et=u;return}if(l=l.sibling,l!==null){Et=l;return}Et=l=o}while(l!==null);_n===0&&(_n=5)}function Kw(o,l){do{var u=bN(o.alternate,o);if(u!==null){u.flags&=32767,Et=u;return}if(u=o.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(o=o.sibling,o!==null)){Et=o;return}Et=o=u}while(o!==null);_n=6,Et=null}function Xw(o,l,u,h,y,S,D,N,z){o.cancelPendingCommit=null;do Of();while(Xn!==0);if((Wt&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(S=l.lanes|l.childLanes,S|=Ym,Hn(o,u,S,D,N,z),o===cn&&(Et=cn=null,kt=0),$l=l,Ra=o,zl=u,ev=S,tv=y,Bw=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,kN(he,function(){return nj(),null})):(o.callbackNode=null,o.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=O.T,O.T=null,y=L.p,L.p=2,D=Wt,Wt|=4;try{SN(o,l,u)}finally{Wt=D,L.p=y,O.T=h}}Xn=1,Zw(),Jw(),ej()}}function Zw(){if(Xn===1){Xn=0;var o=Ra,l=$l,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=O.T,O.T=null;var h=L.p;L.p=2;var y=Wt;Wt|=4;try{Ow(l,o);var S=vv,D=US(o.containerInfo),N=S.focusedElem,z=S.selectionRange;if(D!==N&&N&&N.ownerDocument&&zS(N.ownerDocument.documentElement,N)){if(z!==null&&qm(N)){var ee=z.start,de=z.end;if(de===void 0&&(de=ee),"selectionStart"in N)N.selectionStart=ee,N.selectionEnd=Math.min(de,N.value.length);else{var pe=N.ownerDocument||document,ne=pe&&pe.defaultView||window;if(ne.getSelection){var ie=ne.getSelection(),ct=N.textContent.length,it=Math.min(z.start,ct),en=z.end===void 0?it:Math.min(z.end,ct);!ie.extend&&it>en&&(D=en,en=it,it=D);var Y=$S(N,it),G=$S(N,en);if(Y&&G&&(ie.rangeCount!==1||ie.anchorNode!==Y.node||ie.anchorOffset!==Y.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var J=pe.createRange();J.setStart(Y.node,Y.offset),ie.removeAllRanges(),it>en?(ie.addRange(J),ie.extend(G.node,G.offset)):(J.setEnd(G.node,G.offset),ie.addRange(J))}}}}for(pe=[],ie=N;ie=ie.parentNode;)ie.nodeType===1&&pe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<pe.length;N++){var fe=pe[N];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Gf=!!gv,vv=gv=null}finally{Wt=y,L.p=h,O.T=u}}o.current=l,Xn=2}}function Jw(){if(Xn===2){Xn=0;var o=Ra,l=$l,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=O.T,O.T=null;var h=L.p;L.p=2;var y=Wt;Wt|=4;try{Aw(o,l.alternate,l)}finally{Wt=y,L.p=h,O.T=u}}Xn=3}}function ej(){if(Xn===4||Xn===3){Xn=0,tn();var o=Ra,l=$l,u=zl,h=Bw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Xn=5:(Xn=0,$l=Ra=null,tj(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(Ta=null),as(u),l=l.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(_t,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=O.T,y=L.p,L.p=2,O.T=null;try{for(var S=o.onRecoverableError,D=0;D<h.length;D++){var N=h[D];S(N.value,{componentStack:N.stack})}}finally{O.T=l,L.p=y}}(zl&3)!==0&&Of(),Yo(o),y=o.pendingLanes,(u&4194090)!==0&&(y&42)!==0?o===nv?bu++:(bu=0,nv=o):bu=0,Su(0)}}function tj(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,eu(l)))}function Of(o){return Zw(),Jw(),ej(),nj()}function nj(){if(Xn!==5)return!1;var o=Ra,l=ev;ev=0;var u=as(zl),h=O.T,y=L.p;try{L.p=32>u?32:u,O.T=null,u=tv,tv=null;var S=Ra,D=zl;if(Xn=0,$l=Ra=null,zl=0,(Wt&6)!==0)throw Error(r(331));var N=Wt;if(Wt|=4,zw(S.current),Iw(S,S.current,D,u),Wt=N,Su(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(_t,S)}catch{}return!0}finally{L.p=y,O.T=h,tj(o,l)}}function rj(o,l,u){l=no(u,l),l=Og(o.stateNode,l,2),o=va(o,l,2),o!==null&&(br(o,2),Yo(o))}function rn(o,l,u){if(o.tag===3)rj(o,o,u);else for(;l!==null;){if(l.tag===3){rj(l,o,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ta===null||!Ta.has(h))){o=no(u,o),u=sw(2),h=va(l,u,2),h!==null&&(lw(u,h,l,o),br(h,2),Yo(h));break}}l=l.return}}function av(o,l,u){var h=o.pingCache;if(h===null){h=o.pingCache=new CN;var y=new Set;h.set(l,y)}else y=h.get(l),y===void 0&&(y=new Set,h.set(l,y));y.has(u)||(Kg=!0,y.add(u),o=DN.bind(null,o,l,u),l.then(o,o))}function DN(o,l,u){var h=o.pingCache;h!==null&&h.delete(l),o.pingedLanes|=o.suspendedLanes&u,o.warmLanes&=~u,cn===o&&(kt&u)===u&&(_n===4||_n===3&&(kt&62914560)===kt&&300>Re()-Jg?(Wt&2)===0&&Ul(o,0):Xg|=u,Ll===kt&&(Ll=0)),Yo(o)}function oj(o,l){l===0&&(l=ca()),o=wl(o,l),o!==null&&(br(o,l),Yo(o))}function AN(o){var l=o.memoizedState,u=0;l!==null&&(u=l.retryLane),oj(o,u)}function PN(o,l){var u=0;switch(o.tag){case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),oj(o,u)}function kN(o,l){return Mt(o,l)}var Mf=null,Vl=null,sv=!1,If=!1,lv=!1,ws=0;function Yo(o){o!==Vl&&o.next===null&&(Vl===null?Mf=Vl=o:Vl=Vl.next=o),If=!0,sv||(sv=!0,ON())}function Su(o,l){if(!lv&&If){lv=!0;do for(var u=!1,h=Mf;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var S=0;else{var D=h.suspendedLanes,N=h.pingedLanes;S=(1<<31-Lt(42|o)+1)-1,S&=y&~(D&~N),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,lj(h,S))}else S=kt,S=xi(h,h===cn?S:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(S&3)===0||Zr(h,S)||(u=!0,lj(h,S));h=h.next}while(u);lv=!1}}function NN(){ij()}function ij(){If=sv=!1;var o=0;ws!==0&&(VN()&&(o=ws),ws=0);for(var l=Re(),u=null,h=Mf;h!==null;){var y=h.next,S=aj(h,l);S===0?(h.next=null,u===null?Mf=y:u.next=y,y===null&&(Vl=u)):(u=h,(o!==0||(S&3)!==0)&&(If=!0)),h=y}Su(o)}function aj(o,l){for(var u=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var D=31-Lt(S),N=1<<D,z=y[D];z===-1?((N&u)===0||(N&h)!==0)&&(y[D]=fl(N,l)):z<=l&&(o.expiredLanes|=N),S&=~N}if(l=cn,u=kt,u=xi(o,o===l?u:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h=o.callbackNode,u===0||o===l&&(Qt===2||Qt===9)||o.cancelPendingCommit!==null)return h!==null&&h!==null&&pt(h),o.callbackNode=null,o.callbackPriority=0;if((u&3)===0||Zr(o,u)){if(l=u&-u,l===o.callbackPriority)return l;switch(h!==null&&pt(h),as(u)){case 2:case 8:u=_e;break;case 32:u=he;break;case 268435456:u=$e;break;default:u=he}return h=sj.bind(null,o),u=Mt(u,h),o.callbackPriority=l,o.callbackNode=u,l}return h!==null&&h!==null&&pt(h),o.callbackPriority=2,o.callbackNode=null,2}function sj(o,l){if(Xn!==0&&Xn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var u=o.callbackNode;if(Of()&&o.callbackNode!==u)return null;var h=kt;return h=xi(o,o===cn?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h===0?null:(Fw(o,h,l),aj(o,Re()),o.callbackNode!=null&&o.callbackNode===u?sj.bind(null,o):null)}function lj(o,l){if(Of())return null;Fw(o,l,!0)}function ON(){qN(function(){(Wt&6)!==0?Mt(Ke,NN):ij()})}function cv(){return ws===0&&(ws=bi()),ws}function cj(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Gd(""+o)}function uj(o,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,o.id&&u.setAttribute("form",o.id),l.parentNode.insertBefore(u,l),o=new FormData(o),u.parentNode.removeChild(u),o}function MN(o,l,u,h,y){if(l==="submit"&&u&&u.stateNode===y){var S=cj((y[Te]||null).action),D=h.submitter;D&&(l=(l=D[Te]||null)?cj(l.formAction):D.getAttribute("formAction"),l!==null&&(S=l,D=null));var N=new Kd("action","action",null,h,y);o.push({event:N,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(ws!==0){var z=D?uj(y,D):new FormData(y);Dg(u,{pending:!0,data:z,method:y.method,action:S},null,z)}}else typeof S=="function"&&(N.preventDefault(),z=D?uj(y,D):new FormData(y),Dg(u,{pending:!0,data:z,method:y.method,action:S},S,z))},currentTarget:y}]})}}for(var uv=0;uv<Qm.length;uv++){var dv=Qm[uv],IN=dv.toLowerCase(),LN=dv[0].toUpperCase()+dv.slice(1);To(IN,"on"+LN)}To(FS,"onAnimationEnd"),To(qS,"onAnimationIteration"),To(HS,"onAnimationStart"),To("dblclick","onDoubleClick"),To("focusin","onFocus"),To("focusout","onBlur"),To(eN,"onTransitionRun"),To(tN,"onTransitionStart"),To(nN,"onTransitionCancel"),To(GS,"onTransitionEnd"),cr("onMouseEnter",["mouseout","mouseover"]),cr("onMouseLeave",["mouseout","mouseover"]),cr("onPointerEnter",["pointerout","pointerover"]),cr("onPointerLeave",["pointerout","pointerover"]),Lr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Lr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Lr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Lr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Lr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Lr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$N=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wu));function dj(o,l){l=(l&4)!==0;for(var u=0;u<o.length;u++){var h=o[u],y=h.event;h=h.listeners;e:{var S=void 0;if(l)for(var D=h.length-1;0<=D;D--){var N=h[D],z=N.instance,ee=N.currentTarget;if(N=N.listener,z!==S&&y.isPropagationStopped())break e;S=N,y.currentTarget=ee;try{S(y)}catch(de){jf(de)}y.currentTarget=null,S=z}else for(D=0;D<h.length;D++){if(N=h[D],z=N.instance,ee=N.currentTarget,N=N.listener,z!==S&&y.isPropagationStopped())break e;S=N,y.currentTarget=ee;try{S(y)}catch(de){jf(de)}y.currentTarget=null,S=z}}}}function Tt(o,l){var u=l[Qe];u===void 0&&(u=l[Qe]=new Set);var h=o+"__bubble";u.has(h)||(fj(l,o,2,!1),u.add(h))}function fv(o,l,u){var h=0;l&&(h|=4),fj(u,o,h,l)}var Lf="_reactListening"+Math.random().toString(36).slice(2);function hv(o){if(!o[Lf]){o[Lf]=!0,Xt.forEach(function(u){u!=="selectionchange"&&($N.has(u)||fv(u,!1,o),fv(u,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Lf]||(l[Lf]=!0,fv("selectionchange",!1,l))}}function fj(o,l,u,h){switch(Ij(l)){case 2:var y=d4;break;case 8:y=f4;break;default:y=Rv}u=y.bind(null,l,u,o),y=void 0,!Mm||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?o.addEventListener(l,u,{capture:!0,passive:y}):o.addEventListener(l,u,!0):y!==void 0?o.addEventListener(l,u,{passive:y}):o.addEventListener(l,u,!1)}function pv(o,l,u,h,y){var S=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var D=h.tag;if(D===3||D===4){var N=h.stateNode.containerInfo;if(N===y)break;if(D===4)for(D=h.return;D!==null;){var z=D.tag;if((z===3||z===4)&&D.stateNode.containerInfo===y)return;D=D.return}for(;N!==null;){if(D=ft(N),D===null)return;if(z=D.tag,z===5||z===6||z===26||z===27){h=S=D;continue e}N=N.parentNode}}h=h.return}xS(function(){var ee=S,de=Nm(u),pe=[];e:{var ne=WS.get(o);if(ne!==void 0){var ie=Kd,ct=o;switch(o){case"keypress":if(Qd(u)===0)break e;case"keydown":case"keyup":ie=kk;break;case"focusin":ct="focus",ie=zm;break;case"focusout":ct="blur",ie=zm;break;case"beforeblur":case"afterblur":ie=zm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=wS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=bk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Mk;break;case FS:case qS:case HS:ie=jk;break;case GS:ie=Lk;break;case"scroll":case"scrollend":ie=yk;break;case"wheel":ie=zk;break;case"copy":case"cut":case"paste":ie=Ek;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=CS;break;case"toggle":case"beforetoggle":ie=Bk}var it=(l&4)!==0,en=!it&&(o==="scroll"||o==="scrollend"),Y=it?ne!==null?ne+"Capture":null:ne;it=[];for(var G=ee,J;G!==null;){var fe=G;if(J=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||J===null||Y===null||(fe=Bc(G,Y),fe!=null&&it.push(ju(G,fe,J))),en)break;G=G.return}0<it.length&&(ne=new ie(ne,ct,null,u,de),pe.push({event:ne,listeners:it}))}}if((l&7)===0){e:{if(ne=o==="mouseover"||o==="pointerover",ie=o==="mouseout"||o==="pointerout",ne&&u!==km&&(ct=u.relatedTarget||u.fromElement)&&(ft(ct)||ct[Ve]))break e;if((ie||ne)&&(ne=de.window===de?de:(ne=de.ownerDocument)?ne.defaultView||ne.parentWindow:window,ie?(ct=u.relatedTarget||u.toElement,ie=ee,ct=ct?ft(ct):null,ct!==null&&(en=s(ct),it=ct.tag,ct!==en||it!==5&&it!==27&&it!==6)&&(ct=null)):(ie=null,ct=ee),ie!==ct)){if(it=wS,fe="onMouseLeave",Y="onMouseEnter",G="mouse",(o==="pointerout"||o==="pointerover")&&(it=CS,fe="onPointerLeave",Y="onPointerEnter",G="pointer"),en=ie==null?ne:Kt(ie),J=ct==null?ne:Kt(ct),ne=new it(fe,G+"leave",ie,u,de),ne.target=en,ne.relatedTarget=J,fe=null,ft(de)===ee&&(it=new it(Y,G+"enter",ct,u,de),it.target=J,it.relatedTarget=en,fe=it),en=fe,ie&&ct)t:{for(it=ie,Y=ct,G=0,J=it;J;J=Fl(J))G++;for(J=0,fe=Y;fe;fe=Fl(fe))J++;for(;0<G-J;)it=Fl(it),G--;for(;0<J-G;)Y=Fl(Y),J--;for(;G--;){if(it===Y||Y!==null&&it===Y.alternate)break t;it=Fl(it),Y=Fl(Y)}it=null}else it=null;ie!==null&&hj(pe,ne,ie,it,!1),ct!==null&&en!==null&&hj(pe,en,ct,it,!0)}}e:{if(ne=ee?Kt(ee):window,ie=ne.nodeName&&ne.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ne.type==="file")var He=kS;else if(AS(ne))if(NS)He=Xk;else{He=Yk;var jt=Qk}else ie=ne.nodeName,!ie||ie.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&Pm(ee.elementType)&&(He=kS):He=Kk;if(He&&(He=He(o,ee))){PS(pe,He,u,de);break e}jt&&jt(o,ne,ee),o==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Am(ne,"number",ne.value)}switch(jt=ee?Kt(ee):window,o){case"focusin":(AS(jt)||jt.contentEditable==="true")&&(xl=jt,Hm=ee,Yc=null);break;case"focusout":Yc=Hm=xl=null;break;case"mousedown":Gm=!0;break;case"contextmenu":case"mouseup":case"dragend":Gm=!1,BS(pe,u,de);break;case"selectionchange":if(Jk)break;case"keydown":case"keyup":BS(pe,u,de)}var et;if(Bm)e:{switch(o){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else yl?_S(o,u)&&(at="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(at="onCompositionStart");at&&(ES&&u.locale!=="ko"&&(yl||at!=="onCompositionStart"?at==="onCompositionEnd"&&yl&&(et=bS()):(ha=de,Im="value"in ha?ha.value:ha.textContent,yl=!0)),jt=$f(ee,at),0<jt.length&&(at=new jS(at,o,null,u,de),pe.push({event:at,listeners:jt}),et?at.data=et:(et=DS(u),et!==null&&(at.data=et)))),(et=Fk?qk(o,u):Hk(o,u))&&(at=$f(ee,"onBeforeInput"),0<at.length&&(jt=new jS("onBeforeInput","beforeinput",null,u,de),pe.push({event:jt,listeners:at}),jt.data=et)),MN(pe,o,ee,u,de)}dj(pe,l)})}function ju(o,l,u){return{instance:o,listener:l,currentTarget:u}}function $f(o,l){for(var u=l+"Capture",h=[];o!==null;){var y=o,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=Bc(o,u),y!=null&&h.unshift(ju(o,y,S)),y=Bc(o,l),y!=null&&h.push(ju(o,y,S))),o.tag===3)return h;o=o.return}return[]}function Fl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function hj(o,l,u,h,y){for(var S=l._reactName,D=[];u!==null&&u!==h;){var N=u,z=N.alternate,ee=N.stateNode;if(N=N.tag,z!==null&&z===h)break;N!==5&&N!==26&&N!==27||ee===null||(z=ee,y?(ee=Bc(u,S),ee!=null&&D.unshift(ju(u,ee,z))):y||(ee=Bc(u,S),ee!=null&&D.push(ju(u,ee,z)))),u=u.return}D.length!==0&&o.push({event:l,listeners:D})}var zN=/\r\n?/g,UN=/\u0000|\uFFFD/g;function pj(o){return(typeof o=="string"?o:""+o).replace(zN,`
|
|
575
|
+
`).replace(UN,"")}function mj(o,l){return l=pj(l),pj(o)===l}function zf(){}function Jt(o,l,u,h,y,S){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||ml(o,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&ml(o,""+h);break;case"className":Ci(o,"class",h);break;case"tabIndex":Ci(o,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Ci(o,u,h);break;case"style":vS(o,h,S);break;case"data":if(l!=="object"){Ci(o,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){o.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(u);break}h=Gd(""+h),o.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){o.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(l!=="input"&&Jt(o,l,"name",y.name,y,null),Jt(o,l,"formEncType",y.formEncType,y,null),Jt(o,l,"formMethod",y.formMethod,y,null),Jt(o,l,"formTarget",y.formTarget,y,null)):(Jt(o,l,"encType",y.encType,y,null),Jt(o,l,"method",y.method,y,null),Jt(o,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(u);break}h=Gd(""+h),o.setAttribute(u,h);break;case"onClick":h!=null&&(o.onclick=zf);break;case"onScroll":h!=null&&Tt("scroll",o);break;case"onScrollEnd":h!=null&&Tt("scrollend",o);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=u}}break;case"multiple":o.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":o.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){o.removeAttribute("xlink:href");break}u=Gd(""+h),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(u,""+h):o.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(u,""):o.removeAttribute(u);break;case"capture":case"download":h===!0?o.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(u,h):o.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?o.setAttribute(u,h):o.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?o.removeAttribute(u):o.setAttribute(u,h);break;case"popover":Tt("beforetoggle",o),Tt("toggle",o),ji(o,"popover",h);break;case"xlinkActuate":gt(o,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":gt(o,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":gt(o,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":gt(o,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":gt(o,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":gt(o,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":gt(o,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":gt(o,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":gt(o,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ji(o,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=gk.get(u)||u,ji(o,u,h))}}function mv(o,l,u,h,y,S){switch(u){case"style":vS(o,h,S);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=u}}break;case"children":typeof h=="string"?ml(o,h):(typeof h=="number"||typeof h=="bigint")&&ml(o,""+h);break;case"onScroll":h!=null&&Tt("scroll",o);break;case"onScrollEnd":h!=null&&Tt("scrollend",o);break;case"onClick":h!=null&&(o.onclick=zf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qo.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),S=o[Te]||null,S=S!=null?S[u]:null,typeof S=="function"&&o.removeEventListener(l,S,y),typeof h=="function")){typeof S!="function"&&S!==null&&(u in o?o[u]=null:o.hasAttribute(u)&&o.removeAttribute(u)),o.addEventListener(l,h,y);break e}u in o?o[u]=h:h===!0?o.setAttribute(u,""):ji(o,u,h)}}}function Zn(o,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tt("error",o),Tt("load",o);var h=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var D=u[S];if(D!=null)switch(S){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Jt(o,l,S,D,u,null)}}y&&Jt(o,l,"srcSet",u.srcSet,u,null),h&&Jt(o,l,"src",u.src,u,null);return;case"input":Tt("invalid",o);var N=S=D=y=null,z=null,ee=null;for(h in u)if(u.hasOwnProperty(h)){var de=u[h];if(de!=null)switch(h){case"name":y=de;break;case"type":D=de;break;case"checked":z=de;break;case"defaultChecked":ee=de;break;case"value":S=de;break;case"defaultValue":N=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:Jt(o,l,h,de,u,null)}}hS(o,S,N,z,ee,D,y,!1),qd(o);return;case"select":Tt("invalid",o),h=D=S=null;for(y in u)if(u.hasOwnProperty(y)&&(N=u[y],N!=null))switch(y){case"value":S=N;break;case"defaultValue":D=N;break;case"multiple":h=N;default:Jt(o,l,y,N,u,null)}l=S,u=D,o.multiple=!!h,l!=null?pl(o,!!h,l,!1):u!=null&&pl(o,!!h,u,!0);return;case"textarea":Tt("invalid",o),S=y=h=null;for(D in u)if(u.hasOwnProperty(D)&&(N=u[D],N!=null))switch(D){case"value":h=N;break;case"defaultValue":y=N;break;case"children":S=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:Jt(o,l,D,N,u,null)}mS(o,h,y,S),qd(o);return;case"option":for(z in u)if(u.hasOwnProperty(z)&&(h=u[z],h!=null))switch(z){case"selected":o.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Jt(o,l,z,h,u,null)}return;case"dialog":Tt("beforetoggle",o),Tt("toggle",o),Tt("cancel",o),Tt("close",o);break;case"iframe":case"object":Tt("load",o);break;case"video":case"audio":for(h=0;h<wu.length;h++)Tt(wu[h],o);break;case"image":Tt("error",o),Tt("load",o);break;case"details":Tt("toggle",o);break;case"embed":case"source":case"link":Tt("error",o),Tt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in u)if(u.hasOwnProperty(ee)&&(h=u[ee],h!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Jt(o,l,ee,h,u,null)}return;default:if(Pm(l)){for(de in u)u.hasOwnProperty(de)&&(h=u[de],h!==void 0&&mv(o,l,de,h,u,void 0));return}}for(N in u)u.hasOwnProperty(N)&&(h=u[N],h!=null&&Jt(o,l,N,h,u,null))}function BN(o,l,u,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,D=null,N=null,z=null,ee=null,de=null;for(ie in u){var pe=u[ie];if(u.hasOwnProperty(ie)&&pe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":z=pe;default:h.hasOwnProperty(ie)||Jt(o,l,ie,null,h,pe)}}for(var ne in h){var ie=h[ne];if(pe=u[ne],h.hasOwnProperty(ne)&&(ie!=null||pe!=null))switch(ne){case"type":S=ie;break;case"name":y=ie;break;case"checked":ee=ie;break;case"defaultChecked":de=ie;break;case"value":D=ie;break;case"defaultValue":N=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,l));break;default:ie!==pe&&Jt(o,l,ne,ie,h,pe)}}Dm(o,D,N,z,ee,de,S,y);return;case"select":ie=D=N=ne=null;for(S in u)if(z=u[S],u.hasOwnProperty(S)&&z!=null)switch(S){case"value":break;case"multiple":ie=z;default:h.hasOwnProperty(S)||Jt(o,l,S,null,h,z)}for(y in h)if(S=h[y],z=u[y],h.hasOwnProperty(y)&&(S!=null||z!=null))switch(y){case"value":ne=S;break;case"defaultValue":N=S;break;case"multiple":D=S;default:S!==z&&Jt(o,l,y,S,h,z)}l=N,u=D,h=ie,ne!=null?pl(o,!!u,ne,!1):!!h!=!!u&&(l!=null?pl(o,!!u,l,!0):pl(o,!!u,u?[]:"",!1));return;case"textarea":ie=ne=null;for(N in u)if(y=u[N],u.hasOwnProperty(N)&&y!=null&&!h.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Jt(o,l,N,null,h,y)}for(D in h)if(y=h[D],S=u[D],h.hasOwnProperty(D)&&(y!=null||S!=null))switch(D){case"value":ne=y;break;case"defaultValue":ie=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==S&&Jt(o,l,D,y,h,S)}pS(o,ne,ie);return;case"option":for(var ct in u)if(ne=u[ct],u.hasOwnProperty(ct)&&ne!=null&&!h.hasOwnProperty(ct))switch(ct){case"selected":o.selected=!1;break;default:Jt(o,l,ct,null,h,ne)}for(z in h)if(ne=h[z],ie=u[z],h.hasOwnProperty(z)&&ne!==ie&&(ne!=null||ie!=null))switch(z){case"selected":o.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Jt(o,l,z,ne,h,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var it in u)ne=u[it],u.hasOwnProperty(it)&&ne!=null&&!h.hasOwnProperty(it)&&Jt(o,l,it,null,h,ne);for(ee in h)if(ne=h[ee],ie=u[ee],h.hasOwnProperty(ee)&&ne!==ie&&(ne!=null||ie!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,l));break;default:Jt(o,l,ee,ne,h,ie)}return;default:if(Pm(l)){for(var en in u)ne=u[en],u.hasOwnProperty(en)&&ne!==void 0&&!h.hasOwnProperty(en)&&mv(o,l,en,void 0,h,ne);for(de in h)ne=h[de],ie=u[de],!h.hasOwnProperty(de)||ne===ie||ne===void 0&&ie===void 0||mv(o,l,de,ne,h,ie);return}}for(var Y in u)ne=u[Y],u.hasOwnProperty(Y)&&ne!=null&&!h.hasOwnProperty(Y)&&Jt(o,l,Y,null,h,ne);for(pe in h)ne=h[pe],ie=u[pe],!h.hasOwnProperty(pe)||ne===ie||ne==null&&ie==null||Jt(o,l,pe,ne,h,ie)}var gv=null,vv=null;function Uf(o){return o.nodeType===9?o:o.ownerDocument}function gj(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vj(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function yv(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var xv=null;function VN(){var o=window.event;return o&&o.type==="popstate"?o===xv?!1:(xv=o,!0):(xv=null,!1)}var yj=typeof setTimeout=="function"?setTimeout:void 0,FN=typeof clearTimeout=="function"?clearTimeout:void 0,xj=typeof Promise=="function"?Promise:void 0,qN=typeof queueMicrotask=="function"?queueMicrotask:typeof xj<"u"?function(o){return xj.resolve(null).then(o).catch(HN)}:yj;function HN(o){setTimeout(function(){throw o})}function Da(o){return o==="head"}function bj(o,l){var u=l,h=0,y=0;do{var S=u.nextSibling;if(o.removeChild(u),S&&S.nodeType===8)if(u=S.data,u==="/$"){if(0<h&&8>h){u=h;var D=o.ownerDocument;if(u&1&&Cu(D.documentElement),u&2&&Cu(D.body),u&4)for(u=D.head,Cu(u),D=u.firstChild;D;){var N=D.nextSibling,z=D.nodeName;D[qe]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&D.rel.toLowerCase()==="stylesheet"||u.removeChild(D),D=N}}if(y===0){o.removeChild(S),ku(l);return}y--}else u==="$"||u==="$?"||u==="$!"?y++:h=u.charCodeAt(0)-48;else h=0;u=S}while(u);ku(l)}function bv(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":bv(u),Ye(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}o.removeChild(u)}}function GN(o,l,u,h){for(;o.nodeType===1;){var y=u;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(h){if(!o[qe])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(S=o.getAttribute("rel"),S==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(S!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(S=o.getAttribute("src"),(S!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===S)return o}else return o;if(o=_o(o.nextSibling),o===null)break}return null}function WN(o,l,u){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=_o(o.nextSibling),o===null))return null;return o}function Sv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState==="complete"}function QN(o,l){var u=o.ownerDocument;if(o.data!=="$?"||u.readyState==="complete")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),o._reactRetry=h}}function _o(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return o}var wv=null;function Sj(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"){if(l===0)return o;l--}else u==="/$"&&l++}o=o.previousSibling}return null}function wj(o,l,u){switch(l=Uf(u),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function Cu(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Ye(o)}var lo=new Map,jj=new Set;function Bf(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var zi=L.d;L.d={f:YN,r:KN,D:XN,C:ZN,L:JN,m:e4,X:n4,S:t4,M:r4};function YN(){var o=zi.f(),l=kf();return o||l}function KN(o){var l=Je(o);l!==null&&l.tag===5&&l.type==="form"?F1(l):zi.r(o)}var ql=typeof document>"u"?null:document;function Cj(o,l,u){var h=ql;if(h&&typeof l=="string"&&l){var y=to(l);y='link[rel="'+o+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),jj.has(y)||(jj.add(y),o={rel:o,crossOrigin:u,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),Zn(l,"link",o),mt(l),h.head.appendChild(l)))}}function XN(o){zi.D(o),Cj("dns-prefetch",o,null)}function ZN(o,l){zi.C(o,l),Cj("preconnect",o,l)}function JN(o,l,u){zi.L(o,l,u);var h=ql;if(h&&o&&l){var y='link[rel="preload"][as="'+to(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+to(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+to(u.imageSizes)+'"]')):y+='[href="'+to(o)+'"]';var S=y;switch(l){case"style":S=Hl(o);break;case"script":S=Gl(o)}lo.has(S)||(o=m({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:o,as:l},u),lo.set(S,o),h.querySelector(y)!==null||l==="style"&&h.querySelector(Eu(S))||l==="script"&&h.querySelector(Tu(S))||(l=h.createElement("link"),Zn(l,"link",o),mt(l),h.head.appendChild(l)))}}function e4(o,l){zi.m(o,l);var u=ql;if(u&&o){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+to(h)+'"][href="'+to(o)+'"]',S=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Gl(o)}if(!lo.has(S)&&(o=m({rel:"modulepreload",href:o},l),lo.set(S,o),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Tu(S)))return}h=u.createElement("link"),Zn(h,"link",o),mt(h),u.head.appendChild(h)}}}function t4(o,l,u){zi.S(o,l,u);var h=ql;if(h&&o){var y=gn(h).hoistableStyles,S=Hl(o);l=l||"default";var D=y.get(S);if(!D){var N={loading:0,preload:null};if(D=h.querySelector(Eu(S)))N.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":l},u),(u=lo.get(S))&&jv(o,u);var z=D=h.createElement("link");mt(z),Zn(z,"link",o),z._p=new Promise(function(ee,de){z.onload=ee,z.onerror=de}),z.addEventListener("load",function(){N.loading|=1}),z.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Vf(D,l,h)}D={type:"stylesheet",instance:D,count:1,state:N},y.set(S,D)}}}function n4(o,l){zi.X(o,l);var u=ql;if(u&&o){var h=gn(u).hoistableScripts,y=Gl(o),S=h.get(y);S||(S=u.querySelector(Tu(y)),S||(o=m({src:o,async:!0},l),(l=lo.get(y))&&Cv(o,l),S=u.createElement("script"),mt(S),Zn(S,"link",o),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(y,S))}}function r4(o,l){zi.M(o,l);var u=ql;if(u&&o){var h=gn(u).hoistableScripts,y=Gl(o),S=h.get(y);S||(S=u.querySelector(Tu(y)),S||(o=m({src:o,async:!0,type:"module"},l),(l=lo.get(y))&&Cv(o,l),S=u.createElement("script"),mt(S),Zn(S,"link",o),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(y,S))}}function Ej(o,l,u,h){var y=(y=we.current)?Bf(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=Hl(u.href),u=gn(y).hoistableStyles,h=u.get(l),h||(h={type:"style",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){o=Hl(u.href);var S=gn(y).hoistableStyles,D=S.get(o);if(D||(y=y.ownerDocument||y,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(o,D),(S=y.querySelector(Eu(o)))&&!S._p&&(D.instance=S,D.state.loading=5),lo.has(o)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},lo.set(o,u),S||o4(y,o,u,D.state))),l&&h===null)throw Error(r(528,""));return D}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Gl(u),u=gn(y).hoistableScripts,h=u.get(l),h||(h={type:"script",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Hl(o){return'href="'+to(o)+'"'}function Eu(o){return'link[rel="stylesheet"]['+o+"]"}function Tj(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function o4(o,l,u,h){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=o.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Zn(l,"link",u),mt(l),o.head.appendChild(l))}function Gl(o){return'[src="'+to(o)+'"]'}function Tu(o){return"script[async]"+o}function Rj(o,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=o.querySelector('style[data-href~="'+to(u.href)+'"]');if(h)return l.instance=h,mt(h),h;var y=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),mt(h),Zn(h,"style",y),Vf(h,u.precedence,o),l.instance=h;case"stylesheet":y=Hl(u.href);var S=o.querySelector(Eu(y));if(S)return l.state.loading|=4,l.instance=S,mt(S),S;h=Tj(u),(y=lo.get(y))&&jv(h,y),S=(o.ownerDocument||o).createElement("link"),mt(S);var D=S;return D._p=new Promise(function(N,z){D.onload=N,D.onerror=z}),Zn(S,"link",h),l.state.loading|=4,Vf(S,u.precedence,o),l.instance=S;case"script":return S=Gl(u.src),(y=o.querySelector(Tu(S)))?(l.instance=y,mt(y),y):(h=u,(y=lo.get(S))&&(h=m({},u),Cv(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),mt(y),Zn(y,"link",h),o.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Vf(h,u.precedence,o));return l.instance}function Vf(o,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,S=y,D=0;D<h.length;D++){var N=h[D];if(N.dataset.precedence===l)S=N;else if(S!==y)break}S?S.parentNode.insertBefore(o,S.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(o,l.firstChild))}function jv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function Cv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Ff=null;function _j(o,l,u){if(Ff===null){var h=new Map,y=Ff=new Map;y.set(u,h)}else y=Ff,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(o))return h;for(h.set(o,null),u=u.getElementsByTagName(o),y=0;y<u.length;y++){var S=u[y];if(!(S[qe]||S[me]||o==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var D=S.getAttribute(l)||"";D=o+D;var N=h.get(D);N?N.push(S):h.set(D,[S])}}return h}function Dj(o,l,u){o=o.ownerDocument||o,o.head.insertBefore(u,l==="title"?o.querySelector("head > title"):null)}function i4(o,l,u){if(u===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Aj(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}var Ru=null;function a4(){}function s4(o,l,u){if(Ru===null)throw Error(r(475));var h=Ru;if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var y=Hl(u.href),S=o.querySelector(Eu(y));if(S){o=S._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(h.count++,h=qf.bind(h),o.then(h,h)),l.state.loading|=4,l.instance=S,mt(S);return}S=o.ownerDocument||o,u=Tj(u),(y=lo.get(y))&&jv(u,y),S=S.createElement("link"),mt(S);var D=S;D._p=new Promise(function(N,z){D.onload=N,D.onerror=z}),Zn(S,"link",u),l.instance=S}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(h.count++,l=qf.bind(h),o.addEventListener("load",l),o.addEventListener("error",l))}}function l4(){if(Ru===null)throw Error(r(475));var o=Ru;return o.stylesheets&&o.count===0&&Ev(o,o.stylesheets),0<o.count?function(l){var u=setTimeout(function(){if(o.stylesheets&&Ev(o,o.stylesheets),o.unsuspend){var h=o.unsuspend;o.unsuspend=null,h()}},6e4);return o.unsuspend=l,function(){o.unsuspend=null,clearTimeout(u)}}:null}function qf(){if(this.count--,this.count===0){if(this.stylesheets)Ev(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Hf=null;function Ev(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Hf=new Map,l.forEach(c4,o),Hf=null,qf.call(o))}function c4(o,l){if(!(l.state.loading&4)){var u=Hf.get(o);if(u)var h=u.get(null);else{u=new Map,Hf.set(o,u);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var D=y[S];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(u.set(D.dataset.precedence,D),h=D)}h&&u.set(null,h)}y=l.instance,D=y.getAttribute("data-precedence"),S=u.get(D)||h,S===h&&u.set(null,y),u.set(D,y),this.count++,h=qf.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),S?S.parentNode.insertBefore(y,S.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),l.state.loading|=4}}var _u={$$typeof:R,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function u4(o,l,u,h,y,S,D,N){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fo(0),this.hiddenUpdates=Fo(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Pj(o,l,u,h,y,S,D,N,z,ee,de,pe){return o=new u4(o,l,u,D,N,z,ee,pe),l=1,S===!0&&(l|=24),S=zr(3,null,null,l),o.current=S,S.stateNode=o,l=ag(),l.refCount++,o.pooledCache=l,l.refCount++,S.memoizedState={element:h,isDehydrated:u,cache:l},ug(S),o}function kj(o){return o?(o=jl,o):jl}function Nj(o,l,u,h,y,S){y=kj(y),h.context===null?h.context=y:h.pendingContext=y,h=ga(l),h.payload={element:u},S=S===void 0?null:S,S!==null&&(h.callback=S),u=va(o,h,l),u!==null&&(qr(u,o,l),ou(u,o,l))}function Oj(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<l?u:l}}function Tv(o,l){Oj(o,l),(o=o.alternate)&&Oj(o,l)}function Mj(o){if(o.tag===13){var l=wl(o,67108864);l!==null&&qr(l,o,67108864),Tv(o,67108864)}}var Gf=!0;function d4(o,l,u,h){var y=O.T;O.T=null;var S=L.p;try{L.p=2,Rv(o,l,u,h)}finally{L.p=S,O.T=y}}function f4(o,l,u,h){var y=O.T;O.T=null;var S=L.p;try{L.p=8,Rv(o,l,u,h)}finally{L.p=S,O.T=y}}function Rv(o,l,u,h){if(Gf){var y=_v(h);if(y===null)pv(o,l,h,Wf,u),Lj(o,h);else if(p4(y,o,l,u,h))h.stopPropagation();else if(Lj(o,h),l&4&&-1<h4.indexOf(o)){for(;y!==null;){var S=Je(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var D=Ir(S.pendingLanes);if(D!==0){var N=S;for(N.pendingLanes|=2,N.entangledLanes|=2;D;){var z=1<<31-Lt(D);N.entanglements[1]|=z,D&=~z}Yo(S),(Wt&6)===0&&(Af=Re()+500,Su(0))}}break;case 13:N=wl(S,2),N!==null&&qr(N,S,2),kf(),Tv(S,2)}if(S=_v(h),S===null&&pv(o,l,h,Wf,u),S===y)break;y=S}y!==null&&h.stopPropagation()}else pv(o,l,h,null,u)}}function _v(o){return o=Nm(o),Dv(o)}var Wf=null;function Dv(o){if(Wf=null,o=ft(o),o!==null){var l=s(o);if(l===null)o=null;else{var u=l.tag;if(u===13){if(o=c(l),o!==null)return o;o=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return Wf=o,null}function Ij(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Pe()){case Ke:return 2;case _e:return 8;case he:case Se:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Av=!1,Aa=null,Pa=null,ka=null,Du=new Map,Au=new Map,Na=[],h4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lj(o,l){switch(o){case"focusin":case"focusout":Aa=null;break;case"dragenter":case"dragleave":Pa=null;break;case"mouseover":case"mouseout":ka=null;break;case"pointerover":case"pointerout":Du.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Au.delete(l.pointerId)}}function Pu(o,l,u,h,y,S){return o===null||o.nativeEvent!==S?(o={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:S,targetContainers:[y]},l!==null&&(l=Je(l),l!==null&&Mj(l)),o):(o.eventSystemFlags|=h,l=o.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),o)}function p4(o,l,u,h,y){switch(l){case"focusin":return Aa=Pu(Aa,o,l,u,h,y),!0;case"dragenter":return Pa=Pu(Pa,o,l,u,h,y),!0;case"mouseover":return ka=Pu(ka,o,l,u,h,y),!0;case"pointerover":var S=y.pointerId;return Du.set(S,Pu(Du.get(S)||null,o,l,u,h,y)),!0;case"gotpointercapture":return S=y.pointerId,Au.set(S,Pu(Au.get(S)||null,o,l,u,h,y)),!0}return!1}function $j(o){var l=ft(o.target);if(l!==null){var u=s(l);if(u!==null){if(l=u.tag,l===13){if(l=c(u),l!==null){o.blockedOn=l,X(o.priority,function(){if(u.tag===13){var h=Fr();h=is(h);var y=wl(u,h);y!==null&&qr(y,u,h),Tv(u,h)}});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Qf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var u=_v(o.nativeEvent);if(u===null){u=o.nativeEvent;var h=new u.constructor(u.type,u);km=h,u.target.dispatchEvent(h),km=null}else return l=Je(u),l!==null&&Mj(l),o.blockedOn=u,!1;l.shift()}return!0}function zj(o,l,u){Qf(o)&&u.delete(l)}function m4(){Av=!1,Aa!==null&&Qf(Aa)&&(Aa=null),Pa!==null&&Qf(Pa)&&(Pa=null),ka!==null&&Qf(ka)&&(ka=null),Du.forEach(zj),Au.forEach(zj)}function Yf(o,l){o.blockedOn===l&&(o.blockedOn=null,Av||(Av=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,m4)))}var Kf=null;function Uj(o){Kf!==o&&(Kf=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Kf===o&&(Kf=null);for(var l=0;l<o.length;l+=3){var u=o[l],h=o[l+1],y=o[l+2];if(typeof h!="function"){if(Dv(h||u)===null)continue;break}var S=Je(u);S!==null&&(o.splice(l,3),l-=3,Dg(S,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function ku(o){function l(z){return Yf(z,o)}Aa!==null&&Yf(Aa,o),Pa!==null&&Yf(Pa,o),ka!==null&&Yf(ka,o),Du.forEach(l),Au.forEach(l);for(var u=0;u<Na.length;u++){var h=Na[u];h.blockedOn===o&&(h.blockedOn=null)}for(;0<Na.length&&(u=Na[0],u.blockedOn===null);)$j(u),u.blockedOn===null&&Na.shift();if(u=(o.ownerDocument||o).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],S=u[h+1],D=y[Te]||null;if(typeof S=="function")D||Uj(u);else if(D){var N=null;if(S&&S.hasAttribute("formAction")){if(y=S,D=S[Te]||null)N=D.formAction;else if(Dv(y)!==null)continue}else N=D.action;typeof N=="function"?u[h+1]=N:(u.splice(h,3),h-=3),Uj(u)}}}function Pv(o){this._internalRoot=o}Xf.prototype.render=Pv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var u=l.current,h=Fr();Nj(u,h,o,l,null,null)},Xf.prototype.unmount=Pv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Nj(o.current,2,null,o,null,null),kf(),l[Ve]=null}};function Xf(o){this._internalRoot=o}Xf.prototype.unstable_scheduleHydration=function(o){if(o){var l=U();o={blockedOn:null,target:o,priority:l};for(var u=0;u<Na.length&&l!==0&&l<Na[u].priority;u++);Na.splice(u,0,o),u===0&&$j(o)}};var Bj=t.version;if(Bj!=="19.1.1")throw Error(r(527,Bj,"19.1.1"));L.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(l),o=o!==null?p(o):null,o=o===null?null:o.stateNode,o};var g4={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zf.isDisabled&&Zf.supportsFiber)try{_t=Zf.inject(g4),bt=Zf}catch{}}return zu.createRoot=function(o,l){if(!i(o))throw Error(r(299));var u=!1,h="",y=rw,S=ow,D=iw,N=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(D=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(N=l.unstable_transitionCallbacks)),l=Pj(o,1,!1,null,null,u,h,y,S,D,N,null),o[Ve]=l.current,hv(o),new Pv(l)},zu.hydrateRoot=function(o,l,u){if(!i(o))throw Error(r(299));var h=!1,y="",S=rw,D=ow,N=iw,z=null,ee=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(D=u.onCaughtError),u.onRecoverableError!==void 0&&(N=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(z=u.unstable_transitionCallbacks),u.formState!==void 0&&(ee=u.formState)),l=Pj(o,1,!0,l,u??null,h,y,S,D,N,z,ee),l.context=kj(null),u=l.current,h=Fr(),h=is(h),y=ga(h),y.callback=null,va(u,y,h),u=h,l.current.lanes=u,br(l,u),Yo(l),o[Ve]=l.current,hv(o),new Xf(l)},zu.version="19.1.1",zu}var bT;function LX(){if(bT)return gy.exports;bT=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gy.exports=IX(),gy.exports}var $X=LX();/**
|
|
576
|
+
* react-router v7.8.2
|
|
577
|
+
*
|
|
578
|
+
* Copyright (c) Remix Software Inc.
|
|
579
|
+
*
|
|
580
|
+
* This source code is licensed under the MIT license found in the
|
|
581
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
582
|
+
*
|
|
583
|
+
* @license MIT
|
|
584
|
+
*/var xP=e=>{throw TypeError(e)},zX=(e,t,n)=>t.has(e)||xP("Cannot "+n),xy=(e,t,n)=>(zX(e,t,"read from private field"),n?n.call(e):t.get(e)),UX=(e,t,n)=>t.has(e)?xP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ST="popstate";function BX(e={}){function t(r,i){let{pathname:s,search:c,hash:d}=r.location;return ld("",{pathname:s,search:c,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ka(i)}return FX(t,n,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Mn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function VX(){return Math.random().toString(36).substring(2,10)}function wT(e,t){return{usr:e.state,key:e.key,idx:t}}function ld(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?la(t):t,state:n,key:t&&t.key||r||VX()}}function Ka({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function la(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function FX(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,d="POP",f=null,p=m();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function m(){return(c.state||{idx:null}).idx}function g(){d="POP";let C=m(),T=C==null?null:C-p;p=C,f&&f({action:d,location:j.location,delta:T})}function x(C,T){d="PUSH";let E=ld(j.location,C,T);p=m()+1;let R=wT(E,p),_=j.createHref(E);try{c.pushState(R,"",_)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(_)}s&&f&&f({action:d,location:j.location,delta:1})}function b(C,T){d="REPLACE";let E=ld(j.location,C,T);p=m();let R=wT(E,p),_=j.createHref(E);c.replaceState(R,"",_),s&&f&&f({action:d,location:j.location,delta:0})}function w(C){return bP(C)}let j={get action(){return d},get location(){return e(i,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(ST,g),f=C,()=>{i.removeEventListener(ST,g),f=null}},createHref(C){return t(i,C)},createURL:w,encodeLocation(C){let T=w(C);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:x,replace:b,go(C){return c.go(C)}};return j}function bP(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ka(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Hu,jT=class{constructor(e){if(UX(this,Hu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(xy(this,Hu).has(e))return xy(this,Hu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){xy(this,Hu).set(e,t)}};Hu=new WeakMap;var qX=new Set(["lazy","caseSensitive","path","id","index","children"]);function HX(e){return qX.has(e)}var GX=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function WX(e){return GX.has(e)}function QX(e){return e.index===!0}function cd(e,t,n=[],r={},i=!1){return e.map((s,c)=>{let d=[...n,String(c)],f=typeof s.id=="string"?s.id:d.join("-");if(xt(s.index!==!0||!s.children,"Cannot specify children on an index route"),xt(i||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),QX(s)){let p={...s,...t(s),id:f};return r[f]=p,p}else{let p={...s,...t(s),id:f,children:void 0};return r[f]=p,s.children&&(p.children=cd(s.children,t,d,r,i)),p}})}function Va(e,t,n="/"){return Rh(e,t,n,!1)}function Rh(e,t,n,r){let i=typeof t=="string"?la(t):t,s=xo(i.pathname||"/",n);if(s==null)return null;let c=SP(e);KX(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let p=sZ(s);d=iZ(c[f],p,r)}return d}function YX(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function SP(e,t=[],n=[],r="",i=!1){let s=(c,d,f=i,p)=>{let m={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;xt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=si([r,m.relativePath]),x=n.concat(m);c.children&&c.children.length>0&&(xt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),SP(c.children,t,x,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:rZ(g,c.index),routesMeta:x})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))s(c,d);else for(let f of wP(c.path))s(c,d,!0,f)}),t}function wP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let c=wP(r.join("/")),d=[];return d.push(...c.map(f=>f===""?s:[s,f].join("/"))),i&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function KX(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:oZ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var XX=/^:[\w-]+$/,ZX=3,JX=2,eZ=1,tZ=10,nZ=-2,CT=e=>e==="*";function rZ(e,t){let n=e.split("/"),r=n.length;return n.some(CT)&&(r+=nZ),t&&(r+=JX),n.filter(i=>!CT(i)).reduce((i,s)=>i+(XX.test(s)?ZX:s===""?eZ:tZ),r)}function oZ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function iZ(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],p=d===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",g=ip({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),x=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=ip({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(i,g.params),c.push({params:i,pathname:si([s,g.pathname]),pathnameBase:dZ(si([s,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(s=si([s,g.pathnameBase]))}return c}function ip(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=aZ(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],c=s.replace(/(.)\/+$/,"$1"),d=i.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},x)=>{if(m==="*"){let w=d[x]||"";c=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[x];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:c,pattern:e}}function aZ(e,t=!1,n=!0){Mn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f)=>(r.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function sZ(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function xo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function lZ({basename:e,pathname:t}){return t==="/"?e:si([e,t])}function cZ(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?la(e):e;return{pathname:n?n.startsWith("/")?n:uZ(n,t):t,search:fZ(r),hash:hZ(i)}}function uZ(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function by(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function jP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Qb(e){let t=jP(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Yb(e,t,n,r=!1){let i;typeof e=="string"?i=la(e):(i={...e},xt(!i.pathname||!i.pathname.includes("?"),by("?","pathname","search",i)),xt(!i.pathname||!i.pathname.includes("#"),by("#","pathname","hash",i)),xt(!i.search||!i.search.includes("#"),by("#","search","hash",i)));let s=e===""||i.pathname==="",c=s?"/":i.pathname,d;if(c==null)d=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;i.pathname=x.join("/")}d=g>=0?t[g]:"/"}let f=cZ(i,d),p=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var si=e=>e.join("/").replace(/\/\/+/g,"/"),dZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),fZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ap=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ud(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var CP=["POST","PUT","PATCH","DELETE"],pZ=new Set(CP),mZ=["GET",...CP],gZ=new Set(mZ),vZ=new Set([301,302,303,307,308]),yZ=new Set([307,308]),Sy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xZ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Uu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},bZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kb=e=>bZ.test(e),SZ=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),EP="remix-router-transitions",TP=Symbol("ResetLoaderData");function wZ(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";xt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||SZ,s={},c=cd(e.routes,i,void 0,s),d,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let p=e.dataStrategy||RZ,m={...e.future},g=null,x=new Set,b=null,w=null,j=null,C=e.hydrationData!=null,T=Va(c,e.history.location,f),E=!1,R=null,_;if(T==null&&!e.patchRoutesOnNavigation){let U=fo(404,{pathname:e.history.location.pathname}),{matches:X,route:oe}=dh(c);_=!0,T=X,R={[oe.id]:U}}else if(T&&!e.hydrationData&&Si(T,c,e.history.location.pathname).active&&(T=null),T)if(T.some(U=>U.route.lazy))_=!1;else if(!T.some(U=>U.route.loader))_=!0;else{let U=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let oe=T.findIndex(me=>X[me.route.id]!==void 0);_=T.slice(0,oe+1).every(me=>!dx(me.route,U,X))}else _=T.every(oe=>!dx(oe.route,U,X))}else{_=!1,T=[];let U=Si(null,c,e.history.location.pathname);U.active&&U.matches&&(E=!0,T=U.matches)}let P,A={historyAction:e.history.action,location:e.history.location,matches:T,initialized:_,navigation:Sy,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||R,fetchers:new Map,blockers:new Map},k="POP",I=!1,B,q=!1,Z=new Map,K=null,Q=!1,V=!1,W=new Set,O=new Map,L=0,$=-1,H=new Map,M=new Set,F=new Map,te=new Map,ae=new Set,je=new Map,xe,we=null;function We(){if(g=e.history.listen(({action:U,location:X,delta:oe})=>{if(xe){xe(),xe=void 0;return}Mn(je.size===0||oe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let me=fl({currentLocation:A.location,nextLocation:X,historyAction:U});if(me&&oe!=null){let Te=new Promise(Ve=>{xe=Ve});e.history.go(oe*-1),Zr(me,{state:"blocked",location:X,proceed(){Zr(me,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),Te.then(()=>e.history.go(oe))},reset(){let Ve=new Map(A.blockers);Ve.set(me,Uu),tt({blockers:Ve})}});return}return pt(U,X)}),n){VZ(t,Z);let U=()=>FZ(t,Z);t.addEventListener("pagehide",U),K=()=>t.removeEventListener("pagehide",U)}return A.initialized||pt("POP",A.location,{initialHydration:!0}),P}function Ee(){g&&g(),K&&K(),x.clear(),B&&B.abort(),A.fetchers.forEach((U,X)=>Lt(X)),A.blockers.forEach((U,X)=>xi(X))}function ot(U){return x.add(U),()=>x.delete(U)}function tt(U,X={}){U.matches&&(U.matches=U.matches.map(Te=>{let Ve=s[Te.route.id],Qe=Te.route;return Qe.element!==Ve.element||Qe.errorElement!==Ve.errorElement||Qe.hydrateFallbackElement!==Ve.hydrateFallbackElement?{...Te,route:Ve}:Te})),A={...A,...U};let oe=[],me=[];A.fetchers.forEach((Te,Ve)=>{Te.state==="idle"&&(ae.has(Ve)?oe.push(Ve):me.push(Ve))}),ae.forEach(Te=>{!A.fetchers.has(Te)&&!O.has(Te)&&oe.push(Te)}),[...x].forEach(Te=>Te(A,{deletedFetchers:oe,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),oe.forEach(Te=>Lt(Te)),me.forEach(Te=>A.fetchers.delete(Te))}function Ct(U,X,{flushSync:oe}={}){let me=A.actionData!=null&&A.navigation.formMethod!=null&&Rr(A.navigation.formMethod)&&A.navigation.state==="loading"&&U.state?._isRedirect!==!0,Te;X.actionData?Object.keys(X.actionData).length>0?Te=X.actionData:Te=null:me?Te=A.actionData:Te=null;let Ve=X.loaderData?OT(A.loaderData,X.loaderData,X.matches||[],X.errors):A.loaderData,Qe=A.blockers;Qe.size>0&&(Qe=new Map(Qe),Qe.forEach((qe,Ye)=>Qe.set(Ye,Uu)));let Fe=Q?!1:Hn(U,X.matches||A.matches),Ze=I===!0||A.navigation.formMethod!=null&&Rr(A.navigation.formMethod)&&U.state?._isRedirect!==!0;d&&(c=d,d=void 0),Q||k==="POP"||(k==="PUSH"?e.history.push(U,U.state):k==="REPLACE"&&e.history.replace(U,U.state));let rt;if(k==="POP"){let qe=Z.get(A.location.pathname);qe&&qe.has(U.pathname)?rt={currentLocation:A.location,nextLocation:U}:Z.has(U.pathname)&&(rt={currentLocation:U,nextLocation:A.location})}else if(q){let qe=Z.get(A.location.pathname);qe?qe.add(U.pathname):(qe=new Set([U.pathname]),Z.set(A.location.pathname,qe)),rt={currentLocation:A.location,nextLocation:U}}tt({...X,actionData:Te,loaderData:Ve,historyAction:k,location:U,initialized:!0,navigation:Sy,revalidation:"idle",restoreScrollPosition:Fe,preventScrollReset:Ze,blockers:Qe},{viewTransitionOpts:rt,flushSync:oe===!0}),k="POP",I=!1,q=!1,Q=!1,V=!1,we?.resolve(),we=null}async function Ot(U,X){if(typeof U=="number"){e.history.go(U);return}let oe=ux(A.location,A.matches,f,U,X?.fromRouteId,X?.relative),{path:me,submission:Te,error:Ve}=ET(!1,oe,X),Qe=A.location,Fe=ld(A.location,me,X&&X.state);Fe={...Fe,...e.history.encodeLocation(Fe)};let Ze=X&&X.replace!=null?X.replace:void 0,rt="PUSH";Ze===!0?rt="REPLACE":Ze===!1||Te!=null&&Rr(Te.formMethod)&&Te.formAction===A.location.pathname+A.location.search&&(rt="REPLACE");let qe=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,Ye=(X&&X.flushSync)===!0,ft=fl({currentLocation:Qe,nextLocation:Fe,historyAction:rt});if(ft){Zr(ft,{state:"blocked",location:Fe,proceed(){Zr(ft,{state:"proceeding",proceed:void 0,reset:void 0,location:Fe}),Ot(U,X)},reset(){let Je=new Map(A.blockers);Je.set(ft,Uu),tt({blockers:Je})}});return}await pt(rt,Fe,{submission:Te,pendingError:Ve,preventScrollReset:qe,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:Ye})}function Mt(){we||(we=qZ()),Oe(),tt({revalidation:"loading"});let U=we.promise;return A.navigation.state==="submitting"?U:A.navigation.state==="idle"?(pt(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),U):(pt(k||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:q===!0}),U)}async function pt(U,X,oe){B&&B.abort(),B=null,k=U,Q=(oe&&oe.startUninterruptedRevalidation)===!0,br(A.location,A.matches),I=(oe&&oe.preventScrollReset)===!0,q=(oe&&oe.enableViewTransition)===!0;let me=d||c,Te=oe&&oe.overrideNavigation,Ve=oe?.initialHydration&&A.matches&&A.matches.length>0&&!E?A.matches:Va(me,X,f),Qe=(oe&&oe.flushSync)===!0;if(Ve&&A.initialized&&!V&&MZ(A.location,X)&&!(oe&&oe.submission&&Rr(oe.submission.formMethod))){Ct(X,{matches:Ve},{flushSync:Qe});return}let Fe=Si(Ve,me,X.pathname);if(Fe.active&&Fe.matches&&(Ve=Fe.matches),!Ve){let{error:gn,notFoundMatches:mt,route:Xt}=bi(X.pathname);Ct(X,{matches:mt,loaderData:{},errors:{[Xt.id]:gn}},{flushSync:Qe});return}B=new AbortController;let Ze=ac(e.history,X,B.signal,oe&&oe.submission),rt=e.unstable_getContext?await e.unstable_getContext():new jT,qe;if(oe&&oe.pendingError)qe=[Fa(Ve).route.id,{type:"error",error:oe.pendingError}];else if(oe&&oe.submission&&Rr(oe.submission.formMethod)){let gn=await Rt(Ze,X,oe.submission,Ve,rt,Fe.active,oe&&oe.initialHydration===!0,{replace:oe.replace,flushSync:Qe});if(gn.shortCircuited)return;if(gn.pendingActionResult){let[mt,Xt]=gn.pendingActionResult;if(Gr(Xt)&&ud(Xt.error)&&Xt.error.status===404){B=null,Ct(X,{matches:gn.matches,loaderData:{},errors:{[mt]:Xt.error}});return}}Ve=gn.matches||Ve,qe=gn.pendingActionResult,Te=wy(X,oe.submission),Qe=!1,Fe.active=!1,Ze=ac(e.history,Ze.url,Ze.signal)}let{shortCircuited:Ye,matches:ft,loaderData:Je,errors:Kt}=await tn(Ze,X,Ve,rt,Fe.active,Te,oe&&oe.submission,oe&&oe.fetcherSubmission,oe&&oe.replace,oe&&oe.initialHydration===!0,Qe,qe);Ye||(B=null,Ct(X,{matches:ft||Ve,...MT(qe),loaderData:Je,errors:Kt}))}async function Rt(U,X,oe,me,Te,Ve,Qe,Fe={}){Oe();let Ze=UZ(X,oe);if(tt({navigation:Ze},{flushSync:Fe.flushSync===!0}),Ve){let Ye=await ua(me,X.pathname,U.signal);if(Ye.type==="aborted")return{shortCircuited:!0};if(Ye.type==="error"){if(Ye.partialMatches.length===0){let{matches:Je,route:Kt}=dh(c);return{matches:Je,pendingActionResult:[Kt.id,{type:"error",error:Ye.error}]}}let ft=Fa(Ye.partialMatches).route.id;return{matches:Ye.partialMatches,pendingActionResult:[ft,{type:"error",error:Ye.error}]}}else if(Ye.matches)me=Ye.matches;else{let{notFoundMatches:ft,error:Je,route:Kt}=bi(X.pathname);return{matches:ft,pendingActionResult:[Kt.id,{type:"error",error:Je}]}}}let rt,qe=_h(me,X);if(!qe.route.action&&!qe.route.lazy)rt={type:"error",error:fo(405,{method:U.method,pathname:X.pathname,routeId:qe.route.id})};else{let Ye=fc(i,s,U,me,qe,Qe?[]:r,Te),ft=await $e(U,Ye,Te,null);if(rt=ft[qe.route.id],!rt){for(let Je of me)if(ft[Je.route.id]){rt=ft[Je.route.id];break}}if(U.signal.aborted)return{shortCircuited:!0}}if(Ls(rt)){let Ye;return Fe&&Fe.replace!=null?Ye=Fe.replace:Ye=PT(rt.response.headers.get("Location"),new URL(U.url),f)===A.location.pathname+A.location.search,await Se(U,rt,!0,{submission:oe,replace:Ye}),{shortCircuited:!0}}if(Gr(rt)){let Ye=Fa(me,qe.route.id);return(Fe&&Fe.replace)!==!0&&(k="PUSH"),{matches:me,pendingActionResult:[Ye.route.id,rt,qe.route.id]}}return{matches:me,pendingActionResult:[qe.route.id,rt]}}async function tn(U,X,oe,me,Te,Ve,Qe,Fe,Ze,rt,qe,Ye){let ft=Ve||wy(X,Qe),Je=Qe||Fe||LT(ft),Kt=!Q&&!rt;if(Te){if(Kt){let $n=Re(Ye);tt({navigation:ft,...$n!==void 0?{actionData:$n}:{}},{flushSync:qe})}let gt=await ua(oe,X.pathname,U.signal);if(gt.type==="aborted")return{shortCircuited:!0};if(gt.type==="error"){if(gt.partialMatches.length===0){let{matches:Ei,route:Sr}=dh(c);return{matches:Ei,loaderData:{},errors:{[Sr.id]:gt.error}}}let $n=Fa(gt.partialMatches).route.id;return{matches:gt.partialMatches,loaderData:{},errors:{[$n]:gt.error}}}else if(gt.matches)oe=gt.matches;else{let{error:$n,notFoundMatches:Ei,route:Sr}=bi(X.pathname);return{matches:Ei,loaderData:{},errors:{[Sr.id]:$n}}}}let gn=d||c,{dsMatches:mt,revalidatingFetchers:Xt}=TT(U,me,i,s,e.history,A,oe,Je,X,rt?[]:r,rt===!0,V,W,ae,F,M,gn,f,e.patchRoutesOnNavigation!=null,Ye);if($=++L,!e.dataStrategy&&!mt.some(gt=>gt.shouldLoad)&&!mt.some(gt=>gt.route.unstable_middleware)&&Xt.length===0){let gt=Eo();return Ct(X,{matches:oe,loaderData:{},errors:Ye&&Gr(Ye[1])?{[Ye[0]]:Ye[1].error}:null,...MT(Ye),...gt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:qe}),{shortCircuited:!0}}if(Kt){let gt={};if(!Te){gt.navigation=ft;let $n=Re(Ye);$n!==void 0&&(gt.actionData=$n)}Xt.length>0&&(gt.fetchers=Pe(Xt)),tt(gt,{flushSync:qe})}Xt.forEach(gt=>{An(gt.key),gt.controller&&O.set(gt.key,gt.controller)});let qo=()=>Xt.forEach(gt=>An(gt.key));B&&B.signal.addEventListener("abort",qo);let{loaderResults:Lr,fetcherResults:cr}=await be(mt,Xt,U,me);if(U.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",qo),Xt.forEach(gt=>O.delete(gt.key));let Jr=fh(Lr);if(Jr)return await Se(U,Jr.result,!0,{replace:Ze}),{shortCircuited:!0};if(Jr=fh(cr),Jr)return M.add(Jr.key),await Se(U,Jr.result,!0,{replace:Ze}),{shortCircuited:!0};let{loaderData:hl,errors:da}=NT(A,oe,Lr,Ye,Xt,cr);rt&&A.errors&&(da={...A.errors,...da});let wi=Eo(),ji=yi($),Ci=wi||ji||Xt.length>0;return{matches:oe,loaderData:hl,errors:da,...Ci?{fetchers:new Map(A.fetchers)}:{}}}function Re(U){if(U&&!Gr(U[1]))return{[U[0]]:U[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Pe(U){return U.forEach(X=>{let oe=A.fetchers.get(X.key),me=Bu(void 0,oe?oe.data:void 0);A.fetchers.set(X.key,me)}),new Map(A.fetchers)}async function Ke(U,X,oe,me){An(U);let Te=(me&&me.flushSync)===!0,Ve=d||c,Qe=ux(A.location,A.matches,f,oe,X,me?.relative),Fe=Va(Ve,Qe,f),Ze=Si(Fe,Ve,Qe);if(Ze.active&&Ze.matches&&(Fe=Ze.matches),!Fe){bt(U,X,fo(404,{pathname:Qe}),{flushSync:Te});return}let{path:rt,submission:qe,error:Ye}=ET(!0,Qe,me);if(Ye){bt(U,X,Ye,{flushSync:Te});return}let ft=e.unstable_getContext?await e.unstable_getContext():new jT,Je=(me&&me.preventScrollReset)===!0;if(qe&&Rr(qe.formMethod)){await _e(U,X,rt,Fe,ft,Ze.active,Te,Je,qe);return}F.set(U,{routeId:X,path:rt}),await he(U,X,rt,Fe,ft,Ze.active,Te,Je,qe)}async function _e(U,X,oe,me,Te,Ve,Qe,Fe,Ze){Oe(),F.delete(U);let rt=A.fetchers.get(U);_t(U,BZ(Ze,rt),{flushSync:Qe});let qe=new AbortController,Ye=ac(e.history,oe,qe.signal,Ze);if(Ve){let jn=await ua(me,new URL(Ye.url).pathname,Ye.signal,U);if(jn.type==="aborted")return;if(jn.type==="error"){bt(U,X,jn.error,{flushSync:Qe});return}else if(jn.matches)me=jn.matches;else{bt(U,X,fo(404,{pathname:oe}),{flushSync:Qe});return}}let ft=_h(me,oe);if(!ft.route.action&&!ft.route.lazy){let jn=fo(405,{method:Ze.formMethod,pathname:oe,routeId:X});bt(U,X,jn,{flushSync:Qe});return}O.set(U,qe);let Je=L,Kt=fc(i,s,Ye,me,ft,r,Te),mt=(await $e(Ye,Kt,Te,U))[ft.route.id];if(Ye.signal.aborted){O.get(U)===qe&&O.delete(U);return}if(ae.has(U)){if(Ls(mt)||Gr(mt)){_t(U,La(void 0));return}}else{if(Ls(mt))if(O.delete(U),$>Je){_t(U,La(void 0));return}else return M.add(U),_t(U,Bu(Ze)),Se(Ye,mt,!1,{fetcherSubmission:Ze,preventScrollReset:Fe});if(Gr(mt)){bt(U,X,mt.error);return}}let Xt=A.navigation.location||A.location,qo=ac(e.history,Xt,qe.signal),Lr=d||c,cr=A.navigation.state!=="idle"?Va(Lr,A.navigation.location,f):A.matches;xt(cr,"Didn't find any matches after fetcher action");let Jr=++L;H.set(U,Jr);let hl=Bu(Ze,mt.data);A.fetchers.set(U,hl);let{dsMatches:da,revalidatingFetchers:wi}=TT(qo,Te,i,s,e.history,A,cr,Ze,Xt,r,!1,V,W,ae,F,M,Lr,f,e.patchRoutesOnNavigation!=null,[ft.route.id,mt]);wi.filter(jn=>jn.key!==U).forEach(jn=>{let fa=jn.key,Vd=A.fetchers.get(fa),Fd=Bu(void 0,Vd?Vd.data:void 0);A.fetchers.set(fa,Fd),An(fa),jn.controller&&O.set(fa,jn.controller)}),tt({fetchers:new Map(A.fetchers)});let ji=()=>wi.forEach(jn=>An(jn.key));qe.signal.addEventListener("abort",ji);let{loaderResults:Ci,fetcherResults:gt}=await be(da,wi,qo,Te);if(qe.signal.aborted)return;if(qe.signal.removeEventListener("abort",ji),H.delete(U),O.delete(U),wi.forEach(jn=>O.delete(jn.key)),A.fetchers.has(U)){let jn=La(mt.data);A.fetchers.set(U,jn)}let $n=fh(Ci);if($n)return Se(qo,$n.result,!1,{preventScrollReset:Fe});if($n=fh(gt),$n)return M.add($n.key),Se(qo,$n.result,!1,{preventScrollReset:Fe});let{loaderData:Ei,errors:Sr}=NT(A,cr,Ci,void 0,wi,gt);yi(Jr),A.navigation.state==="loading"&&Jr>$?(xt(k,"Expected pending action"),B&&B.abort(),Ct(A.navigation.location,{matches:cr,loaderData:Ei,errors:Sr,fetchers:new Map(A.fetchers)})):(tt({errors:Sr,loaderData:OT(A.loaderData,Ei,cr,Sr),fetchers:new Map(A.fetchers)}),V=!1)}async function he(U,X,oe,me,Te,Ve,Qe,Fe,Ze){let rt=A.fetchers.get(U);_t(U,Bu(Ze,rt?rt.data:void 0),{flushSync:Qe});let qe=new AbortController,Ye=ac(e.history,oe,qe.signal);if(Ve){let Xt=await ua(me,new URL(Ye.url).pathname,Ye.signal,U);if(Xt.type==="aborted")return;if(Xt.type==="error"){bt(U,X,Xt.error,{flushSync:Qe});return}else if(Xt.matches)me=Xt.matches;else{bt(U,X,fo(404,{pathname:oe}),{flushSync:Qe});return}}let ft=_h(me,oe);O.set(U,qe);let Je=L,Kt=fc(i,s,Ye,me,ft,r,Te),mt=(await $e(Ye,Kt,Te,U))[ft.route.id];if(O.get(U)===qe&&O.delete(U),!Ye.signal.aborted){if(ae.has(U)){_t(U,La(void 0));return}if(Ls(mt))if($>Je){_t(U,La(void 0));return}else{M.add(U),await Se(Ye,mt,!1,{preventScrollReset:Fe});return}if(Gr(mt)){bt(U,X,mt.error);return}_t(U,La(mt.data))}}async function Se(U,X,oe,{submission:me,fetcherSubmission:Te,preventScrollReset:Ve,replace:Qe}={}){X.response.headers.has("X-Remix-Revalidate")&&(V=!0);let Fe=X.response.headers.get("Location");xt(Fe,"Expected a Location header on the redirect Response"),Fe=PT(Fe,new URL(U.url),f);let Ze=ld(A.location,Fe,{_isRedirect:!0});if(n){let Kt=!1;if(X.response.headers.has("X-Remix-Reload-Document"))Kt=!0;else if(Kb(Fe)){const gn=bP(Fe,!0);Kt=gn.origin!==t.location.origin||xo(gn.pathname,f)==null}if(Kt){Qe?t.location.replace(Fe):t.location.assign(Fe);return}}B=null;let rt=Qe===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:qe,formAction:Ye,formEncType:ft}=A.navigation;!me&&!Te&&qe&&Ye&&ft&&(me=LT(A.navigation));let Je=me||Te;if(yZ.has(X.response.status)&&Je&&Rr(Je.formMethod))await pt(rt,Ze,{submission:{...Je,formAction:Fe},preventScrollReset:Ve||I,enableViewTransition:oe?q:void 0});else{let Kt=wy(Ze,me);await pt(rt,Ze,{overrideNavigation:Kt,fetcherSubmission:Te,preventScrollReset:Ve||I,enableViewTransition:oe?q:void 0})}}async function $e(U,X,oe,me){let Te,Ve={};try{Te=await DZ(p,U,X,me,oe,!1)}catch(Qe){return X.filter(Fe=>Fe.shouldLoad).forEach(Fe=>{Ve[Fe.route.id]={type:"error",error:Qe}}),Ve}if(U.signal.aborted)return Ve;for(let[Qe,Fe]of Object.entries(Te))if($Z(Fe)){let Ze=Fe.result;Ve[Qe]={type:"redirect",response:NZ(Ze,U,Qe,X,f)}}else Ve[Qe]=await kZ(Fe);return Ve}async function be(U,X,oe,me){let Te=$e(oe,U,me,null),Ve=Promise.all(X.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.request&&Ze.controller){let qe=(await $e(Ze.request,Ze.matches,me,Ze.key))[Ze.match.route.id];return{[Ze.key]:qe}}else return Promise.resolve({[Ze.key]:{type:"error",error:fo(404,{pathname:Ze.path})}})})),Qe=await Te,Fe=(await Ve).reduce((Ze,rt)=>Object.assign(Ze,rt),{});return{loaderResults:Qe,fetcherResults:Fe}}function Oe(){V=!0,F.forEach((U,X)=>{O.has(X)&&W.add(X),An(X)})}function _t(U,X,oe={}){A.fetchers.set(U,X),tt({fetchers:new Map(A.fetchers)},{flushSync:(oe&&oe.flushSync)===!0})}function bt(U,X,oe,me={}){let Te=Fa(A.matches,X);Lt(U),tt({errors:{[Te.route.id]:oe},fetchers:new Map(A.fetchers)},{flushSync:(me&&me.flushSync)===!0})}function nn(U){return te.set(U,(te.get(U)||0)+1),ae.has(U)&&ae.delete(U),A.fetchers.get(U)||xZ}function Lt(U){let X=A.fetchers.get(U);O.has(U)&&!(X&&X.state==="loading"&&H.has(U))&&An(U),F.delete(U),H.delete(U),M.delete(U),ae.delete(U),W.delete(U),A.fetchers.delete(U)}function Ln(U){let X=(te.get(U)||0)-1;X<=0?(te.delete(U),ae.add(U)):te.set(U,X),tt({fetchers:new Map(A.fetchers)})}function An(U){let X=O.get(U);X&&(X.abort(),O.delete(U))}function Vo(U){for(let X of U){let oe=nn(X),me=La(oe.data);A.fetchers.set(X,me)}}function Eo(){let U=[],X=!1;for(let oe of M){let me=A.fetchers.get(oe);xt(me,`Expected fetcher: ${oe}`),me.state==="loading"&&(M.delete(oe),U.push(oe),X=!0)}return Vo(U),X}function yi(U){let X=[];for(let[oe,me]of H)if(me<U){let Te=A.fetchers.get(oe);xt(Te,`Expected fetcher: ${oe}`),Te.state==="loading"&&(An(oe),H.delete(oe),X.push(oe))}return Vo(X),X.length>0}function Ir(U,X){let oe=A.blockers.get(U)||Uu;return je.get(U)!==X&&je.set(U,X),oe}function xi(U){A.blockers.delete(U),je.delete(U)}function Zr(U,X){let oe=A.blockers.get(U)||Uu;xt(oe.state==="unblocked"&&X.state==="blocked"||oe.state==="blocked"&&X.state==="blocked"||oe.state==="blocked"&&X.state==="proceeding"||oe.state==="blocked"&&X.state==="unblocked"||oe.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${oe.state} -> ${X.state}`);let me=new Map(A.blockers);me.set(U,X),tt({blockers:me})}function fl({currentLocation:U,nextLocation:X,historyAction:oe}){if(je.size===0)return;je.size>1&&Mn(!1,"A router only supports one blocker at a time");let me=Array.from(je.entries()),[Te,Ve]=me[me.length-1],Qe=A.blockers.get(Te);if(!(Qe&&Qe.state==="proceeding")&&Ve({currentLocation:U,nextLocation:X,historyAction:oe}))return Te}function bi(U){let X=fo(404,{pathname:U}),oe=d||c,{matches:me,route:Te}=dh(oe);return{notFoundMatches:me,route:Te,error:X}}function ca(U,X,oe){if(b=U,j=X,w=oe||null,!C&&A.navigation===Sy){C=!0;let me=Hn(A.location,A.matches);me!=null&&tt({restoreScrollPosition:me})}return()=>{b=null,j=null,w=null}}function Fo(U,X){return w&&w(U,X.map(me=>YX(me,A.loaderData)))||U.key}function br(U,X){if(b&&j){let oe=Fo(U,X);b[oe]=j()}}function Hn(U,X){if(b){let oe=Fo(U,X),me=b[oe];if(typeof me=="number")return me}return null}function Si(U,X,oe){if(e.patchRoutesOnNavigation)if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:Rh(X,oe,f,!0)}}else return{active:!0,matches:Rh(X,oe,f,!0)||[]};return{active:!1,matches:null}}async function ua(U,X,oe,me){if(!e.patchRoutesOnNavigation)return{type:"success",matches:U};let Te=U;for(;;){let Ve=d==null,Qe=d||c,Fe=s;try{await e.patchRoutesOnNavigation({signal:oe,path:X,matches:Te,fetcherKey:me,patch:(qe,Ye)=>{oe.aborted||RT(qe,Ye,Qe,Fe,i,!1)}})}catch(qe){return{type:"error",error:qe,partialMatches:Te}}finally{Ve&&!oe.aborted&&(c=[...c])}if(oe.aborted)return{type:"aborted"};let Ze=Va(Qe,X,f);if(Ze)return{type:"success",matches:Ze};let rt=Rh(Qe,X,f,!0);if(!rt||Te.length===rt.length&&Te.every((qe,Ye)=>qe.route.id===rt[Ye].route.id))return{type:"success",matches:null};Te=rt}}function is(U){s={},d=cd(U,i,void 0,s)}function as(U,X,oe=!1){let me=d==null;RT(U,X,d||c,s,i,oe),me&&(c=[...c],tt({}))}return P={get basename(){return f},get future(){return m},get state(){return A},get routes(){return c},get window(){return t},initialize:We,subscribe:ot,enableScrollRestoration:ca,navigate:Ot,fetch:Ke,revalidate:Mt,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:nn,deleteFetcher:Ln,dispose:Ee,getBlocker:Ir,deleteBlocker:xi,patchRoutes:as,_internalFetchControllers:O,_internalSetRoutes:is,_internalSetStateDoNotUseOrYouWillBreakYourApp(U){tt(U)}},P}function jZ(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ux(e,t,n,r,i,s){let c,d;if(i){c=[];for(let p of t)if(c.push(p),p.route.id===i){d=p;break}}else c=t,d=t[t.length-1];let f=Yb(r||".",Qb(c),xo(e.pathname,n)||e.pathname,s==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let p=Xb(f.search);if(d.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let x=m.toString();f.search=x?`?${x}`:""}}return n!=="/"&&(f.pathname=lZ({basename:n,pathname:f.pathname})),Ka(f)}function ET(e,t,n){if(!n||!jZ(n))return{path:t};if(n.formMethod&&!zZ(n.formMethod))return{path:t,error:fo(405,{method:n.formMethod})};let r=()=>({path:t,error:fo(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=kP(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Rr(s))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[b,w])=>`${x}${b}=${w}
|
|
585
|
+
`,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!Rr(s))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}xt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=hx(n.formData),f=n.formData;else if(n.body instanceof FormData)d=hx(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=kT(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=kT(d)}catch{return r()}let p={formMethod:s,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Rr(p.formMethod))return{path:t,submission:p};let m=la(t);return e&&m.search&&Xb(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Ka(m),submission:p}}function TT(e,t,n,r,i,s,c,d,f,p,m,g,x,b,w,j,C,T,E,R){let _=R?Gr(R[1])?R[1].error:R[1].data:void 0,P=i.createURL(s.location),A=i.createURL(f),k;if(m&&s.errors){let Q=Object.keys(s.errors)[0];k=c.findIndex(V=>V.route.id===Q)}else if(R&&Gr(R[1])){let Q=R[0];k=c.findIndex(V=>V.route.id===Q)-1}let I=R?R[1].statusCode:void 0,B=I&&I>=400,q={currentUrl:P,currentParams:s.matches[0]?.params||{},nextUrl:A,nextParams:c[0].params,...d,actionResult:_,actionStatus:I},Z=c.map((Q,V)=>{let{route:W}=Q,O=null;if(k!=null&&V>k?O=!1:W.lazy?O=!0:W.loader==null?O=!1:m?O=dx(W,s.loaderData,s.errors):CZ(s.loaderData,s.matches[V],Q)&&(O=!0),O!==null)return fx(n,r,e,Q,p,t,O);let L=B?!1:g||P.pathname+P.search===A.pathname+A.search||P.search!==A.search||EZ(s.matches[V],Q),$={...q,defaultShouldRevalidate:L},H=sp(Q,$);return fx(n,r,e,Q,p,t,H,$)}),K=[];return w.forEach((Q,V)=>{if(m||!c.some(te=>te.route.id===Q.routeId)||b.has(V))return;let W=s.fetchers.get(V),O=W&&W.state!=="idle"&&W.data===void 0,L=Va(C,Q.path,T);if(!L){if(E&&O)return;K.push({key:V,routeId:Q.routeId,path:Q.path,matches:null,match:null,request:null,controller:null});return}if(j.has(V))return;let $=_h(L,Q.path),H=new AbortController,M=ac(i,Q.path,H.signal),F=null;if(x.has(V))x.delete(V),F=fc(n,r,M,L,$,p,t);else if(O)g&&(F=fc(n,r,M,L,$,p,t));else{let te={...q,defaultShouldRevalidate:B?!1:g};sp($,te)&&(F=fc(n,r,M,L,$,p,t,te))}F&&K.push({key:V,routeId:Q.routeId,path:Q.path,matches:F,match:$,request:M,controller:H})}),{dsMatches:Z,revalidatingFetchers:K}}function dx(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function CZ(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function EZ(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function sp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function RT(e,t,n,r,i,s){let c;if(e){let p=r[e];xt(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=n;let d=[],f=[];if(t.forEach(p=>{let m=c.find(g=>RP(p,g));m?f.push({existingRoute:m,newRoute:p}):d.push(p)}),d.length>0){let p=cd(d,i,[e||"_","patch",String(c?.length||"0")],r);c.push(...p)}if(s&&f.length>0)for(let p=0;p<f.length;p++){let{existingRoute:m,newRoute:g}=f[p],x=m,[b]=cd([g],i,[],{},!0);Object.assign(x,{element:b.element?b.element:x.element,errorElement:b.errorElement?b.errorElement:x.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:x.hydrateFallbackElement})}}function RP(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>t.children?.some(i=>RP(n,i))):!1}var _T=new WeakMap,_P=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(xt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let s=i.lazy[e];if(!s)return;let c=_T.get(i);c||(c={},_T.set(i,c));let d=c[e];if(d)return d;let f=(async()=>{let p=HX(e),g=i[e]!==void 0&&e!=="hasErrorBoundary";if(p)Mn(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Mn(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await s();x!=null&&(Object.assign(i,{[e]:x}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(x=>x===void 0)&&(i.lazy=void 0))})();return c[e]=f,f},DT=new WeakMap;function TZ(e,t,n,r,i){let s=n[e.id];if(xt(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=DT.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{xt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),b={};for(let w in x){let j=x[w];if(j===void 0)continue;let C=WX(w),E=s[w]!==void 0&&w!=="hasErrorBoundary";C?Mn(!C,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?Mn(!E,`Route "${s.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=j}Object.assign(s,b),Object.assign(s,{...r(s),lazy:void 0})})();return DT.set(s,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],f;for(let m of c){if(i&&i.includes(m))continue;let g=_P({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(d.push(g),m===t&&(f=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function AT(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,s)=>{n[t[s].route.id]=i}),n}async function RZ(e){return e.matches.some(t=>t.route.unstable_middleware)?DP(e,()=>AT(e)):AT(e)}function DP(e,t){return _Z(e,t,r=>r,IZ,n);function n(r,i,s){if(s)return Promise.resolve(Object.assign(s.value,{[i]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(c.findIndex(p=>p.route.id===i)||0,c.findIndex(p=>p.unstable_shouldCallHandler())||0),f=Fa(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function _Z(e,t,n,r,i){let{matches:s,request:c,params:d,context:f}=e,p=s.flatMap(g=>g.route.unstable_middleware?g.route.unstable_middleware.map(x=>[g.route.id,x]):[]);return await AP({request:c,params:d,context:f},p,t,n,r,i)}async function AP(e,t,n,r,i,s,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[c];if(!f)return await n();let[p,m]=f,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await AP(e,t,n,r,i,s,c+1)},g.value}catch(b){return g={value:await s(b,p,g)},g.value}};try{let b=await m(e,x),w=b!=null?r(b):void 0;return i(w)?w:g?w??g.value:(g={value:await x()},g.value)}catch(b){return await s(b,p,g)}}function PP(e,t,n,r,i){let s=_P({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=TZ(r.route,Rr(n.method)?"action":"loader",t,e,i);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function fx(e,t,n,r,i,s,c,d=null){let f=!1,p=PP(e,t,n,r,i);return{...r,_lazyPromises:p,shouldLoad:c,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler(m){return f=!0,d?typeof m=="boolean"?sp(r,{...d,defaultShouldRevalidate:m}):sp(r,d):c},resolve(m){return f||c||m&&!Rr(n.method)&&(r.route.lazy||r.route.loader)?AZ({request:n,match:r,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:m,scopedContext:s}):Promise.resolve({type:"data",result:void 0})}}}function fc(e,t,n,r,i,s,c,d=null){return r.map(f=>f.route.id!==i.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:PP(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:fx(e,t,n,f,s,c,!0,d))}async function DZ(e,t,n,r,i,s){n.some(p=>p._lazyPromises?.middleware)&&await Promise.all(n.map(p=>p._lazyPromises?.middleware));let c={request:t,params:n[0].params,context:i,matches:n},f=await e({...c,fetcherKey:r,unstable_runClientMiddleware:p=>{let m=c;return DP(m,()=>p({...m,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function AZ({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:i,scopedContext:s}){let c,d,f=Rr(e.method),p=f?"action":"loader",m=g=>{let x,b=new Promise((C,T)=>x=T);d=()=>x(),e.signal.addEventListener("abort",d);let w=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${p}" [routeId: ${t.route.id}]`)):g({request:e,params:t.params,context:s},...C!==void 0?[C]:[]),j=(async()=>{try{return{type:"data",result:await(i?i(T=>w(T)):w())}}catch(C){return{type:"error",result:C}}})();return Promise.race([j,b])};try{let g=f?t.route.action:t.route.loader;if(n||r)if(g){let x,[b]=await Promise.all([m(g).catch(w=>{x=w}),n,r]);if(x!==void 0)throw x;c=b}else{await n;let x=f?t.route.action:t.route.loader;if(x)[c]=await Promise.all([m(x),r]);else if(p==="action"){let b=new URL(e.url),w=b.pathname+b.search;throw fo(405,{method:e.method,pathname:w,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(g)c=await m(g);else{let x=new URL(e.url),b=x.pathname+x.search;throw fo(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{d&&e.signal.removeEventListener("abort",d)}return c}async function PZ(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function kZ(e){let{result:t,type:n}=e;if(NP(t)){let r;try{r=await PZ(t)}catch(i){return{type:"error",error:i}}return n==="error"?{type:"error",error:new ap(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?IT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new ap(t.init?.status||500,void 0,t.data),statusCode:ud(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ud(t)?t.status:void 0}:IT(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function NZ(e,t,n,r,i){let s=e.headers.get("Location");if(xt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Kb(s)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);s=ux(new URL(t.url),c,i,s),e.headers.set("Location",s)}return e}function PT(e,t,n){if(Kb(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=xo(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function ac(e,t,n,r){let i=e.createURL(kP(t)).toString(),s={signal:n};if(r&&Rr(r.formMethod)){let{formMethod:c,formEncType:d}=r;s.method=c.toUpperCase(),d==="application/json"?(s.headers=new Headers({"Content-Type":d}),s.body=JSON.stringify(r.json)):d==="text/plain"?s.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?s.body=hx(r.formData):s.body=r.formData}return new Request(i,s)}function hx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function kT(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function OZ(e,t,n,r=!1,i=!1){let s={},c=null,d,f=!1,p={},m=n&&Gr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let x=g.route.id,b=t[x];if(xt(!Ls(b),"Cannot handle redirect results in processLoaderData"),Gr(b)){let w=b.error;if(m!==void 0&&(w=m,m=void 0),c=c||{},i)c[x]=w;else{let j=Fa(e,x);c[j.route.id]==null&&(c[j.route.id]=w)}r||(s[x]=TP),f||(f=!0,d=ud(b.error)?b.error.status:500),b.headers&&(p[x]=b.headers)}else s[x]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(d=b.statusCode),b.headers&&(p[x]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:d||200,loaderHeaders:p}}function NT(e,t,n,r,i,s){let{loaderData:c,errors:d}=OZ(t,n,r);return i.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f;if(g&&g.signal.aborted)return;let x=s[p];if(xt(x,"Did not find corresponding fetcher result"),Gr(x)){let b=Fa(e.matches,m?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:x.error}),e.fetchers.delete(p)}else if(Ls(x))xt(!1,"Unhandled fetcher revalidation redirect");else{let b=La(x.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:d}}function OT(e,t,n,r){let i=Object.entries(t).filter(([,s])=>s!==TP).reduce((s,[c,d])=>(s[c]=d,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(i[c]=e[c]),r&&r.hasOwnProperty(c))break}return i}function MT(e){return e?Gr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Fa(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function dh(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function fo(e,{pathname:t,routeId:n,method:r,type:i,message:s}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new ap(e||500,c,new Error(d),!0)}function fh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Ls(i))return{key:r,result:i}}}function kP(e){let t=typeof e=="string"?la(e):e;return Ka({...t,hash:""})}function MZ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function IZ(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&LZ(n))}function LZ(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function $Z(e){return NP(e.result)&&vZ.has(e.result.status)}function Gr(e){return e.type==="error"}function Ls(e){return(e&&e.type)==="redirect"}function IT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function NP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function zZ(e){return gZ.has(e.toUpperCase())}function Rr(e){return pZ.has(e.toUpperCase())}function Xb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function _h(e,t){let n=typeof t=="string"?la(t).search:t.search;if(e[e.length-1].route.index&&Xb(n||""))return e[e.length-1];let r=jP(e);return r[r.length-1]}function LT(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:c}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function wy(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function UZ(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Bu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function BZ(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function La(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function VZ(e,t){try{let n=e.sessionStorage.getItem(EP);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function FZ(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(EP,JSON.stringify(n))}catch(r){Mn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function qZ(){let e,t,n=new Promise((r,i)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{i(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var cl=v.createContext(null);cl.displayName="DataRouter";var Ld=v.createContext(null);Ld.displayName="DataRouterState";v.createContext(!1);var Zb=v.createContext({isTransitioning:!1});Zb.displayName="ViewTransition";var OP=v.createContext(new Map);OP.displayName="Fetchers";var HZ=v.createContext(null);HZ.displayName="Await";var vi=v.createContext(null);vi.displayName="Navigation";var $d=v.createContext(null);$d.displayName="Location";var Bo=v.createContext({outlet:null,matches:[],isDataRoute:!1});Bo.displayName="Route";var Jb=v.createContext(null);Jb.displayName="RouteError";function GZ(e,{relative:t}={}){xt(zd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(vi),{hash:i,pathname:s,search:c}=Ud(e,{relative:t}),d=s;return n!=="/"&&(d=s==="/"?n:si([n,s])),r.createHref({pathname:d,search:c,hash:i})}function zd(){return v.useContext($d)!=null}function Mr(){return xt(zd(),"useLocation() may be used only in the context of a <Router> component."),v.useContext($d).location}var MP="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function IP(e){v.useContext(vi).static||v.useLayoutEffect(e)}function wn(){let{isDataRoute:e}=v.useContext(Bo);return e?sJ():WZ()}function WZ(){xt(zd(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(cl),{basename:t,navigator:n}=v.useContext(vi),{matches:r}=v.useContext(Bo),{pathname:i}=Mr(),s=JSON.stringify(Qb(r)),c=v.useRef(!1);return IP(()=>{c.current=!0}),v.useCallback((f,p={})=>{if(Mn(c.current,MP),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Yb(f,JSON.parse(s),i,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:si([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,i,e])}var QZ=v.createContext(null);function YZ(e){let t=v.useContext(Bo).outlet;return t&&v.createElement(QZ.Provider,{value:e},t)}function Bt(){let{matches:e}=v.useContext(Bo),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=v.useContext(Bo),{pathname:r}=Mr(),i=JSON.stringify(Qb(n));return v.useMemo(()=>Yb(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function KZ(e,t){return LP(e,t)}function LP(e,t,n,r,i){xt(zd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(vi),{matches:c}=v.useContext(Bo),d=c[c.length-1],f=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let E=g&&g.path||"";$P(p,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
586
|
+
|
|
587
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let x=Mr(),b;if(t){let E=typeof t=="string"?la(t):t;xt(m==="/"||E.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),b=E}else b=x;let w=b.pathname||"/",j=w;if(m!=="/"){let E=m.replace(/^\//,"").split("/");j="/"+w.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=Va(e,{pathname:j});Mn(g||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Mn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let T=tJ(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},f,E.params),pathname:si([m,s.encodeLocation?s.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:si([m,s.encodeLocation?s.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),c,n,r,i);return t&&T?v.createElement($d.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},T):T}function XZ(){let e=aJ(),t=ud(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:s},"ErrorBoundary")," or"," ",v.createElement("code",{style:s},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:i},n):null,c)}var ZZ=v.createElement(XZ,null),JZ=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?v.createElement(Bo.Provider,{value:this.props.routeContext},v.createElement(Jb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function eJ({routeContext:e,match:t,children:n}){let r=v.useContext(cl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Bo.Provider,{value:e},n)}function tJ(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,c=n?.errors;if(c!=null){let p=s.findIndex(m=>m.route.id&&c?.[m.route.id]!==void 0);xt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let d=!1,f=-1;if(n)for(let p=0;p<s.length;p++){let m=s[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(f=p),m.route.id){let{loaderData:g,errors:x}=n,b=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||b){d=!0,f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}return s.reduceRight((p,m,g)=>{let x,b=!1,w=null,j=null;n&&(x=c&&m.route.id?c[m.route.id]:void 0,w=m.route.errorElement||ZZ,d&&(f<0&&g===0?($P("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,j=null):f===g&&(b=!0,j=m.route.hydrateFallbackElement||null)));let C=t.concat(s.slice(0,g+1)),T=()=>{let E;return x?E=w:b?E=j:m.route.Component?E=v.createElement(m.route.Component,null):m.route.element?E=m.route.element:E=p,v.createElement(eJ,{match:m,routeContext:{outlet:p,matches:C,isDataRoute:n!=null},children:E})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?v.createElement(JZ,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:T(),routeContext:{outlet:null,matches:C,isDataRoute:!0},unstable_onError:r}):T()},null)}function eS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nJ(e){let t=v.useContext(cl);return xt(t,eS(e)),t}function rJ(e){let t=v.useContext(Ld);return xt(t,eS(e)),t}function oJ(e){let t=v.useContext(Bo);return xt(t,eS(e)),t}function tS(e){let t=oJ(e),n=t.matches[t.matches.length-1];return xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function iJ(){return tS("useRouteId")}function aJ(){let e=v.useContext(Jb),t=rJ("useRouteError"),n=tS("useRouteError");return e!==void 0?e:t.errors?.[n]}function sJ(){let{router:e}=nJ("useNavigate"),t=tS("useNavigate"),n=v.useRef(!1);return IP(()=>{n.current=!0}),v.useCallback(async(i,s={})=>{Mn(n.current,MP),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var $T={};function $P(e,t,n){!t&&!$T[e]&&($T[e]=!0,Mn(!1,n))}var zT={};function UT(e,t){!e&&!zT[t]&&(zT[t]=!0,console.warn(t))}function lJ(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Mn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Mn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Mn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var cJ=["HydrateFallback","hydrateFallbackElement"],uJ=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function dJ({router:e,flushSync:t,unstable_onError:n}){let[r,i]=v.useState(e.state),[s,c]=v.useState(),[d,f]=v.useState({isTransitioning:!1}),[p,m]=v.useState(),[g,x]=v.useState(),[b,w]=v.useState(),j=v.useRef(new Map),C=v.useCallback(P=>{i(A=>(P.errors&&n&&Object.entries(P.errors).forEach(([k,I])=>{A.errors?.[k]!==I&&n(I)}),P))},[n]),T=v.useCallback((P,{deletedFetchers:A,flushSync:k,viewTransitionOpts:I})=>{P.fetchers.forEach((q,Z)=>{q.data!==void 0&&j.current.set(Z,q.data)}),A.forEach(q=>j.current.delete(q)),UT(k===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let B=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(UT(I==null||B,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!I||!B){t&&k?t(()=>C(P)):v.startTransition(()=>C(P));return}if(t&&k){t(()=>{g&&(p&&p.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let q=e.window.document.startViewTransition(()=>{t(()=>C(P))});q.finished.finally(()=>{t(()=>{m(void 0),x(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>x(q));return}g?(p&&p.resolve(),g.skipTransition(),w({state:P,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(c(P),f({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[e.window,t,g,p,C]);v.useLayoutEffect(()=>e.subscribe(T),[e,T]),v.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new uJ)},[d]),v.useEffect(()=>{if(p&&s&&e.window){let P=s,A=p.promise,k=e.window.document.startViewTransition(async()=>{v.startTransition(()=>C(P)),await A});k.finished.finally(()=>{m(void 0),x(void 0),c(void 0),f({isTransitioning:!1})}),x(k)}},[s,p,e.window,C]),v.useEffect(()=>{p&&s&&r.location.key===s.location.key&&p.resolve()},[p,g,r.location,s]),v.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]);let E=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,A,k)=>e.navigate(P,{state:A,preventScrollReset:k?.preventScrollReset}),replace:(P,A,k)=>e.navigate(P,{replace:!0,state:A,preventScrollReset:k?.preventScrollReset})}),[e]),R=e.basename||"/",_=v.useMemo(()=>({router:e,navigator:E,static:!1,basename:R,unstable_onError:n}),[e,E,R,n]);return v.createElement(v.Fragment,null,v.createElement(cl.Provider,{value:_},v.createElement(Ld.Provider,{value:r},v.createElement(OP.Provider,{value:j.current},v.createElement(Zb.Provider,{value:d},v.createElement(pJ,{basename:R,location:r.location,navigationType:r.historyAction,navigator:E},v.createElement(fJ,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var fJ=v.memo(hJ);function hJ({routes:e,future:t,state:n,unstable_onError:r}){return LP(e,void 0,n,r,t)}function nS(e){return YZ(e.context)}function Le(e){xt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function pJ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){xt(!zd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:c,navigator:i,static:s,future:{}}),[c,i,s]);typeof n=="string"&&(n=la(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:x="default"}=n,b=v.useMemo(()=>{let w=xo(f,c);return w==null?null:{location:{pathname:w,search:p,hash:m,state:g,key:x},navigationType:r}},[c,f,p,m,g,x,r]);return Mn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:v.createElement(vi.Provider,{value:d},v.createElement($d.Provider,{children:t,value:b}))}function mJ({children:e,location:t}){return KZ(px(e),t)}function px(e,t=[]){let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let s=[...t,i];if(r.type===v.Fragment){n.push.apply(n,px(r.props.children,s));return}xt(r.type===Le,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),xt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=px(r.props.children,s)),n.push(c)}),n}var Dh="get",Ah="application/x-www-form-urlencoded";function Tm(e){return e!=null&&typeof e.tagName=="string"}function gJ(e){return Tm(e)&&e.tagName.toLowerCase()==="button"}function vJ(e){return Tm(e)&&e.tagName.toLowerCase()==="form"}function yJ(e){return Tm(e)&&e.tagName.toLowerCase()==="input"}function xJ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bJ(e,t){return e.button===0&&(!t||t==="_self")&&!xJ(e)}function mx(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function SJ(e,t){let n=mx(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}var hh=null;function wJ(){if(hh===null)try{new FormData(document.createElement("form"),0),hh=!1}catch{hh=!0}return hh}var jJ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function jy(e){return e!=null&&!jJ.has(e)?(Mn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ah}"`),null):e}function CJ(e,t){let n,r,i,s,c;if(vJ(e)){let d=e.getAttribute("action");r=d?xo(d,t):null,n=e.getAttribute("method")||Dh,i=jy(e.getAttribute("enctype"))||Ah,s=new FormData(e)}else if(gJ(e)||yJ(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(r=f?xo(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Dh,i=jy(e.getAttribute("formenctype"))||jy(d.getAttribute("enctype"))||Ah,s=new FormData(d,e),!wJ()){let{name:p,type:m,value:g}=e;if(m==="image"){let x=p?`${p}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else p&&s.append(p,g)}}else{if(Tm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Dh,r=null,i=Ah,c=e}return s&&i==="text/plain"&&(c=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function EJ(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&xo(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function TJ(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function RJ(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function _J(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let c=await TJ(s,n);return c.links?c.links():[]}return[]}));return kJ(r.flat(1).filter(RJ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function BT(e,t,n,r,i,s){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,d=(f,p)=>n[p].pathname!==f.pathname||n[p].route.path?.endsWith("*")&&n[p].params["*"]!==f.params["*"];return s==="assets"?t.filter((f,p)=>c(f,p)||d(f,p)):s==="data"?t.filter((f,p)=>{let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||d(f,p))return!0;if(f.route.shouldRevalidate){let g=f.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function DJ(e,t,{includeHydrateFallback:n}={}){return AJ(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function AJ(e){return[...new Set(e)]}function PJ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function kJ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(PJ(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function zP(){let e=v.useContext(cl);return rS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function NJ(){let e=v.useContext(Ld);return rS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var oS=v.createContext(void 0);oS.displayName="FrameworkContext";function UP(){let e=v.useContext(oS);return rS(e,"You must render this element inside a <HydratedRouter> element"),e}function OJ(e,t){let n=v.useContext(oS),[r,i]=v.useState(!1),[s,c]=v.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,x=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=T=>{T.forEach(E=>{c(E.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[r]);let b=()=>{i(!0)},w=()=>{i(!1),c(!1)};return n?e!=="intent"?[s,x,{}]:[s,x,{onFocus:Vu(d,b),onBlur:Vu(f,w),onMouseEnter:Vu(p,b),onMouseLeave:Vu(m,w),onTouchStart:Vu(g,b)}]:[!1,x,{}]}function Vu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function MJ({page:e,...t}){let{router:n}=zP(),r=v.useMemo(()=>Va(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(LJ,{page:e,matches:r,...t}):null}function IJ(e){let{manifest:t,routeModules:n}=UP(),[r,i]=v.useState([]);return v.useEffect(()=>{let s=!1;return _J(e,t,n).then(c=>{s||i(c)}),()=>{s=!0}},[e,t,n]),r}function LJ({page:e,matches:t,...n}){let r=Mr(),{manifest:i,routeModules:s}=UP(),{basename:c}=zP(),{loaderData:d,matches:f}=NJ(),p=v.useMemo(()=>BT(e,t,f,i,r,"data"),[e,t,f,i,r]),m=v.useMemo(()=>BT(e,t,f,i,r,"assets"),[e,t,f,i,r]),g=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,j=!1;if(t.forEach(T=>{let E=i.routes[T.route.id];!E||!E.hasLoader||(!p.some(R=>R.route.id===T.route.id)&&T.route.id in d&&s[T.route.id]?.shouldRevalidate||E.hasClientLoader?j=!0:w.add(T.route.id))}),w.size===0)return[];let C=EJ(e,c,"data");return j&&w.size>0&&C.searchParams.set("_routes",t.filter(T=>w.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[c,d,r,i,p,t,e,s]),x=v.useMemo(()=>DJ(m,i),[m,i]),b=IJ(m);return v.createElement(v.Fragment,null,g.map(w=>v.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),x.map(w=>v.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:j})=>v.createElement("link",{key:w,nonce:n.nonce,...j})))}function $J(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var BP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{BP&&(window.__reactRouterVersion="7.8.2")}catch{}function zJ(e,t){return wZ({basename:t?.basename,unstable_getContext:t?.unstable_getContext,future:t?.future,history:BX({window:t?.window}),hydrationData:UJ(),routes:e,mapRouteProperties:lJ,hydrationRouteProperties:cJ,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function UJ(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:BJ(e.errors)}),e}function BJ(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new ap(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let c=new s(i.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}var VP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FP=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:c,state:d,target:f,to:p,preventScrollReset:m,viewTransition:g,...x},b){let{basename:w}=v.useContext(vi),j=typeof p=="string"&&VP.test(p),C,T=!1;if(typeof p=="string"&&j&&(C=p,BP))try{let B=new URL(window.location.href),q=p.startsWith("//")?new URL(B.protocol+p):new URL(p),Z=xo(q.pathname,w);q.origin===B.origin&&Z!=null?p=Z+q.search+q.hash:T=!0}catch{Mn(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=GZ(p,{relative:i}),[R,_,P]=OJ(r,x),A=HJ(p,{replace:c,state:d,target:f,preventScrollReset:m,relative:i,viewTransition:g});function k(B){t&&t(B),B.defaultPrevented||A(B)}let I=v.createElement("a",{...x,...P,href:C||E,onClick:T||s?t:k,ref:$J(b,_),target:f,"data-discover":!j&&n==="render"?"true":void 0});return R&&!j?v.createElement(v.Fragment,null,I,v.createElement(MJ,{page:E})):I});FP.displayName="Link";var VJ=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:c,viewTransition:d,children:f,...p},m){let g=Ud(c,{relative:p.relative}),x=Mr(),b=v.useContext(Ld),{navigator:w,basename:j}=v.useContext(vi),C=b!=null&&KJ(g)&&d===!0,T=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,E=x.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(E=E.toLowerCase(),R=R?R.toLowerCase():null,T=T.toLowerCase()),R&&j&&(R=xo(R,j)||R);const _=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let P=E===T||!i&&E.startsWith(T)&&E.charAt(_)==="/",A=R!=null&&(R===T||!i&&R.startsWith(T)&&R.charAt(T.length)==="/"),k={isActive:P,isPending:A,isTransitioning:C},I=P?t:void 0,B;typeof r=="function"?B=r(k):B=[r,P?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let q=typeof s=="function"?s(k):s;return v.createElement(FP,{...p,"aria-current":I,className:B,ref:m,style:q,to:c,viewTransition:d},typeof f=="function"?f(k):f)});VJ.displayName="NavLink";var FJ=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:c=Dh,action:d,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...x},b)=>{let w=QJ(),j=YJ(d,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",T=typeof d=="string"&&VP.test(d),E=R=>{if(f&&f(R),R.defaultPrevented)return;R.preventDefault();let _=R.nativeEvent.submitter,P=_?.getAttribute("formmethod")||c;w(_||R.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:s,relative:p,preventScrollReset:m,viewTransition:g})};return v.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:E,...x,"data-discover":!T&&e==="render"?"true":void 0})});FJ.displayName="Form";function qJ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qP(e){let t=v.useContext(cl);return xt(t,qJ(e)),t}function HJ(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:c}={}){let d=wn(),f=Mr(),p=Ud(e,{relative:s});return v.useCallback(m=>{if(bJ(m,t)){m.preventDefault();let g=n!==void 0?n:Ka(f)===Ka(p);d(e,{replace:g,state:r,preventScrollReset:i,relative:s,viewTransition:c})}},[f,d,p,n,r,t,e,i,s,c])}function iS(e){Mn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(mx(e)),n=v.useRef(!1),r=Mr(),i=v.useMemo(()=>SJ(r.search,n.current?null:t.current),[r.search]),s=wn(),c=v.useCallback((d,f)=>{const p=mx(typeof d=="function"?d(new URLSearchParams(i)):d);n.current=!0,s("?"+p,f)},[s,i]);return[i,c]}var GJ=0,WJ=()=>`__${String(++GJ)}__`;function QJ(){let{router:e}=qP("useSubmit"),{basename:t}=v.useContext(vi),n=iJ();return v.useCallback(async(r,i={})=>{let{action:s,method:c,encType:d,formData:f,body:p}=CJ(r,t);if(i.navigate===!1){let m=i.fetcherKey||WJ();await e.fetch(m,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:f,body:p,formMethod:i.method||c,formEncType:i.encType||d,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:f,body:p,formMethod:i.method||c,formEncType:i.encType||d,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function YJ(e,{relative:t}={}){let{basename:n}=v.useContext(vi),r=v.useContext(Bo);xt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ud(e||".",{relative:t})},c=Mr();if(e==null){s.search=c.search;let d=new URLSearchParams(s.search),f=d.getAll("index");if(f.some(m=>m==="")){d.delete("index"),f.filter(g=>g).forEach(g=>d.append("index",g));let m=d.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:si([n,s.pathname])),Ka(s)}function KJ(e,{relative:t}={}){let n=v.useContext(Zb);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=qP("useViewTransitionState"),i=Ud(e,{relative:t});if(!n.isTransitioning)return!1;let s=xo(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=xo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ip(i.pathname,c)!=null||ip(i.pathname,s)!=null}function aS(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function XJ(e){if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return e.specimen?.[0]}function rs(e){return qs(e.getActiveLogin()?.project)}function Rm(e){const t=Ae(),n=rs(t),r=wn(),[i,s]=v.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ue.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ue.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(Uc,{search:i,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})}function ZJ(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Bots"}),a.jsx(Rm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(vt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function JJ(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Clients"}),a.jsx(Rm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(vt,{to:"/admin/clients/new",children:"Create new client"})})]})}function _m(e){return a.jsx(sl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{mi(t)?e.onChange(qt(t)):e.onChange(void 0)}})}function eee(){const e=Ae(),t=rs(e),[n,r]=v.useState(""),[i,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Create new Bot"}),a.jsxs(dt,{onSubmit:()=>{const x={name:n,description:i,accessPolicy:c};e.post("admin/projects/"+t+"/bot",x).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),Ne({color:"green",message:"Bot created"})}).catch(b=>{Ne({color:"red",message:Ge(b),autoClose:!1}),p(Ht(b))})},children:[!m&&a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Name",htmlFor:"name",outcome:f,children:a.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:x=>r(x.currentTarget.value),error:Pt(f,"name")})}),a.jsx(Nt,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(ze,{id:"description",name:"description",onChange:x=>s(x.currentTarget.value),error:Pt(f,"description")})}),a.jsx(Nt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(_m,{name:"accessPolicy",onChange:d})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Create Bot"})})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(De,{children:"Bot created"}),a.jsxs(pr,{children:[a.jsx(pr.Item,{children:a.jsx(vt,{to:m,children:"Go to new bot"})}),a.jsx(pr.Item,{children:a.jsx(vt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function tee(){const e=Ae(),t=rs(e),[n,r]=v.useState(""),[i,s]=v.useState(""),[c,d]=v.useState(""),[f,p]=v.useState(),[m,g]=v.useState(),[x,b]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Create new Client"}),a.jsxs(dt,{onSubmit:()=>{const w={name:n,description:i,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",w).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(j),Ne({color:"green",message:"Client created"})}).catch(j=>{Ne({color:"red",message:Ge(j),autoClose:!1}),g(Ht(j))})},children:[!x&&a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Name",htmlFor:"name",outcome:m,children:a.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:w=>r(w.currentTarget.value),error:Pt(m,"name")})}),a.jsx(Nt,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(ze,{id:"description",name:"description",onChange:w=>s(w.currentTarget.value),error:Pt(m,"description")})}),a.jsx(Nt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(ze,{id:"redirectUri",name:"redirectUri",onChange:w=>d(w.currentTarget.value),error:Pt(m,"redirectUri")})}),a.jsx(Nt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(_m,{name:"accessPolicy",onChange:p})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Create Client"})})]}),x&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(De,{children:"Client created"}),a.jsxs(pr,{children:[a.jsx(pr.Item,{children:a.jsx(vt,{to:x,children:"Go to new client"})}),a.jsx(pr.Item,{children:a.jsx(vt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function nee(e){return a.jsx(sl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{mi(t)?e.onChange(qt(t)):e.onChange(void 0)}})}function ree(){const{membershipId:e}=Bt(),t=Ae(),n=rs(t),r=wn(),i=t.get(`admin/projects/${n}/members/${e}`).read(),[s,c]=v.useState(i.accessPolicy),[d,f]=v.useState(i.userConfiguration),[p,m]=v.useState(i.admin),[g,x]=v.useState(),[b,w]=v.useState(!1);function j(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(C=>x(Ht(C)))}return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(dc,{value:i.profile,link:!0})}),a.jsxs(dt,{onSubmit:()=>{const C={...i,accessPolicy:s,userConfiguration:d,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>w(!0)).catch(T=>x(Ht(T)))},children:[!b&&a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(_m,{name:"accessPolicy",defaultValue:s,onChange:c})}),a.jsx(Nt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx(nee,{name:"userConfiguration",defaultValue:d,onChange:f})}),a.jsx(Nt,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx(Dn,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),a.jsxs(ye,{justify:"flex-end",mt:"xl",children:[a.jsx(ke,{type:"submit",children:"Save"}),a.jsx(ke,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User updated"}),a.jsx("pre",{children:JSON.stringify(g,void 0,2)}),a.jsxs("p",{children:["Click ",a.jsx(vt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function oee(){const e=Ae(),[t,n]=v.useState(e.getProject()),[r,i]=v.useState(),[s,c]=v.useState(),[d,f]=v.useState(!1),[p,m]=v.useState(void 0),g=v.useCallback(x=>{const b={resourceType:x.resourceType,firstName:x.firstName,lastName:x.lastName,email:x.email,sendEmail:x.sendEmail==="on",accessPolicy:r,admin:x.isAdmin==="on",scope:x.isProjectScoped==="on"?"project":"server",mfaRequired:x.mfaRequired==="on"};return e.invite(t?.id,b).then(w=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),rm(w)?c(w):m(w),f(b.sendEmail??!1),Ne({color:"green",message:"Invite success"})}).catch(w=>{Ne({color:"red",message:Ge(w),autoClose:!1}),c(Ht(w))})},[e,t,r]);return a.jsxs(dt,{onSubmit:g,children:[!p&&!s&&a.jsxs(Ue,{children:[a.jsx(Ie,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(Nt,{title:"Project",htmlFor:"project",outcome:s,children:a.jsx(sl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(sn,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Pt(s,"resourceType")}),a.jsx(ze,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Pt(s,"firstName")}),a.jsx(ze,{name:"lastName",label:"Last Name",required:!0,error:Pt(s,"lastName")}),a.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,error:Pt(s,"email")}),a.jsx(Nt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:a.jsx(_m,{name:"accessPolicy",onChange:i})}),a.jsx(Dn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(Dn,{name:"isAdmin",label:"Admin"}),a.jsx(Dn,{name:"isProjectScoped",label:"Project scoped"}),a.jsx(Dn,{name:"mfaRequired",label:"MFA required"}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yr,{children:"Invite"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User created, email couldn't be sent"}),a.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),a.jsxs("p",{children:["Click ",a.jsx(vt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(De,{children:"User created"}),d&&a.jsx(De,{children:"Email sent"}),a.jsxs(pr,{children:[a.jsx(pr.Item,{children:a.jsx(vt,{to:p,children:"Go to new membership"})}),a.jsx(pr.Item,{children:a.jsx(vt,{to:p.profile,children:"Go to new profile"})}),a.jsx(pr.Item,{children:a.jsx(vt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function iee(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Patients"}),a.jsx(Rm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(vt,{to:"/admin/invite",children:"Invite new patient"})})]})}function aee(){const e=Ae();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(xr,{outcome:nm});function t(n){e.post("admin/projects/setpassword",n).then(()=>Ne({color:"green",message:"Done"})).catch(r=>Ne({color:"red",message:Ge(r),autoClose:!1}))}return a.jsxs(lt,{width:600,children:[a.jsx(Ie,{order:1,children:"Project Admin"}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Force Set Password"}),a.jsx(De,{children:"Sets the password for the specified user in this project."}),a.jsx(De,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(dt,{onSubmit:t,children:a.jsxs(Ue,{children:[a.jsx(ze,{name:"email",label:"Email",required:!0}),a.jsx(Oo,{name:"password",label:"Password",required:!0}),a.jsx(ke,{type:"submit",children:"Force Set Password"})]})})]})}function VT(){const e=Ae(),t=rs(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Details"}),a.jsxs(vm,{children:[a.jsx(mo,{term:"ID",children:n.project.id}),a.jsx(mo,{term:"Name",children:n.project.name})]})]})}const FT=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function see(){const e=wn(),n=Mr().pathname.replace("/admin/","")||FT[0],r=Ae(),i=rs(r),s=v.useMemo(()=>r.get("admin/projects/"+i).read(),[r,i]);function c(d){e(`/admin/${d}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(mr,{children:[a.jsx(ht,{children:a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Project"}),a.jsx(ht.Value,{children:s.project.name})]})}),a.jsx(Xr,{children:a.jsx(zt,{value:n.toLowerCase(),onChange:c,children:a.jsx(zt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:FT.map(d=>a.jsx(zt.Tab,{value:d.toLowerCase(),children:d},d))})})})]}),a.jsx(lt,{children:a.jsx(nS,{})})]})}function lee(){const e=Ae(),t=rs(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Yr(n.project.secret||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/secrets`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ne({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(Ie,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(Md,{property:ts("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(ke,{type:"submit",children:"Save"})]})}function cee(){const e=Ae(),t=rs(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Yr(n.project.site||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/sites`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ne({color:"green",message:"Saved"})).catch(f=>{const p=Ht(f);Ne({color:"red",message:`Error ${p.issue?.[0].details?.text} ${p.issue?.[0].expression?.[0]}`,autoClose:!1})})},children:[a.jsx(Ie,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(Md,{property:ts("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(ke,{type:"submit",children:"Save"})]})}function HP(e,t,n,r){const i=Date.now().toString();Ne({id:i,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const s={method:"POST",pollStatusOnAccepted:!0};return r&&(s.body=JSON.stringify(r)),e.startAsyncRequest(n,s).then(c=>{let d="Done";return c.resourceType==="AsyncJob"?d=a.jsx(vt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&c.issue?.[0]?.details?.text&&(d=a.jsx(De,{children:c.issue[0].details.text})),ho.update({id:i,color:"green",title:t,message:d,icon:a.jsx(gi,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw ho.update({id:i,color:"red",title:t,message:Ge(c),icon:a.jsx(Qs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function Es(e,t,n,r){HP(e,t,n,r).catch(()=>{})}const GP="System AsyncJob",WP="Post-deploy Migrations",ph=[WP,GP];function uee(){const e=Ae(),[t,n]=v.useState(ph[0]);function r(i){i||=ph[0],ph.includes(i)&&n(i)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(xr,{outcome:nm}):a.jsx(Od,{miw:"1600",maw:"2000",children:a.jsxs($c,{children:[a.jsx(Ie,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(zt,{keepMounted:!1,value:t,onChange:r,children:[a.jsx(zt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:ph.map(i=>a.jsx(zt.Tab,{value:i,children:i},i))}),a.jsx(zt.Panel,{value:GP,pt:"md",children:a.jsx(fee,{})}),a.jsx(zt.Panel,{value:WP,pt:"md",children:a.jsx(pee,{})})]})]})})}const dee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function fee(){const e=wn(),[t]=v.useState(dee);return a.jsxs(Ue,{children:[a.jsx(vt,{to:`/${t.resourceType}/${Ha(t)}`,children:"Show in search page"}),a.jsx(Uc,{checkboxesEnabled:!1,search:t,onClick:n=>e(qT(n.resource))?.catch(console.error),onAuxClick:n=>window.open(qT(n.resource),"_blank")})]})}const hee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"},{code:"type",operator:ue.EQUALS,value:"data-migration"}],count:1e3,sortRules:[{code:"_lastUpdated",descending:!0}]};function pee(){const e=Ae(),[t,n]=v.useState(),[r,i]=v.useState(),[s,c]=v.useState([]),[d,f]=v.useState(0),[p,m]=v.useState([]);v.useEffect(()=>{const j="info";m(C=>C.includes(j)?C:[...C,j]),e.get("admin/super/migrations",{cache:"no-cache"}).then(C=>{C.postDeployMigrations.sort((T,E)=>E-T),n(C)}).catch(C=>{Ne({color:"red",message:Ge(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,d]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",Ha({...hee,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{i(C.entry?.map(T=>T.resource))})).catch(C=>{i(void 0),Ne({color:"red",message:Ge(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,d]);function g(){f(j=>j+1)}function x(j){HP(e,"Run Pending Data Migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const b=p.length>0;function w(j,{isLoading:C}){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(Ip,{visible:C}),a.jsxs(ve,{children:[a.jsx(ve.Thead,{children:a.jsxs(ve.Tr,{children:[a.jsx(ve.Th,{children:"Version"}),a.jsx(ve.Th,{children:"Action"}),a.jsx(ve.Th,{children:"Status"}),a.jsx(ve.Th,{children:"AsyncJob"}),a.jsx(ve.Th,{children:"Last Updated"}),a.jsx(ve.Th,{children:"Request Time"}),a.jsx(ve.Th,{children:"Duration"}),a.jsx(ve.Th,{children:"Attempts"})]})}),a.jsx(ve.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(ke,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx(xA,{size:14}),onClick:g,loading:b,children:"Refresh"}),w(()=>{if(!b){if(!t)return a.jsx(ve.Tr,{children:a.jsx(ve.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(ve.Tr,{children:a.jsx(ve.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:T,asyncJobs:E}=mee(j,r??[],t?.pendingPostDeployMigration),R=s.includes(j),_=j===t?.pendingPostDeployMigration&&(!T||T?.status==="error"),P=[a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:j}),a.jsx(ve.Td,{children:_&&a.jsx(ke,{color:"green",size:"xs",onClick:()=>x(j),children:"Start"})}),a.jsx(ve.Td,{children:C}),a.jsx(ve.Td,{children:T&&a.jsx(vt,{to:`/AsyncJob/${T?.id}`,children:T?.id})}),a.jsx(ve.Td,{children:T?.meta?.lastUpdated}),a.jsx(ve.Td,{children:T?.requestTime}),a.jsx(ve.Td,{children:HT(T)}),a.jsx(ve.Td,{display:"flex",children:a.jsxs(ye,{gap:"xs",children:[E.length?E.length:"",R&&E.length>1&&a.jsx(ke,{leftSection:a.jsx(Wq,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(A=>A.includes(j)?A.filter(k=>k!==j):A),children:"Hide all"}),!R&&E.length>1&&a.jsx(ke,{leftSection:a.jsx(yA,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(A=>A.includes(j)?A:[...A,j]),children:"Show all"})]})})]},j)];return R&&P.push(...E.filter(A=>A.id!==T?.id).map(A=>a.jsxs(ve.Tr,{bg:"gray.1",children:[a.jsx(ve.Td,{children:j}),a.jsx(ve.Td,{}),a.jsx(ve.Td,{children:A.status}),a.jsx(ve.Td,{children:a.jsx(vt,{to:`/AsyncJob/${A.id}`,children:A.id})}),a.jsx(ve.Td,{children:A.meta?.lastUpdated}),a.jsx(ve.Td,{children:A.requestTime}),a.jsx(ve.Td,{children:HT(A)}),a.jsx(ve.Td,{})]},A.id))),P})},{isLoading:b})]})}function mee(e,t,n){const r=t.filter(c=>c.dataVersion===e),i=r.find(c=>c.status==="completed")??r[0];let s;return n===0?s=i?.status??"completed":e>n?s=i?.status??"pending":e===n?s=i?.status??"next":s=i?.status??"completed",{status:s,asyncJob:i,asyncJobs:r}}function qT(e){return`/${e.resourceType}/${e.id}`}function HT(e){const t=e?.requestTime,n=e?.transactionTime??e?.meta?.lastUpdated;if(!t||!n)return"";const r=new Date(t),s=new Date(n).getTime()-r.getTime();if(s<1e3)return`${s.toFixed(0)}ms`;const c=s/1e3;return c<60?`${c.toFixed(2)}s`:c<3600?`${(c/60).toFixed(2)}m`:`${(c/3600).toFixed(2)}h`}function gee(){const e=Ae(),[t,{open:n,close:r}]=pp(!1),[i,s]=v.useState(""),[c,d]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(xr,{outcome:nm});function f(){Es(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){Es(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){Es(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(P){Es(e,"Reindexing Resources","admin/super/reindex",P)}function x(){Es(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){Es(e,"Run Pending Data Migration","admin/super/migrate")}function w(P){e.post("admin/super/removebotidjobsfromqueue",P).then(()=>Ne({color:"green",message:"Done"})).catch(A=>Ne({color:"red",message:Ge(A),autoClose:!1}))}function j(P){e.post("admin/super/purge",{...P,before:Ib(P.before)}).then(()=>Ne({color:"green",message:"Done"})).catch(A=>Ne({color:"red",message:Ge(A),autoClose:!1}))}function C(P){e.post("admin/super/setpassword",P).then(()=>Ne({color:"green",message:"Done"})).catch(A=>Ne({color:"red",message:Ge(A),autoClose:!1}))}function T(P){e.post("fhir/R4/$db-stats",P.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:P.tableNames}]}:void 0).then(A=>{s("Database Stats"),d(a.jsx("pre",{children:A.parameter?.find(k=>k.name==="tableString")?.valueString})),n()}).catch(A=>Ne({color:"red",message:Ge(A),autoClose:!1}))}function E(){e.post("fhir/R4/$db-invalid-indexes").then(P=>{s("Database Invalid Indexes"),d(a.jsx("pre",{children:P.parameter?.filter(A=>A.name==="invalidIndex").map(A=>A.valueString).join(`
|
|
588
|
+
`)})),n()}).catch(P=>Ne({color:"red",message:Ge(P),autoClose:!1}))}function R(){e.post("fhir/R4/$db-schema-diff").then(P=>{s("Schema Diff"),d(a.jsx("pre",{children:P.parameter?.find(A=>A.name==="migrationString")?.valueString})),n()}).catch(P=>Ne({color:"red",message:Ge(P),autoClose:!1}))}function _(){Es(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return a.jsxs(lt,{width:600,children:[a.jsx(Ie,{order:1,children:"Super Admin"}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Structure Definitions"}),a.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),a.jsx(dt,{children:a.jsx(ke,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Search Parameters"}),a.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),a.jsx(dt,{children:a.jsx(ke,{onClick:p,children:"Rebuild SearchParameters"})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Value Sets"}),a.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),a.jsx(dt,{children:a.jsx(ke,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Run Pending Data Migration"}),a.jsx("p",{children:"When a Medplum version releases with data migrations to apply, you can run them here. Press this button to kick off the background data migration process."}),a.jsx(dt,{onSubmit:b,children:a.jsx(Ue,{children:a.jsx(ke,{type:"submit",children:"Start Migration"})})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Reindex Resources"}),a.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),a.jsx(dt,{onSubmit:g,children:a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(ze,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(Nt,{title:"Search Filter",htmlFor:"filter",children:a.jsx(ze,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx(Nt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx(vee,{})}),a.jsx(ke,{type:"submit",children:"Reindex"})]})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Purge Resources"}),a.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),a.jsx(dt,{onSubmit:j,children:a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(sn,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(Nt,{title:"Purge Before",htmlFor:"before",children:a.jsx(ai,{name:"before",placeholder:"Before Date"})}),a.jsx(ke,{type:"submit",children:"Purge"})]})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(dt,{onSubmit:w,children:a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Bot ID",children:a.jsx(ze,{name:"botId",placeholder:"Bot Id"})}),a.jsx(ke,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Force Set Password"}),a.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),a.jsx(dt,{onSubmit:C,children:a.jsxs(Ue,{children:[a.jsx(ze,{name:"email",label:"Email",required:!0}),a.jsx(Oo,{name:"password",label:"Password",required:!0}),a.jsx(ze,{name:"projectId",label:"Project ID"}),a.jsx(ke,{type:"submit",children:"Force Set Password"})]})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(dt,{onSubmit:T,children:a.jsxs(Ue,{children:[a.jsx(Nt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(ze,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(ke,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(dt,{onSubmit:E,children:a.jsx(Ue,{children:a.jsx(ke,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Schema Drift"}),a.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),a.jsxs(ir,{children:[a.jsx(ir.Col,{span:6,children:a.jsx(dt,{onSubmit:R,children:a.jsx(Ue,{children:a.jsx(ke,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(ir.Col,{span:6,children:a.jsx(dt,{onSubmit:_,children:a.jsx(Ue,{children:a.jsx(ke,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Reload Cron Resources"}),a.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),a.jsx(dt,{onSubmit:x,children:a.jsx(Ue,{children:a.jsx(ke,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Explain Search"}),a.jsx("p",{children:"Runs an EXPLAIN query on the database to show the query plan for a search."}),a.jsx(yee,{setModalTitle:s,setModalContent:d,openModal:n}),a.jsx(Vn,{opened:t,onClose:r,title:i,centered:!0,size:"auto",children:c})]})}function vee(){const[e,t]=v.useState("outdated");return a.jsxs(a.Fragment,{children:[a.jsx(sn,{id:"reindexType",name:"reindexType",value:e,onChange:n=>t(n.target.value),data:[{label:"Outdated resources",value:"outdated"},{label:"All resources",value:"all"},{label:"Less than or equal to a specific version",value:"specific"}]}),e==="specific"&&a.jsx(Wp,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function yee({setModalTitle:e,setModalContent:t,openModal:n}){const r=Ae(),[i,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(),x=v.useMemo(()=>{if(i?.reference)return{"_has:ProjectMembership:profile:project":i.reference}},[i]);v.useEffect(()=>{if(g(void 0),!c?.reference&&!i?.reference){p(void 0);return}r.searchResources("ProjectMembership",{profile:c?.reference,project:i?.reference,_count:20}).then(j=>{p(j),j.length===1&&g(qt(j[0]))}).catch(j=>{console.error(j),Ne({color:"red",message:Ge(j),autoClose:!1})})},[r,c,i]);const b=v.useMemo(()=>{const j={};return c?.reference&&(j.profile=c?.reference),i?.reference&&(j.project=i?.reference),j},[c,i]);function w(j){if(!j.query){Ne({color:"red",message:"Query is required",autoClose:!1});return}const C=j.onBehalfOfProjectMembership;delete j.onBehalfOfProjectMembership;const T={query:j.query,analyze:j.analyze==="on",format:"text"},E={};C&&(E["x-medplum-on-behalf-of"]=C),r.post("fhir/R4/$explain",T,void 0,{headers:E}).then(R=>{e("Database Explain");const _=R.parameter?.find(I=>I.name==="explain")?.valueString,P=R.parameter?.find(I=>I.name==="query")?.valueString,A=R.parameter?.find(I=>I.name==="parameters")?.valueString,k=[P,A,`
|
|
589
|
+
`,_].join(`
|
|
590
|
+
`);t(a.jsx(Mp,{block:!0,maw:"100%",children:k})),n()}).catch(R=>{Ne({color:"red",message:Ge(R),autoClose:!1})})}return!r.isLoading()&&!r.isSuperAdmin()?a.jsx(xr,{outcome:nm}):a.jsx(dt,{onSubmit:w,children:a.jsxs(Ue,{children:[a.jsx(ze,{name:"query",label:"Search",required:!0,placeholder:"Observation?code=85354-9&_sort=-date&_count=5"}),a.jsx(Dn,{name:"analyze",label:"Analyze"}),a.jsx(Dp,{label:"On Behalf Of",children:a.jsxs(Ue,{gap:"sm",children:[a.jsx(Ga,{required:!0,placeholder:"Project",targetTypes:["Project"],name:"onBehalfOfProject",onChange:s}),a.jsx(Ga,{required:!0,placeholder:"Practitioner or Patient",name:"onBehalfOfProfile",targetTypes:["Practitioner","Patient"],onChange:d,searchCriteria:x}),f?.length!==1&&a.jsx(Ga,{required:!0,placeholder:"ProjectMembership",name:"onBehalfOfProjectMembership",targetTypes:["ProjectMembership"],onChange:g,searchCriteria:b}),f?.length===1&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"hidden",name:"onBehalfOfProjectMembership",value:Dt(f[0])}),a.jsx(Zh,{value:qt(f[0])})]}),!m&&a.jsx(De,{fs:"italic",children:"On Behalf Of not set. Running as super admin"})]})}),a.jsx(ke,{type:"submit",children:"Explain Search"})]})})}function xee(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Users"}),a.jsx(Rm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(vt,{to:"/admin/invite",children:"Invite new user"})})]})}const bee=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Cc(e,t,n){const r=See(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&>(r,"path",s),GT(r,"relativePath",s),r}function See(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=bee.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function GT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var ul=(e,t,n)=>new Promise((r,i)=>{var s=f=>{try{d(n.next(f))}catch(p){i(p)}},c=f=>{try{d(n.throw(f))}catch(p){i(p)}},d=f=>f.done?r(f.value):Promise.resolve(f.value).then(s,c);d((n=n.apply(e,t)).next())});const wee=[".DS_Store","Thumbs.db"];function jee(e){return ul(this,null,function*(){return lp(e)&&Cee(e.dataTransfer)?_ee(e.dataTransfer,e.type):Eee(e)?Tee(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Ree(e):[]})}function Cee(e){return lp(e)}function Eee(e){return lp(e)&&lp(e.target)}function lp(e){return typeof e=="object"&&e!==null}function Tee(e){return gx(e.target.files).map(t=>Cc(t))}function Ree(e){return ul(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Cc(n))})}function _ee(e,t){return ul(this,null,function*(){if(e.items){const n=gx(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(Dee));return WT(QP(r))}return WT(gx(e.files).map(n=>Cc(n)))})}function WT(e){return e.filter(t=>wee.indexOf(t.name)===-1)}function gx(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function Dee(e){if(typeof e.webkitGetAsEntry!="function")return QT(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?YP(t):QT(e,t)}function QP(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?QP(n):[n]],[])}function QT(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(s=>ul(this,null,function*(){const c=yield s.getFile();return c.handle=s,Cc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const i=Cc(r,(n=t?.fullPath)!=null?n:void 0);return Promise.resolve(i)}function Aee(e){return ul(this,null,function*(){return e.isDirectory?YP(e):Pee(e)})}function YP(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(c=>ul(this,null,function*(){if(c.length){const d=Promise.all(c.map(Aee));i.push(d),s()}else try{const d=yield Promise.all(i);n(d)}catch(d){r(d)}}),c=>{r(c)})}s()})}function Pee(e){return ul(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const i=Cc(r,e.fullPath);t(i)},r=>{n(r)})})})}function Cy(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(c=>{const d=c.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?s===d.replace(/\/.*$/,""):i===d})}return!0}var kee=Object.defineProperty,Nee=Object.defineProperties,Oee=Object.getOwnPropertyDescriptors,YT=Object.getOwnPropertySymbols,Mee=Object.prototype.hasOwnProperty,Iee=Object.prototype.propertyIsEnumerable,KT=(e,t,n)=>t in e?kee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lee=(e,t)=>{for(var n in t||(t={}))Mee.call(t,n)&&KT(e,n,t[n]);if(YT)for(var n of YT(t))Iee.call(t,n)&&KT(e,n,t[n]);return e},$ee=(e,t)=>Nee(e,Oee(t));const zee=typeof Cy=="function"?Cy:Cy.default,Uee="file-invalid-type",Bee="file-too-large",Vee="file-too-small",Fee="too-many-files",qee=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:Uee,message:`File type must be ${n}`}},XT=e=>({code:Bee,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),ZT=e=>({code:Vee,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),Hee={code:Fee,message:"Too many files"};function KP(e,t){const n=e.type==="application/x-moz-file"||zee(e,t);return[n,n?null:qee(t)]}function XP(e,t,n){if(As(e.size))if(As(t)&&As(n)){if(e.size>n)return[!1,XT(n)];if(e.size<t)return[!1,ZT(t)]}else{if(As(t)&&e.size<t)return[!1,ZT(t)];if(As(n)&&e.size>n)return[!1,XT(n)]}return[!0,null]}function As(e){return e!=null}function Gee({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:s,validator:c}){return!i&&e.length>1||i&&s>=1&&e.length>s?!1:e.every(d=>{const[f]=KP(d,t),[p]=XP(d,n,r),m=c?c(d):null;return f&&p&&!m})}function cp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function mh(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,t=>t==="Files"||t==="application/x-moz-file"):!!e.target&&!!e.target.files}function JT(e){e.preventDefault()}function Wee(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Qee(e){return e.indexOf("Edge/")!==-1}function Yee(e=window.navigator.userAgent){return Wee(e)||Qee(e)}function Xo(...e){return(t,...n)=>e.some(r=>(!cp(t)&&r&&r(t,...n),cp(t)))}function Kee(){return"showOpenFilePicker"in window}function Xee(e){return As(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let i=!0;return ZP(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),i=!1),(!Array.isArray(r)||!r.every(JP))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),i=!1),i}).reduce((n,[r,i])=>$ee(Lee({},n),{[r]:i}),{})}]:e}function Zee(e){if(As(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>ZP(t)||JP(t)).join(",")}function Jee(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function ete(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ZP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function JP(e){return/^.*\.[\w]+$/.test(e)}var tte=Object.defineProperty,nte=Object.defineProperties,rte=Object.getOwnPropertyDescriptors,up=Object.getOwnPropertySymbols,ek=Object.prototype.hasOwnProperty,tk=Object.prototype.propertyIsEnumerable,eR=(e,t,n)=>t in e?tte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t)=>{for(var n in t||(t={}))ek.call(t,n)&&eR(e,n,t[n]);if(up)for(var n of up(t))tk.call(t,n)&&eR(e,n,t[n]);return e},Ua=(e,t)=>nte(e,rte(t)),dp=(e,t)=>{var n={};for(var r in e)ek.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&up)for(var r of up(e))t.indexOf(r)<0&&tk.call(e,r)&&(n[r]=e[r]);return n};const sS=v.forwardRef((e,t)=>{var n=e,{children:r}=n,i=dp(n,["children"]);const s=rk(i),{open:c}=s,d=dp(s,["open"]);return v.useImperativeHandle(t,()=>({open:c}),[c]),En.createElement(v.Fragment,null,r(Ua(hr({},d),{open:c})))});sS.displayName="Dropzone";const nk={disabled:!1,getFilesFromEvent:jee,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};sS.defaultProps=nk;sS.propTypes={children:on.func,accept:on.objectOf(on.arrayOf(on.string)),multiple:on.bool,preventDropOnDocument:on.bool,noClick:on.bool,noKeyboard:on.bool,noDrag:on.bool,noDragEventsBubbling:on.bool,minSize:on.number,maxSize:on.number,maxFiles:on.number,disabled:on.bool,getFilesFromEvent:on.func,onFileDialogCancel:on.func,onFileDialogOpen:on.func,useFsAccessApi:on.bool,autoFocus:on.bool,onDragEnter:on.func,onDragLeave:on.func,onDragOver:on.func,onDrop:on.func,onDropAccepted:on.func,onDropRejected:on.func,onError:on.func,validator:on.func};const vx={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function rk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:i,minSize:s,multiple:c,maxFiles:d,onDragEnter:f,onDragLeave:p,onDragOver:m,onDrop:g,onDropAccepted:x,onDropRejected:b,onFileDialogCancel:w,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:T,preventDropOnDocument:E,noClick:R,noKeyboard:_,noDrag:P,noDragEventsBubbling:A,onError:k,validator:I}=hr(hr({},nk),e),B=v.useMemo(()=>Zee(t),[t]),q=v.useMemo(()=>Xee(t),[t]),Z=v.useMemo(()=>typeof j=="function"?j:tR,[j]),K=v.useMemo(()=>typeof w=="function"?w:tR,[w]),Q=v.useRef(null),V=v.useRef(null),[W,O]=v.useReducer(ote,vx),{isFocused:L,isFileDialogActive:$}=W,H=v.useRef(typeof window<"u"&&window.isSecureContext&&C&&Kee()),M=()=>{!H.current&&$&&setTimeout(()=>{if(V.current){const{files:he}=V.current;he.length||(O({type:"closeDialog"}),K())}},300)};v.useEffect(()=>(window.addEventListener("focus",M,!1),()=>{window.removeEventListener("focus",M,!1)}),[V,$,K,H]);const F=v.useRef([]),te=he=>{Q.current&&Q.current.contains(he.target)||(he.preventDefault(),F.current=[])};v.useEffect(()=>(E&&(document.addEventListener("dragover",JT,!1),document.addEventListener("drop",te,!1)),()=>{E&&(document.removeEventListener("dragover",JT),document.removeEventListener("drop",te))}),[Q,E]),v.useEffect(()=>(!n&&T&&Q.current&&Q.current.focus(),()=>{}),[Q,T,n]);const ae=v.useCallback(he=>{k?k(he):console.error(he)},[k]),je=v.useCallback(he=>{he.preventDefault(),he.persist(),Re(he),F.current=[...F.current,he.target],mh(he)&&Promise.resolve(r(he)).then(Se=>{if(cp(he)&&!A)return;const $e=Se.length,be=$e>0&&Gee({files:Se,accept:B,minSize:s,maxSize:i,multiple:c,maxFiles:d,validator:I}),Oe=$e>0&&!be;O({isDragAccept:be,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),f&&f(he)}).catch(Se=>ae(Se))},[r,f,ae,A,B,s,i,c,d,I]),xe=v.useCallback(he=>{he.preventDefault(),he.persist(),Re(he);const Se=mh(he);if(Se&&he.dataTransfer)try{he.dataTransfer.dropEffect="copy"}catch{}return Se&&m&&m(he),!1},[m,A]),we=v.useCallback(he=>{he.preventDefault(),he.persist(),Re(he);const Se=F.current.filter(be=>Q.current&&Q.current.contains(be)),$e=Se.indexOf(he.target);$e!==-1&&Se.splice($e,1),F.current=Se,!(Se.length>0)&&(O({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),mh(he)&&p&&p(he))},[Q,p,A]),We=v.useCallback((he,Se)=>{const $e=[],be=[];he.forEach(Oe=>{const[_t,bt]=KP(Oe,B),[nn,Lt]=XP(Oe,s,i),Ln=I?I(Oe):null;if(_t&&nn&&!Ln)$e.push(Oe);else{let An=[bt,Lt];Ln&&(An=An.concat(Ln)),be.push({file:Oe,errors:An.filter(Vo=>Vo)})}}),(!c&&$e.length>1||c&&d>=1&&$e.length>d)&&($e.forEach(Oe=>{be.push({file:Oe,errors:[Hee]})}),$e.splice(0)),O({acceptedFiles:$e,fileRejections:be,isDragReject:be.length>0,type:"setFiles"}),g&&g($e,be,Se),be.length>0&&b&&b(be,Se),$e.length>0&&x&&x($e,Se)},[O,c,B,s,i,d,g,x,b,I]),Ee=v.useCallback(he=>{he.preventDefault(),he.persist(),Re(he),F.current=[],mh(he)&&Promise.resolve(r(he)).then(Se=>{cp(he)&&!A||We(Se,he)}).catch(Se=>ae(Se)),O({type:"reset"})},[r,We,ae,A]),ot=v.useCallback(()=>{if(H.current){O({type:"openDialog"}),Z();const he={multiple:c,types:q};window.showOpenFilePicker(he).then(Se=>r(Se)).then(Se=>{We(Se,null),O({type:"closeDialog"})}).catch(Se=>{Jee(Se)?(K(Se),O({type:"closeDialog"})):ete(Se)?(H.current=!1,V.current?(V.current.value=null,V.current.click()):ae(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ae(Se)});return}V.current&&(O({type:"openDialog"}),Z(),V.current.value=null,V.current.click())},[O,Z,K,C,We,ae,q,c]),tt=v.useCallback(he=>{!Q.current||!Q.current.isEqualNode(he.target)||(he.key===" "||he.key==="Enter"||he.keyCode===32||he.keyCode===13)&&(he.preventDefault(),ot())},[Q,ot]),Ct=v.useCallback(()=>{O({type:"focus"})},[]),Ot=v.useCallback(()=>{O({type:"blur"})},[]),Mt=v.useCallback(()=>{R||(Yee()?setTimeout(ot,0):ot())},[R,ot]),pt=he=>n?null:he,Rt=he=>_?null:pt(he),tn=he=>P?null:pt(he),Re=he=>{A&&he.stopPropagation()},Pe=v.useMemo(()=>(he={})=>{var Se=he,{refKey:$e="ref",role:be,onKeyDown:Oe,onFocus:_t,onBlur:bt,onClick:nn,onDragEnter:Lt,onDragOver:Ln,onDragLeave:An,onDrop:Vo}=Se,Eo=dp(Se,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return hr(hr({onKeyDown:Rt(Xo(Oe,tt)),onFocus:Rt(Xo(_t,Ct)),onBlur:Rt(Xo(bt,Ot)),onClick:pt(Xo(nn,Mt)),onDragEnter:tn(Xo(Lt,je)),onDragOver:tn(Xo(Ln,xe)),onDragLeave:tn(Xo(An,we)),onDrop:tn(Xo(Vo,Ee)),role:typeof be=="string"&&be!==""?be:"presentation",[$e]:Q},!n&&!_?{tabIndex:0}:{}),Eo)},[Q,tt,Ct,Ot,Mt,je,xe,we,Ee,_,P,n]),Ke=v.useCallback(he=>{he.stopPropagation()},[]),_e=v.useMemo(()=>(he={})=>{var Se=he,{refKey:$e="ref",onChange:be,onClick:Oe}=Se,_t=dp(Se,["refKey","onChange","onClick"]);const bt={accept:B,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:pt(Xo(be,Ee)),onClick:pt(Xo(Oe,Ke)),tabIndex:-1,[$e]:V};return hr(hr({},bt),_t)},[V,t,c,Ee,n]);return Ua(hr({},W),{isFocused:L&&!n,getRootProps:Pe,getInputProps:_e,rootRef:Q,inputRef:V,open:pt(ot)})}function ote(e,t){switch(t.type){case"focus":return Ua(hr({},e),{isFocused:!0});case"blur":return Ua(hr({},e),{isFocused:!1});case"openDialog":return Ua(hr({},vx),{isFileDialogActive:!0});case"closeDialog":return Ua(hr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Ua(hr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ua(hr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return hr({},vx);default:return e}}function tR(){}const[ite,ate]=gr("Dropzone component was not found in tree");function lS(e){const t=n=>{const{children:r,...i}=se(`Dropzone${Zj(e)}`,{},n),s=ate(),c=Xi(r)?r:a.jsx("span",{children:r});return s[e]?v.cloneElement(c,i):null};return t.displayName=`@mantine/dropzone/${Zj(e)}`,t}const ste=lS("accept"),lte=lS("reject"),cte=lS("idle");var dd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const ute={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},dte=(e,{radius:t,variant:n,acceptColor:r,rejectColor:i})=>{const s=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:i||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Ut(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},os=ge((e,t)=>{const n=se("Dropzone",ute,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,radius:p,disabled:m,loading:g,multiple:x,maxSize:b,accept:w,children:j,onDropAny:C,onDrop:T,onReject:E,openRef:R,name:_,maxFiles:P,autoFocus:A,activateOnClick:k,activateOnDrag:I,dragEventsBubbling:B,activateOnKeyboard:q,onDragEnter:Z,onDragLeave:K,onDragOver:Q,onFileDialogCancel:V,onFileDialogOpen:W,preventDropOnDocument:O,useFsAccessApi:L,getFilesFromEvent:$,validator:H,rejectColor:M,acceptColor:F,enablePointerEvents:te,loaderProps:ae,inputProps:je,mod:xe,...we}=n,We=Me({name:"Dropzone",classes:dd,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:dte}),{getRootProps:Ee,getInputProps:ot,isDragAccept:tt,isDragReject:Ct,isDragActive:Ot,open:Mt}=rk({onDrop:C,onDropAccepted:T,onDropRejected:E,disabled:m||g,accept:Array.isArray(w)?w.reduce((Re,Pe)=>({...Re,[Pe]:[]}),{}):w,multiple:x,maxSize:b,maxFiles:P,autoFocus:A,noClick:!k,noDrag:!I,noDragEventsBubbling:!B,noKeyboard:!q,onDragEnter:Z,onDragLeave:K,onDragOver:Q,onFileDialogCancel:V,onFileDialogOpen:W,preventDropOnDocument:O,useFsAccessApi:L,validator:H,...$?{getFilesFromEvent:$}:null});Ku(R,Mt);const pt=Ot&&tt,Rt=Ot&&Ct,tn=!pt&&!Rt;return a.jsx(ite,{value:{accept:pt,reject:Rt,idle:tn},children:a.jsxs(ce,{...Ee(),...We("root",{focusable:!0}),...we,mod:[{accept:pt,reject:Rt,idle:tn,disabled:m,loading:g,"activate-on-click":k},xe],children:[a.jsx(Ip,{visible:g,overlayProps:{radius:p},unstyled:d,loaderProps:ae}),a.jsx("input",{...ot(je),name:_}),a.jsx("div",{...We("inner"),ref:t,"data-enable-pointer-events":te||void 0,children:j})]})})});os.classes=dd;os.displayName="@mantine/dropzone/Dropzone";os.Accept=ste;os.Idle=cte;os.Reject=lte;const fte={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Kr("max"),withinPortal:!0},cS=ge((e,t)=>{const n=se("DropzoneFullScreen",fte,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,active:p,onDrop:m,onReject:g,zIndex:x,withinPortal:b,portalProps:w,...j}=n,C=Me({name:"DropzoneFullScreen",classes:dd,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"fullScreen"}),{resolvedClassNames:T,resolvedStyles:E}=Js({classNames:r,styles:c,props:n}),[R,_]=v.useState(0),[P,{open:A,close:k}]=pp(!1),I=q=>{q.dataTransfer?.types.includes("Files")&&(_(Z=>Z+1),A())},B=()=>{_(q=>q-1)};return v.useEffect(()=>{R===0&&k()},[R]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",I,!1),document.addEventListener("dragleave",B,!1),()=>{document.removeEventListener("dragenter",I,!1),document.removeEventListener("dragleave",B,!1)}},[p]),a.jsx(Za,{...w,withinPortal:b,children:a.jsx(ce,{...C("fullScreen",{style:{opacity:P?1:0,pointerEvents:P?"all":"none",zIndex:x}}),ref:t,children:a.jsx(os,{...j,classNames:T,styles:E,unstyled:d,className:dd.dropzone,onDrop:q=>{m?.(q),k(),_(0)},onReject:q=>{g?.(q),k(),_(0)}})})})});cS.classes=dd;cS.displayName="@mantine/dropzone/DropzoneFullScreen";os.FullScreen=cS;const gh=os,hte='{"resourceType": "Bundle"}';function Ey({id:e,title:t,message:n,color:r,icon:i,withCloseButton:s=!1,method:c="show",loading:d}){ho[c]({id:e,loading:d,title:t,message:n,color:r,icon:i,withCloseButton:s,autoClose:!1})}function pte(){const e=Sn(),t=Ae(),[n,r]=v.useState({}),i=v.useCallback(async(d,f)=>{const p="batch-upload";Ey({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(d);m.type!=="batch"&&m.type!=="transaction"&&(m=WD(m));const g=await t.executeBatch(m);r(x=>({...x,[f]:g})),Ey({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(gi,{size:"1rem"}),withCloseButton:!0})}catch(m){Ey({id:p,title:"Batch Upload Failed",color:"red",message:Ge(m),method:"update",icon:a.jsx(Qs,{size:"1rem"}),withCloseButton:!0})}},[t]),s=v.useCallback(async d=>{for(const f of d){const p=new FileReader;p.onload=m=>i(m.target?.result,f.name),p.readAsText(f)}},[i]),c=v.useCallback(async d=>{await i(d.input,"JSON Data")},[i]);return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Batch Create"}),a.jsxs(De,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",a.jsx(At,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Input"}),a.jsxs(zt,{defaultValue:"upload",children:[a.jsxs(zt.List,{children:[a.jsx(zt.Tab,{value:"upload",children:"File Upload"}),a.jsx(zt.Tab,{value:"json",children:"JSON"})]}),a.jsx(zt.Panel,{value:"upload",pt:"xs",children:a.jsx(gh,{onDrop:s,accept:["application/json"],children:a.jsxs(ye,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(gh.Accept,{children:a.jsx(HE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(gh.Reject,{children:a.jsx(Qs,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(gh.Idle,{children:a.jsx(HE,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(De,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(De,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(zt.Panel,{value:"json",pt:"xs",children:a.jsxs(dt,{onSubmit:c,children:[a.jsx(kc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:hte,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(zt,{defaultValue:Object.keys(n)[0],children:[a.jsx(zt.List,{children:Object.keys(n).map(d=>a.jsx(zt.Tab,{value:d,children:d},d))}),Object.keys(n).map(d=>a.jsx(zt.Panel,{value:d,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[d],void 0,2)})},d))]}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{onClick:()=>r({}),children:"Start over"})})]})]})}function mte(){const{resourceType:e}=Bt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(i=>!!i),[r]=jc("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(lt,{children:[a.jsxs(Ie,{children:["No apps for ",e]}),a.jsx(vt,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(lt,{children:a.jsx("div",{children:r.map(i=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(vt,{to:`/forms/${i.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:i.name})}),a.jsx("p",{children:i.description})]},i.id))})}):a.jsx(yo,{})}function gte(){const e=Ae(),[t,n]=v.useState(),[r,i]=v.useState(!1);return a.jsx(lt,{width:450,children:a.jsxs(dt,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>i(!0)).catch(c=>n(Ht(c)))},children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Change password"})]}),!r&&a.jsxs(Ue,{gap:"xl",mt:"xl",children:[a.jsx(Oo,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Pt(t,"oldPassword")}),a.jsx(Oo,{name:"newPassword",label:"New password",required:!0,error:Pt(t,"newPassword")}),a.jsx(Oo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Pt(t,"confirmPassword")}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const yx=["Form","JSON","Profiles"],vte=["Profiles"],Ty=yx[0].toLowerCase();function yte(){const e=wn(),t=Sn(),{resourceType:n}=Bt(),[r,i]=v.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&yx.map(d=>d.toLowerCase()).includes(c)?c:Ty});function s(c){c||(c=Ty),i(c),e(`/${n}/new/${c}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(mr,{children:[a.jsxs(De,{p:"md",fw:500,children:["New ",n]}),a.jsx(Xr,{children:a.jsx(zt,{defaultValue:Ty,value:r,onChange:s,children:a.jsx(zt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:yx.map(c=>a.jsx(zt.Tab,{value:c.toLowerCase(),px:"md",children:vte.includes(c)?a.jsxs(ye,{gap:"xs",wrap:"nowrap",children:[c,a.jsx(Op,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),a.jsx(nS,{})]})}function xte(){return a.jsx(lt,{children:a.jsxs(Ue,{children:[a.jsx(Ie,{order:1,children:"Unexpected Error"}),a.jsx(De,{children:"We're sorry, something went wrong."}),a.jsxs(De,{children:["Please contact ",a.jsx(At,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function ok(e){const t=Gt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(vt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,d){c&&d&&n.push({key:c,value:d})}function i(c){c&&r(c.system,c.value)}function s(c,d){Array.isArray(d)?d.forEach(f=>s(c,f)):typeof d=="string"?r(c,d):d&&(Array.isArray(d.coding)?r(c,d.coding.map(f=>f.display||f.code).join(", ")):r(c,d.text))}if("name"in t){const c=Ki(t);c!==Dt(t)&&r("Name",c)}return"category"in t&&s("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&s("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(i):i(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),a.jsx(ht,{children:n.map((c,d)=>a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:c.key}),a.jsx(ht.Value,{children:c.value})]},`${c.key}-${d}`))})}function bte(){const{id:e}=Bt(),t=Mr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,i=Ae(),[s,c]=v.useState(!0),[d,f]=v.useState(),[p,m]=v.useState(),[g,x]=v.useState(),[b,w]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const R={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const _=r.split(",").filter(P=>!!P);_.length===1&&R.entry.push({request:{method:"GET",url:_[0]}}),m(_)}i.executeBatch(R).then(_=>{_.entry?.[0]?.response?.status!=="200"?w(_.entry?.[0]?.response?.outcome):(f(_.entry[0]?.resource),x(_.entry[1]?.resource)),c(!1)}).catch(_=>{w(_),c(!1)})},[i,e,r]),b)return a.jsx(lt,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return a.jsxs(lt,{children:[a.jsx(Ie,{children:d?.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[j.length===1&&a.jsx("li",{children:a.jsx(vt,{to:j[0],children:"Review your answers"})}),j.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:j.map(R=>a.jsx("li",{children:a.jsx(vt,{to:R,children:Dt(R)})},R.id))})]}),g&&a.jsx("li",{children:a.jsxs(vt,{to:g,children:["Back to ",Ki(g)]})}),a.jsx("li",{children:a.jsx(vt,{to:"/",children:"Go back home"})})]})]});if(s||!d)return a.jsx(yo,{});const T=g&&aS(g);return a.jsxs(a.Fragment,{children:[a.jsxs(mr,{shadow:"xs",radius:0,children:[T&&a.jsx(sP,{patient:T}),g&&g.resourceType!=="Patient"&&a.jsx(ok,{resource:g}),a.jsx(ce,{px:"xl",py:"md",children:a.jsxs(De,{children:[Ki(d),p&&p.length>1&&a.jsxs(a.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),a.jsx(lt,{children:a.jsx(vP,{questionnaire:d,subject:g&&qt(g),onSubmit:E})})]});async function E(R){const _=[];if(!p||p.length===0)_.push(await i.createResource(R));else for(const P of p)_.push(await i.createResource({...R,subject:{reference:P}}));C(_)}}const Ste="_paper_unw9o_1",wte={paper:Ste},jte={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function ik(e,t){const n=e.resourceType||Cte(t),r=e.fields??Ete(n),i=e.filters??(e.resourceType?void 0:Tte(n)),s=e.sortRules??Rte(n),c=e.offset??0,d=e.count??sm;return{...e,resourceType:n,fields:r,filters:i,sortRules:s,offset:c,count:d}}function Cte(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function Ete(e){const t=uS(e);if(t?.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function Tte(e){return uS(e)?.filters}function Rte(e){const t=uS(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function uS(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function _te(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function Dte(e,t){const n={...e,count:1e3,offset:0},r=ik(n,t.getUserConfiguration()),i=await t.search(r.resourceType,Ha({...r,total:"accurate",fields:void 0}));return WD(i)}function nR(){const e=Ae(),t=wn(),n=Mr(),[r,i]=v.useState();return v.useEffect(()=>{const s=FD(n.pathname+n.search),c=ik(s,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===Ha(c)?(_te(c),i(c)):t(`/${c.resourceType}${Ha(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(yo,{}):a.jsx(mr,{shadow:"xs",m:"md",p:"xs",className:wte.paper,children:a.jsx(Uc,{checkboxesEnabled:!0,search:r,onClick:s=>t(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onAuxClick:s=>window.open(`/${s.resource.resourceType}/${s.resource.id}`,"_blank"),onChange:s=>{t(`/${r.resourceType}${Ha(s.definition)}`)?.catch(console.error)},onNew:()=>{t(jte[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+Ha(r);e.download(s).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Ne({color:"red",message:Ge(c),autoClose:!1}))},onExportTransactionBundle:async()=>{Dte(r,e).then(s=>jA(JSON.stringify(s,void 0,2))).catch(s=>Ne({color:"red",message:Ge(s),autoClose:!1}))},onDelete:s=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:s.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>i({...r})).catch(c=>Ne({color:"red",message:Ge(c),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)?.catch(console.error)}})})}function Ate(){const[e]=jc("ObservationDefinition","_count=100");return e?a.jsxs(ve,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Method"}),a.jsx("th",{children:"Unit"}),a.jsx("th",{children:"Precision"}),a.jsx("th",{children:"Ranges"})]})}),a.jsx("tbody",{children:e.map(t=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(ii,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(ii,{value:t.code})}),a.jsx("td",{children:a.jsx(ii,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(xx,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(yo,{})}function xx(e){const{ranges:t}=e;if(!t)return null;const n=rR(t.map(i=>i.gender));if(n.length>1)return od(n),a.jsx(a.Fragment,{children:n.map(i=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:In(i)})}),a.jsx(xx,{ranges:e.ranges?.filter(s=>s.gender===i)})]},i))});const r=rR(t.map(i=>i.age&&id(i.age)));return r.length>1?(od(r),a.jsx(a.Fragment,{children:r.map(i=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:In(i)})}),a.jsx(xx,{ranges:e.ranges?.filter(s=>id(s.age)===i)})]},i))})):a.jsx(a.Fragment,{children:t.map(i=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:i.condition}),a.jsx("td",{children:a.jsx(Mb,{value:i.range})})]})})},`range-${i.condition}`))})}function rR(e){return[...new Set(e.filter(t=>!!t))]}function Pte(){const[e]=jc("ActivityDefinition","_count=100"),[t]=jc("ObservationDefinition","_count=100");return!e||!t?a.jsx(yo,{}):a.jsxs(ve,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Assay"}),e.map(n=>a.jsx("th",{children:n.name},n.id))]})}),a.jsx("tbody",{children:t.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(ii,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(ii,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(i=>i.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function kte(){const e=Ae(),[t,n]=v.useState(),[r,i]=v.useState(void 0),[s,c]=v.useState(!1),d=v.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),i(m.enrolled)}).catch(m=>Ne({color:"red",message:Ge(m),autoClose:!1}))},[e]);v.useEffect(()=>{d()},[d]);const f=v.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{i(!0),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Ge(g),autoClose:!1}))},[e]),p=v.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?a.jsxs(lt,{children:[a.jsx(Vn,{title:"Disable MFA",opened:s,onClose:()=>c(!1),children:a.jsx(Xh,{title:"Disable MFA",buttonText:"Submit code",onSubmit:async m=>{await p(m),c(!1),i(!1),Ne({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(oq,{})}),d()}})}),a.jsxs(ye,{children:[a.jsx(Ie,{children:"MFA is enabled"}),a.jsx(ke,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):a.jsx(lt,{width:400,children:a.jsx(Xh,{title:"Multi Factor Auth Setup",buttonText:"Enroll",qrCodeUrl:t,onSubmit:f})})}const Nte={},bx={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Nte?.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bd(){return bx}function ak(){return sk("registerEnabled")}function Ote(){return sk("awsTextractEnabled")}function sk(e){try{return bx[e]!==!1&&bx[e]!=="false"}catch{return!0}}function Mte(){const e=wn(),[t]=iS(),n=Ae(),r=t.get("scope")||"openid",[i,s]=v.useState(),[c,d]=v.useState(!0),f=t.get("client_id"),p=t.get("login");if(v.useEffect(()=>{if(!f||f==="medplum-cli")return;async function g(){try{const x=await n.get(`/auth/clientinfo/${f}`);s(x)}catch(x){Ne({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ge(x),withCloseButton:!0})}finally{d(!1)}}g().catch(console.error)},[n,f]),!f)return null;function m(g){const x=new URL(t.get("redirect_uri"));for(const b of["scope","state","nonce"])t.has(b)&&x.searchParams.set(b,t.get(b));x.searchParams.set("code",g),window.location.assign(x.toString())}return a.jsx(OA,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:Bd().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:p||void 0,children:!c&&a.jsxs(a.Fragment,{children:[i?.logo?.url?a.jsx("img",{src:i?.logo?.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):a.jsx(Co,{size:32}),a.jsx(Ie,{children:i?.welcomeString??"Sign in to Medplum"})]})})}function Ite(){const e=Ae(),t=wn(),n=Bd();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),ak()?a.jsxs(zG,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Create a new account"})]}):a.jsx(lt,{width:450,children:a.jsx(ra,{icon:a.jsx(al,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function Lte(){const e=wn(),t=Ae(),[n,r]=v.useState(),[i,s]=v.useState(!1),c=Bd().recaptchaSiteKey;return v.useEffect(()=>{kA(c)},[c]),a.jsx(lt,{width:450,children:a.jsxs(dt,{onSubmit:async d=>{let f="";f=await NA(c),t.post("auth/resetpassword",{...d,recaptchaToken:f}).then(()=>s(!0)).catch(p=>r(Ht(p)))},children:[a.jsxs(Ue,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Medplum Password Reset"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(xr,{issues:zc(n,void 0)}),!i&&a.jsxs(a.Fragment,{children:[a.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Pt(n,"email")}),a.jsxs(ye,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(At,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register")?.catch(console.error),size:"xs",children:"Register"}),a.jsx(ke,{type:"submit",children:"Reset password"})]})]}),i&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function $te(e){const t=Ae(),[n,r]=v.useState(),[i,s]=v.useState();return i?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Request group created successfully."}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Go to the"," ",a.jsx(vt,{to:i,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(vt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(dt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n?.reference}]}).then(s).catch(console.log)},children:a.jsxs(Ue,{children:[a.jsxs(Ie,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(De,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(De,{children:"The following tasks will be created:"}),a.jsx("ul",{children:e.planDefinition.action?.map((c,d)=>a.jsxs("li",{children:[c.definitionCanonical?.startsWith("Questionnaire/")&&"Questionnaire request: ",c.title&&a.jsx(a.Fragment,{children:c.title}),c.code&&a.jsx(ii,{value:c.code[0]})]},`action-${d}`))}),a.jsx(Nt,{title:"Subject",children:a.jsx(Ga,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"Go"})})]})})}function zte(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t});return n?a.jsx(lt,{children:a.jsx($te,{planDefinition:n})}):null}function Ute(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t}),[r,i]=jc("Questionnaire","subject-type="+e),[s,c]=jc("ClientApplication",{_count:1e3});if(!n||i||c)return a.jsx(yo,{});const d=s?.filter(m=>Bte(e)&&!!m.launchUri);if((!r||r.length===0)&&(!d||d.length===0))return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Apps"}),a.jsxs("p",{children:["No apps found. Contact your administrator or ",a.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,p;return n.resourceType==="Patient"?f=qt(n):n.resourceType==="Encounter"&&(f=n.subject,p=qt(n)),a.jsxs(lt,{children:[r?.map(m=>a.jsxs("div",{children:[a.jsx(Ie,{order:3,children:a.jsx(vt,{to:`/forms/${m.id}?subject=${Dt(n)}`,children:m.title||m.name})}),a.jsx(De,{children:m.description})]},m.id)),d?.map(m=>a.jsxs("div",{children:[a.jsx(Ie,{order:3,children:a.jsx(NX,{client:m,patient:f,encounter:p,children:m.name})}),a.jsx(De,{children:m.description})]},m.id))]})}function Bte(e){return e==="Patient"||e==="Encounter"}function Vte(){const{resourceType:e,id:t}=Bt(),n=wn(),[r,i]=v.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(lt,{children:a.jsx(Uc,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>i(s.definition),hideFilters:!0})})}function Fte(){const e=Ae(),{resourceType:t,id:n}=Bt(),r=e.readHistory(t,n).read();return a.jsx(xd,{maw:1200,children:a.jsx($c,{children:a.jsx(wX,{history:r})})})}const qte="_hl7Input_k5xm3_1",Hte={hl7Input:qte};function Gte(e){return a.jsx("iframe",{title:"Bot Runner",frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function Wte(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),a.jsx("iframe",{title:"Code Editor",frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Wu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Qte=`{
|
|
591
|
+
"resourceType": "Patient",
|
|
592
|
+
"name": [
|
|
593
|
+
{
|
|
594
|
+
"given": [
|
|
595
|
+
"Alice"
|
|
596
|
+
],
|
|
597
|
+
"family": "Smith"
|
|
598
|
+
}
|
|
599
|
+
]
|
|
600
|
+
}`,Yte="MSH|^~\\&|ADT1|MCM|LABADT|MCM|198808181126|SECURITY|ADT|MSG00001|P|2.1\rPID|||PATID1234^5^M11||JONES^WILLIAM^A^III||19610615|M-||C|1200 N ELM STREET^^GREENSBORO^NC^27401-1020|GL|(919)379-1212|(919)271-3434||S||PATID12345001^2^M10|123456789|987654^NC\rNK1|1|JONES^BARBARA^K|SPO|||||20011105\rPV1|1|I|2000^2012^01||||004777^LEBAUER^SIDNEY^J.|||SUR||-||1|A0-";function Kte(){const e=Ae(),{id:t}=Bt(),[n,r]=v.useState(),[i,s]=v.useState(),[c,d]=v.useState(Qte),[f,p]=v.useState(Yte),[m,g]=v.useState(un.FHIR_JSON),x=v.useRef(null),b=v.useRef(null),[w,j]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async A=>{r(A),s(await Xte(e,A))}).catch(A=>Ne({color:"red",message:Ge(A),autoClose:!1}))},[e,t]);const C=v.useCallback(async()=>Wu(x.current,{command:"getValue"}),[]),T=v.useCallback(async()=>Wu(x.current,{command:"getOutput"}),[]),E=v.useCallback(async()=>m===un.FHIR_JSON?JSON.parse(c):f,[m,c,f]),R=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{const k=await C(),I=await T(),B=await e.createAttachment({data:k,filename:"index.ts",contentType:"text/typescript"}),q=await e.createAttachment({data:I,filename:"index.js",contentType:"text/typescript"}),Z=[{op:"add",path:"/sourceCode",value:B},{op:"add",path:"/executableCode",value:q}];await e.patchResource("Bot",t,Z),Ne({color:"green",message:"Saved"})}catch(k){Ne({color:"red",message:Ge(k),autoClose:!1})}finally{j(!1)}},[e,t,C,T]),_=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Ne({color:"green",message:"Deployed"})}catch(k){Ne({color:"red",message:Ge(k),autoClose:!1})}finally{j(!1)}},[e,t]),P=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{const k=await E(),I=await e.post(e.fhirUrl("Bot",t,"$execute"),k,m);await Wu(b.current,{command:"setValue",value:I}),Ne({color:"green",message:"Success"})}catch(k){Ne({color:"red",message:Ge(k),autoClose:!1})}finally{j(!1)}},[e,t,E,m]);return!n||i===void 0?null:a.jsxs(ir,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(ir.Col,{span:8,children:a.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(Wte,{iframeRef:x,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:i,minHeight:"528px"}),a.jsxs(ye,{justify:"flex-end",gap:"xs",children:[a.jsx(ke,{type:"button",onClick:R,loading:w,leftSection:a.jsx(pq,{size:"1rem"}),children:"Save"}),a.jsx(ke,{type:"button",onClick:_,loading:w,leftSection:a.jsx(Tb,{size:"1rem"}),children:"Deploy"}),a.jsx(ke,{type:"button",onClick:P,loading:w,leftSection:a.jsx(tH,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(ir.Col,{span:4,children:[a.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(sn,{data:[{label:"FHIR",value:un.FHIR_JSON},{label:"HL7",value:un.HL7_V2}],onChange:A=>g(A.currentTarget.value)}),m===un.FHIR_JSON?a.jsx(kc,{value:c,onChange:A=>d(A),autosize:!0,minRows:15}):a.jsx("textarea",{className:Hte.hl7Input,value:f,onChange:A=>p(A.currentTarget.value),rows:15})]}),a.jsx(mr,{m:2,p:"xs",shadow:"md",children:a.jsx(Gte,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Xte(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(DD);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function dl(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Zte(){const e=Ae(),{resourceType:t,id:n}=Bt(),r={reference:t+"/"+n},i=v.useCallback(s=>{e.updateResource(dl(s)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Ge(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(lt,{children:a.jsx(nK,{value:r,onSubmit:i})});case"Questionnaire":return a.jsx(lt,{children:a.jsx(AK,{questionnaire:r,onSubmit:i})});default:return null}}function Jte(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t}),r=wn();return n?a.jsx(lt,{children:a.jsx(oX,{value:n,onStart:(i,s)=>r(`/forms/${qs(s)}`)?.catch(console.error),onEdit:(i,s,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function ene(){const e=Ae(),{resourceType:t,id:n}=Bt(),r=wn();return a.jsxs(lt,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(ke,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)?.catch(console.error)).catch(i=>Ne({color:"red",message:Ge(i),autoClose:!1}))},children:"Delete"})]})}const tne="_selectProfileBtn_tbaz6_1",nne="_chevron_tbaz6_13",oR={selectProfileBtn:tne,chevron:nne};function rne(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t}),[r,i]=v.useState(),s=yd({onDropdownClose:()=>s.resetSelectedOption()}),c=v.useMemo(()=>{if(Tn(n?.meta?.profile))return[a.jsx(st.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(st.Option,{value:f,children:f},f))]},[n?.meta?.profile]);if(v.useEffect(()=>{n?.meta?.profile?.length===1&&i(n.meta.profile[0])},[n?.meta?.profile]),!n)return null;let d;return Tn(c)&&(d=a.jsx(ye,{justify:"flex-end",children:a.jsxs(Ue,{align:"flex-end",gap:"xs",children:[a.jsxs(st,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:f=>{i(f),s.closeDropdown()},children:[a.jsx(st.Target,{children:a.jsx(er,{onClick:()=>s.toggleDropdown(),children:a.jsxs(Mp,{fw:"bold",fs:"sm",className:oR.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(Eb,{stroke:1.5,className:oR.chevron})]})})}),a.jsx(st.Dropdown,{w:"max-content",children:a.jsx(st.Options,{children:c})})]}),a.jsx(ce,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(De,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(De,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(De,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(lt,{children:a.jsxs(Ue,{gap:"xl",children:[d,a.jsx(Vb,{value:n,profileUrl:r})]})})}function one(){const e=Ae(),{resourceType:t,id:n}=Bt(),[r,i]=v.useState(),[s,c]=v.useState(),d=wn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{i(Yr(b)),c(Yr(b))}).catch(b=>{p(Ht(b)),Ne({color:"red",message:Ge(b),autoClose:!1})})},[e,t,n]);const m=v.useCallback(b=>{p(void 0),e.updateResource(dl(b)).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(w=>{p(Ht(w)),Ne({color:"red",message:Ge(w),autoClose:!1})})},[e,t,n,d]),g=v.useCallback(b=>{p(void 0);const w=XA.createPatch(r,b);e.patchResource(t,n,w).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Ht(j)),Ne({color:"red",message:Ge(j),autoClose:!1})})},[e,t,n,r,d]),x=v.useCallback(()=>d(`/${t}/${n}/delete`)?.catch(console.error),[d,t,n]);return s?a.jsx(lt,{children:a.jsx(op,{defaultValue:s,onSubmit:m,onPatch:g,onDelete:x,outcome:f})}):null}function ine(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t});return n?a.jsx(lt,{maw:700,children:n.resourceType==="Patient"?a.jsx(KY,{patient:n}):a.jsx(ra,{icon:a.jsx(al,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function lk({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,i=Ae(),[s,c]=v.useState();return v.useEffect(()=>{i.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(d=>{c(d.filter(vW))}).catch(console.error)},[i,n,r]),a.jsx(zt,{value:t?.url,onChange:d=>{const f=s?.find(p=>p.url===d);f&&n(f)},children:a.jsx(zt.List,{children:s?.map(d=>{const f=e.meta?.profile?.includes(d.url),p=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return a.jsx(zt.Tab,{value:d.url,title:p,rightSection:f&&a.jsx(tb,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(NH,{size:"90%"})}),children:d.title||d.name},d.url)})})})}function ck(e,t){const n=Ae(),r=wn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(d=>r("/"+d.resourceType+"/"+d.id)).catch(d=>{t&&t(Ht(d)),Ne({color:"red",message:Ge(d),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Ry(){const{resourceType:e}=Bt(),t=Mr(),[n,r]=v.useState(),{defaultValue:i,handleSubmit:s}=ck(e,r),[c,d]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=dl(m);c&&OD(g,c.url),s(g)},[c,s]);return f?a.jsx(lt,{children:a.jsxs(Ue,{children:[a.jsx(lk,{resource:i,currentProfile:c,onChange:d}),c?a.jsx(op,{defaultValue:i,onSubmit:p,outcome:n,profileUrl:c.url},c.url):a.jsx(De,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(lt,{children:a.jsx(op,{defaultValue:i,onSubmit:s,outcome:n})})}function iR(){const e=Ae(),{resourceType:t,id:n}=Bt(),r=e.readHistory(t,n).read();return a.jsx(lt,{children:a.jsx(DX,{history:r})})}function ane(){const{resourceType:e}=Bt(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:i}=ck(e,n),s=v.useCallback(c=>{i(JSON.parse(c["new-resource"]))},[i]);return a.jsxs(lt,{children:[t&&a.jsx(xr,{outcome:t}),a.jsxs(dt,{onSubmit:s,children:[a.jsx(kc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Lo(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"OK"})})]})]})}function sne(){const e=Ae(),{resourceType:t,id:n}=Bt(),r=Gt({reference:t+"/"+n}),i=wn(),[s,c]=v.useState(),d=v.useCallback(f=>{e.updateResource(dl(JSON.parse(f.resource))).then(()=>{c(void 0),i(`/${t}/${n}/details`)?.catch(console.error),Ne({color:"green",message:"Success"})}).catch(p=>{Ne({color:"red",message:Ge(p),autoClose:!1})})},[e,t,n,i]);return r?a.jsxs(lt,{children:[s&&a.jsx(xr,{outcome:s}),a.jsxs(dt,{onSubmit:d,children:[a.jsx(kc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Lo(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"OK"})})]})]}):null}function lne(){const{resourceType:e,id:t}=Bt();return Gt({reference:e+"/"+t})?a.jsxs(lt,{children:[a.jsxs(ra,{icon:a.jsx(al,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(At,{href:`/forms/${t}`,children:`/forms/${t}`})]}),a.jsx(vP,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function cne(){const e=Ae(),{resourceType:t,id:n}=Bt(),[r,i]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(d=>i(Yr(d))).catch(d=>{Ne({color:"red",message:Ge(d)})})},[e,t,n]),r?a.jsxs(lt,{children:[a.jsxs(Ie,{order:2,children:["Available ",t," profiles"]}),a.jsx(Ue,{children:a.jsxs(a.Fragment,{children:[a.jsx(lk,{resource:r,currentProfile:s,onChange:c}),s?a.jsx(une,{profile:s,resource:r,onResourceUpdated:d=>i(d)},s.url):a.jsx(De,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const une=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Ae(),[i,s]=v.useState(),[c,d]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(p=>{s(void 0);const m=dl(p);c?OD(m,e.url):vU(m,e.url),r.updateResource(m).then(g=>{n(g),Ne({color:"green",message:"Success"})}).catch(g=>{s(Ht(g)),Ne({color:"red",message:Ge(g),autoClose:!1})})},[r,e.url,n,c]);return a.jsxs(Ue,{children:[a.jsx(Ed,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>d(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(op,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:i}):a.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"OK"})})})]})},uk={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},dne=Object.keys(uk);function fne(){const e=Ae(),{id:t}=Bt(),n=Gt({reference:`Questionnaire/${t}`}),[r,i]=v.useState(),[s,c]=v.useState("create"),[d,f]=v.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>hne(g,n));function m(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${Dt(n)}`:Dt(n)}`,channel:{type:"rest-hook",endpoint:Dt(r)},...s?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:s}]}:void 0}).then(()=>{i(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Ge(g),autoClose:!1}))}return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Bots"}),a.jsxs(Ue,{children:[p.length===0&&a.jsx("p",{children:"No bots found."}),p.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(ll,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(yn,{}),a.jsxs(Ue,{mt:10,children:[a.jsx(pd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(ye,{children:[a.jsx(sl,{name:"bot",resourceType:"Bot",onChange:g=>i(g)}),a.jsx(ke,{onClick:m,children:"Connect"})]}),a.jsx(ye,{children:a.jsx(sn,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:dne,onChange:g=>c(uk[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:d})]})}function hne(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(Dt(t))||(t.url?n.includes(t.url):!1))}function pne(){const{id:e}=Bt(),t=wn(),r=Ae().readReference({reference:`Questionnaire/${e}`}).read(),[i,s]=v.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ue.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return a.jsx(lt,{children:a.jsx(Uc,{search:i,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})})}function mne(){const e=Ae(),{resourceType:t,id:n}=Bt(),r=Gt({reference:t+"/"+n}),i=v.useCallback(s=>{e.updateResource(dl(s)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Ge(c),autoClose:!1})})},[e]);return r?a.jsx(lt,{children:a.jsx(KK,{onSubmit:i,definition:r})}):null}function gne(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t});return n?a.jsx(lt,{children:e==="MeasureReport"?a.jsx(QY,{measureReport:n}):a.jsx(Bb,{value:n})}):null}const vne="_container_1ue98_1",yne="_entry_1ue98_14",xne="_active_1ue98_21",_y={container:vne,entry:yne,active:xne};function bne(e){const t=Ae(),n=Gt(e.value),[r,i]=v.useState();return v.useEffect(()=>{if(!n)return;const s=aS(n);if(!s)return;const c="reference"in s?s.reference:Dt(s);t.search("ServiceRequest","subject="+c).then(d=>{const p=(d.entry??[]).map(m=>m.resource);ZA(p),p.reverse(),i(p)}).catch(d=>Ne({color:"red",message:Ge(d),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:_y.container,children:r.map(s=>a.jsxs("div",{className:It(_y.entry,{[_y.active]:s.id===n?.id}),children:[a.jsx("p",{children:a.jsx(vt,{to:s,children:Sne(s)})}),s.category?.[0]?.text&&a.jsx("p",{children:s.category[0]?.text}),s.code?.coding?.[0]?.code&&a.jsx("p",{children:s.code.coding[0]?.code}),a.jsx("p",{children:wne(s)})]},s.id))}):null}function Sne(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function wne(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const jne="_container_1l2dh_1",Cne={container:jne};function Ene(e){const t=Gt(e.valueSet);if(!t)return null;const n=[""],r=t.compose?.include?.[0]?.concept?.map(i=>i.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:Cne.container,children:a.jsx(sn,{defaultValue:e.defaultValue,onChange:i=>e.onChange(i.currentTarget.value),data:n})})}function Tne(e){const t=Gt(e.specimen);return t?a.jsxs(ht,{children:[a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Type"}),a.jsx(ht.Value,{children:"Specimen"})]}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Collected"}),a.jsx(ht.Value,{children:sr(t.collection?.collectedDateTime)})]}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Specimen Age"}),a.jsx(ht.Value,{children:Rne(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Specimen Stability"}),a.jsx(ht.Value,{children:_ne(t)})]}):a.jsx(a.Fragment,{})]}):null}function Rne(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return dk(fk(n,new Date))}function _ne(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return dk(fk(t,n))}function dk(e){return e.toString().padStart(3,"0")+"D"}function fk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function Dne(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),e==="Agent"&&t.push("Tools"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),e==="Patient"&&t.push("Export"),t}function Ane(){const e=Ae(),{resourceType:t,id:n}=Bt(),r={reference:t+"/"+n},i=wn(),[s,c]=v.useState(),d=Gt(r,c),f=Dne(t),[p,m]=v.useState(()=>{const E=window.location.pathname.split("/").pop();return E&&f.map(R=>R.toLowerCase()).includes(E)?E:f[0].toLowerCase()});async function g(){const R=(await e.readHistory(t,n)).entry?.find(_=>!!_.resource)?.resource;R?x(R):Ne({color:"red",message:"No history to restore",autoClose:!1})}function x(E){e.updateResource(dl(E)).then(()=>{c(void 0),Ne({color:"green",message:"Success"})}).catch(R=>{Ne({color:"red",message:Ge(R),autoClose:!1})})}if(s)return Rz(s)?a.jsxs(lt,{children:[a.jsx(Ie,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(ke,{color:"red",onClick:g,children:"Restore"})]}):a.jsx(xr,{outcome:s});function b(E){E||(E=f[0].toLowerCase()),m(E),i(`/${t}/${n}/${E}`)?.catch(console.error)}function w(E){const R=d,_=R.orderDetail||[];_.length===0&&_.push({}),_[0].text!==E&&(_[0].text=E,x({...R,orderDetail:_}))}const j=d&&aS(d),C=d&&XJ(d),T=e.getUserConfiguration()?.option?.find(E=>E.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[d?.resourceType==="ServiceRequest"&&T&&a.jsx(Ene,{valueSet:{reference:T},defaultValue:d.orderDetail?.[0]?.text,onChange:w},Dt(d)+"-"+d.orderDetail?.[0]?.text),d&&a.jsx(bne,{value:d}),d&&a.jsxs(mr,{children:[j&&a.jsx(sP,{patient:j}),C&&a.jsx(Tne,{specimen:C}),t!=="Patient"&&a.jsx(ok,{resource:r}),a.jsx(Xr,{children:a.jsx(zt,{value:p.toLowerCase(),onChange:b,children:a.jsx(zt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map(E=>a.jsx(zt.Tab,{value:E.toLowerCase(),children:E},E))})})})]}),a.jsx(nS,{})]})}function vh(){const e=wn(),{resourceType:t,id:n,versionId:r,tab:i}=Bt(),s=Ae(),[c,d]=v.useState(!0),[f,p]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),d(!0),s.readHistory(t,n).then(R=>p(R)).then(()=>d(!1)).catch(R=>{g(R),d(!1)})},[s,t,n]),c)return a.jsx(yo,{});const x=f?.entry??[],b=x.findIndex(R=>R.resource?.meta?.versionId===r);if(b===-1)return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Version not found"}),a.jsx(vt,{to:`/${t}/${n}`,children:"Return to resource"})]});const w=x[b].resource,j=b<x.length-1?x[b+1].resource:void 0,C="diff",T=i||C,E=x.length-b;return a.jsx(xd,{maw:1200,children:a.jsx($c,{children:a.jsxs(Ue,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(em,{cols:2,mb:"lg",children:[a.jsx(jo,{total:x.length,value:E,getControlProps:rP,onChange:R=>e(`/${t}/${n}/_history/${x[x.length-R]?.resource?.meta?.versionId}/${T}`)?.catch(console.error)}),a.jsx(ye,{justify:"right",children:a.jsx(Cd,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:T,onChange:R=>e(`/${t}/${n}/_history/${r}/${R||C}`)?.catch(console.error)})})]}),a.jsx(ce,{mb:"lg",children:a.jsxs(vm,{compact:!0,children:[a.jsx(mo,{term:"Version ID",children:w.meta?.versionId}),a.jsx(mo,{term:"Author",children:a.jsx(dc,{value:w.meta?.author,link:!0},w.meta?.author?.reference)}),a.jsx(mo,{term:"Date/Time",children:sr(w.meta?.lastUpdated)})]})}),T==="diff"&&a.jsx(EX,{original:j??{resourceType:t,id:n},revised:w}),T==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(w,void 0,2)})]})})})}function Pne(){const{resourceType:e,id:t}=Bt(),n=wn(),[r,i]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(lt,{children:a.jsx(kY,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>i(s.definition),hideFilters:!0})})}function kne(e){const t=Ae(),{resource:n,opened:r,onClose:i}=e,[s,c]=v.useState(!1),[d,f]=v.useState(),[p,m]=v.useState(!1),g=v.useCallback(async()=>{if(n?.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:s&&d?Dt(d):void 0,verbose:p}),Ne({color:"green",message:"Done"}),i()}catch(x){Ne({color:"red",message:Ge(x),autoClose:!1})}},[t,n,i,s,d,p]);return a.jsx(Vn,{opened:r,onClose:i,title:"Resend Subscriptions",children:a.jsx(dt,{onSubmit:g,children:a.jsxs(Ue,{children:[a.jsx(Dn,{label:"Choose subscription (all subscriptions by default)",onChange:x=>c(x.currentTarget.checked)}),s&&a.jsx(sl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx(Dn,{label:"Verbose mode",onChange:x=>m(x.currentTarget.checked)}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Resend"})})]})})})}function aR(){const e=Ae(),t=hm(),{resourceType:n,id:r}=Bt(),i={reference:n+"/"+r},[s,c]=v.useState(),d=pp(!1);function f(E,R){return e.updateResource({...E,priority:R})}function p(E,R){f(E,"stat").then(R).catch(console.error)}function m(E,R){f(E,"routine").then(R).catch(console.error)}function g(E){t(`/${E.resourceType}/${E.id}`)}function x(E){t(`/${E.resourceType}/${E.id}/edit`)}function b(E){t(`/${E.resourceType}/${E.id}/delete`)}function w(E){c(E),d[1].open()}function j(E){t(`/${E.resourceType}/${E.id}/_history/${E.meta?.versionId}`)}function C(E,R){const _="aws-textract";Ne({id:_,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(E.resourceType,E.id,"$aws-textract"),{}).then(()=>{R(),ks({id:_,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(gi,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(P=>ks({id:_,title:"AWS Textract Error",color:"red",message:Ge(P),icon:a.jsx(Qs,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(E){const{primaryResource:R,currentResource:_,reloadTimeline:P}=E,A=_.resourceType===R.resourceType&&_.id===R.id,k=_.resourceType==="Communication"&&_.priority!=="stat",I=_.resourceType==="Communication"&&_.priority==="stat",B=A,q=!A,Z=!A,K=!A,Q=e.getProjectMembership()?.admin,V=Q,W=Ote()&&(_.resourceType==="DocumentReference"||_.resourceType==="Media");return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Label,{children:"Resource"}),k&&a.jsx(Ce.Item,{leftSection:a.jsx(Xq,{size:14}),onClick:()=>p(_,P),"aria-label":`Pin ${Dt(_)}`,children:"Pin"}),I&&a.jsx(Ce.Item,{leftSection:a.jsx(Jq,{size:14}),onClick:()=>m(_,P),"aria-label":`Unpin ${Dt(_)}`,children:"Unpin"}),q&&a.jsx(Ce.Item,{leftSection:a.jsx(qE,{size:14}),onClick:()=>g(_),"aria-label":`Details ${Dt(_)}`,children:"Details"}),B&&a.jsx(Ce.Item,{leftSection:a.jsx(qE,{size:14}),onClick:()=>j(_),"aria-label":`Details ${Dt(_)}`,children:"Details"}),Z&&a.jsx(Ce.Item,{leftSection:a.jsx(mA,{size:14}),onClick:()=>x(_),"aria-label":`Edit ${Dt(_)}`,children:"Edit"}),Q&&a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Label,{children:"Admin"}),V&&a.jsx(Ce.Item,{leftSection:a.jsx(sH,{size:14}),onClick:()=>w(_),"aria-label":`Resend Subscriptions ${Dt(_)}`,children:"Resend Subscriptions"})]}),W&&a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Label,{children:"AWS AI"}),a.jsx(Ce.Item,{leftSection:a.jsx(TH,{size:14}),onClick:()=>C(_,P),"aria-label":`AWS Textract ${Dt(_)}`,children:"AWS Textract"})]}),K&&a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Label,{children:"Danger zone"}),a.jsx(Ce.Item,{color:"red",leftSection:a.jsx(mm,{size:14}),onClick:()=>b(_),"aria-label":`Delete ${Dt(_)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(UQ,{encounter:i,getMenu:T}),n==="Patient"&&a.jsx(JY,{patient:i,getMenu:T}),n==="ServiceRequest"&&a.jsx(kX,{serviceRequest:i,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(zQ,{resource:i,getMenu:T}),a.jsx(kne,{resource:s,opened:d[0],onClose:d[1].close},`resend-subscriptions-${s?.id}`)]})}function Nne(e){const{opened:t,close:n,version:r,loadingStatus:i,handleStatus:s,handleUpgrade:c}=e,[d,f]=v.useState(),[p,m]=v.useState(!1);return v.useEffect(()=>{t&&(d||QV("app-tools-page").then(f).catch(console.error),s())},[t,d,s]),d&&r&&!i?r==="unknown"?a.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(d)?a.jsxs("p",{children:["This agent is already on the latest version (",d,")."]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",d,"?"]}),a.jsxs(ye,{children:[a.jsx(ke,{onClick:()=>{c(p),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),a.jsx(Dn,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):a.jsx(yo,{})}function One(){const e=Ae(),{id:t}=Bt(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,i]=v.useState(!1),[s,c]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState(),[g,x]=v.useState(),[b,w]=v.useState(),[j,C]=v.useState(),[T,E]=v.useState(!1),[R,_]=v.useState(!1),[P,{open:A,close:k}]=pp(!1);v.useEffect(()=>{if(r||s||d||T){_(!0);return}_(!1)},[r,s,d,T]);const I=v.useCallback(()=>{i(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(V=>{m(V.parameter?.find(W=>W.name==="status")?.valueCode),x(V.parameter?.find(W=>W.name==="version")?.valueString),w(V.parameter?.find(W=>W.name==="lastUpdated")?.valueInstant)}).catch(V=>Q(Ge(V))).finally(()=>i(!1))},[e,t]),B=v.useCallback(V=>{const W=V.host,O=V.pingCount||1;W&&(E(!0),e.pushToAgent(n,W,`PING ${O}`,un.PING,!0).then(L=>C(L)).catch(L=>Q(Ge(L))).finally(()=>E(!1)))},[e,n]),q=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(V=>{K("Agent config reloaded successfully.")}).catch(V=>Q(Ge(V))).finally(()=>c(!1))},[e,t]),Z=v.useCallback(V=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade",`?force=${V}`),{cache:"reload"}).then(W=>{K("Agent upgraded successfully.")}).catch(W=>Q(Ge(W))).finally(()=>f(!1))},[e,t]);function K(V){Ne({color:"green",title:"Success",icon:a.jsx(gi,{size:"1rem"}),message:V})}function Q(V){Ne({color:"red",title:"Error",message:V,autoClose:!1})}return a.jsxs(lt,{children:[a.jsx(Vn,{opened:P,onClose:k,title:"Upgrade Agent",centered:!0,children:a.jsx(Nne,{opened:P,close:k,version:g,loadingStatus:r,handleStatus:I,handleUpgrade:Z})}),a.jsx(Ie,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(ll,{value:n,link:!0})]}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Agent Status"}),a.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),a.jsx(ke,{onClick:I,loading:r,disabled:R&&!r,children:"Get Status"}),!r&&p&&a.jsx(ve,{children:a.jsxs(ve.Tbody,{children:[a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:"Status"}),a.jsx(ve.Td,{children:a.jsx(bm,{status:p})})]}),a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:"Version"}),a.jsx(ve.Td,{children:g})]}),a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:"Last Updated"}),a.jsx(ve.Td,{children:sr(b,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Reload Config"}),a.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),a.jsx(ke,{onClick:q,loading:s,disabled:R&&!s,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Upgrade Agent"}),a.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),a.jsx(ke,{onClick:A,loading:d,disabled:R&&!d,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(yn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Ping from Agent"}),a.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),a.jsx(dt,{onSubmit:B,children:a.jsxs(ye,{children:[a.jsx(ze,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(bn,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:T,disabled:R&&!T,children:a.jsx(dH,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(Wp,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!T&&j&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:j})]})]})}function Mne(){const e=wn(),t=Ae(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(s=>Ne({color:"red",message:Ge(s),autoClose:!1}))},[t]);function i(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Ne({color:"green",message:"Login revoked"})).catch(c=>Ne({color:"red",message:Ge(c),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(lt,{children:[a.jsx(Ie,{children:"Security"}),a.jsxs(vm,{children:[a.jsx(mo,{term:"ID",children:a.jsx(At,{href:`/${Dt(n.profile)}`,children:n.profile.id})}),a.jsx(mo,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(mo,{term:"Name",children:Lc(n.profile.name?.[0])})]})]}),a.jsxs(lt,{children:[a.jsx(Ie,{children:"Sessions"}),a.jsxs(ve,{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"OS"}),a.jsx("th",{children:"Browser"}),a.jsx("th",{children:"IP Address"}),a.jsx("th",{children:"Auth Method"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.security.sessions.map(s=>a.jsxs("tr",{children:[a.jsx("td",{children:s.os}),a.jsx("td",{children:s.browser}),a.jsx("td",{children:s.remoteAddress}),a.jsx("td",{children:s.authMethod}),a.jsx("td",{children:sr(s.lastUpdated)}),a.jsx("td",{children:a.jsx(At,{href:"#",onClick:()=>i(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(lt,{children:[a.jsx(Ie,{children:"Password"}),a.jsx(ke,{onClick:()=>e("/changepassword")?.catch(console.error),children:"Change password"})]}),a.jsxs(lt,{children:[a.jsx(Ie,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(ke,{onClick:()=>e("/mfa")?.catch(console.error),children:"Enroll"})]})]}):null}function Ine(){const{id:e,secret:t}=Bt(),n=Ae(),[r,i]=v.useState(),[s,c]=v.useState(!1),d=zc(r,void 0);return a.jsxs(lt,{width:450,children:[a.jsx(xr,{issues:d}),a.jsxs(dt,{onSubmit:f=>{if(f.password!==f.confirmPassword){i(oi("Passwords do not match","confirmPassword"));return}i(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>i(Ht(m)))},children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Set password"})]}),!s&&a.jsxs(Ue,{children:[a.jsx(Oo,{name:"password",label:"New password",required:!0,error:Pt(r,"password")}),a.jsx(Oo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Pt(r,"confirmPassword")}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"Set password"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(vt,{to:"/signin",children:"sign in"}),"."]})]})]})}function Lne(){const e=pm(),t=wn(),[n]=iS(),r=Bd(),i=v.useCallback(()=>{const s=n.get("next");t(s?.startsWith("/")?s:"/")?.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&i()},[e,n,i]),a.jsxs(OA,{onSuccess:()=>i(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:ak()?()=>t("/register")?.catch(console.error):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Sign in to Medplum"}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function $ne(){const e=wn(),t=Mr(),[n,r]=v.useState(),[i,s]=v.useState(),[c,d]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),s(f.query),d(JSON.parse(f.fields))},[t]),!n||!i||!c?null:a.jsx($Y,{resourceType:n,checkboxesEnabled:!0,query:i,fields:c,onClick:f=>e(`/${n}/${f.resource.id}`)?.catch(console.error),onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{e(`/bulk/${n}?ids=${f.join(",")}`)?.catch(console.error)}})}function zne(){const{id:e,secret:t}=Bt(),n=Ae(),[r,i]=v.useState(),[s,c]=v.useState(!1),d=zc(r,void 0);return a.jsxs(lt,{width:450,children:[a.jsx(xr,{issues:d}),a.jsxs(dt,{onSubmit:()=>{i(void 0);const f={id:e,secret:t};n.post("auth/verifyemail",f).then(()=>c(!0)).catch(p=>i(Ht(p)))},children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Email address verification required"})]}),!s&&a.jsxs(Ue,{children:[a.jsx("p",{children:"In order to sign in, click the button below to verify your ability to receive email at the address this link was sent to."}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"Verify email"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Email verified. You can now ",a.jsx(vt,{to:"/signin",children:"sign in"}),"."]})]})]})}function Une(){return a.jsx(mJ,{children:a.jsxs(Le,{errorElement:a.jsx(xte,{}),children:[a.jsx(Le,{path:"/signin",element:a.jsx(Lne,{})}),a.jsx(Le,{path:"/oauth",element:a.jsx(Mte,{})}),a.jsx(Le,{path:"/resetpassword",element:a.jsx(Lte,{})}),a.jsx(Le,{path:"/setpassword/:id/:secret",element:a.jsx(Ine,{})}),a.jsx(Le,{path:"/verifyemail/:id/:secret",element:a.jsx(zne,{})}),a.jsx(Le,{path:"/register",element:a.jsx(Ite,{})}),a.jsx(Le,{path:"/changepassword",element:a.jsx(gte,{})}),a.jsx(Le,{path:"/security",element:a.jsx(Mne,{})}),a.jsx(Le,{path:"/mfa",element:a.jsx(kte,{})}),a.jsx(Le,{path:"/batch",element:a.jsx(pte,{})}),a.jsx(Le,{path:"/bulk/:resourceType",element:a.jsx(mte,{})}),a.jsx(Le,{path:"/smart",element:a.jsx($ne,{})}),a.jsx(Le,{path:"/forms/:id",element:a.jsx(bte,{})}),a.jsx(Le,{path:"/admin/super",element:a.jsx(gee,{})}),a.jsx(Le,{path:"/admin/super/asyncjob",element:a.jsx(uee,{})}),a.jsx(Le,{path:"/admin/config",element:a.jsx(aee,{})}),a.jsxs(Le,{path:"/admin",element:a.jsx(see,{}),children:[a.jsx(Le,{path:"patients",element:a.jsx(iee,{})}),a.jsx(Le,{path:"bots/new",element:a.jsx(eee,{})}),a.jsx(Le,{path:"bots",element:a.jsx(ZJ,{})}),a.jsx(Le,{path:"clients/new",element:a.jsx(tee,{})}),a.jsx(Le,{path:"clients",element:a.jsx(JJ,{})}),a.jsx(Le,{path:"details",element:a.jsx(VT,{})}),a.jsx(Le,{path:"invite",element:a.jsx(oee,{})}),a.jsx(Le,{path:"users",element:a.jsx(xee,{})}),a.jsx(Le,{path:"project",element:a.jsx(VT,{})}),a.jsx(Le,{path:"secrets",element:a.jsx(lee,{})}),a.jsx(Le,{path:"sites",element:a.jsx(cee,{})}),a.jsx(Le,{path:"members/:membershipId",element:a.jsx(ree,{})})]}),a.jsx(Le,{path:"/lab/assays",element:a.jsx(Ate,{})}),a.jsx(Le,{path:"/lab/panels",element:a.jsx(Pte,{})}),a.jsxs(Le,{path:"/:resourceType/new",element:a.jsx(yte,{}),children:[a.jsx(Le,{index:!0,element:a.jsx(Ry,{})}),a.jsx(Le,{path:"form",element:a.jsx(Ry,{})}),a.jsx(Le,{path:"json",element:a.jsx(ane,{})}),a.jsx(Le,{path:"profiles",element:a.jsx(Ry,{})})]}),a.jsxs(Le,{path:"/:resourceType/:id",element:a.jsx(Ane,{}),children:[a.jsx(Le,{index:!0,element:a.jsx(aR,{})}),a.jsx(Le,{path:"apply",element:a.jsx(zte,{})}),a.jsx(Le,{path:"apps",element:a.jsx(Ute,{})}),a.jsx(Le,{path:"event",element:a.jsx(Vte,{})}),a.jsx(Le,{path:"blame",element:a.jsx(Fte,{})}),a.jsx(Le,{path:"bots",element:a.jsx(fne,{})}),a.jsx(Le,{path:"builder",element:a.jsx(Zte,{})}),a.jsx(Le,{path:"checklist",element:a.jsx(Jte,{})}),a.jsx(Le,{path:"delete",element:a.jsx(ene,{})}),a.jsx(Le,{path:"details",element:a.jsx(rne,{})}),a.jsx(Le,{path:"edit",element:a.jsx(one,{})}),a.jsx(Le,{path:"editor",element:a.jsx(Kte,{})}),a.jsxs(Le,{path:"history",children:[a.jsx(Le,{index:!0,element:a.jsx(iR,{})}),a.jsx(Le,{path:":versionId/:tab",element:a.jsx(vh,{})}),a.jsx(Le,{path:":versionId",element:a.jsx(vh,{})})]}),a.jsxs(Le,{path:"_history",children:[a.jsx(Le,{index:!0,element:a.jsx(iR,{})}),a.jsx(Le,{path:":versionId/:tab",element:a.jsx(vh,{})}),a.jsx(Le,{path:":versionId",element:a.jsx(vh,{})})]}),a.jsx(Le,{path:"json",element:a.jsx(sne,{})}),a.jsx(Le,{path:"preview",element:a.jsx(lne,{})}),a.jsx(Le,{path:"responses",element:a.jsx(pne,{})}),a.jsx(Le,{path:"report",element:a.jsx(gne,{})}),a.jsx(Le,{path:"ranges",element:a.jsx(mne,{})}),a.jsx(Le,{path:"subscriptions",element:a.jsx(Pne,{})}),a.jsx(Le,{path:"timeline",element:a.jsx(aR,{})}),a.jsx(Le,{path:"tools",element:a.jsx(One,{})}),a.jsx(Le,{path:"profiles",element:a.jsx(cne,{})}),a.jsx(Le,{path:"export",element:a.jsx(ine,{})})]}),a.jsx(Le,{path:"/:resourceType",element:a.jsx(nR,{})}),a.jsx(Le,{path:"/",element:a.jsx(nR,{})})]})})}function Bne(){const e=Ae(),t=e.getUserConfiguration(),n=Mr(),[r]=iS();return e.isLoading()?a.jsx(yo,{}):a.jsx(EG,{logo:a.jsx(Co,{size:24}),pathname:n.pathname,searchParams:r,version:XD,menus:Vne(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(yo,{}),children:a.jsx(Une,{})})})}function Vne(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:Fne(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(Lq,{})}]}),t}const sR={Patient:bH,Practitioner:kq,Organization:XF,ServiceRequest:oH,DiagnosticReport:cH,Questionnaire:Aq,admin:HF,AccessPolicy:Mq,Subscription:AH,batch:Yq,Observation:Hq};function Fne(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in sR){const n=sR[t];return a.jsx(n,{})}}catch{}return a.jsx(tm,{w:30})}async function qne(){const e=Bd(),t=new ZD({baseUrl:e.baseUrl,clientId:e.clientId,cacheTime:6e4,autoBatchTime:100,onUnauthenticated:()=>{window.location.pathname!=="/signin"&&window.location.pathname!=="/oauth"&&(window.location.href="/signin?next="+encodeURIComponent(window.location.pathname+window.location.search))}}),n={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:"500",lineHeight:"2.0"}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},r=zJ([{path:"*",element:a.jsx(Bne,{})}]),i=c=>r.navigate(c);$X.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(YV,{medplum:t,navigate:i,children:a.jsxs(kR,{theme:n,children:[a.jsx(aa,{position:"bottom-right"}),a.jsx(dJ,{router:r})]})})}))}qne().catch(console.error);
|
|
601
|
+
//# sourceMappingURL=index-Bvd9gX-s.js.map
|