@medplum/app 4.4.1 → 4.4.3
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/LICENSE.txt +176 -0
- package/dist/assets/index-B5mDagDt.js +607 -0
- package/dist/assets/index-B5mDagDt.js.map +1 -0
- package/dist/index.html +2 -2
- package/package.json +14 -14
- package/dist/assets/index-BVGe6_AW.js +0 -607
- package/dist/assets/index-BVGe6_AW.js.map +0 -1
|
@@ -1,607 +0,0 @@
|
|
|
1
|
-
function bO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)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(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function jx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kv={exports:{}},Iu={};/**
|
|
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 Hj;function SO(){if(Hj)return Iu;Hj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:s}}return Iu.Fragment=t,Iu.jsx=n,Iu.jsxs=n,Iu}var Gj;function wO(){return Gj||(Gj=1,kv.exports=SO()),kv.exports}var a=wO(),eo=function(){return eo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},eo.apply(this,arguments)};function uR(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function jO(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;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 Wj;function CO(){if(Wj)return yt;Wj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=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(N){return N===null||typeof N!="object"?null:(N=g&&N[g]||N["@@iterator"],typeof N=="function"?N:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function C(N,F,J){this.props=N,this.context=F,this.refs=j,this.updater=J||b}C.prototype.isReactComponent={},C.prototype.setState=function(N,F){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,F,"setState")},C.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function R(){}R.prototype=C.prototype;function E(N,F,J){this.props=N,this.context=F,this.refs=j,this.updater=J||b}var T=E.prototype=new R;T.constructor=E,S(T,C.prototype),T.isPureReactComponent=!0;var _=Array.isArray,P={H:null,A:null,T:null,S:null,V:null},A=Object.prototype.hasOwnProperty;function k(N,F,J,ae,je,xe){return J=xe.ref,{$$typeof:e,type:N,key:F,ref:J!==void 0?J:null,props:xe}}function L(N,F){return k(N.type,F,void 0,void 0,void 0,N.props)}function z(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function B(N){var F={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(J){return F[J]})}var Z=/\/+/g;function K(N,F){return typeof N=="object"&&N!==null&&N.key!=null?B(""+N.key):F.toString(36)}function Y(){}function H(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(Y,Y):(N.status="pending",N.then(function(F){N.status==="pending"&&(N.status="fulfilled",N.value=F)},function(F){N.status==="pending"&&(N.status="rejected",N.reason=F)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function W(N,F,J,ae,je){var xe=typeof N;(xe==="undefined"||xe==="boolean")&&(N=null);var we=!1;if(N===null)we=!0;else switch(xe){case"bigint":case"string":case"number":we=!0;break;case"object":switch(N.$$typeof){case e:case t:we=!0;break;case m:return we=N._init,W(we(N._payload),F,J,ae,je)}}if(we)return je=je(N),we=ae===""?"."+K(N,0):ae,_(je)?(J="",we!=null&&(J=we.replace(Z,"$&/")+"/"),W(je,F,J,"",function(ot){return ot})):je!=null&&(z(je)&&(je=L(je,J+(je.key==null||N&&N.key===je.key?"":(""+je.key).replace(Z,"$&/")+"/")+we)),F.push(je)),1;we=0;var Qe=ae===""?".":ae+":";if(_(N))for(var Ee=0;Ee<N.length;Ee++)ae=N[Ee],xe=Qe+K(ae,Ee),we+=W(ae,F,J,xe,je);else if(Ee=x(N),typeof Ee=="function")for(N=Ee.call(N),Ee=0;!(ae=N.next()).done;)ae=ae.value,xe=Qe+K(ae,Ee++),we+=W(ae,F,J,xe,je);else if(xe==="object"){if(typeof N.then=="function")return W(H(N),F,J,ae,je);throw F=String(N),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return we}function M(N,F,J){if(N==null)return N;var ae=[],je=0;return W(N,ae,"","",function(xe){return F.call(J,xe,je++)}),ae}function I(N){if(N._status===-1){var F=N._result;F=F(),F.then(function(J){(N._status===0||N._status===-1)&&(N._status=1,N._result=J)},function(J){(N._status===0||N._status===-1)&&(N._status=2,N._result=J)}),N._status===-1&&(N._status=0,N._result=F)}if(N._status===1)return N._result.default;throw N._result}var $=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function q(){}return yt.Children={map:M,forEach:function(N,F,J){M(N,function(){F.apply(this,arguments)},J)},count:function(N){var F=0;return M(N,function(){F++}),F},toArray:function(N){return M(N,function(F){return F})||[]},only:function(N){if(!z(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},yt.Component=C,yt.Fragment=n,yt.Profiler=o,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(N){return P.H.useMemoCache(N)}},yt.cache=function(N){return function(){return N.apply(null,arguments)}},yt.cloneElement=function(N,F,J){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ae=S({},N.props),je=N.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=J;else if(1<we){for(var Qe=Array(we),Ee=0;Ee<we;Ee++)Qe[Ee]=arguments[Ee+2];ae.children=Qe}return k(N.type,je,void 0,void 0,xe,ae)},yt.createContext=function(N){return N={$$typeof:c,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:s,_context:N},N},yt.createElement=function(N,F,J){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=J;else if(1<we){for(var Qe=Array(we),Ee=0;Ee<we;Ee++)Qe[Ee]=arguments[Ee+2];je.children=Qe}if(N&&N.defaultProps)for(ae in we=N.defaultProps,we)je[ae]===void 0&&(je[ae]=we[ae]);return k(N,xe,void 0,void 0,null,je)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(N){return{$$typeof:d,render:N}},yt.isValidElement=z,yt.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:I}},yt.memo=function(N,F){return{$$typeof:p,type:N,compare:F===void 0?null:F}},yt.startTransition=function(N){var F=P.T,J={};P.T=J;try{var ae=N(),je=P.S;je!==null&&je(J,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(q,$)}catch(xe){$(xe)}finally{P.T=F}},yt.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},yt.use=function(N){return P.H.use(N)},yt.useActionState=function(N,F,J){return P.H.useActionState(N,F,J)},yt.useCallback=function(N,F){return P.H.useCallback(N,F)},yt.useContext=function(N){return P.H.useContext(N)},yt.useDebugValue=function(){},yt.useDeferredValue=function(N,F){return P.H.useDeferredValue(N,F)},yt.useEffect=function(N,F,J){var ae=P.H;if(typeof J=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ae.useEffect(N,F)},yt.useId=function(){return P.H.useId()},yt.useImperativeHandle=function(N,F,J){return P.H.useImperativeHandle(N,F,J)},yt.useInsertionEffect=function(N,F){return P.H.useInsertionEffect(N,F)},yt.useLayoutEffect=function(N,F){return P.H.useLayoutEffect(N,F)},yt.useMemo=function(N,F){return P.H.useMemo(N,F)},yt.useOptimistic=function(N,F){return P.H.useOptimistic(N,F)},yt.useReducer=function(N,F,J){return P.H.useReducer(N,F,J)},yt.useRef=function(N){return P.H.useRef(N)},yt.useState=function(N){return P.H.useState(N)},yt.useSyncExternalStore=function(N,F,J){return P.H.useSyncExternalStore(N,F,J)},yt.useTransition=function(){return P.H.useTransition()},yt.version="19.1.1",yt}var Qj;function Cx(){return Qj||(Qj=1,Nv.exports=CO()),Nv.exports}var v=Cx();const En=jx(v),EO=bO({__proto__:null,default:En},[v]);var Ch="right-scroll-bar-position",Eh="width-before-scroll-bar",TO="with-scroll-bars-hidden",RO="--removed-body-scroll-bar-size";function Ov(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function _O(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var DO=typeof window<"u"?v.useLayoutEffect:v.useEffect,Yj=new WeakMap;function AO(e,t){var n=_O(null,function(r){return e.forEach(function(o){return Ov(o,r)})});return DO(function(){var r=Yj.get(n);if(r){var o=new Set(r),s=new Set(e),c=n.current;o.forEach(function(d){s.has(d)||Ov(d,null)}),s.forEach(function(d){o.has(d)||Ov(d,c)})}Yj.set(n,e)},[e]),n}function PO(e){return e}function kO(e,t){t===void 0&&(t=PO);var n=[],r=!1,o={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 o}function NO(e){e===void 0&&(e={});var t=kO(null);return t.options=eo({async:!0,ssr:!1},e),t}var dR=function(e){var t=e.sideCar,n=uR(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,eo({},n))};dR.isSideCarExport=!0;function OO(e,t){return e.useMedium(t),dR}var fR=NO(),Mv=function(){},yp=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Mv,onWheelCapture:Mv,onTouchMoveCapture:Mv}),o=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,S=e.noIsolation,j=e.inert,C=e.allowPinchZoom,R=e.as,E=R===void 0?"div":R,T=e.gapMode,_=uR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=x,A=AO([n,t]),k=eo(eo({},_),o);return v.createElement(v.Fragment,null,m&&v.createElement(P,{sideCar:fR,removeScrollBar:p,shards:g,noRelative:b,noIsolation:S,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:T}),c?v.cloneElement(v.Children.only(d),eo(eo({},k),{ref:A})):v.createElement(E,eo({},k,{className:f,ref:A}),d))});yp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yp.classNames={fullWidth:Eh,zeroRight:Ch};var MO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function LO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=MO();return t&&e.setAttribute("nonce",t),e}function IO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $O(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=LO())&&(IO(t,n),$O(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},UO=function(){var e=zO();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hR=function(){var e=UO(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},BO={left:0,top:0,right:0,gap:0},Lv=function(e){return parseInt(e||"",10)||0},VO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Lv(n),Lv(r),Lv(o)]},FO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BO;var t=VO(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])}},qO=hR(),uc="data-scroll-locked",HO=function(e,t,n,r){var o=e.left,s=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
-
.`.concat(TO,` {
|
|
19
|
-
overflow: hidden `).concat(r,`;
|
|
20
|
-
padding-right: `).concat(d,"px ").concat(r,`;
|
|
21
|
-
}
|
|
22
|
-
body[`).concat(uc,`] {
|
|
23
|
-
overflow: hidden `).concat(r,`;
|
|
24
|
-
overscroll-behavior: contain;
|
|
25
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
26
|
-
padding-left: `.concat(o,`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(Ch,` {
|
|
36
|
-
right: `).concat(d,"px ").concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(Eh,` {
|
|
40
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.`).concat(Ch," .").concat(Ch,` {
|
|
44
|
-
right: 0 `).concat(r,`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.`).concat(Eh," .").concat(Eh,` {
|
|
48
|
-
margin-right: 0 `).concat(r,`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
body[`).concat(uc,`] {
|
|
52
|
-
`).concat(RO,": ").concat(d,`px;
|
|
53
|
-
}
|
|
54
|
-
`)},Kj=function(){var e=parseInt(document.body.getAttribute(uc)||"0",10);return isFinite(e)?e:0},GO=function(){v.useEffect(function(){return document.body.setAttribute(uc,(Kj()+1).toString()),function(){var e=Kj()-1;e<=0?document.body.removeAttribute(uc):document.body.setAttribute(uc,e.toString())}},[])},WO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;GO();var s=v.useMemo(function(){return FO(o)},[o]);return v.createElement(qO,{styles:HO(s,!t,o,n?"":"!important")})},Py=!1;if(typeof window<"u")try{var oh=Object.defineProperty({},"passive",{get:function(){return Py=!0,!0}});window.addEventListener("test",oh,oh),window.removeEventListener("test",oh,oh)}catch{Py=!1}var Kl=Py?{passive:!1}:!1,QO=function(e){return e.tagName==="TEXTAREA"},pR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!QO(e)&&n[t]==="visible")},YO=function(e){return pR(e,"overflowY")},KO=function(e){return pR(e,"overflowX")},Xj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=mR(e,r);if(o){var s=gR(e,r),c=s[1],d=s[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},XO=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ZO=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},mR=function(e,t){return e==="v"?YO(t):KO(t)},gR=function(e,t){return e==="v"?XO(t):ZO(t)},JO=function(e,t){return e==="h"&&t==="rtl"?-1:1},e4=function(e,t,n,r,o){var s=JO(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=gR(e,d),S=b[0],j=b[1],C=b[2],R=j-C-s*S;(S||R)&&mR(e,d)&&(g+=R,x+=S);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},ah=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zj=function(e){return[e.deltaX,e.deltaY]},Jj=function(e){return e&&"current"in e?e.current:e},t4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},n4=function(e){return`
|
|
55
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
-
`)},r4=0,Xl=[];function i4(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(r4++)[0],s=v.useState(hR)[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(o));var j=jO([e.lockRef.current],(e.shards||[]).map(Jj),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[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 R=ah(j),E=n.current,T="deltaX"in j?j.deltaX:E[0]-R[0],_="deltaY"in j?j.deltaY:E[1]-R[1],P,A=j.target,k=Math.abs(T)>Math.abs(_)?"h":"v";if("touches"in j&&k==="h"&&A.type==="range")return!1;var L=Xj(k,A);if(!L)return!0;if(L?P=k:(P=k==="v"?"h":"v",L=Xj(k,A)),!L)return!1;if(!r.current&&"changedTouches"in j&&(T||_)&&(r.current=P),!P)return!0;var z=r.current||P;return e4(z,C,j,z==="h"?T:_)},[]),f=v.useCallback(function(j){var C=j;if(!(!Xl.length||Xl[Xl.length-1]!==s)){var R="deltaY"in C?Zj(C):ah(C),E=t.current.filter(function(P){return P.name===C.type&&(P.target===C.target||C.target===P.shadowParent)&&t4(P.delta,R)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var T=(c.current.shards||[]).map(Jj).filter(Boolean).filter(function(P){return P.contains(C.target)}),_=T.length>0?d(C,T[0]):!c.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,R,E){var T={name:j,delta:C,target:R,should:E,shadowParent:o4(R)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(_){return _!==T})},1)},[]),m=v.useCallback(function(j){n.current=ah(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,Zj(j),j.target,d(j,e.lockRef.current))},[]),x=v.useCallback(function(j){p(j.type,ah(j),j.target,d(j,e.lockRef.current))},[]);v.useEffect(function(){return Xl.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Kl),document.addEventListener("touchmove",f,Kl),document.addEventListener("touchstart",m,Kl),function(){Xl=Xl.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,Kl),document.removeEventListener("touchmove",f,Kl),document.removeEventListener("touchstart",m,Kl)}},[]);var b=e.removeScrollBar,S=e.inert;return v.createElement(v.Fragment,null,S?v.createElement(s,{styles:n4(o)}):null,b?v.createElement(WO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function o4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const a4=OO(fR,i4);var gc=v.forwardRef(function(e,t){return v.createElement(yp,eo({},e,{ref:t,sideCar:a4}))});gc.classNames=yp.classNames;function an(e){return Object.keys(e)}function Iv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Ex(e,t){const n={...e},r=t;return Iv(e)&&Iv(t)&&Object.keys(t).forEach(o=>{Iv(r[o])&&o in e?n[o]=Ex(n[o],r[o]):n[o]=r[o]}),n}function s4(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function l4(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function Zu(e){const t=l4(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 vR(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const o=`${r/16}${e}`;return t?$v(o):o}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 o=r.replace("px","");if(!Number.isNaN(Number(o))){const s=`${Number(o)/16}${e}`;return t?$v(s):s}}return r}return n}const le=vR("rem",{shouldScale:!0}),Ih=vR("em");function es(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function yR(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 Jo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function xr(e){const t=v.createContext(null);return[({children:o,value:s})=>a.jsx(t.Provider,{value:s,children:o}),()=>{const o=v.useContext(t);if(o===null)throw new Error(e);return o}]}function ea(e=null){const t=v.createContext(e);return[({children:o,value:s})=>a.jsx(t.Provider,{value:s,children:o}),()=>v.useContext(t)]}function eC(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function $h(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function c4(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 u4(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 d4(e,t,n){return $h(e,n)===$h(t,n)}function xR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:s="rtl",orientation:c}){return d=>{n?.(d);const f=Array.from($h(d.currentTarget,e)?.querySelectorAll(t)||[]).filter(S=>d4(d.currentTarget,S,e)),p=f.findIndex(S=>d.currentTarget===S),m=u4(p,f,r),g=c4(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(),o&&f[x].click());break}case"ArrowLeft":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[b].focus(),o&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[g].focus(),o&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[m].focus(),o&&f[m].click());break}case"Home":{d.stopPropagation(),d.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{d.stopPropagation(),d.preventDefault();const S=f.length-1;!f[S].disabled&&f[S].focus();break}}}}const f4={app:100,modal:200,popover:300,overlay:400,max:9999};function Xr(e){return f4[e]}const zh=()=>{};function h4(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||zh:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function rt(e,t="size",n=!0){if(e!==void 0)return yR(e)?n?le(e):e:`var(--${t}-${e})`}function Nn(e){return rt(e,"mantine-spacing")}function Ut(e){return e===void 0?"var(--mantine-radius-default)":rt(e,"mantine-radius")}function On(e){return rt(e,"mantine-font-size")}function bR(e){return rt(e,"mantine-line-height",!1)}function Tx(e){if(e)return rt(e,"mantine-shadow",!1)}function Ar(e,t){return n=>{e?.(n),t?.(n)}}function Rx(e,t){return e in t?Zu(t[e]):Zu(e)}function Ju(e,t){const n=e.map(r=>({value:r,px:Rx(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Pi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function p4(e,t,n){return n?Array.from($h(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function m4(){const[e,t]=v.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Th(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 Uh(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function g4(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 o=0;o<r;o+=1){const s=n[o];if(!(s in t)||e[s]!==t[s]&&!(Number.isNaN(e[s])&&Number.isNaN(t[s])))return!1}return!0}function tC(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Ps(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function xp(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,o=Ps(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,o(...f))};c.current=p,d.flush=p,s.current=window.setTimeout(p,n)},[o,n]),{flush:c.current});return v.useEffect(()=>()=>{window.clearTimeout(s.current),r&&d.flush()},[d,r]),d}const nC=["mousedown","touchstart"];function v4(e,t,n){const r=v.useRef(null);return v.useEffect(()=>{const o=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||nC).forEach(s=>document.addEventListener(s,o)),()=>{(t||nC).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function SR({timeout:e=2e3}={}){const[t,n]=v.useState(null),[r,o]=v.useState(!1),[s,c]=v.useState(null),d=m=>{window.clearTimeout(s),c(window.setTimeout(()=>o(!1),e)),o(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:()=>{o(!1),n(null),window.clearTimeout(s)},error:t,copied:r}}function y4(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function x4(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function wR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=v.useState(n?t:x4(e)),s=v.useRef(null);return v.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),y4(s.current,c=>o(c.matches))},[e]),r}function b4(e,t){return wR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Dc=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Go(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function jR({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 Go(()=>{let o=-1;const s=c=>{c.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const S4=/input|select|textarea|button|object/,CR="a, input, select, textarea, button, object, [tabindex]";function w4(e){return e.style.display==="none"}function j4(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(w4(n))return!1;n=n.parentNode}return!0}function ER(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function ky(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(ER(e));return(S4.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&j4(e)}function TR(e){const t=ER(e);return(Number.isNaN(t)||t>=0)&&ky(e)}function C4(e){return Array.from(e.querySelectorAll(CR)).filter(TR)}function E4(e,t){const n=C4(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let s=r===o.activeElement||e===o.activeElement;const c=o.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 T4(e=!0){const t=v.useRef(null),n=o=>{let s=o.querySelector("[data-autofocus]");if(!s){const c=Array.from(o.querySelectorAll(CR));s=c.find(TR)||c.find(ky)||null,!s&&ky(o)&&(s=o)}s&&s.focus({preventScroll:!0})},r=v.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return v.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=s=>{s.key==="Tab"&&t.current&&E4(t.current,s)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const R4=e=>(e+1)%1e6;function _4(){const[,e]=v.useReducer(R4,0);return e}const D4=En.useId||(()=>{});function A4(){const e=D4();return e?`mantine-${e.replace(/:/g,"")}`:""}function br(e){const t=A4(),[n,r]=v.useState(t);return Dc(()=>{r(Uh())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function RR(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function ed(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function P4(...e){const t=new Map;return n=>{if(e.forEach(r=>{const o=ed(r,n);o&&t.set(r,o)}),t.size>0)return()=>{e.forEach(r=>{const o=t.get(r);o?o():ed(r,null)}),t.clear()}}}function Vn(...e){return v.useCallback(P4(...e),e)}function Yn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=v.useState(t!==void 0?t:n),c=(d,...f)=>{s(d),r?.(d,...f)};return e!==void 0?[e,r,!0]:[o,c,!1]}function Ia(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const sh="dots";function k4({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:s}){const c=Math.max(Math.trunc(e),0),[d,f]=Yn({value:r,onChange:s,defaultValue:o,finalValue:o}),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 Ia(1,c);const C=Math.max(d-t,n),R=Math.min(d+t,c-n),E=C>n+2,T=R<c-(n+1);if(!E&&T){const _=t*2+n+2;return[...Ia(1,_),sh,...Ia(c-(n-1),c)]}if(E&&!T){const _=n+1+2*t;return[...Ia(1,n),sh,...Ia(c-_,c)]}return[...Ia(1,n),sh,...Ia(C,R),sh,...Ia(c-n+1,c)]},[c,t,d]),active:d,setPage:p,next:m,previous:g,first:x,last:b}}function _x(e,t){return wR("(prefers-reduced-motion: reduce)",e,t)}function N4(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(!g4(e[n],t[n]))return!1;return!0}function O4(e){const t=v.useRef([]),n=v.useRef(0);return N4(t.current,e)||(t.current=e,n.current+=1),[n.current]}function M4(e,t){v.useEffect(e,O4(t))}function md(e=!1,t){const{onOpen:n,onClose:r}={},[o,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(()=>{o?d():c()},[d,c,o]);return[o,{open:c,close:d,toggle:f}]}function L4(e,t,n={autoInvoke:!1}){const r=v.useRef(null),o=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&&o(),s),[s,o]),{start:o,clear:s}}function I4(e,t,n){const r=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||o.current)&&(r.current=new MutationObserver(e),r.current.observe(s||o.current,t)),()=>{r.current?.disconnect()}},[e,t]),o}function $4(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var z4={};function _R(){return typeof process<"u"&&z4?"production":"development"}function bp(e){const t=En.version;return typeof En.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function DR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=DR(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="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=DR(e))&&(r&&(r+=" "),r+=t);return r}const U4={};function B4(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=It(t[r],o):t[r]=o})}),t}function Sp({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||U4);return B4(s)}function Bh({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 Dx=v.createContext(null);function ta(){const e=v.useContext(Dx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function V4(){return ta().cssVariablesResolver}function F4(){return ta().classNamesPrefix}function wp(){return ta().getStyleNonce}function q4(){return ta().withStaticClasses}function H4(){return ta().headless}function G4(){return ta().stylesTransform?.sx}function W4(){return ta().stylesTransform?.styles}function AR(){return ta().env||"default"}function Q4(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function Y4(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,o=n>>8&255,s=n&255;return{r,g:o,b:s,a:1}}function K4(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o===void 0?1:o}}function X4(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),o=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))*o,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 Ax(e){return Q4(e)?Y4(e):e.startsWith("rgb")?K4(e):e.startsWith("hsl")?X4(e):{r:0,g:0,b:0,a:1}}function lh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:s}=Ax(e),c=1-t,d=f=>Math.round(f*c);return`rgba(${d(n)}, ${d(r)}, ${d(o)}, ${s})`}function td(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 Z4(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function J4(e){if(e.startsWith("oklch("))return(Z4(e)||0)/100;const{r:t,g:n,b:r}=Ax(e),o=t/255,s=n/255,c=r/255,d=zv(o),f=zv(s),p=zv(c);return .2126*d+.7152*f+.0722*p}function $u(e,t=.179){return e.startsWith("var(")?!1:J4(e)>t}function gi({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:$u(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:$u(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:$u(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),s=o?Number(o):void 0,c=r in t.colors;if(c){const d=s!==void 0?t.colors[r][s]:t.colors[r][td(t,n||"light")];return{color:r,value:d,shade:s,isThemeColor:c,isLight:$u(d,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:$u(e,t.luminanceThreshold),shade:s,variable:void 0}}function Ft(e,t){const n=gi({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Ny(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),o=Ft(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function di(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:o}=Ax(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Zl=di,eM=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const s=gi({color:e,theme:t}),c=typeof o=="boolean"?o: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:lh(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:di(d,.1),hover:di(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:di(e,.1),hover:di(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:di(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:di(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:di(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:di(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:lh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:lh(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:lh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:Ny(r,t),hover:Ny(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)`}:{}},tM={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"]},rC="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Px={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:tM,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:eM,autoContrast:!1,luminanceThreshold:.3,fontFamily:rC,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:rC,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 iC(e){return e==="auto"||e==="dark"||e==="light"}function nM({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 iC(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&&iC(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const rM="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",oC="[@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 aC(e){if(!(e.primaryColor in e.colors))throw new Error(rM);if(typeof e.primaryShade=="object"&&(!Uv(e.primaryShade.dark)||!Uv(e.primaryShade.light)))throw new Error(oC);if(typeof e.primaryShade=="number"&&!Uv(e.primaryShade))throw new Error(oC)}function iM(e,t){if(!t)return aC(e),e;const n=Ex(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),aC(n),n}const kx=v.createContext(null),oM=()=>v.useContext(kx)||Px;function Sn(){const e=v.useContext(kx);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 PR({theme:e,children:t,inherit:n=!0}){const r=oM(),o=v.useMemo(()=>iM(n?r:Px,e),[e,r,n]);return a.jsx(kx.Provider,{value:o,children:t})}PR.displayName="@mantine/core/MantineThemeProvider";function aM(){const e=Sn(),t=wp(),n=an(e.breakpoints).reduce((r,o)=>{const s=e.breakpoints[o].includes("px"),c=Zu(e.breakpoints[o]),d=s?`${c-.1}px`:Ih(c-.1),f=s?`${c}px`:Ih(c);return`${r}@media (max-width: ${d}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${o} {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 zu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function sM(e,t){const n=Bv(e.variables),r=n?zu(t,n):"",o=Bv(e.dark),s=Bv(e.light),c=o?zu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",d=s?zu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${c}${d}`}function na({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&gi({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function sC(e,t){return na({color:e.colors[e.primaryColor][td(e,t)],theme:e,autoContrast:null})}function ch({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const d=td(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`]:Zl(e.colors[t][d],.1),[`--mantine-color-${r}-light-hover`]:Zl(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`]:Zl(e.colors[t][d],.05)};return o?{[`--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=td(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`]:Zl(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:Zl(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`]:Zl(e.colors[t][Math.max(s-4,0)],.05)};return o?{[`--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 lM(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Jl(e,t,n){an(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const kR=e=>{const t=td(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":sC(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":sC(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)"}};Jl(r.variables,e.breakpoints,"breakpoint"),Jl(r.variables,e.spacing,"spacing"),Jl(r.variables,e.fontSizes,"font-size"),Jl(r.variables,e.lineHeights,"line-height"),Jl(r.variables,e.shadows,"shadow"),Jl(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(lM(c)){Object.assign(r.light,ch({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,ch({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,ch({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,ch({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return an(o).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=o[s].fontSize,r.variables[`--mantine-${s}-line-height`]=o[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=o[s].fontWeight||e.headings.fontWeight}),r};function cM({theme:e,generator:t}){const n=kR(e),r=t?.(e);return r?Ex(n,r):n}const Vv=kR(Px);function uM(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 dM(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 NR({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=wp(),o=V4(),s=cM({theme:n,generator:o}),c=e===":root"&&t,d=c?uM(s):s,f=sM(d,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":dM(e)}`}}):null}NR.displayName="@mantine/CssVariables";function fM(){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 ec(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 hM({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=v.useRef(null),[s,c]=v.useState(()=>e.get(t)),d=r||s,f=v.useCallback(m=>{r||(ec(m,n),c(m),e.set(m))},[e.set,d,r]),p=v.useCallback(()=>{c(t),ec(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Dc(()=>{ec(e.get(t),n)},[]),v.useEffect(()=>{if(r)return ec(r,n),()=>{};r===void 0&&ec(s,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{s==="auto"&&ec(g.matches?"dark":"light",n)};return o.current?.addEventListener("change",m),()=>o.current?.removeEventListener("change",m)},[s,r]),{colorScheme:d,setColorScheme:f,clearColorScheme:p}}function pM({respectReducedMotion:e,getRootElement:t}){Dc(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}fM();function OR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:s=!0,withCssVariables:c=!0,cssVariablesSelector:d=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=nM(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:x,forceColorScheme:b,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:R,clearColorScheme:E}=hM({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return pM({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(Dx.Provider,{value:{colorScheme:C,setColorScheme:R,clearColorScheme:E,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:x,cssVariablesSelector:d,withStaticClasses:r,stylesTransform:S,env:j},children:a.jsxs(PR,{theme:e,children:[c&&a.jsx(NR,{cssVariablesSelector:d,deduplicateCssVariables:s}),o&&a.jsx(aM,{}),t]})})}OR.displayName="@mantine/core/MantineProvider";function el({classNames:e,styles:t,props:n,stylesCtx:r}){const o=Sn();return{resolvedClassNames:Sp({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Bh({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const mM={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function gM({theme:e,options:t,unstyled:n}){return It(t?.focusable&&!n&&(e.focusClassName||mM[e.focusRing]),t?.active&&!n&&e.activeClassName)}function vM({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Sp({theme:o,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function lC({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Sp({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function yM({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function xM({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function bM({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function SM({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(s=>Sp({theme:t,classNames:t.components[s]?.classNames,props:r,stylesCtx:o})?.[n])}function wM({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function jM({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:s,classes:c,unstyled:d,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:x,headless:b,transformedStyles:S}){return It(gM({theme:e,options:t,unstyled:d||b}),SM({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),wM({options:t,classes:c,selector:r,unstyled:d}),lC({selector:r,stylesCtx:g,theme:e,classNames:s,props:m}),lC({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),vM({selector:r,stylesCtx:g,options:t,props:m,theme:e}),yM({rootSelector:p,selector:r,className:f}),xM({selector:r,classes:c,unstyled:d||b}),x&&!b&&bM({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function CM({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(s=>Bh({theme:e,styles:e.components[s]?.styles,props:n,stylesCtx:r})[o]).reduce((s,c)=>({...s,...c}),{})}function Oy({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Oy({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function EM(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...es(n[r])}}),t),{})}function TM({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:s,themeName:c,headless:d}){return EM([d?{}:t?.(n,r,o),...c.map(f=>n.components?.[f]?.vars?.(n,r,o)),e?.(n,r,o)])?.[s]}function RM({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:s,rootSelector:c,styles:d,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:x}){return{...!x&&CM({theme:e,themeName:t,props:o,stylesCtx:s,selector:n}),...!x&&Bh({theme:e,styles:d,props:o,stylesCtx:s})[n],...!x&&Bh({theme:e,styles:r?.styles,props:r?.props||o,stylesCtx:s})[n],...TM({theme:e,props:o,stylesCtx:s,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?Oy({style:f,theme:e}):null,...Oy({style:r?.style,theme:e})}}function _M({props:e,stylesCtx:t,themeName:n}){const r=Sn(),o=W4()?.();return{getTransformedStyles:c=>o?[...c.map(f=>o(f,{props:e,theme:r,ctx:t})),...n.map(f=>o(r.components[f]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!o}}function Le({name:e,classes:t,props:n,stylesCtx:r,className:o,style:s,rootSelector:c="root",unstyled:d,classNames:f,styles:p,vars:m,varsResolver:g}){const x=Sn(),b=F4(),S=q4(),j=H4(),C=(Array.isArray(e)?e:[e]).filter(T=>T),{withStylesTransform:R,getTransformedStyles:E}=_M({props:n,stylesCtx:r,themeName:C});return(T,_)=>({className:jM({theme:x,options:_,themeName:C,selector:T,classNamesPrefix:b,classNames:f,classes:t,unstyled:d,className:o,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:S,headless:j,transformedStyles:E([_?.styles,p])}),style:RM({theme:x,themeName:C,selector:T,options:_,props:n,stylesCtx:r,rootSelector:c,styles:p,style:s,vars:m,varsResolver:g,headless:j,withStylesTransform:R})})}function tl(e,t){return typeof e=="boolean"?e:t.autoContrast}function cC(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 DM({keepTransitions:e}={}){const t=v.useRef(zh),n=v.useRef(-1),r=v.useContext(Dx),o=wp(),s=v.useRef(o?.());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:cC(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},d=()=>{r.clearColorScheme(),t.current=e?()=>{}:cC(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=b4("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(),o=r.components[e]?.defaultProps,s=typeof o=="function"?o(r):o;return{...t,...s,...es(n)}}function Fv(e){return an(e).reduce((t,n)=>e[n]!==void 0?`${t}${s4(n)}:${e[n]};`:t,"").trim()}function AM({selector:e,styles:t,media:n,container:r}){const o=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`${o?`${e}{${o}}`:""}${s.join("")}${c.join("")}`.trim()}function nl(e){const t=wp();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:AM(e)}})}function ra(e){const{m:t,mx:n,my:r,mt:o,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:x,pt:b,pb:S,pl:j,pr:C,pe:R,ps:E,bd:T,bg:_,c:P,opacity:A,ff:k,fz:L,fw:z,lts:B,ta:Z,lh:K,fs:Y,tt:H,td:W,w:M,miw:I,maw:$,h:q,mih:N,mah:F,bgsz:J,bgp:ae,bgr:je,bga:xe,pos:we,top:Qe,left:Ee,bottom:ot,right:nt,inset:Ct,display:Mt,flex:Lt,hiddenFrom:pt,visibleFrom:Rt,lightHidden:tn,darkHidden:Re,sx:Pe,...Xe}=e;return{styleProps:es({m:t,mx:n,my:r,mt:o,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:x,pt:b,pb:S,pl:j,pr:C,pe:R,ps:E,bd:T,bg:_,c:P,opacity:A,ff:k,fz:L,fw:z,lts:B,ta:Z,lh:K,fs:Y,tt:H,td:W,w:M,miw:I,maw:$,h:q,mih:N,mah:F,bgsz:J,bgp:ae,bgr:je,bga:xe,pos:we,top:Qe,left:Ee,bottom:ot,right:nt,inset:Ct,display:Mt,flex:Lt,hiddenFrom:pt,visibleFrom:Rt,lightHidden:tn,darkHidden:Re,sx:Pe}),rest:Xe}}const PM={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 Nx(e,t){const n=gi({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 kM(e,t){const n=gi({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Nx(e,t)}function NM(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(c=>c.trim()!=="");let s=`${le(n)}`;return r&&(s+=` ${r}`),o.length>0&&(s+=` ${Nx(o.join(" "),t)}`),s.trim()}return e}const uC={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 OM(e){return typeof e=="string"&&e in uC?uC[e]:e}const MM=["h1","h2","h3","h4","h5","h6"];function LM(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&MM.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function IM(e){return e}const $M=["h1","h2","h3","h4","h5","h6"];function zM(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&$M.includes(e)?`var(--mantine-${e}-line-height)`:e}function UM(e){return typeof e=="number"?le(e):e}function BM(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:Nx,textColor:kM,fontSize:LM,spacing:BM,identity:IM,size:UM,lineHeight:zM,fontFamily:OM,border:NM};function dC(e){return e.replace("(min-width: ","").replace("em)","")}function VM({media:e,...t}){const r=Object.keys(e).sort((o,s)=>Number(dC(o))-Number(dC(s))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function FM(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function qM(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function HM(e){return typeof e=="object"&&e!==null?an(e).filter(t=>t!=="base"):[]}function GM(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function MR({styleProps:e,data:t,theme:n}){return VM(an(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const s=t[o],c=Array.isArray(s.property)?s.property:[s.property],d=qM(e[o]);if(!FM(e[o]))return c.forEach(p=>{r.inlineStyles[p]=qv[s.type](d,n)}),r;r.hasResponsiveStyles=!0;const f=HM(e[o]);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](GM(e[o],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function gd(){return`__m__-${v.useId().replace(/:/g,"")}`}function LR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...LR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function IR(e){return e.startsWith("data-")?e:`data-${e}`}function WM(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[IR(n)]=e[n]),t},{})}function $R(e){return e?typeof e=="string"?{[IR(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...$R(n)}),{}):WM(e):null}function My(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...My(r,t)}),{}):typeof e=="function"?e(t):e??{}}function QM({theme:e,style:t,vars:n,styleProps:r}){const o=My(t,e),s=My(n,e);return{...o,...s,...r}}const zR=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:s,size:c,hiddenFrom:d,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:x,...b},S)=>{const j=Sn(),C=e||"div",{styleProps:R,rest:E}=ra(b),_=G4()?.()?.(R.sx),P=gd(),A=MR({styleProps:R,theme:j,data:PM}),k={ref:S,style:QM({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":o,"data-size":yR(c)?void 0:c||void 0,size:x,...$R(s),...E};return a.jsxs(a.Fragment,{children:[A.hasResponsiveStyles&&a.jsx(nl,{selector:`.${P}`,styles:A.styles,media:A.media}),typeof g=="function"?g(k):a.jsx(C,{...k})]})});zR.displayName="@mantine/core/Box";const ce=zR;function UR(e){return e}function YM(e){const t=e;return n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ye(e){const t=v.forwardRef(e);return t.extend=UR,t.withProps=n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function cr(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=UR,t}const KM=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function rl(){return v.useContext(KM)}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 fC;function XM(){if(fC)return nr;fC=1;var e=Cx();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},o=Symbol.for("react.portal");function s(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,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 hC;function BR(){if(hC)return Hv.exports;hC=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=XM(),Hv.exports}var Ox=BR();const Wu=jx(Ox);function jp(){return typeof window<"u"}function Ac(e){return VR(e)?(e.nodeName||"").toLowerCase():"#document"}function Pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ho(e){var t;return(t=(VR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function VR(e){return jp()?e instanceof Node||e instanceof Pr(e).Node:!1}function mn(e){return jp()?e instanceof Element||e instanceof Pr(e).Element:!1}function Qr(e){return jp()?e instanceof HTMLElement||e instanceof Pr(e).HTMLElement:!1}function Ly(e){return!jp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pr(e).ShadowRoot}const ZM=new Set(["inline","contents"]);function vd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ZM.has(o)}const JM=new Set(["table","td","th"]);function e3(e){return JM.has(Ac(e))}const t3=[":popover-open",":modal"];function Cp(e){return t3.some(t=>{try{return e.matches(t)}catch{return!1}})}const n3=["transform","translate","scale","rotate","perspective"],r3=["transform","translate","scale","rotate","perspective","filter"],i3=["paint","layout","strict","content"];function Mx(e){const t=Ep(),n=mn(e)?vi(e):e;return n3.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)||r3.some(r=>(n.willChange||"").includes(r))||i3.some(r=>(n.contain||"").includes(r))}function o3(e){let t=Wo(e);for(;Qr(t)&&!Ya(t);){if(Mx(t))return t;if(Cp(t))return null;t=Wo(t)}return null}function Ep(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const a3=new Set(["html","body","#document"]);function Ya(e){return a3.has(Ac(e))}function vi(e){return Pr(e).getComputedStyle(e)}function Tp(e){return mn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wo(e){if(Ac(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ly(e)&&e.host||ho(e);return Ly(t)?t.host:t}function FR(e){const t=Wo(e);return Ya(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qr(t)&&vd(t)?t:FR(t)}function Ho(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=FR(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),c=Pr(o);if(s){const d=Iy(c);return t.concat(c,c.visualViewport||[],vd(o)?o:[],d&&n?Ho(d):[])}return t.concat(o,Ho(o,[],n))}function Iy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pC(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 nd(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ly(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function qR(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function HR(){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 s3(e){return u3()?!1:!mC()&&e.width===0&&e.height===0||mC()&&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 l3(){return/apple/i.test(navigator.vendor)}function mC(){const e=/android/i;return e.test(qR())||e.test(HR())}function c3(){return qR().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function u3(){return HR().includes("jsdom/")}function $y(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function d3(e){return"nativeEvent"in e}function f3(e){return e.matches("html,body")}function Os(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 sc(e){return"composedPath"in e?e.composedPath()[0]:e.target}const h3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function p3(e){return Qr(e)&&e.matches(h3)}const Mi=Math.min,or=Math.max,Vh=Math.round,uh=Math.floor,no=e=>({x:e,y:e}),m3={left:"right",right:"left",bottom:"top",top:"bottom"},g3={start:"end",end:"start"};function zy(e,t,n){return or(e,Mi(t,n))}function Qo(e,t){return typeof e=="function"?e(t):e}function Li(e){return e.split("-")[0]}function Pc(e){return e.split("-")[1]}function Lx(e){return e==="x"?"y":"x"}function Ix(e){return e==="y"?"height":"width"}const v3=new Set(["top","bottom"]);function ki(e){return v3.has(Li(e))?"y":"x"}function $x(e){return Lx(ki(e))}function y3(e,t,n){n===void 0&&(n=!1);const r=Pc(e),o=$x(e),s=Ix(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Fh(c)),[c,Fh(c)]}function x3(e){const t=Fh(e);return[Uy(e),t,Uy(t)]}function Uy(e){return e.replace(/start|end/g,t=>g3[t])}const gC=["left","right"],vC=["right","left"],b3=["top","bottom"],S3=["bottom","top"];function w3(e,t,n){switch(e){case"top":case"bottom":return n?t?vC:gC:t?gC:vC;case"left":case"right":return t?b3:S3;default:return[]}}function j3(e,t,n,r){const o=Pc(e);let s=w3(Li(e),n==="start",r);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(Uy)))),s}function Fh(e){return e.replace(/left|right|bottom|top/g,t=>m3[t])}function C3(e){return{top:0,right:0,bottom:0,left:0,...e}}function zx(e){return typeof e!="number"?C3(e):{top:e,right:e,bottom:e,left:e}}function vc(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function yC(e,t,n){let{reference:r,floating:o}=e;const s=ki(t),c=$x(t),d=Ix(c),f=Li(t),p=s==="y",m=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,x=r[d]/2-o[d]/2;let b;switch(f){case"top":b={x:m,y:r.y-o.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-o.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Pc(t)){case"start":b[c]-=x*(n&&p?-1:1);break;case"end":b[c]+=x*(n&&p?-1:1);break}return b}const E3=async(e,t,n)=>{const{placement:r="bottom",strategy:o="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:o}),{x:m,y:g}=yC(p,r,f),x=r,b={},S=0;for(let j=0;j<d.length;j++){const{name:C,fn:R}=d[j],{x:E,y:T,data:_,reset:P}=await R({x:m,y:g,initialPlacement:r,placement:x,strategy:o,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=E??m,g=T??g,b={...b,[C]:{...b[C],..._}},P&&S<=50&&(S++,typeof P=="object"&&(P.placement&&(x=P.placement),P.rects&&(p=P.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:m,y:g}=yC(p,x,f)),j=-1)}return{x:m,y:g,placement:x,strategy:o,middlewareData:b}};async function Ux(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:c,elements:d,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:x=!1,padding:b=0}=Qo(t,e),S=zx(b),C=d[x?g==="floating"?"reference":"floating":g],R=vc(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:o,width:c.floating.width,height:c.floating.height}:c.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d.floating)),_=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},P=vc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:T,strategy:f}):E);return{top:(R.top-P.top+S.top)/_.y,bottom:(P.bottom-R.bottom+S.bottom)/_.y,left:(R.left-P.left+S.left)/_.x,right:(P.right-R.right+S.right)/_.x}}const T3=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:c,elements:d,middlewareData:f}=t,{element:p,padding:m=0}=Qo(e,t)||{};if(p==null)return{};const g=zx(m),x={x:n,y:r},b=$x(o),S=Ix(b),j=await c.getDimensions(p),C=b==="y",R=C?"top":"left",E=C?"bottom":"right",T=C?"clientHeight":"clientWidth",_=s.reference[S]+s.reference[b]-x[b]-s.floating[S],P=x[b]-s.reference[b],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let k=A?A[T]:0;(!k||!await(c.isElement==null?void 0:c.isElement(A)))&&(k=d.floating[T]||s.floating[S]);const L=_/2-P/2,z=k/2-j[S]/2-1,B=Mi(g[R],z),Z=Mi(g[E],z),K=B,Y=k-j[S]-Z,H=k/2-j[S]/2+L,W=zy(K,H,Y),M=!f.arrow&&Pc(o)!=null&&H!==W&&s.reference[S]/2-(H<K?B:Z)-j[S]/2<0,I=M?H<K?H-K:H-Y:0;return{[b]:x[b]+I,data:{[b]:W,centerOffset:H-W-I,...M&&{alignmentOffset:I}},reset:M}}}),R3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:c,initialPlacement:d,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=Qo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const R=Li(o),E=ki(d),T=Li(d)===d,_=await(f.isRTL==null?void 0:f.isRTL(p.floating)),P=x||(T||!j?[Fh(d)]:x3(d)),A=S!=="none";!x&&A&&P.push(...j3(d,j,S,_));const k=[d,...P],L=await Ux(t,C),z=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&z.push(L[R]),g){const H=y3(o,c,_);z.push(L[H[0]],L[H[1]])}if(B=[...B,{placement:o,overflows:z}],!z.every(H=>H<=0)){var Z,K;const H=(((Z=s.flip)==null?void 0:Z.index)||0)+1,W=k[H];if(W&&(!(g==="alignment"?E!==ki(W):!1)||B.every($=>ki($.placement)===E?$.overflows[0]>0:!0)))return{data:{index:H,overflows:B},reset:{placement:W}};let M=(K=B.filter(I=>I.overflows[0]<=0).sort((I,$)=>I.overflows[1]-$.overflows[1])[0])==null?void 0:K.placement;if(!M)switch(b){case"bestFit":{var Y;const I=(Y=B.filter($=>{if(A){const q=ki($.placement);return q===E||q==="y"}return!0}).map($=>[$.placement,$.overflows.filter(q=>q>0).reduce((q,N)=>q+N,0)]).sort(($,q)=>$[1]-q[1])[0])==null?void 0:Y[0];I&&(M=I);break}case"initialPlacement":M=d;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function GR(e){const t=Mi(...e.map(s=>s.left)),n=Mi(...e.map(s=>s.top)),r=or(...e.map(s=>s.right)),o=or(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:o-n}}function _3(e){const t=e.slice().sort((o,s)=>o.y-s.y),n=[];let r=null;for(let o=0;o<t.length;o++){const s=t[o];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(o=>vc(GR(o)))}const D3=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:c}=t,{padding:d=2,x:f,y:p}=Qo(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),g=_3(m),x=vc(GR(m)),b=zx(d);function S(){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(ki(n)==="y"){const B=g[0],Z=g[g.length-1],K=Li(n)==="top",Y=B.top,H=Z.bottom,W=K?B.left:Z.left,M=K?B.right:Z.right,I=M-W,$=H-Y;return{top:Y,bottom:H,left:W,right:M,width:I,height:$,x:W,y:Y}}const C=Li(n)==="left",R=or(...g.map(B=>B.right)),E=Mi(...g.map(B=>B.left)),T=g.filter(B=>C?B.left===E:B.right===R),_=T[0].top,P=T[T.length-1].bottom,A=E,k=R,L=k-A,z=P-_;return{top:_,bottom:P,left:A,right:k,width:L,height:z,x:A,y:_}}return x}const j=await s.getElementRects({reference:{getBoundingClientRect:S},floating:r.floating,strategy:c});return o.reference.x!==j.reference.x||o.reference.y!==j.reference.y||o.reference.width!==j.reference.width||o.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}},WR=new Set(["left","top"]);async function A3(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Li(n),d=Pc(n),f=ki(n)==="y",p=WR.has(c)?-1:1,m=s&&f?-1:1,g=Qo(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof S=="number"&&(b=d==="end"?S*-1:S),f?{x:b*m,y:x*p}:{x:x*p,y:b*m}}const P3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:c,middlewareData:d}=t,f=await A3(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:{...f,placement:c}}}}},k3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:R,y:E}=C;return{x:R,y:E}}},...f}=Qo(e,t),p={x:n,y:r},m=await Ux(t,f),g=ki(Li(o)),x=Lx(g);let b=p[x],S=p[g];if(s){const C=x==="y"?"top":"left",R=x==="y"?"bottom":"right",E=b+m[C],T=b-m[R];b=zy(E,b,T)}if(c){const C=g==="y"?"top":"left",R=g==="y"?"bottom":"right",E=S+m[C],T=S-m[R];S=zy(E,S,T)}const j=d.fn({...t,[x]:b,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[x]:s,[g]:c}}}}}},N3=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=Qo(e,t),m={x:n,y:r},g=ki(o),x=Lx(g);let b=m[x],S=m[g];const j=Qo(d,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const T=x==="y"?"height":"width",_=s.reference[x]-s.floating[T]+C.mainAxis,P=s.reference[x]+s.reference[T]-C.mainAxis;b<_?b=_:b>P&&(b=P)}if(p){var R,E;const T=x==="y"?"width":"height",_=WR.has(Li(o)),P=s.reference[g]-s.floating[T]+(_&&((R=c.offset)==null?void 0:R[g])||0)+(_?0:C.crossAxis),A=s.reference[g]+s.reference[T]+(_?0:((E=c.offset)==null?void 0:E[g])||0)-(_?C.crossAxis:0);S<P?S=P:S>A&&(S=A)}return{[x]:b,[g]:S}}}},O3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:c,elements:d}=t,{apply:f=()=>{},...p}=Qo(e,t),m=await Ux(t,p),g=Li(o),x=Pc(o),b=ki(o)==="y",{width:S,height:j}=s.floating;let C,R;g==="top"||g==="bottom"?(C=g,R=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=g,C=x==="end"?"top":"bottom");const E=j-m.top-m.bottom,T=S-m.left-m.right,_=Mi(j-m[C],E),P=Mi(S-m[R],T),A=!t.middlewareData.shift;let k=_,L=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=E),A&&!x){const B=or(m.left,0),Z=or(m.right,0),K=or(m.top,0),Y=or(m.bottom,0);b?L=S-2*(B!==0||Z!==0?B+Z:or(m.left,m.right)):k=j-2*(K!==0||Y!==0?K+Y:or(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:k});const z=await c.getDimensions(d.floating);return S!==z.width||j!==z.height?{reset:{rects:!0}}:{}}}};function QR(e){const t=vi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qr(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r,d=Vh(n)!==s||Vh(r)!==c;return d&&(n=s,r=c),{width:n,height:r,$:d}}function Bx(e){return mn(e)?e:e.contextElement}function dc(e){const t=Bx(e);if(!Qr(t))return no(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=QR(t);let c=(s?Vh(n.width):n.width)/r,d=(s?Vh(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const M3=no(0);function YR(e){const t=Pr(e);return!Ep()||!t.visualViewport?M3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function L3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pr(e)?!1:t}function Fs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Bx(e);let c=no(1);t&&(r?mn(r)&&(c=dc(r)):c=dc(e));const d=L3(s,n,r)?YR(s):no(0);let f=(o.left+d.x)/c.x,p=(o.top+d.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(s){const x=Pr(s),b=r&&mn(r)?Pr(r):r;let S=x,j=Iy(S);for(;j&&r&&b!==S;){const C=dc(j),R=j.getBoundingClientRect(),E=vi(j),T=R.left+(j.clientLeft+parseFloat(E.paddingLeft))*C.x,_=R.top+(j.clientTop+parseFloat(E.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=T,p+=_,S=Pr(j),j=Iy(S)}}return vc({width:m,height:g,x:f,y:p})}function Rp(e,t){const n=Tp(e).scrollLeft;return t?t.left+n:Fs(ho(e)).left+n}function KR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Rp(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function I3(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",c=ho(r),d=t?Cp(t.floating):!1;if(r===c||d&&s)return n;let f={scrollLeft:0,scrollTop:0},p=no(1);const m=no(0),g=Qr(r);if((g||!g&&!s)&&((Ac(r)!=="body"||vd(c))&&(f=Tp(r)),Qr(r))){const b=Fs(r);p=dc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const x=c&&!g&&!s?KR(c,f):no(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 $3(e){return Array.from(e.getClientRects())}function z3(e){const t=ho(e),n=Tp(e),r=e.ownerDocument.body,o=or(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=or(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Rp(e);const d=-n.scrollTop;return vi(r).direction==="rtl"&&(c+=or(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:d}}const xC=25;function U3(e,t){const n=Pr(e),r=ho(e),o=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,d=0,f=0;if(o){s=o.width,c=o.height;const m=Ep();(!m||m&&t==="fixed")&&(d=o.offsetLeft,f=o.offsetTop)}const p=Rp(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,S=Math.abs(r.clientWidth-g.clientWidth-b);S<=xC&&(s-=S)}else p<=xC&&(s+=p);return{width:s,height:c,x:d,y:f}}const B3=new Set(["absolute","fixed"]);function V3(e,t){const n=Fs(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Qr(e)?dc(e):no(1),c=e.clientWidth*s.x,d=e.clientHeight*s.y,f=o*s.x,p=r*s.y;return{width:c,height:d,x:f,y:p}}function bC(e,t,n){let r;if(t==="viewport")r=U3(e,n);else if(t==="document")r=z3(ho(e));else if(mn(t))r=V3(t,n);else{const o=YR(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return vc(r)}function XR(e,t){const n=Wo(e);return n===t||!mn(n)||Ya(n)?!1:vi(n).position==="fixed"||XR(n,t)}function F3(e,t){const n=t.get(e);if(n)return n;let r=Ho(e,[],!1).filter(d=>mn(d)&&Ac(d)!=="body"),o=null;const s=vi(e).position==="fixed";let c=s?Wo(e):e;for(;mn(c)&&!Ya(c);){const d=vi(c),f=Mx(c);!f&&d.position==="fixed"&&(o=null),(s?!f&&!o:!f&&d.position==="static"&&!!o&&B3.has(o.position)||vd(c)&&!f&&XR(e,c))?r=r.filter(m=>m!==c):o=d,c=Wo(c)}return t.set(e,r),r}function q3(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?Cp(t)?[]:F3(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((p,m)=>{const g=bC(t,m,o);return p.top=or(g.top,p.top),p.right=Mi(g.right,p.right),p.bottom=Mi(g.bottom,p.bottom),p.left=or(g.left,p.left),p},bC(t,d,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function H3(e){const{width:t,height:n}=QR(e);return{width:t,height:n}}function G3(e,t,n){const r=Qr(t),o=ho(t),s=n==="fixed",c=Fs(e,!0,s,t);let d={scrollLeft:0,scrollTop:0};const f=no(0);function p(){f.x=Rp(o)}if(r||!r&&!s)if((Ac(t)!=="body"||vd(o))&&(d=Tp(t)),r){const b=Fs(t,!0,s,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else o&&p();s&&!r&&o&&p();const m=o&&!r&&!s?KR(o,d):no(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 vi(e).position==="static"}function SC(e,t){if(!Qr(e)||vi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ho(e)===n&&(n=n.ownerDocument.body),n}function ZR(e,t){const n=Pr(e);if(Cp(e))return n;if(!Qr(e)){let o=Wo(e);for(;o&&!Ya(o);){if(mn(o)&&!Wv(o))return o;o=Wo(o)}return n}let r=SC(e,t);for(;r&&e3(r)&&Wv(r);)r=SC(r,t);return r&&Ya(r)&&Wv(r)&&!Mx(r)?n:r||o3(e)||n}const W3=async function(e){const t=this.getOffsetParent||ZR,n=this.getDimensions,r=await n(e.floating);return{reference:G3(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Q3(e){return vi(e).direction==="rtl"}const Y3={convertOffsetParentRelativeRectToViewportRelativeRect:I3,getDocumentElement:ho,getClippingRect:q3,getOffsetParent:ZR,getElementRects:W3,getClientRects:$3,getDimensions:H3,getScale:dc,isElement:mn,isRTL:Q3};function JR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function K3(e,t){let n=null,r;const o=ho(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 S=uh(g),j=uh(o.clientWidth-(m+x)),C=uh(o.clientHeight-(g+b)),R=uh(m),T={rootMargin:-S+"px "+-j+"px "+-C+"px "+-R+"px",threshold:or(0,Mi(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&&!JR(p,e.getBoundingClientRect())&&c(),_=!1}try{n=new IntersectionObserver(P,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,T)}n.observe(e)}return c(!0),s}function X3(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Bx(e),m=o||s?[...p?Ho(p):[],...Ho(t)]:[];m.forEach(R=>{o&&R.addEventListener("scroll",n,{passive:!0}),s&&R.addEventListener("resize",n)});const g=p&&d?K3(p,n):null;let x=-1,b=null;c&&(b=new ResizeObserver(R=>{let[E]=R;E&&E.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let S,j=f?Fs(e):null;f&&C();function C(){const R=Fs(e);j&&!JR(j,R)&&n(),j=R,S=requestAnimationFrame(C)}return n(),()=>{var R;m.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),g?.(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const Z3=P3,J3=k3,e9=R3,t9=O3,wC=T3,n9=D3,r9=N3,i9=(e,t,n)=>{const r=new Map,o={platform:Y3,...n},s={...o.platform,_c:r};return E3(e,t,{...o,platform:s})};var o9=typeof document<"u",a9=function(){},Rh=o9?v.useLayoutEffect:a9;function qh(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,o;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(!qh(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!qh(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function e2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jC(e,t){const n=e2(e);return Math.round(t*n)/n}function Qv(e){const t=v.useRef(e);return Rh(()=>{t.current=e}),t}function s9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,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);qh(x,r)||b(r);const[S,j]=v.useState(null),[C,R]=v.useState(null),E=v.useCallback($=>{$!==A.current&&(A.current=$,j($))},[]),T=v.useCallback($=>{$!==k.current&&(k.current=$,R($))},[]),_=s||S,P=c||C,A=v.useRef(null),k=v.useRef(null),L=v.useRef(m),z=f!=null,B=Qv(f),Z=Qv(o),K=Qv(p),Y=v.useCallback(()=>{if(!A.current||!k.current)return;const $={placement:t,strategy:n,middleware:x};Z.current&&($.platform=Z.current),i9(A.current,k.current,$).then(q=>{const N={...q,isPositioned:K.current!==!1};H.current&&!qh(L.current,N)&&(L.current=N,Ox.flushSync(()=>{g(N)}))})},[x,t,n,Z,K]);Rh(()=>{p===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[p]);const H=v.useRef(!1);Rh(()=>(H.current=!0,()=>{H.current=!1}),[]),Rh(()=>{if(_&&(A.current=_),P&&(k.current=P),_&&P){if(B.current)return B.current(_,P,Y);Y()}},[_,P,Y,B,z]);const W=v.useMemo(()=>({reference:A,floating:k,setReference:E,setFloating:T}),[E,T]),M=v.useMemo(()=>({reference:_,floating:P}),[_,P]),I=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!M.floating)return $;const q=jC(M.floating,m.x),N=jC(M.floating,m.y);return d?{...$,transform:"translate("+q+"px, "+N+"px)",...e2(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:N}},[n,d,M.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:Y,refs:W,elements:M,floatingStyles:I}),[m,Y,W,M,I])}const l9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?wC({element:r.current,padding:o}).fn(n):{}:r?wC({element:r,padding:o}).fn(n):{}}}},t2=(e,t)=>({...Z3(e),options:[e,t]}),Vx=(e,t)=>({...J3(e),options:[e,t]}),CC=(e,t)=>({...r9(e),options:[e,t]}),Hh=(e,t)=>({...e9(e),options:[e,t]}),c9=(e,t)=>({...t9(e),options:[e,t]}),Ku=(e,t)=>({...n9(e),options:[e,t]}),n2=(e,t)=>({...l9(e),options:[e,t]});function u9(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 r2={...EO},d9=r2.useInsertionEffect,f9=d9||(e=>e());function qo(e){const t=v.useRef(()=>{});return f9(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var ro=typeof document<"u"?v.useLayoutEffect:v.useEffect;let EC=!1,h9=0;const TC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+h9++;function p9(){const[e,t]=v.useState(()=>EC?TC():void 0);return ro(()=>{e==null&&t(TC())},[]),v.useEffect(()=>{EC=!0},[]),e}const m9=r2.useId,i2=m9||p9;function g9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(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(o=>o!==n))||[])}}}const v9=v.createContext(null),y9=v.createContext(null),Fx=()=>{var e;return((e=v.useContext(v9))==null?void 0:e.id)||null},qx=()=>v.useContext(y9);function Hx(e){return"data-floating-ui-"+e}function Yv(e){const t=v.useRef(e);return ro(()=>{t.current=e}),t}const RC=Hx("safe-polygon");function _h(e,t,n){return n&&!$y(n)?0:typeof e=="number"?e:e?.[t]}function x9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,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=qx(),S=Fx(),j=Yv(p),C=Yv(f),R=Yv(n),E=v.useRef(),T=v.useRef(-1),_=v.useRef(),P=v.useRef(-1),A=v.useRef(!0),k=v.useRef(!1),L=v.useRef(()=>{}),z=v.useRef(!1),B=v.useCallback(()=>{var I;const $=(I=o.current.openEvent)==null?void 0:I.type;return $?.includes("mouse")&&$!=="mousedown"},[o]);v.useEffect(()=>{if(!d)return;function I($){let{open:q}=$;q||(clearTimeout(T.current),clearTimeout(P.current),A.current=!0,z.current=!1)}return s.on("openchange",I),()=>{s.off("openchange",I)}},[d,s]),v.useEffect(()=>{if(!d||!j.current||!n)return;function I(q){B()&&r(!1,q,"hover")}const $=Os(c.floating).documentElement;return $.addEventListener("mouseleave",I),()=>{$.removeEventListener("mouseleave",I)}},[c.floating,n,r,d,j,B]);const Z=v.useCallback(function(I,$,q){$===void 0&&($=!0),q===void 0&&(q="hover");const N=_h(C.current,"close",E.current);N&&!_.current?(clearTimeout(T.current),T.current=window.setTimeout(()=>r(!1,I,q),N)):$&&(clearTimeout(T.current),r(!1,I,q))},[C,r]),K=qo(()=>{L.current(),_.current=void 0}),Y=qo(()=>{if(k.current){const I=Os(c.floating).body;I.style.pointerEvents="",I.removeAttribute(RC),k.current=!1}}),H=qo(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);v.useEffect(()=>{if(!d)return;function I(F){if(clearTimeout(T.current),A.current=!1,m&&!$y(E.current)||g>0&&!_h(C.current,"open"))return;const J=_h(C.current,"open",E.current);J?T.current=window.setTimeout(()=>{R.current||r(!0,F,"hover")},J):n||r(!0,F,"hover")}function $(F){if(H())return;L.current();const J=Os(c.floating);if(clearTimeout(P.current),z.current=!1,j.current&&o.current.floatingContext){n||clearTimeout(T.current),_.current=j.current({...o.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){Y(),K(),H()||Z(F,!0,"safe-polygon")}});const je=_.current;J.addEventListener("mousemove",je),L.current=()=>{J.removeEventListener("mousemove",je)};return}(E.current==="touch"?!nd(c.floating,F.relatedTarget):!0)&&Z(F)}function q(F){H()||o.current.floatingContext&&(j.current==null||j.current({...o.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){Y(),K(),H()||Z(F)}})(F))}if(mn(c.domReference)){var N;const F=c.domReference;return n&&F.addEventListener("mouseleave",q),(N=c.floating)==null||N.addEventListener("mouseleave",q),x&&F.addEventListener("mousemove",I,{once:!0}),F.addEventListener("mouseenter",I),F.addEventListener("mouseleave",$),()=>{var J;n&&F.removeEventListener("mouseleave",q),(J=c.floating)==null||J.removeEventListener("mouseleave",q),x&&F.removeEventListener("mousemove",I),F.removeEventListener("mouseenter",I),F.removeEventListener("mouseleave",$)}}},[c,d,e,m,g,x,Z,K,Y,r,n,R,b,C,j,o,H]),ro(()=>{var I;if(d&&n&&(I=j.current)!=null&&I.__options.blockPointerEvents&&B()){k.current=!0;const q=c.floating;if(mn(c.domReference)&&q){var $;const N=Os(c.floating).body;N.setAttribute(RC,"");const F=c.domReference,J=b==null||($=b.nodesRef.current.find(ae=>ae.id===S))==null||($=$.context)==null?void 0:$.elements.floating;return J&&(J.style.pointerEvents=""),N.style.pointerEvents="none",F.style.pointerEvents="auto",q.style.pointerEvents="auto",()=>{N.style.pointerEvents="",F.style.pointerEvents="",q.style.pointerEvents=""}}}},[d,n,S,c,b,j,B]),ro(()=>{n||(E.current=void 0,z.current=!1,K(),Y())},[n,K,Y]),v.useEffect(()=>()=>{K(),clearTimeout(T.current),clearTimeout(P.current),Y()},[d,c.domReference,K,Y]);const W=v.useMemo(()=>{function I($){E.current=$.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove($){const{nativeEvent:q}=$;function N(){!A.current&&!R.current&&r(!0,q,"hover")}m&&!$y(E.current)||n||g===0||z.current&&$.movementX**2+$.movementY**2<2||(clearTimeout(P.current),E.current==="touch"?N():(z.current=!0,P.current=window.setTimeout(N,g)))}}},[m,r,n,R,g]),M=v.useMemo(()=>({onMouseEnter(){clearTimeout(T.current)},onMouseLeave(I){H()||Z(I.nativeEvent,!1)}}),[Z,H]);return v.useMemo(()=>d?{reference:W,floating:M}:{},[d,W,M])}const By=()=>{},o2=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:By,setState:By,isInstantPhase:!1}),b9=()=>v.useContext(o2);function S9(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,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 ro(()=>{o.currentId?c.current===null?c.current=o.currentId:o.isInstantPhase||s({isInstantPhase:!0}):(o.isInstantPhase&&s({isInstantPhase:!1}),c.current=null)},[o.currentId,o.isInstantPhase]),v.createElement(o2.Provider,{value:v.useMemo(()=>({...o,setState:s,setCurrentId:d}),[o,d])},t)}function w9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:s,enabled:c=!0}=t,d=s??o,f=b9(),{currentId:p,setCurrentId:m,initialDelay:g,setState:x,timeoutMs:b}=f;return ro(()=>{c&&p&&(x({delay:{open:1,close:_h(g,"close")}}),p!==d&&r(!1))},[c,d,r,x,p,g]),ro(()=>{function S(){r(!1),x({delay:g,currentId:null})}if(c&&p&&!n&&p===d){if(b){const j=window.setTimeout(S,b);return()=>{clearTimeout(j)}}S()}},[c,n,x,p,d,r,g,b]),ro(()=>{c&&(m===By||!n||m(d))},[c,n,m,d]),f}function Kv(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(c=>{var d;return o.parentId===c.id&&((d=o.context)==null?void 0:d.open)})}),n=n.concat(r);return n}const j9="data-floating-ui-focusable",C9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},E9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},_C=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 T9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,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:S}=t,j=qx(),C=qo(typeof f=="function"?f:()=>!1),R=typeof f=="function"?C:f,E=v.useRef(!1),T=v.useRef(!1),{escapeKey:_,outsidePress:P}=_C(b),{escapeKey:A,outsidePress:k}=_C(S),L=v.useRef(!1),z=qo(W=>{var M;if(!n||!c||!d||W.key!=="Escape"||L.current)return;const I=(M=s.current.floatingContext)==null?void 0:M.nodeId,$=j?Kv(j.nodesRef.current,I):[];if(!_&&(W.stopPropagation(),$.length>0)){let q=!0;if($.forEach(N=>{var F;if((F=N.context)!=null&&F.open&&!N.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}r(!1,d3(W)?W.nativeEvent:W,"escape-key")}),B=qo(W=>{var M;const I=()=>{var $;z(W),($=sc(W))==null||$.removeEventListener("keydown",I)};(M=sc(W))==null||M.addEventListener("keydown",I)}),Z=qo(W=>{var M;const I=E.current;E.current=!1;const $=T.current;if(T.current=!1,p==="click"&&$||I||typeof R=="function"&&!R(W))return;const q=sc(W),N="["+Hx("inert")+"]",F=Os(o.floating).querySelectorAll(N);let J=mn(q)?q:null;for(;J&&!Ya(J);){const we=Wo(J);if(Ya(we)||!mn(we))break;J=we}if(F.length&&mn(q)&&!f3(q)&&!nd(q,o.floating)&&Array.from(F).every(we=>!nd(J,we)))return;if(Qr(q)&&H){const we=q.clientWidth>0&&q.scrollWidth>q.clientWidth,Qe=q.clientHeight>0&&q.scrollHeight>q.clientHeight;let Ee=Qe&&W.offsetX>q.clientWidth;if(Qe&&vi(q).direction==="rtl"&&(Ee=W.offsetX<=q.offsetWidth-q.clientWidth),Ee||we&&W.offsetY>q.clientHeight)return}const ae=(M=s.current.floatingContext)==null?void 0:M.nodeId,je=j&&Kv(j.nodesRef.current,ae).some(we=>{var Qe;return Gv(W,(Qe=we.context)==null?void 0:Qe.elements.floating)});if(Gv(W,o.floating)||Gv(W,o.domReference)||je)return;const xe=j?Kv(j.nodesRef.current,ae):[];if(xe.length>0){let we=!0;if(xe.forEach(Qe=>{var Ee;if((Ee=Qe.context)!=null&&Ee.open&&!Qe.context.dataRef.current.__outsidePressBubbles){we=!1;return}}),!we)return}r(!1,W,"outside-press")}),K=qo(W=>{var M;const I=()=>{var $;Z(W),($=sc(W))==null||$.removeEventListener(p,I)};(M=sc(W))==null||M.addEventListener(p,I)});v.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=_,s.current.__outsidePressBubbles=P;let W=-1;function M(F){r(!1,F,"ancestor-scroll")}function I(){window.clearTimeout(W),L.current=!0}function $(){W=window.setTimeout(()=>{L.current=!1},Ep()?5:0)}const q=Os(o.floating);d&&(q.addEventListener("keydown",A?B:z,A),q.addEventListener("compositionstart",I),q.addEventListener("compositionend",$)),R&&q.addEventListener(p,k?K:Z,k);let N=[];return x&&(mn(o.domReference)&&(N=Ho(o.domReference)),mn(o.floating)&&(N=N.concat(Ho(o.floating))),!mn(o.reference)&&o.reference&&o.reference.contextElement&&(N=N.concat(Ho(o.reference.contextElement)))),N=N.filter(F=>{var J;return F!==((J=q.defaultView)==null?void 0:J.visualViewport)}),N.forEach(F=>{F.addEventListener("scroll",M,{passive:!0})}),()=>{d&&(q.removeEventListener("keydown",A?B:z,A),q.removeEventListener("compositionstart",I),q.removeEventListener("compositionend",$)),R&&q.removeEventListener(p,k?K:Z,k),N.forEach(F=>{F.removeEventListener("scroll",M)}),window.clearTimeout(W)}},[s,o,d,R,p,n,r,x,c,_,P,z,A,B,Z,k,K]),v.useEffect(()=>{E.current=!1},[R,p]);const Y=v.useMemo(()=>({onKeyDown:z,[C9[g]]:W=>{m&&r(!1,W.nativeEvent,"reference-press")}}),[z,r,m,g]),H=v.useMemo(()=>({onKeyDown:z,onMouseDown(){T.current=!0},onMouseUp(){T.current=!0},[E9[p]]:()=>{E.current=!0}}),[z,p]);return v.useMemo(()=>c?{reference:Y,floating:H}:{},[c,Y,H])}function R9(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=i2(),s=v.useRef({}),[c]=v.useState(()=>g9()),d=Fx()!=null,[f,p]=v.useState(r.reference),m=qo((b,S,j)=>{s.current.openEvent=b?S:void 0,c.emit("openchange",{open:b,event:S,reason:j,nested:d}),n?.(b,S,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:o,refs:g}),[t,m,x,c,o,g])}function Gx(e){e===void 0&&(e={});const{nodeId:t}=e,n=R9({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,c]=v.useState(null),[d,f]=v.useState(null),m=o?.domReference||s,g=v.useRef(null),x=qx();ro(()=>{m&&(g.current=m)},[m]);const b=s9({...e,elements:{...o,...d&&{reference:d}}}),S=v.useCallback(T=>{const _=mn(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;f(_),b.refs.setReference(_)},[b.refs]),j=v.useCallback(T=>{(mn(T)||T===null)&&(g.current=T,c(T)),(mn(b.refs.reference.current)||b.refs.reference.current===null||T!==null&&!mn(T))&&b.refs.setReference(T)},[b.refs]),C=v.useMemo(()=>({...b.refs,setReference:j,setPositionReference:S,domReference:g}),[b.refs,j,S]),R=v.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),E=v.useMemo(()=>({...b,...r,refs:C,elements:R,nodeId:t}),[b,C,R,t,r]);return ro(()=>{r.dataRef.current.floatingContext=E;const T=x?.nodesRef.current.find(_=>_.id===t);T&&(T.context=E)}),v.useMemo(()=>({...b,context:E,refs:C,elements:R}),[b,C,R,E])}function _9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,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=Pr(c.domReference);function S(){!n&&Qr(c.domReference)&&c.domReference===pC(Os(c.domReference))&&(p.current=!0)}function j(){g.current=!0}return b.addEventListener("blur",S),b.addEventListener("keydown",j,!0),()=>{b.removeEventListener("blur",S),b.removeEventListener("keydown",j,!0)}},[c.domReference,n,d]),v.useEffect(()=>{if(!d)return;function b(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return o.on("openchange",b),()=>{o.off("openchange",b)}},[o,d]),v.useEffect(()=>()=>{clearTimeout(m.current)},[]);const x=v.useMemo(()=>({onPointerDown(b){s3(b.nativeEvent)||(g.current=!1)},onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const S=sc(b.nativeEvent);if(f&&mn(S))try{if(l3()&&c3())throw Error();if(!S.matches(":focus-visible"))return}catch{if(!g.current&&!p3(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const S=b.relatedTarget,j=b.nativeEvent,C=mn(S)&&S.hasAttribute(Hx("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var R;const E=pC(c.domReference?c.domReference.ownerDocument:document);!S&&E===c.domReference||nd((R=s.current.floatingContext)==null?void 0:R.refs.floating.current,E)||nd(c.domReference,E)||C||r(!1,j,"focus")})}}),[s,c.domReference,r,f]);return v.useMemo(()=>d?{reference:x}:{},[d,x])}const DC="active",AC="selected";function Xv(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[DC]:c,[AC]:d,...f}=e;s=f}return{...n==="floating"&&{tabIndex:-1,[j9]:""},...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(!(o&&[DC,AC].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,S=new Array(b),j=0;j<b;j++)S[j]=arguments[j];return(x=r.get(p))==null?void 0:x.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function D9(e){e===void 0&&(e=[]);const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),r=e.map(d=>d?.item),o=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:o,getFloatingProps:s,getItemProps:c}),[o,s,c])}const A9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function P9(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:c="dialog"}=t,d=(n=A9.get(c))!=null?n:c,f=i2(),m=Fx()!=null,g=v.useMemo(()=>d==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":r?o: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,o,m,r,f,c]),x=v.useMemo(()=>{const S={id:o,...d&&{role:d}};return d==="tooltip"||c==="label"?S:{...S,...d==="menu"&&{"aria-labelledby":f}}},[d,o,f,c]),b=v.useCallback(S=>{let{active:j,selected:C}=S;const R={role:"option",...j&&{id:o+"-option"}};switch(c){case"select":return{...R,"aria-selected":j&&C};case"combobox":return{...R,...j&&{"aria-selected":!0}}}return{}},[o,c]);return v.useMemo(()=>s?{reference:g,floating:x,item:b}:{},[s,g,x,b])}const[k9,bi]=xr("ScrollArea.Root component was not found in tree");function yc(e,t){const n=Ps(t);Dc(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const N9=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=bi(),[s,c]=v.useState(0),[d,f]=v.useState(0),p=!!(s&&d);return yc(o.scrollbarX,()=>{const m=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(m),f(m)}),yc(o.scrollbarY,()=>{const m=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(m),c(m)}),p?a.jsx("div",{...r,ref:t,style:{...n,width:s,height:d}}):null}),O9=v.forwardRef((e,t)=>{const n=bi(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(N9,{...e,ref:t}):null}),M9={scrollHideDelay:1e3,type:"hover"},a2=v.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",M9,e),{type:r,scrollHideDelay:o,scrollbars:s,...c}=n,[d,f]=v.useState(null),[p,m]=v.useState(null),[g,x]=v.useState(null),[b,S]=v.useState(null),[j,C]=v.useState(null),[R,E]=v.useState(0),[T,_]=v.useState(0),[P,A]=v.useState(!1),[k,L]=v.useState(!1),z=Vn(t,B=>f(B));return a.jsx(k9,{value:{type:r,scrollHideDelay:o,scrollArea:d,viewport:p,onViewportChange:m,content:g,onContentChange:x,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:P,onScrollbarXEnabledChange:A,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:k,onScrollbarYEnabledChange:L,onCornerWidthChange:E,onCornerHeightChange:_},children:a.jsx(ce,{...c,ref:z,__vars:{"--sa-corner-width":s!=="xy"?"0px":`${R}px`,"--sa-corner-height":s!=="xy"?"0px":`${T}px`}})})});a2.displayName="@mantine/core/ScrollAreaRoot";function s2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function _p(e){const t=s2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function l2(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 L9(e,[t,n]){return Math.min(n,Math.max(t,e))}function PC(e,t,n="ltr"){const r=_p(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,c=t.content-t.viewport,d=s-r,f=n==="ltr"?[0,c]:[c*-1,0],p=L9(e,f);return l2([0,c],[0,d])(p)}function I9(e,t,n,r="ltr"){const o=_p(n),s=o/2,c=t||s,d=o-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 l2([f,p],g)(e)}function c2(e,t){return e>0&&e<t}function Ga(e){return e?parseInt(e,10):0}function Bs(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[$9,u2]=xr("ScrollAreaScrollbar was not found in tree"),d2=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,x=bi(),[b,S]=v.useState(null),j=Vn(t,L=>S(L)),C=v.useRef(null),R=v.useRef(""),{viewport:E}=x,T=n.content-n.viewport,_=Ps(p),P=Ps(d),A=xp(m,10),k=L=>{if(C.current){const z=L.clientX-C.current.left,B=L.clientY-C.current.top;f({x:z,y:B})}};return v.useEffect(()=>{const L=z=>{const B=z.target;b?.contains(B)&&_(z,T)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[E,b,T,_]),v.useEffect(P,[n,P]),yc(b,A),yc(x.content,A),a.jsx($9,{value:{scrollbar:b,hasThumb:r,onThumbChange:Ps(o),onThumbPointerUp:Ps(s),onThumbPositionChange:P,onThumbPointerDown:Ps(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:Bs(e.onPointerDown,L=>{L.preventDefault(),L.button===0&&(L.target.setPointerCapture(L.pointerId),C.current=b.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",k(L))}),onPointerMove:Bs(e.onPointerMove,k),onPointerUp:Bs(e.onPointerUp,L=>{const z=L.target;z.hasPointerCapture(L.pointerId)&&(L.preventDefault(),z.releasePointerCapture(L.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=R.current,C.current=null}})})}),f2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=bi(),[d,f]=v.useState(),p=v.useRef(null),m=Vn(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),a.jsx(d2,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{...o,"--sa-thumb-width":`${_p(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),c2(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:Ga(d.paddingLeft),paddingEnd:Ga(d.paddingRight)}})}})});f2.displayName="@mantine/core/ScrollAreaScrollbarX";const h2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=bi(),[d,f]=v.useState(),p=v.useRef(null),m=Vn(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),a.jsx(d2,{...s,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${_p(n)}px`,...o},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),c2(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:Ga(d.paddingTop),paddingEnd:Ga(d.paddingBottom)}})}})});h2.displayName="@mantine/core/ScrollAreaScrollbarY";const Dp=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=rl(),s=bi(),c=v.useRef(null),d=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=s2(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,S)=>I9(b,d.current,f,S);return n==="horizontal"?a.jsx(f2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollLeft,S=PC(b,f,o);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollLeft=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollLeft=x(b,o))}}):n==="vertical"?a.jsx(h2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollTop,S=PC(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, ${S}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=x(b))}}):null});Dp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Wx=v.forwardRef((e,t)=>{const n=bi(),{forceMount:r,...o}=e,[s,c]=v.useState(!1),d=e.orientation==="horizontal",f=xp(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?p:m)}},10);return yc(n.viewport,f),yc(n.content,f),r||s?a.jsx(Dp,{"data-state":s?"visible":"hidden",...o,ref:t}):null});Wx.displayName="@mantine/core/ScrollAreaScrollbarAuto";const p2=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=bi(),[s,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:d}=o;let f=0;if(d){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return d.addEventListener("pointerenter",p),d.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),d.removeEventListener("pointerenter",p),d.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),n||s?a.jsx(Wx,{"data-state":s?"visible":"hidden",...r,ref:t}):null});p2.displayName="@mantine/core/ScrollAreaScrollbarHover";const z9=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=bi(),s=e.orientation==="horizontal",[c,d]=v.useState("hidden"),f=xp(()=>d("idle"),100);return v.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>d("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay]),v.useEffect(()=>{const{viewport:p}=o,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)}},[o.viewport,s,f]),n||c!=="hidden"?a.jsx(Dp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Bs(e.onPointerEnter,()=>d("interacting")),onPointerLeave:Bs(e.onPointerLeave,()=>d("idle"))}):null}),Vy=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=bi(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,d=e.orientation==="horizontal";return v.useEffect(()=>(d?s(!0):c(!0),()=>{d?s(!1):c(!1)}),[d,s,c]),o.type==="hover"?a.jsx(p2,{...r,ref:t,forceMount:n}):o.type==="scroll"?a.jsx(z9,{...r,ref:t,forceMount:n}):o.type==="auto"?a.jsx(Wx,{...r,ref:t,forceMount:n}):o.type==="always"?a.jsx(Dp,{...r,ref:t}):null});Vy.displayName="@mantine/core/ScrollAreaScrollbar";function U9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){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(o)})(),()=>window.cancelAnimationFrame(r)}const m2=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=bi(),s=u2(),{onThumbPositionChange:c}=s,d=Vn(t,m=>s.onThumbChange(m)),f=v.useRef(void 0),p=xp(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=o;if(m){const g=()=>{if(p(),!f.current){const x=U9(m,c);f.current=x,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[o.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:Bs(e.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),b=m.clientX-x.left,S=m.clientY-x.top;s.onThumbPointerDown({x:b,y:S})}),onPointerUp:Bs(e.onPointerUp,s.onThumbPointerUp)})});m2.displayName="@mantine/core/ScrollAreaThumb";const Fy=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=u2();return n||o.hasThumb?a.jsx(m2,{ref:t,...r}):null});Fy.displayName="@mantine/core/ScrollAreaThumb";const g2=v.forwardRef(({children:e,style:t,...n},r)=>{const o=bi(),s=Vn(r,o.onViewportChange);return a.jsx(ce,{...n,ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:a.jsx("div",{style:{minWidth:"100%"},ref:o.onContentChange,children:e})})});g2.displayName="@mantine/core/ScrollAreaViewport";var Qx={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const v2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},B9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Zr=ye((e,t)=>{const n=se("ScrollArea",v2,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:x,viewportRef:b,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:R,onBottomReached:E,onTopReached:T,overscrollBehavior:_,...P}=n,[A,k]=v.useState(!1),[L,z]=v.useState(!1),[B,Z]=v.useState(!1),K=Le({name:"ScrollArea",props:n,classes:Qx,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:B9}),Y=v.useRef(null),H=u9([b,Y]);return v.useEffect(()=>{if(!Y.current||C!=="present")return;const W=Y.current,M=new ResizeObserver(()=>{const{scrollHeight:I,clientHeight:$,scrollWidth:q,clientWidth:N}=W;z(I>$),Z(q>N)});return M.observe(W),()=>M.disconnect()},[Y,C]),a.jsxs(a2,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:R,...K("root"),...P,children:[a.jsx(g2,{...x,...K("viewport",{style:x?.style}),ref:H,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":R||void 0,"data-horizontal-hidden":C==="present"&&!B?"true":void 0,"data-vertical-hidden":C==="present"&&!L?"true":void 0,onScroll:W=>{x?.onScroll?.(W),S?.({x:W.currentTarget.scrollLeft,y:W.currentTarget.scrollTop});const{scrollTop:M,scrollHeight:I,clientHeight:$}=W.currentTarget;M-(I-$)>=-.6&&E?.(),M===0&&T?.()},children:j}),(R==="xy"||R==="x")&&a.jsx(Vy,{...K("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!B?!0:void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:a.jsx(Fy,{...K("thumb")})}),(R==="xy"||R==="y")&&a.jsx(Vy,{...K("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:a.jsx(Fy,{...K("thumb")})}),a.jsx(O9,{...K("corner"),"data-hovered":A||void 0,"data-hidden":m==="never"||void 0})]})});Zr.displayName="@mantine/core/ScrollArea";const Ap=ye((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:s,scrollHideDelay:c,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:S,scrollbars:j,style:C,vars:R,onBottomReached:E,onTopReached:T,..._}=se("ScrollAreaAutosize",v2,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(Zr,{classNames:r,styles:o,scrollHideDelay:c,scrollbarSize:s,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:S,vars:R,scrollbars:j,onBottomReached:E,onTopReached:T,children:n})})})});Zr.classes=Qx;Ap.displayName="@mantine/core/ScrollAreaAutosize";Ap.classes=Qx;Zr.Autosize=Ap;var y2={root:"m_87cf2631"};const V9={__staticSelector:"UnstyledButton"},er=cr((e,t)=>{const n=se("UnstyledButton",V9,e),{className:r,component:o="button",__staticSelector:s,unstyled:c,classNames:d,styles:f,style:p,...m}=n,g=Le({name:s,props:n,classes:y2,className:r,style:p,classNames:d,styles:f,unstyled:c});return a.jsx(ce,{...g("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...m})});er.classes=y2;er.displayName="@mantine/core/UnstyledButton";var x2={root:"m_515a97f8"};const F9={},Yx=ye((e,t)=>{const n=se("VisuallyHidden",F9,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,...p}=n,m=Le({name:"VisuallyHidden",classes:x2,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d});return a.jsx(ce,{component:"span",ref:t,...m("root"),...p})});Yx.classes=x2;Yx.displayName="@mantine/core/VisuallyHidden";var b2={root:"m_1b7284a3"};const q9={},H9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ut(t),"--paper-shadow":Tx(n)}}),yr=cr((e,t)=>{const n=se("Paper",q9,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,withBorder:f,vars:p,radius:m,shadow:g,variant:x,mod:b,...S}=n,j=Le({name:"Paper",props:n,classes:b2,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:H9});return a.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:x,...S})});yr.classes=b2;yr.displayName="@mantine/core/Paper";function S2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}function kC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function NC(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const G9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function W9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:c,dir:d}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[G9[f]]:r},g=-t/2;return f==="left"?{...m,...kC(p,c,n,o),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...kC(p,c,n,o),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...NC(p,s,n,o,d),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...NC(p,s,n,o,d),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Kx=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:s,arrowX:c,arrowY:d,style:f,...p},m)=>{const{dir:g}=rl();return s?a.jsx("div",{...p,ref:m,style:{...f,...W9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:g,arrowX:c,arrowY:d})}}):null});Kx.displayName="@mantine/core/FloatingArrow";var w2={root:"m_9814e45f"};const Q9={zIndex:Xr("modal")},Y9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&di(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${le(o)})`:void 0,"--overlay-radius":s===void 0?void 0:Ut(s),"--overlay-z-index":c?.toString()}}),xc=cr((e,t)=>{const n=se("Overlay",Q9,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,fixed:p,center:m,children:g,radius:x,zIndex:b,gradient:S,blur:j,color:C,backgroundOpacity:R,mod:E,...T}=n,_=Le({name:"Overlay",props:n,classes:w2,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Y9});return a.jsx(ce,{ref:t,..._("root"),mod:[{center:m,fixed:p},E],...T,children:g})});xc.classes=w2;xc.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 K9({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 o=Zv(n);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return Zv(n)}const X9={},j2=ye((e,t)=>{const{children:n,target:r,reuseTargetNode:o,...s}=se("Portal",X9,e),[c,d]=v.useState(!1),f=v.useRef(null);return Dc(()=>(d(!0),f.current=K9({target:r,reuseTargetNode:o,...s}),ed(t,f.current),!r&&!o&&f.current&&document.body.appendChild(f.current),()=>{!r&&!o&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:Ox.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});j2.displayName="@mantine/core/Portal";const ts=ye(({withinPortal:e=!0,children:t,...n},r)=>AR()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(j2,{ref:r,...n,children:t}));ts.displayName="@mantine/core/OptionalPortal";const Uu=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),dh={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:{...Uu("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Uu("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Uu("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Uu("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Uu("top"),common:{transformOrigin:"top right"}}},OC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function Z9({transition:e,state:t,duration:n,timingFunction:r}){const o={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in dh?{transitionProperty:dh[e].transitionProperty,...o,...dh[e].common,...dh[e][OC[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[OC[t]]}}function J9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:c,onExited:d,enterDelay:f,exitDelay:p}){const m=Sn(),g=_x(),x=m.respectReducedMotion?g:!1,[b,S]=v.useState(x?0:e),[j,C]=v.useState(r?"entered":"exited"),R=v.useRef(-1),E=v.useRef(-1),T=v.useRef(-1);function _(){window.clearTimeout(R.current),window.clearTimeout(E.current),cancelAnimationFrame(T.current)}const P=k=>{_();const L=k?o:s,z=k?c:d,B=x?0:k?e:t;S(B),B===0?(typeof L=="function"&&L(),typeof z=="function"&&z(),C(k?"entered":"exited")):T.current=requestAnimationFrame(()=>{Wu.flushSync(()=>{C(k?"pre-entering":"pre-exiting")}),T.current=requestAnimationFrame(()=>{typeof L=="function"&&L(),C(k?"entering":"exiting"),R.current=window.setTimeout(()=>{typeof z=="function"&&z(),C(k?"entered":"exited")},B)})})},A=k=>{if(_(),typeof(k?f:p)!="number"){P(k);return}E.current=window.setTimeout(()=>{P(k)},k?f:p)};return Go(()=>{A(r)},[r]),v.useEffect(()=>()=>{_()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function po({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:c="ease",onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:x}){const b=AR(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=J9({mounted:o,exitDuration:r,duration:n,timingFunction:c,onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:x});return S===0||b==="test"?o?a.jsx(a.Fragment,{children:s({})}):e?s({display:"none"}):null:j==="exited"?e?s({display:"none"}):null:a.jsx(a.Fragment,{children:s(Z9({transition:t,duration:S,state:j,timingFunction:C}))})}po.displayName="@mantine/core/Transition";const[e5,C2]=xr("Popover component was not found in the tree");function Pp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=T4(t),s=Vn(o,r);return Jo(e)?v.cloneElement(e,{[n]:s}):e}function E2(e){return a.jsx(Yx,{tabIndex:-1,"data-autofocus":!0,...e})}Pp.displayName="@mantine/core/FocusTrap";E2.displayName="@mantine/core/FocusTrapInitialFocus";Pp.InitialFocus=E2;var T2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const t5={},Xx=ye((e,t)=>{const n=se("PopoverDropdown",t5,e),{className:r,style:o,vars:s,children:c,onKeyDownCapture:d,variant:f,classNames:p,styles:m,...g}=n,x=C2(),b=jR({opened:x.opened,shouldReturnFocus:x.returnFocus}),S=x.withRoles?{"aria-labelledby":x.getTargetId(),id:x.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=Vn(t,x.floating);return x.disabled?null:a.jsx(ts,{...x.portalProps,withinPortal:x.withinPortal,children:a.jsx(po,{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(Pp,{active:x.trapFocus&&x.opened,innerRef:j,children:a.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:h4(()=>{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,o]}),children:[c,a.jsx(Kx,{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})})]})})})})});Xx.classes=T2;Xx.displayName="@mantine/core/PopoverDropdown";const n5={refProp:"ref",popupType:"dialog"},R2=ye((e,t)=>{const{children:n,refProp:r,popupType:o,...s}=se("PopoverTarget",n5,e);if(!Jo(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=C2(),f=Vn(d.reference,bp(n),t),p=d.withRoles?{"aria-haspopup":o,"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}})});R2.displayName="@mantine/core/PopoverTarget";function _2({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=v.useState(0);v.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return X3(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Go(()=>{t.update()},r),Go(()=>{s(c=>c+1)},[e])}function r5(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 i5(e,t){const n=r5(e.middlewares),r=[t2(e.offset)];return n.shift&&r.push(Vx(typeof n.shift=="boolean"?{limiter:CC(),padding:5}:{limiter:CC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Hh():Hh(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Ku():Ku(n.inline)),r.push(n2({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(c9({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,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:o,availableWidth:s,availableHeight:c,...d}):Object.assign(p,{maxWidth:`${s}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(p,{width:`${o.reference.width}px`})}})),r}function o5(e){const[t,n]=Yn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=v.useRef(t),o=()=>{t&&!e.disabled&&n(!1)},s=()=>!e.disabled&&n(!t),c=Gx({strategy:e.strategy,placement:e.position,middleware:i5(e,()=>c)});return _2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),Go(()=>{e.onPositionChange?.(c.placement)},[c.placement]),Go(()=>{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:o,onToggle:s}}const a5={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:Xr("popover"),__staticSelector:"Popover",width:"max-content"},s5=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ut(t),"--popover-shadow":Tx(n)}});function zi(e){const t=se("Popover",a5,e),{children:n,position:r,offset:o,onPositionChange:s,positionDependencies:c,opened:d,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:x,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,unstyled:E,classNames:T,styles:_,closeOnClickOutside:P,withinPortal:A,portalProps:k,closeOnEscape:L,clickOutsideEvents:z,trapFocus:B,onClose:Z,onDismiss:K,onOpen:Y,onChange:H,zIndex:W,radius:M,shadow:I,id:$,defaultOpened:q,__staticSelector:N,withRoles:F,disabled:J,returnFocus:ae,variant:je,keepMounted:xe,vars:we,floatingStrategy:Qe,withOverlay:Ee,overlayProps:ot,...nt}=t,Ct=Le({name:N,props:t,classes:T2,classNames:T,styles:_,unstyled:E,rootSelector:"dropdown",vars:we,varsResolver:s5}),{resolvedStyles:Mt}=el({classNames:T,styles:_,props:t}),Lt=v.useRef(null),[pt,Rt]=v.useState(null),[tn,Re]=v.useState(null),{dir:Pe}=rl(),Xe=br($),Ae=o5({middlewares:x,width:g,position:S2(Pe,r),offset:typeof o=="number"?o+(b?S/2:0):o,arrowRef:Lt,arrowOffset:j,onPositionChange:s,positionDependencies:c,opened:d,defaultOpened:q,onChange:H,onOpen:Y,onClose:Z,onDismiss:K,strategy:Qe,disabled:J});v4(()=>{P&&(Ae.onClose(),K?.())},z,[pt,tn]);const pe=v.useCallback(Me=>{Rt(Me),Ae.floating.refs.setReference(Me)},[Ae.floating.refs.setReference]),Se=v.useCallback(Me=>{Re(Me),Ae.floating.refs.setFloating(Me)},[Ae.floating.refs.setFloating]),ze=v.useCallback(()=>{f?.onExited?.(),p?.()},[f?.onExited,p]),be=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(e5,{value:{returnFocus:ae,disabled:J,controlled:Ae.controlled,reference:pe,floating:Se,x:Ae.floating.x,y:Ae.floating.y,arrowX:Ae.floating?.middlewareData?.arrow?.x,arrowY:Ae.floating?.middlewareData?.arrow?.y,opened:Ae.opened,arrowRef:Lt,transitionProps:{...f,onExited:ze,onEntered:be},width:g,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,placement:Ae.floating.placement,trapFocus:B,withinPortal:A,portalProps:k,zIndex:W,radius:M,shadow:I,closeOnEscape:L,onDismiss:K,onClose:Ae.onClose,onToggle:Ae.onToggle,getTargetId:()=>`${Xe}-target`,getDropdownId:()=>`${Xe}-dropdown`,withRoles:F,targetProps:nt,__staticSelector:N,classNames:T,styles:_,unstyled:E,variant:je,keepMounted:xe,getStyles:Ct,resolvedStyles:Mt,floatingStrategy:Qe},children:[n,Ee&&a.jsx(po,{transition:"fade",mounted:Ae.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:Me=>a.jsx(ts,{withinPortal:A,children:a.jsx(xc,{...ot,...Ct("overlay",{className:ot?.className,style:[Me,ot?.style]})})})})]})}zi.Target=R2;zi.Dropdown=Xx;zi.displayName="@mantine/core/Popover";zi.extend=e=>e;var Ni={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 D2=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:It(Ni.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Ni.bar}),a.jsx("span",{className:Ni.bar}),a.jsx("span",{className:Ni.bar})]}));D2.displayName="@mantine/core/Bars";const A2=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:It(Ni.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Ni.dot}),a.jsx("span",{className:Ni.dot}),a.jsx("span",{className:Ni.dot})]}));A2.displayName="@mantine/core/Dots";const P2=v.forwardRef(({className:e,...t},n)=>a.jsx(ce,{component:"span",className:It(Ni.ovalLoader,e),...t,ref:n}));P2.displayName="@mantine/core/Oval";const k2={bars:D2,oval:P2,dots:A2},l5={loaders:k2,type:"oval"},c5=(e,{size:t,color:n})=>({root:{"--loader-size":rt(t,"loader-size"),"--loader-color":n?Ft(n,e):void 0}}),Nr=ye((e,t)=>{const n=se("Loader",l5,e),{size:r,color:o,type:s,vars:c,className:d,style:f,classNames:p,styles:m,unstyled:g,loaders:x,variant:b,children:S,...j}=n,C=Le({name:"Loader",props:n,classes:Ni,className:d,style:f,classNames:p,styles:m,unstyled:g,vars:c,varsResolver:c5});return S?a.jsx(ce,{...C("root"),ref:t,...j,children:S}):a.jsx(ce,{...C("root"),ref:t,component:x[s],variant:b,size:r,...j})});Nr.defaultLoaders=k2;Nr.classes=Ni;Nr.displayName="@mantine/core/Loader";var kc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const MC={orientation:"horizontal"},u5=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Zx=ye((e,t)=>{const n=se("ActionIconGroup",MC,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:x,...b}=se("ActionIconGroup",MC,e),S=Le({name:"ActionIconGroup",props:n,classes:kc,className:r,style:o,classNames:s,styles:c,unstyled:d,vars:p,varsResolver:u5,rootSelector:"group"});return a.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},x],role:"group",...b})});Zx.classes=kc;Zx.displayName="@mantine/core/ActionIconGroup";const LC={},d5=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":rt(c,"section-height"),"--section-padding-x":rt(c,"section-padding-x"),"--section-fz":On(c),"--section-radius":t===void 0?void 0:Ut(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},Jx=ye((e,t)=>{const n=se("ActionIconGroupSection",LC,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:x,...b}=se("ActionIconGroupSection",LC,e),S=Le({name:"ActionIconGroupSection",props:n,classes:kc,className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,varsResolver:d5,rootSelector:"groupSection"});return a.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});Jx.classes=kc;Jx.displayName="@mantine/core/ActionIconGroupSection";const f5={},h5=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":rt(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=cr((e,t)=>{const n=se("ActionIcon",f5,e),{className:r,unstyled:o,variant:s,classNames:c,styles:d,style:f,loading:p,loaderProps:m,size:g,color:x,radius:b,__staticSelector:S,gradient:j,vars:C,children:R,disabled:E,"data-disabled":T,autoContrast:_,mod:P,...A}=n,k=Le({name:["ActionIcon",S],props:n,className:r,style:f,classes:kc,classNames:c,styles:d,unstyled:o,vars:C,varsResolver:h5});return a.jsxs(er,{...k("root",{active:!E&&!p&&!T}),...A,unstyled:o,variant:s,size:g,disabled:E||p,ref:t,mod:[{loading:p,disabled:E||T},P],children:[a.jsx(po,{mounted:!!p,transition:"slide-down",duration:150,children:L=>a.jsx(ce,{component:"span",...k("loader",{style:L}),"aria-hidden":!0,children:a.jsx(Nr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(ce,{component:"span",mod:{loading:p},...k("icon"),children:R})]})});bn.classes=kc;bn.displayName="@mantine/core/ActionIcon";bn.Group=Zx;bn.GroupSection=Jx;const N2=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"})}));N2.displayName="@mantine/core/CloseIcon";var O2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const p5={variant:"subtle"},m5=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":rt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ut(n),"--cb-icon-size":le(r)}}),ns=cr((e,t)=>{const n=se("CloseButton",p5,e),{iconSize:r,children:o,vars:s,radius:c,className:d,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":x,disabled:b,variant:S,icon:j,mod:C,__staticSelector:R,...E}=n,T=Le({name:R||"CloseButton",props:n,className:d,style:p,classes:O2,classNames:f,styles:m,unstyled:g,vars:s,varsResolver:m5});return a.jsxs(er,{ref:t,...E,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||x},C],...T("root",{variant:S,active:!b&&!x}),children:[j||a.jsx(N2,{}),o]})});ns.classes=O2;ns.displayName="@mantine/core/CloseButton";function g5(e){return v.Children.toArray(e).filter(Boolean)}var M2={root:"m_4081bf90"};const v5={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},y5=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:s,wrap:c},{childWidth:d})=>({root:{"--group-child-width":t&&n?d:void 0,"--group-gap":Nn(r),"--group-align":o,"--group-justify":s,"--group-wrap":c}}),ge=ye((e,t)=>{const n=se("Group",v5,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,children:f,gap:p,align:m,justify:g,wrap:x,grow:b,preventGrowOverflow:S,vars:j,variant:C,__size:R,mod:E,...T}=n,_=g5(f),P=_.length,A=Nn(p??"md"),L={childWidth:`calc(${100/P}% - (${A} - ${A} / ${P}))`},z=Le({name:"Group",props:n,stylesCtx:L,className:o,style:s,classes:M2,classNames:r,styles:c,unstyled:d,vars:j,varsResolver:y5});return a.jsx(ce,{...z("root"),ref:t,variant:C,mod:[{grow:b},E],size:R,...T,children:_})});ge.classes=M2;ge.displayName="@mantine/core/Group";const[x5,ia]=xr("ModalBase component was not found in tree");function b5({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),o=v.useRef(-1),c=_x()?0:t;return v.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):c===0?r(!1):o.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(o.current)),[e,c]),n}function S5({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:s,returnFocus:c}){const d=br(e),[f,p]=v.useState(!1),[m,g]=v.useState(!1),x=typeof t?.duration=="number"?t?.duration:200,b=b5({opened:n,transitionDuration:x});return RR("keydown",S=>{S.key==="Escape"&&o&&!S.isComposing&&n&&S.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&s()},{capture:!0}),jR({opened:n,shouldReturnFocus:r&&c}),{_id:d,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const L2=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,onExitTransitionEnd:s,onEnterTransitionEnd:c,trapFocus:d,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:x,lockScroll:b,children:S,zIndex:j,shadow:C,padding:R,__vars:E,unstyled:T,removeScrollProps:_,...P},A)=>{const{_id:k,titleMounted:L,bodyMounted:z,shouldLockScroll:B,setTitleMounted:Z,setBodyMounted:K}=S5({id:r,transitionProps:o,opened:t,trapFocus:d,closeOnEscape:f,onClose:n,returnFocus:p}),{key:Y,...H}=_||{};return a.jsx(ts,{...x,withinPortal:g,children:a.jsx(x5,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${k}-title`,getBodyId:()=>`${k}-body`,titleMounted:L,bodyMounted:z,setTitleMounted:Z,setBodyMounted:K,trapFocus:d,closeOnEscape:f,zIndex:j,unstyled:T},children:a.jsx(gc,{enabled:B&&b,...H,children:a.jsx(ce,{ref:A,...P,__vars:{...E,"--mb-z-index":(j||Xr("modal")).toString(),"--mb-shadow":Tx(C),"--mb-padding":Nn(R)},children:S})},Y)})})});L2.displayName="@mantine/core/ModalBase";function w5(){const e=ia();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var bc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const I2=v.forwardRef(({className:e,...t},n)=>{const r=w5(),o=ia();return a.jsx(ce,{ref:n,...t,id:r,className:It({[bc.body]:!o.unstyled},e)})});I2.displayName="@mantine/core/ModalBaseBody";const $2=v.forwardRef(({className:e,onClick:t,...n},r)=>{const o=ia();return a.jsx(ns,{ref:r,...n,onClick:s=>{o.onClose(),t?.(s)},className:It({[bc.close]:!o.unstyled},e),unstyled:o.unstyled})});$2.displayName="@mantine/core/ModalBaseCloseButton";const z2=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...s},c)=>{const d=ia();return a.jsx(po,{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({[bc.inner]:!d.unstyled},n.className),children:a.jsx(Pp,{active:d.opened&&d.trapFocus,innerRef:c,children:a.jsx(yr,{...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:[o,f],className:It({[bc.content]:!d.unstyled},t),unstyled:d.unstyled,children:s.children})})})})});z2.displayName="@mantine/core/ModalBaseContent";const U2=v.forwardRef(({className:e,...t},n)=>{const r=ia();return a.jsx(ce,{component:"header",ref:n,className:It({[bc.header]:!r.unstyled},e),...t})});U2.displayName="@mantine/core/ModalBaseHeader";const j5={duration:200,timingFunction:"ease",transition:"fade"};function C5(e){const t=ia();return{...j5,...t.transitionProps,...e}}const B2=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},s)=>{const c=ia(),d=C5(t);return a.jsx(po,{mounted:r!==void 0?r:c.opened,...d,transition:"fade",children:f=>a.jsx(xc,{ref:s,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e?.(p),c.closeOnClickOutside&&c.onClose()},...o})})});B2.displayName="@mantine/core/ModalBaseOverlay";function E5(){const e=ia();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const V2=v.forwardRef(({className:e,...t},n)=>{const r=E5(),o=ia();return a.jsx(ce,{component:"h2",ref:n,className:It({[bc.title]:!o.unstyled},e),...t,id:r})});V2.displayName="@mantine/core/ModalBaseTitle";function T5({children:e}){return a.jsx(a.Fragment,{children:e})}const[R5,_5]=ea({size:"sm"}),D5={},F2=ye((e,t)=>{const n=se("InputClearButton",D5,e),{size:r,variant:o,vars:s,classNames:c,styles:d,...f}=n,p=_5(),{resolvedClassNames:m,resolvedStyles:g}=el({classNames:c,styles:d,props:n});return a.jsx(ns,{variant:o||"transparent",ref:t,size:r||p?.size||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});F2.displayName="@mantine/core/InputClearButton";const[A5,Nc]=ea({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Si={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 IC={},P5=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),kp=ye((e,t)=>{const n=se("InputDescription",IC,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:x,...b}=se("InputDescription",IC,n),S=Nc(),j=Le({name:["InputWrapper",m],props:n,classes:Si,className:o,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"description",vars:f,varsResolver:P5}),C=g&&S?.getStyles||j;return a.jsx(ce,{component:"p",ref:t,variant:x,size:p,...C("description",S?.getStyles?{className:o,style:s}:void 0),...b})});kp.classes=Si;kp.displayName="@mantine/core/InputDescription";const k5={},N5=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),Np=ye((e,t)=>{const n=se("InputError",k5,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:x,...b}=n,S=Le({name:["InputWrapper",m],props:n,classes:Si,className:o,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"error",vars:f,varsResolver:N5}),j=Nc(),C=g&&j?.getStyles||S;return a.jsx(ce,{component:"p",ref:t,variant:x,size:p,...C("error",j?.getStyles?{className:o,style:s}:void 0),...b})});Np.classes=Si;Np.displayName="@mantine/core/InputError";const $C={labelElement:"label"},O5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0}}),yd=ye((e,t)=>{const n=se("InputLabel",$C,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,labelElement:p,size:m,required:g,htmlFor:x,onMouseDown:b,children:S,__staticSelector:j,variant:C,mod:R,...E}=se("InputLabel",$C,n),T=Le({name:["InputWrapper",j],props:n,classes:Si,className:o,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"label",vars:f,varsResolver:O5}),_=Nc(),P=_?.getStyles||T;return a.jsxs(ce,{...P("label",_?.getStyles?{className:o,style:s}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?x:void 0,mod:[{required:g},R],onMouseDown:A=>{b?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},...E,children:[S,g&&a.jsx("span",{...P("required"),"aria-hidden":!0,children:" *"})]})});yd.classes=Si;yd.displayName="@mantine/core/InputLabel";const zC={},e0=ye((e,t)=>{const n=se("InputPlaceholder",zC,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,__staticSelector:p,variant:m,error:g,mod:x,...b}=se("InputPlaceholder",zC,n),S=Le({name:["InputPlaceholder",p],props:n,classes:Si,className:o,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"placeholder"});return a.jsx(ce,{...S("placeholder"),mod:[{error:!!g},x],component:"span",variant:m,ref:t,...b})});e0.classes=Si;e0.displayName="@mantine/core/InputPlaceholder";function M5(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),o=e.slice(0,r),s=e.slice(r+1),c=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&s.includes("description")||n&&s.includes("error"),offsetTop:c}}const L5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},I5=(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)})`}}),xd=ye((e,t)=>{const n=se("InputWrapper",L5,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:x,inputWrapperOrder:b,label:S,error:j,description:C,labelProps:R,descriptionProps:E,errorProps:T,labelElement:_,children:P,withAsterisk:A,id:k,required:L,__stylesApiProps:z,mod:B,...Z}=n,K=Le({name:["InputWrapper",g],props:z||n,classes:Si,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:I5}),Y={size:p,variant:m,__staticSelector:g},H=br(k),W=typeof A=="boolean"?A:L,M=T?.id||`${H}-error`,I=E?.id||`${H}-description`,$=H,q=!!j&&typeof j!="boolean",N=!!C,F=`${q?M:""} ${N?I:""}`,J=F.trim().length>0?F.trim():void 0,ae=R?.id||`${H}-label`,je=S&&a.jsx(yd,{labelElement:_,id:ae,htmlFor:$,required:W,...Y,...R,children:S},"label"),xe=N&&a.jsx(kp,{...E,...Y,size:E?.size||Y.size,id:E?.id||I,children:C},"description"),we=a.jsx(v.Fragment,{children:x(P)},"input"),Qe=q&&v.createElement(Np,{...T,...Y,size:T?.size||Y.size,key:"error",id:T?.id||M},j),Ee=b.map(ot=>{switch(ot){case"label":return je;case"input":return we;case"description":return xe;case"error":return Qe;default:return null}});return a.jsx(A5,{value:{getStyles:K,describedBy:J,inputId:$,labelId:ae,...M5(b,{hasDescription:N,hasError:q})},children:a.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},B],...K("root"),...Z,children:Ee})})});xd.classes=Si;xd.displayName="@mantine/core/InputWrapper";const $5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},z5=(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":rt(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?rt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),fn=cr((e,t)=>{const n=se("Input",$5,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:x,error:b,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:R,rightSection:E,rightSectionProps:T,rightSectionWidth:_,rightSectionPointerEvents:P,leftSectionPointerEvents:A,variant:k,vars:L,pointer:z,multiline:B,radius:Z,id:K,withAria:Y,withErrorStyles:H,mod:W,inputSize:M,__clearSection:I,__clearable:$,__defaultRightSection:q,...N}=n,{styleProps:F,rest:J}=ra(N),ae=Nc(),je={offsetBottom:ae?.offsetBottom,offsetTop:ae?.offsetTop},xe=Le({name:["Input",p],props:m||n,classes:Si,className:o,style:s,classNames:r,styles:c,unstyled:d,stylesCtx:je,rootSelector:"wrapper",vars:L,varsResolver:z5}),we=Y?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":ae?.describedBy,id:ae?.inputId||K}:{},Qe=E||$&&I||q;return a.jsx(R5,{value:{size:g||"sm"},children:a.jsxs(ce,{...xe("wrapper"),...F,...x,mod:[{error:!!b&&H,pointer:z,disabled:S,multiline:B,"data-with-right-section":!!Qe,"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",...J,...we,ref:t,required:f,mod:{disabled:S,error:!!b&&H},variant:k,__size:M,...xe("input")}),Qe&&a.jsx("div",{...T,"data-position":"right",...xe("section",{className:T?.className,style:T?.style}),children:Qe})]})})});fn.classes=Si;fn.Wrapper=xd;fn.Label=yd;fn.Error=Np;fn.Description=kp;fn.Placeholder=e0;fn.ClearButton=F2;fn.displayName="@mantine/core/Input";function U5(e,t,n){const r=se(e,t,n),{label:o,description:s,error:c,required:d,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:x,__stylesApiProps:b,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:R,id:E,size:T,style:_,inputContainer:P,inputWrapperOrder:A,withAsterisk:k,variant:L,vars:z,mod:B,...Z}=r,{styleProps:K,rest:Y}=ra(Z),H={label:o,description:s,error:c,required:d,classNames:f,className:m,__staticSelector:x,__stylesApiProps:b||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:T,style:_,inputContainer:P,inputWrapperOrder:A,withAsterisk:k,variant:L,id:E,mod:B,...R};return{...Y,classNames:f,styles:p,unstyled:g,wrapperProps:{...H,...K},inputProps:{required:d,classNames:f,styles:p,unstyled:g,size:T,__staticSelector:x,__stylesApiProps:b||r,error:c,variant:L,id:E}}}const B5={__staticSelector:"InputBase",withAria:!0},Sr=cr((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=U5("InputBase",B5,e);return a.jsx(fn.Wrapper,{...r,children:a.jsx(fn,{...n,...o,ref:t})})});Sr.classes={...fn.classes,...fn.Wrapper.classes};Sr.displayName="@mantine/core/InputBase";const V5={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 q2={root:"m_8bffd616"};const F5={},lo=cr((e,t)=>{const n=se("Flex",F5,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,gap:p,rowGap:m,columnGap:g,align:x,justify:b,wrap:S,direction:j,...C}=n,R=Le({name:"Flex",classes:q2,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f}),E=Sn(),T=gd(),_=MR({styleProps:{gap:p,rowGap:m,columnGap:g,align:x,justify:b,wrap:S,direction:j},theme:E,data:V5});return a.jsxs(a.Fragment,{children:[_.hasResponsiveStyles&&a.jsx(nl,{selector:`.${T}`,styles:_.styles,media:_.media}),a.jsx(ce,{ref:t,...R("root",{className:T,style:es(_.inlineStyles)}),...C})]})});lo.classes=q2;lo.displayName="@mantine/core/Flex";function q5(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 H5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=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(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),R=Ga(j.borderTopWidth)+Ga(C.borderTopWidth),E=Ga(j.borderLeftWidth)+Ga(C.borderLeftWidth),T={top:b.top-S.top-R,left:b.left-S.left-E,width:b.width,height:b.height};n.current.style.transform=`translateY(${T.top}px) translateX(${T.left}px)`,n.current.style.width=`${T.width}px`,n.current.style.height=`${T.height}px`},m=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),o.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=S=>{q5(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),L4(()=>{_R()!=="test"&&c(!0)},20,{autoInvoke:!0}),I4(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:d}}var H2={root:"m_96b553a6"};const G5={},W5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),t0=ye((e,t)=>{const n=se("FloatingIndicator",G5,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,target:p,parent:m,transitionDuration:g,mod:x,displayAfterTransitionEnd:b,...S}=n,j=Le({name:"FloatingIndicator",classes:H2,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:W5}),C=v.useRef(null),{initialized:R,hidden:E}=H5({target:p,parent:m,ref:C,displayAfterTransitionEnd:b}),T=Vn(t,C);return!p||!m?null:a.jsx(ce,{ref:T,mod:[{initialized:R,hidden:E},x],...j("root"),...S})});t0.displayName="@mantine/core/FloatingIndicator";t0.classes=H2;var G2={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 Q5={},Y5=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const s=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});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}}},oa=ye((e,t)=>{const n=se("Alert",Q5,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,title:g,children:x,id:b,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:R,variant:E,autoContrast:T,..._}=n,P=Le({name:"Alert",classes:G2,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Y5}),A=br(b),k=g&&`${A}-title`||void 0,L=`${A}-body`;return a.jsx(ce,{id:A,...P("root",{variant:E}),variant:E,ref:t,..._,role:"alert","aria-describedby":L,"aria-labelledby":k,children:a.jsxs("div",{...P("wrapper"),children:[S&&a.jsx("div",{...P("icon"),children:S}),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:L,...P("message"),"data-variant":E,children:x})]}),j&&a.jsx(ns,{...P("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":R,unstyled:d})]})})});oa.classes=G2;oa.displayName="@mantine/core/Alert";var W2={root:"m_b6d8b162"};function K5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const X5={inherit:!1},Z5=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:s})=>({root:{"--text-fz":On(o),"--text-lh":bR(o),"--text-gradient":t==="gradient"?Ny(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Ft(s,e):void 0}}),_e=cr((e,t)=>{const n=se("Text",X5,e),{lineClamp:r,truncate:o,inline:s,inherit:c,gradient:d,span:f,__staticSelector:p,vars:m,className:g,style:x,classNames:b,styles:S,unstyled:j,variant:C,mod:R,size:E,...T}=n,_=Le({name:["Text",p],props:n,classes:W2,className:g,style:x,classNames:b,styles:S,unstyled:j,vars:m,varsResolver:Z5});return a.jsx(ce,{..._("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":K5(o),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":c},R],size:E,...T})});_e.classes=W2;_e.displayName="@mantine/core/Text";var Q2={root:"m_849cf0da"};const J5={underline:"hover"},Pt=cr((e,t)=>{const{underline:n,className:r,unstyled:o,mod:s,...c}=se("Anchor",J5,e);return a.jsx(_e,{component:"a",ref:t,className:It({[Q2.root]:!o},r),...c,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:o})});Pt.classes=Q2;Pt.displayName="@mantine/core/Anchor";const[eL,Oc]=xr("AppShell was not found in tree");var rs={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const tL={},n0=ye((e,t)=>{const n=se("AppShellAside",tL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Oc();return b.disabled?null:a.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("aside",{className:o,classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});n0.classes=rs;n0.displayName="@mantine/core/AppShellAside";const nL={},r0=ye((e,t)=>{const n=se("AppShellFooter",nL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Oc();return b.disabled?null:a.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("footer",{className:It({[gc.classNames.zeroRight]:b.offsetScrollbars},o),classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-footer-z-index":(m??b.zIndex)?.toString()}})});r0.classes=rs;r0.displayName="@mantine/core/AppShellFooter";const rL={},i0=ye((e,t)=>{const n=se("AppShellHeader",rL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Oc();return b.disabled?null:a.jsx(ce,{component:"header",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("header",{className:It({[gc.classNames.zeroRight]:b.offsetScrollbars},o),classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-header-z-index":(m??b.zIndex)?.toString()}})});i0.classes=rs;i0.displayName="@mantine/core/AppShellHeader";const iL={},o0=ye((e,t)=>{const n=se("AppShellMain",iL,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=Oc();return a.jsx(ce,{component:"main",ref:t,...p.getStyles("main",{className:o,style:s,classNames:r,styles:c}),...f})});o0.classes=rs;o0.displayName="@mantine/core/AppShellMain";function bd(e){return typeof e=="object"?e.base:e}function Sd(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 wd(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function oL({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){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"),Sd(s)){const f=le(bd(s));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(wd(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=Rx(r.breakpoint,o.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 aL({baseStyles:e,minMediaStyles:t,footer:n}){const r=n?.height,o="translateY(var(--app-shell-footer-height))",s=n?.offset??!0;if(Sd(r)){const c=le(bd(r));e["--app-shell-footer-height"]=c,s&&(e["--app-shell-footer-offset"]=c)}wd(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"]=o,e["--app-shell-footer-offset"]="0px !important")}function sL({baseStyles:e,minMediaStyles:t,header:n}){const r=n?.height,o="translateY(calc(var(--app-shell-header-height) * -1))",s=n?.offset??!0;if(Sd(r)){const c=le(bd(r));e["--app-shell-header-height"]=c,s&&(e["--app-shell-header-offset"]=c)}wd(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"]=o,e["--app-shell-header-offset"]="0px !important")}function lL({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){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"),Sd(s)){const f=le(bd(s));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(wd(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=Rx(r.breakpoint,o.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 cL({padding:e,baseStyles:t,minMediaStyles:n}){Sd(e)&&(t["--app-shell-padding"]=Jv(bd(e))),wd(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 uL({navbar:e,header:t,footer:n,aside:r,padding:o,theme:s}){const c={},d={},f={};lL({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,navbar:e,theme:s}),oL({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,aside:r,theme:s}),sL({baseStyles:f,minMediaStyles:c,header:t}),aL({baseStyles:f,minMediaStyles:c,footer:n}),cL({baseStyles:f,minMediaStyles:c,padding:o});const p=Ju(an(c),s.breakpoints).map(x=>({query:`(min-width: ${Ih(x.px)})`,styles:c[x.value]})),m=Ju(an(d),s.breakpoints).map(x=>({query:`(max-width: ${Ih(x.px)})`,styles:d[x.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function dL({navbar:e,header:t,aside:n,footer:r,padding:o}){const s=Sn(),c=ta(),{media:d,baseStyles:f}=uL({navbar:e,header:t,footer:r,aside:n,padding:o,theme:s});return a.jsx(nl,{media:d,styles:f,selector:c.cssVariablesSelector})}const fL={},a0=ye((e,t)=>{const n=se("AppShellNavbar",fL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Oc();return b.disabled?null:a.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("navbar",{className:o,classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});a0.classes=rs;a0.displayName="@mantine/core/AppShellNavbar";const hL={},s0=cr((e,t)=>{const n=se("AppShellSection",hL,e),{classNames:r,className:o,style:s,styles:c,vars:d,grow:f,mod:p,...m}=n,g=Oc();return a.jsx(ce,{ref:t,mod:[{grow:f},p],...g.getStyles("section",{className:o,style:s,classNames:r,styles:c}),...m})});s0.classes=rs;s0.displayName="@mantine/core/AppShellSection";function pL({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),o=v.useRef(-1),s=v.useRef(-1);return RR("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),Dc(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const mL={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Xr("app")},gL=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),kr=ye((e,t)=>{const n=se("AppShell",mL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:x,transitionTimingFunction:b,header:S,zIndex:j,layout:C,disabled:R,aside:E,footer:T,offsetScrollbars:_=C!=="alt",mod:P,...A}=n,k=Le({name:"AppShell",classes:rs,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:gL}),L=pL({disabled:R,transitionDuration:x});return a.jsxs(eL,{value:{getStyles:k,withBorder:m,zIndex:j,disabled:R,offsetScrollbars:_},children:[a.jsx(dL,{navbar:p,header:S,aside:E,footer:T,padding:g}),a.jsx(ce,{ref:t,...k("root"),mod:[{resizing:L,layout:C,disabled:R},P],...A})]})});kr.classes=rs;kr.displayName="@mantine/core/AppShell";kr.Navbar=a0;kr.Header=i0;kr.Main=o0;kr.Aside=n0;kr.Footer=r0;kr.Section=s0;function Y2(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=>Y2(t))}:e}function K2(e){return e?e.map(t=>Y2(t)):[]}function X2(e){return e.reduce((t,n)=>"group"in n?{...t,...X2(n.items)}:(t[n.value]=n,t),{})}var Or={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 vL={error:null},yL=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":rt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Ft(n,e):void 0}}),Op=ye((e,t)=>{const n=se("ComboboxChevron",vL,e),{size:r,error:o,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,mod:g,...x}=n,b=Le({name:"ComboboxChevron",classes:Or,props:n,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,varsResolver:yL,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:o},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"})})});Op.classes=Or;Op.displayName="@mantine/core/ComboboxChevron";const[xL,wi]=xr("Combobox component was not found in tree"),Z2=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},s)=>a.jsx(fn.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:c=>{c.preventDefault(),t?.(c)},onClick:c=>{r(),n?.(c)}}));Z2.displayName="@mantine/core/ComboboxClearButton";const bL={},l0=ye((e,t)=>{const{classNames:n,styles:r,className:o,style:s,hidden:c,...d}=se("ComboboxDropdown",bL,e),f=wi();return a.jsx(zi.Dropdown,{...d,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:o,style:s,classNames:n,styles:r})})});l0.classes=Or;l0.displayName="@mantine/core/ComboboxDropdown";const SL={refProp:"ref"},J2=ye((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",SL,e);if(wi(),!Jo(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(zi.Target,{ref:t,refProp:r,children:n})});J2.displayName="@mantine/core/ComboboxDropdownTarget";const wL={},c0=ye((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=se("ComboboxEmpty",wL,e),f=wi();return a.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:s,style:o}),...d})});c0.classes=Or;c0.displayName="@mantine/core/ComboboxEmpty";function u0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:s}){const c=wi(),[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()):o==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&o==="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 jL={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},e_=ye((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=se("ComboboxEventsTarget",jL,e);if(!Jo(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=wi(),g=u0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...p,[r]:Vn(t,m.store.targetRef,bp(n))})});e_.displayName="@mantine/core/ComboboxEventsTarget";const CL={},d0=ye((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=se("ComboboxFooter",CL,e),f=wi();return a.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:o,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});d0.classes=Or;d0.displayName="@mantine/core/ComboboxFooter";const EL={},f0=ye((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,children:d,label:f,...p}=se("ComboboxGroup",EL,e),m=wi();return a.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:o,styles:s}),...p,children:[f&&a.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:s}),children:f}),d]})});f0.classes=Or;f0.displayName="@mantine/core/ComboboxGroup";const TL={},h0=ye((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=se("ComboboxHeader",TL,e),f=wi();return a.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:o,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});h0.classes=Or;h0.displayName="@mantine/core/ComboboxHeader";function t_({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}t_.displayName="@mantine/core/ComboboxHiddenInput";const RL={},p0=ye((e,t)=>{const n=se("ComboboxOption",RL,e),{classNames:r,className:o,style:s,styles:c,vars:d,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:x,disabled:b,selected:S,mod:j,...C}=n,R=wi(),E=v.useId(),T=p||E;return a.jsx(ce,{...R.getStyles("option",{className:o,classNames:r,styles:c,style:s}),...C,ref:t,id:T,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},j],role:"option",onClick:_=>{b?_.preventDefault():(R.onOptionSubmit?.(n.value,n),f?.(_))},onMouseDown:_=>{_.preventDefault(),g?.(_)},onMouseOver:_=>{R.resetSelectionOnOptionHover&&R.store.resetSelectedOption(),x?.(_)}})});p0.classes=Or;p0.displayName="@mantine/core/ComboboxOption";const _L={},m0=ye((e,t)=>{const n=se("ComboboxOptions",_L,e),{classNames:r,className:o,style:s,styles:c,id:d,onMouseDown:f,labelledBy:p,...m}=n,g=wi(),x=br(d);return v.useEffect(()=>{g.store.setListId(x)},[x]),a.jsx(ce,{ref:t,...g.getStyles("options",{className:o,style:s,classNames:r,styles:c}),...m,id:x,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f?.(b)}})});m0.classes=Or;m0.displayName="@mantine/core/ComboboxOptions";const DL={withAriaAttributes:!0,withKeyboardNavigation:!0},g0=ye((e,t)=>{const n=se("ComboboxSearch",DL,e),{classNames:r,styles:o,unstyled:s,vars:c,withAriaAttributes:d,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,x=wi(),b=x.getStyles("search"),S=u0({targetType:"input",withAriaAttributes:d,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(fn,{ref:Vn(t,x.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},o],size:m||x.size,...S,...g,__staticSelector:"Combobox"})});g0.classes=Or;g0.displayName="@mantine/core/ComboboxSearch";const AL={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},n_=ye((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=se("ComboboxTarget",AL,e);if(!Jo(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=wi(),g=u0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),x=v.cloneElement(n,{...g,...p});return a.jsx(zi.Target,{ref:Vn(t,m.store.targetRef),children:x})});n_.displayName="@mantine/core/ComboboxTarget";function PL(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 kL(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 NL(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function il({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,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),S=v.useRef(-1),j=v.useRef(-1),C=v.useCallback((M="unknown")=>{d||(f(!0),o?.(M))},[f,o,d]),R=v.useCallback((M="unknown")=>{d&&(f(!1),r?.(M))},[f,r,d]),E=v.useCallback((M="unknown")=>{d?R(M):C(M)},[R,C,d]),T=v.useCallback(()=>{const M=document.querySelector(`#${p.current} [data-combobox-selected]`);M?.removeAttribute("data-combobox-selected"),M?.removeAttribute("aria-selected")},[]),_=v.useCallback(M=>{const $=document.getElementById(p.current)?.querySelectorAll("[data-combobox-option]");if(!$)return null;const q=M>=$.length?0:M<0?$.length-1:M;return m.current=q,$?.[q]&&!$[q].hasAttribute("data-combobox-disabled")?(T(),$[q].setAttribute("data-combobox-selected","true"),$[q].setAttribute("aria-selected","true"),$[q].scrollIntoView({block:"nearest",behavior:c}),$[q].id):null},[c,T]),P=v.useCallback(()=>{const M=document.querySelector(`#${p.current} [data-combobox-active]`);if(M){const I=document.querySelectorAll(`#${p.current} [data-combobox-option]`),$=Array.from(I).findIndex(q=>q===M);return _($)}return _(0)},[_]),A=v.useCallback(()=>_(kL(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[_,s]),k=v.useCallback(()=>_(PL(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[_,s]),L=v.useCallback(()=>_(NL(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[_]),z=v.useCallback((M="selected",I)=>{j.current=window.setTimeout(()=>{const $=document.querySelectorAll(`#${p.current} [data-combobox-option]`),q=Array.from($).findIndex(N=>N.hasAttribute(`data-combobox-${M}`));m.current=q,I?.scrollIntoView&&$[q]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),B=v.useCallback(()=>{m.current=-1,T()},[T]),Z=v.useCallback(()=>{document.querySelectorAll(`#${p.current} [data-combobox-option]`)?.[m.current]?.click()},[]),K=v.useCallback(M=>{p.current=M},[]),Y=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),H=v.useCallback(()=>{S.current=window.setTimeout(()=>x.current.focus(),0)},[]),W=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:d,openDropdown:C,closeDropdown:R,toggleDropdown:E,selectedOptionIndex:m.current,getSelectedOptionIndex:W,selectOption:_,selectFirstOption:L,selectActiveOption:P,selectNextOption:A,selectPreviousOption:k,resetSelectedOption:B,updateSelectedOptionIndex:z,listId:p.current,setListId:K,clickSelectedOption:Z,searchRef:g,focusSearchInput:Y,targetRef:x,focusTarget:H}}const OL={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},ML=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":On(t),"--combobox-option-padding":rt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":On(t),"--combobox-option-padding":rt(t,"combobox-option-padding")}});function We(e){const t=se("Combobox",OL,e),{classNames:n,styles:r,unstyled:o,children:s,store:c,vars:d,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:x,__staticSelector:b,readOnly:S,...j}=t,C=il(),R=c||C,E=Le({name:b||"Combobox",classes:Or,props:t,classNames:n,styles:r,unstyled:o,vars:d,varsResolver:ML}),T=()=>{p?.(),R.closeDropdown()};return a.jsx(xL,{value:{getStyles:E,store:R,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:x,readOnly:S},children:a.jsx(zi,{opened:R.dropdownOpened,...j,onChange:_=>!_&&T(),withRoles:!1,unstyled:o,children:s})})}const LL=e=>e;We.extend=LL;We.classes=Or;We.displayName="@mantine/core/Combobox";We.Target=n_;We.Dropdown=l0;We.Options=m0;We.Option=p0;We.Search=g0;We.Empty=c0;We.Chevron=Op;We.Footer=d0;We.Header=h0;We.EventsTarget=e_;We.DropdownTarget=J2;We.Group=f0;We.ClearButton=Z2;We.HiddenInput=t_;var r_={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const i_=r_,Mp=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:s,children:c,label:d,description:f,id:p,disabled:m,error:g,size:x,labelPosition:b="left",bodyElement:S="div",labelElement:j="label",variant:C,style:R,vars:E,mod:T,..._},P)=>{const A=Le({name:e,props:t,className:n,style:R,classes:r_,classNames:r,styles:o,unstyled:s});return a.jsx(ce,{...A("root"),ref:P,__vars:{"--label-fz":On(x),"--label-lh":rt(x,"label-lh")},mod:[{"label-position":b},T],variant:C,size:x,..._,children:a.jsxs(ce,{component:S,htmlFor:S==="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})]})]})})});Mp.displayName="@mantine/core/InlineInput";const o_=v.createContext(null),IL=o_.Provider,a_=()=>v.useContext(o_),[$L,zL]=ea();var s_={card:"m_26775b0a"};const UL={withBorder:!0},BL=(e,{radius:t})=>({card:{"--card-radius":Ut(t)}}),v0=ye((e,t)=>{const n=se("CheckboxCard",UL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:x,onClick:b,defaultChecked:S,onChange:j,...C}=n,R=Le({name:"CheckboxCard",classes:s_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:BL,rootSelector:"card"}),E=a_(),T=typeof p=="boolean"?p:E?E.value.includes(x||""):void 0,[_,P]=Yn({value:T,defaultValue:S,finalValue:!1,onChange:j});return a.jsx($L,{value:{checked:_},children:a.jsx(er,{ref:t,mod:[{"with-border":g,checked:_},m],...R("card"),...C,role:"checkbox","aria-checked":_,onClick:A=>{b?.(A),E?.onChange(x||""),P(!_)}})})});v0.displayName="@mantine/core/CheckboxCard";v0.classes=s_;function y0({children:e,role:t}){const n=Nc();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const VL={},x0=ye((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,readOnly:f,...p}=se("CheckboxGroup",VL,e),[m,g]=Yn({value:n,defaultValue:r,finalValue:[],onChange:o}),x=b=>{const S=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return a.jsx(IL,{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(y0,{role:"group",children:d})})})});x0.classes=fn.Wrapper.classes;x0.displayName="@mantine/core/CheckboxGroup";function jd({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 l_({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(jd,{...t})}var c_={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const FL={icon:l_},qL=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=gi({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":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ut(t),"--checkbox-color":s==="outline"?f:Ft(n,e),"--checkbox-icon-color":o?Ft(o,e):tl(c,e)?na({color:n,theme:e,autoContrast:c}):void 0}}},b0=ye((e,t)=>{const n=se("CheckboxIndicator",FL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,icon:p,indeterminate:m,radius:g,color:x,iconColor:b,autoContrast:S,checked:j,mod:C,variant:R,disabled:E,...T}=n,_=p,P=Le({name:"CheckboxIndicator",classes:c_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:qL,rootSelector:"indicator"}),A=zL(),k=typeof j=="boolean"||typeof m=="boolean"?j||m:A?.checked||!1;return a.jsx(ce,{ref:t,...P("indicator",{variant:R}),variant:R,mod:[{checked:k,disabled:E},C],...T,children:a.jsx(_,{indeterminate:m,...P("icon")})})});b0.displayName="@mantine/core/CheckboxIndicator";b0.classes=c_;var u_={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const HL={labelPosition:"right",icon:l_},GL=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=gi({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":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ut(t),"--checkbox-color":s==="outline"?f:Ft(n,e),"--checkbox-icon-color":o?Ft(o,e):tl(c,e)?na({color:n,theme:e,autoContrast:c}):void 0}}},Dn=ye((e,t)=>{const n=se("Checkbox",HL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,id:g,size:x,radius:b,wrapperProps:S,checked:j,labelPosition:C,description:R,error:E,disabled:T,variant:_,indeterminate:P,icon:A,rootRef:k,iconColor:L,onChange:z,autoContrast:B,mod:Z,...K}=n,Y=a_(),H=x||Y?.size,W=A,M=Le({name:"Checkbox",props:n,classes:u_,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:GL}),{styleProps:I,rest:$}=ra(K),q=br(g),N=Y?{checked:Y.value.includes($.value),onChange:ae=>{Y.onChange(ae),z?.(ae)}}:{},F=v.useRef(null),J=t||F;return v.useEffect(()=>{J&&"current"in J&&J.current&&(J.current.indeterminate=P||!1)},[P,J]),a.jsx(Mp,{...M("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:q,size:H,labelPosition:C,label:m,description:R,error:E,disabled:T,classNames:r,styles:c,unstyled:d,"data-checked":N.checked||j||void 0,variant:_,ref:k,mod:Z,...I,...S,children:a.jsxs(ce,{...M("inner"),mod:{"data-label-position":C},children:[a.jsx(ce,{component:"input",id:q,ref:J,checked:j,disabled:T,mod:{error:!!E,indeterminate:P},...M("input",{focusable:!0,variant:_}),onChange:z,...$,...N,type:"checkbox"}),a.jsx(W,{indeterminate:P,...M("icon")})]})})});Dn.classes={...u_,...i_};Dn.displayName="@mantine/core/Checkbox";Dn.Group=x0;Dn.Indicator=b0;Dn.Card=v0;function Sc(e){return"group"in e}function d_({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let s=0;s<e.length;s+=1){const c=e[s];if(o.length===n)return o;Sc(c)&&o.push({group:c.group,items:d_({options:c.items,search:t,limit:n-o.length})}),Sc(c)||c.label.toLowerCase().includes(r)&&o.push(c)}return o}function WL(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 f_(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Sc(n))f_(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 QL(e,t){return Array.isArray(e)?e.includes(t):e===t}function h_({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:s}){if(!Sc(e)){const d=QL(n,e.value),f=t&&d&&a.jsx(jd,{className:Or.optionsDropdownCheckIcon}),p=a.jsxs(a.Fragment,{children:[r==="left"&&f,a.jsx("span",{children:e.label}),r==="right"&&f]});return a.jsx(We.Option,{value:e.value,disabled:e.disabled,className:It({[Or.optionsDropdownOption]:!o}),"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(h_,{data:d,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:s},d.value));return a.jsx(We.Group,{label:e.group,children:c})}function YL({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:s,maxDropdownHeight:c,withScrollArea:d=!0,filterOptions:f=!0,withCheckIcon:p=!1,value:m,checkIconPosition:g,nothingFoundMessage:x,unstyled:b,labelId:S,renderOption:j,scrollAreaProps:C,"aria-label":R}){f_(e);const T=typeof o=="string"?(r||d_)({options:e,search:f?o:"",limit:s??1/0}):e,_=WL(T),P=T.map(A=>a.jsx(h_,{data:A,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},Sc(A)?A.group:A.value));return a.jsx(We.Dropdown,{hidden:t||n&&_,"data-composed":!0,children:a.jsxs(We.Options,{labelledBy:S,"aria-label":R,children:[d?a.jsx(Zr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:P}):P,_&&x&&a.jsx(We.Empty,{children:x})]})})}const p_=v.createContext(null),KL=p_.Provider;function XL(){return{withinGroup:!!v.useContext(p_)}}var Lp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const ZL={},JL=(e,{spacing:t})=>({group:{"--ag-spacing":Nn(t)}}),S0=ye((e,t)=>{const n=se("AvatarGroup",ZL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,spacing:p,...m}=n,g=Le({name:"AvatarGroup",classes:Lp,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:JL,rootSelector:"group"});return a.jsx(KL,{value:!0,children:a.jsx(ce,{ref:t,...g("group"),...m})})});S0.classes=Lp;S0.displayName="@mantine/core/AvatarGroup";function e7(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 t7(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 n7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function r7(e,t=n7){const n=t7(e),r=Math.abs(n)%t.length;return t[r]}function i7(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 o7={},a7=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c,name:d,allowedInitialsColors:f})=>{const p=s==="initials"&&typeof d=="string"?r7(d,f):s,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":rt(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}}},qs=cr((e,t)=>{const n=se("Avatar",o7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,src:p,alt:m,radius:g,color:x,gradient:b,imageProps:S,children:j,autoContrast:C,mod:R,name:E,allowedInitialsColors:T,..._}=n,P=XL(),[A,k]=v.useState(!p),L=Le({name:"Avatar",props:n,classes:Lp,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:a7});return v.useEffect(()=>k(!p),[p]),a.jsx(ce,{...L("root"),mod:[{"within-group":P.withinGroup},R],ref:t,..._,children:A?a.jsx("span",{...L("placeholder"),title:m,children:j||typeof E=="string"&&i7(E)||a.jsx(e7,{})}):a.jsx("img",{...S,...L("image"),src:p,alt:m,onError:z=>{k(!0),S?.onError?.(z)}})})});qs.classes=Lp;qs.displayName="@mantine/core/Avatar";qs.Group=S0;var m_={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const s7={},l7=(e,{radius:t,color:n,gradient:r,variant:o,size:s,autoContrast:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:c});return{root:{"--badge-height":rt(s,"badge-height"),"--badge-padding-x":rt(s,"badge-padding-x"),"--badge-fz":rt(s,"badge-fz"),"--badge-radius":t===void 0?void 0:Ut(t),"--badge-bg":n||o?d.background:void 0,"--badge-color":n||o?d.color:void 0,"--badge-bd":n||o?d.border:void 0,"--badge-dot-color":o==="dot"?Ft(n,e):void 0}}},Ip=cr((e,t)=>{const n=se("Badge",s7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,gradient:g,leftSection:x,rightSection:b,children:S,variant:j,fullWidth:C,autoContrast:R,circle:E,mod:T,..._}=n,P=Le({name:"Badge",props:n,classes:m_,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:l7});return a.jsxs(ce,{variant:j,mod:[{block:C,circle:E,"with-right-section":!!b,"with-left-section":!!x},T],...P("root",{variant:j}),ref:t,..._,children:[x&&a.jsx("span",{...P("section"),"data-position":"left",children:x}),a.jsx("span",{...P("label"),children:S}),b&&a.jsx("span",{...P("section"),"data-position":"right",children:b})]})});Ip.classes=m_;Ip.displayName="@mantine/core/Badge";var g_={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const c7={iconSize:48},u7=(e,{color:t,iconSize:n,radius:r})=>{const o=gi({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=gi({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":di(s.value,.07),"--bq-bg-dark":di(o.value,.06),"--bq-bd":Ft(t,e),"--bq-icon-size":le(n),"--bq-radius":Ut(r)}}},w0=ye((e,t)=>{const n=se("Blockquote",c7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,icon:m,iconSize:g,cite:x,...b}=n,S=Le({name:"Blockquote",classes:g_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:u7});return a.jsxs(ce,{component:"blockquote",ref:t,...S("root"),...b,children:[m&&a.jsx("span",{...S("icon"),children:m}),p,x&&a.jsx("cite",{...S("cite"),children:x})]})});w0.classes=g_;w0.displayName="@mantine/core/Blockquote";var Mc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const UC={orientation:"horizontal"},d7=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),j0=ye((e,t)=>{const n=se("ButtonGroup",UC,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:x,...b}=se("ButtonGroup",UC,e),S=Le({name:"ButtonGroup",props:n,classes:Mc,className:r,style:o,classNames:s,styles:c,unstyled:d,vars:p,varsResolver:d7,rootSelector:"group"});return a.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},x],role:"group",...b})});j0.classes=Mc;j0.displayName="@mantine/core/ButtonGroup";const BC={},f7=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":rt(c,"section-height"),"--section-padding-x":rt(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||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},C0=ye((e,t)=>{const n=se("ButtonGroupSection",BC,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:x,...b}=se("ButtonGroupSection",BC,e),S=Le({name:"ButtonGroupSection",props:n,classes:Mc,className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,varsResolver:f7,rootSelector:"groupSection"});return a.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});C0.classes=Mc;C0.displayName="@mantine/core/ButtonGroupSection";const h7={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},p7={},m7=(e,{radius:t,color:n,gradient:r,variant:o,size:s,justify:c,autoContrast:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:d});return{root:{"--button-justify":c,"--button-height":rt(s,"button-height"),"--button-padding-x":rt(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||o?f.background:void 0,"--button-hover":n||o?f.hover:void 0,"--button-color":f.color,"--button-bd":n||o?f.border:void 0,"--button-hover-color":n||o?f.hoverColor:void 0}}},ke=cr((e,t)=>{const n=se("Button",p7,e),{style:r,vars:o,className:s,color:c,disabled:d,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:x,radius:b,loading:S,loaderProps:j,gradient:C,classNames:R,styles:E,unstyled:T,"data-disabled":_,autoContrast:P,mod:A,...k}=n,L=Le({name:"Button",props:n,classes:Mc,className:s,style:r,classNames:R,styles:E,unstyled:T,vars:o,varsResolver:m7}),z=!!p,B=!!m;return a.jsxs(er,{ref:t,...L("root",{active:!d&&!S&&!_}),unstyled:T,variant:x,disabled:d||S,mod:[{disabled:d||_,loading:S,block:g,"with-left-section":z,"with-right-section":B},A],...k,children:[a.jsx(po,{mounted:!!S,transition:h7,duration:150,children:Z=>a.jsx(ce,{component:"span",...L("loader",{style:Z}),"aria-hidden":!0,children:a.jsx(Nr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...L("inner"),children:[p&&a.jsx(ce,{component:"span",...L("section"),mod:{position:"left"},children:p}),a.jsx(ce,{component:"span",mod:{loading:S},...L("label"),children:f}),m&&a.jsx(ce,{component:"span",...L("section"),mod:{position:"right"},children:m})]})]})});ke.classes=Mc;ke.displayName="@mantine/core/Button";ke.Group=j0;ke.GroupSection=C0;var v_={root:"m_4451eb3a"};const g7={},Jn=cr((e,t)=>{const n=se("Center",g7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,inline:p,mod:m,...g}=n,x=Le({name:"Center",props:n,classes:v_,className:o,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=v_;Jn.displayName="@mantine/core/Center";const[v7,y7]=ea(),x7={};function y_(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:s}=se("ChipGroup",x7,e),[c,d]=Yn({value:t,defaultValue:n,finalValue:o?[]: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(v7,{value:{isChipSelected:f,onChange:p,multiple:o},children:s})}y_.displayName="@mantine/core/ChipGroup";var x_={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 b7={type:"checkbox"},S7=(e,{size:t,radius:n,variant:r,color:o,autoContrast:s})=>{const c=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":On(t),"--chip-size":rt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ut(n),"--chip-checked-padding":rt(t,"chip-checked-padding"),"--chip-padding":rt(t,"chip-padding"),"--chip-icon-size":rt(t,"chip-icon-size"),"--chip-bg":o||r?c.background:void 0,"--chip-hover":o||r?c.hover:void 0,"--chip-color":o||r?c.color:void 0,"--chip-bd":o||r?c.border:void 0,"--chip-spacing":rt(t,"chip-spacing")}}},rd=ye((e,t)=>{const n=se("Chip",b7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,id:p,checked:m,defaultChecked:g,onChange:x,value:b,wrapperProps:S,type:j,disabled:C,children:R,size:E,variant:T,icon:_,rootRef:P,autoContrast:A,mod:k,...L}=n,z=Le({name:"Chip",classes:x_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:S7}),B=y7(),Z=br(p),{styleProps:K,rest:Y}=ra(L),[H,W]=Yn({value:m,defaultValue:g,finalValue:!1,onChange:x}),M=B?{checked:B.isChipSelected(b),onChange:$=>{B.onChange($),x?.($.currentTarget.checked)},type:B.multiple?"checkbox":"radio"}:{},I=M.checked||H;return a.jsxs(ce,{size:E,variant:T,ref:P,mod:k,...z("root"),...K,...S,children:[a.jsx("input",{type:j,...z("input"),checked:I,onChange:$=>W($.currentTarget.checked),id:Z,disabled:C,ref:t,value:b,...M,...Y}),a.jsxs("label",{htmlFor:Z,"data-checked":I||void 0,"data-disabled":C||void 0,...z("label",{variant:T||"filled"}),children:[I&&a.jsx("span",{...z("iconWrapper"),children:_||a.jsx(jd,{...z("checkIcon")})}),a.jsx("span",{children:R})]})]})});rd.classes=x_;rd.displayName="@mantine/core/Chip";rd.Group=y_;var b_={root:"m_b183c0a2"};const w7={},j7=(e,{color:t})=>({root:{"--code-bg":t?Ft(t,e):void 0}}),Cd=ye((e,t)=>{const n=se("Code",w7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,block:m,variant:g,mod:x,...b}=n,S=Le({name:"Code",props:n,classes:b_,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:j7});return a.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},x],...S("root"),...b,dir:"ltr"})});Cd.classes=b_;Cd.displayName="@mantine/core/Code";var S_={root:"m_7485cace"};const C7={},E7=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:rt(t,"container-size")}}),Ed=ye((e,t)=>{const n=se("Container",C7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,fluid:p,mod:m,...g}=n,x=Le({name:"Container",classes:S_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:E7});return a.jsx(ce,{ref:t,mod:[{fluid:p},m],...x("root"),...g})});Ed.classes=S_;Ed.displayName="@mantine/core/Container";const T7={timeout:1e3};function E0(e){const{children:t,timeout:n,value:r,...o}=se("CopyButton",T7,e),s=SR({timeout:n}),c=()=>s.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:s.copied,...o})})}E0.displayName="@mantine/core/CopyButton";var w_={root:"m_3eebeb36",label:"m_9e365f20"};const R7={orientation:"horizontal"},_7=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Ft(t,e):void 0,"--divider-border-style":n,"--divider-size":rt(r,"divider-size")}}),pn=ye((e,t)=>{const n=se("Divider",R7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,orientation:m,label:g,labelPosition:x,mod:b,...S}=n,j=Le({name:"Divider",classes:w_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:_7});return a.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...j("root"),...S,role:"separator",children:g&&a.jsx(ce,{component:"span",mod:{position:x},...j("label"),children:g})})});pn.classes=w_;pn.displayName="@mantine/core/Divider";function D7({open:e,close:t,openDelay:n,closeDelay:r}){const o=v.useRef(-1),s=v.useRef(-1),c=()=>{window.clearTimeout(o.current),window.clearTimeout(s.current)},d=()=>{c(),n===0||n===void 0?e():o.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[VC,j_]=xr("Grid component was not found in tree"),qy=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,FC=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":qy(e,t),qC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},HC=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function A7({span:e,order:t,offset:n,selector:r}){const o=Sn(),s=j_(),c=s.breakpoints||o.breakpoints,f=Pi(e)===void 0?12:Pi(e),p=es({"--col-order":Pi(t)?.toString(),"--col-flex-grow":qC(f,s.grow),"--col-flex-basis":qy(f,s.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":FC(f,s.columns,s.grow),"--col-offset":HC(Pi(n),s.columns)}),m=an(c).reduce((b,S)=>(b[S]||(b[S]={}),typeof t=="object"&&t[S]!==void 0&&(b[S]["--col-order"]=t[S]?.toString()),typeof e=="object"&&e[S]!==void 0&&(b[S]["--col-flex-grow"]=qC(e[S],s.grow),b[S]["--col-flex-basis"]=qy(e[S],s.columns),b[S]["--col-width"]=e[S]==="content"?"auto":void 0,b[S]["--col-max-width"]=FC(e[S],s.columns,s.grow)),typeof n=="object"&&n[S]!==void 0&&(b[S]["--col-offset"]=HC(n[S],s.columns)),b),{}),x=Ju(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(nl,{styles:p,media:s.type==="container"?void 0:x,container:s.type==="container"?x:void 0,selector:r})}var T0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const P7={span:12},R0=ye((e,t)=>{const n=se("GridCol",P7,e),{classNames:r,className:o,style:s,styles:c,vars:d,span:f,order:p,offset:m,...g}=n,x=j_(),b=gd();return a.jsxs(a.Fragment,{children:[a.jsx(A7,{selector:`.${b}`,span:f,order:p,offset:m}),a.jsx(ce,{ref:t,...x.getStyles("col",{className:It(o,b),style:s,classNames:r,styles:c}),...g})]})});R0.classes=T0;R0.displayName="@mantine/core/GridCol";function GC({gutter:e,selector:t,breakpoints:n,type:r}){const o=Sn(),s=n||o.breakpoints,c=es({"--grid-gutter":Nn(Pi(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=Ju(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(nl,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const k7={gutter:"md",grow:!1,columns:12},N7=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),ar=ye((e,t)=>{const n=se("Grid",k7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,grow:p,gutter:m,columns:g,align:x,justify:b,children:S,breakpoints:j,type:C,...R}=n,E=Le({name:"Grid",classes:T0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:N7}),T=gd();return C==="container"&&j?a.jsxs(VC,{value:{getStyles:E,grow:p,columns:g||12,breakpoints:j,type:C},children:[a.jsx(GC,{selector:`.${T}`,...n}),a.jsx("div",{...E("container"),children:a.jsx(ce,{ref:t,...E("root",{className:T}),...R,children:a.jsx("div",{...E("inner"),children:S})})})]}):a.jsxs(VC,{value:{getStyles:E,grow:p,columns:g||12,breakpoints:j,type:C},children:[a.jsx(GC,{selector:`.${T}`,...n}),a.jsx(ce,{ref:t,...E("root",{className:T}),...R,children:a.jsx("div",{...E("inner"),children:S})})]})});ar.classes=T0;ar.displayName="@mantine/core/Grid";ar.Col=R0;function Gh(){return Gh=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},Gh.apply(null,arguments)}function _0(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 O7=v.useLayoutEffect,M7=function(t){var n=En.useRef(t);return O7(function(){n.current=t}),n},WC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},L7=function(t,n){var r=En.useRef();return En.useCallback(function(o){t.current=o,r.current&&WC(r.current,null),r.current=n,n&&WC(n,o)},[n])},QC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},I7=function(t){Object.keys(QC).forEach(function(n){t.style.setProperty(n,QC[n],"important")})},YC=I7,pr=null,KC=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function $7(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),pr||(pr=document.createElement("textarea"),pr.setAttribute("tabindex","-1"),pr.setAttribute("aria-hidden","true"),YC(pr)),pr.parentNode===null&&document.body.appendChild(pr);var o=e.paddingSize,s=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(x){var b=x;pr.style[b]=c[b]}),YC(pr),pr.value=t;var f=KC(pr,e);pr.value=t,f=KC(pr,e),pr.value="x";var p=pr.scrollHeight-o,m=p*n;d==="border-box"&&(m=m+o+s),f=Math.max(m,f);var g=p*r;return d==="border-box"&&(g=g+o+s),f=Math.min(g,f),[f,p]}var XC=function(){},z7=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},U7=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],B7=!!document.documentElement.currentStyle,V7=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=z7(U7,n),o=r.boxSizing;if(o==="")return null;B7&&o==="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}},F7=V7;function D0(e,t,n){var r=M7(n);v.useLayoutEffect(function(){var o=function(c){return r.current(c)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var q7=function(t,n){D0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},H7=function(t){D0(window,"resize",t)},G7=function(t){D0(document.fonts,"loadingdone",t)},W7=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Q7=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,s=t.minRows,c=t.onChange,d=c===void 0?XC:c,f=t.onHeightChange,p=f===void 0?XC:f,m=_0(t,W7),g=m.value!==void 0,x=v.useRef(null),b=L7(x,n),S=v.useRef(0),j=v.useRef(),C=function(){var T=x.current,_=r&&j.current?j.current:F7(T);if(_){j.current=_;var P=$7(_,T.value||T.placeholder||"x",s,o),A=P[0],k=P[1];S.current!==A&&(S.current=A,T.style.setProperty("height",A+"px","important"),p(A,{rowHeight:k}))}},R=function(T){g||C(),d(T)};return v.useLayoutEffect(C),q7(x,function(){if(!g){var E=x.current.value;requestAnimationFrame(function(){var T=x.current;T&&E!==T.value&&C()})}}),H7(C),G7(C),v.createElement("textarea",Gh({},m,{onChange:R,ref:b}))},Y7=v.forwardRef(Q7);const K7={},ol=ye((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:s,resize:c,...d}=se("Textarea",K7,e),f=n&&_R()!=="test",p=f?{maxRows:r,minRows:o}:{};return a.jsx(Sr,{component:f?Y7:"textarea",ref:t,...d,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});ol.classes=Sr.classes;ol.displayName="@mantine/core/Textarea";function ZC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const X7={serialize:JSON.stringify,deserialize:JSON.parse},Lc=ye((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:s,validationError:c,serialize:d,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:x,...b}=se("JsonInput",X7,e),[S,j]=Yn({value:n,defaultValue:r,finalValue:"",onChange:o}),[C,R]=v.useState(ZC(S,f)),E=_=>{p?.(_),R(!0)},T=_=>{typeof m=="function"&&m(_);const P=ZC(_.currentTarget.value,f);s&&!g&&P&&_.currentTarget.value.trim()!==""&&j(d(f(_.currentTarget.value),null,2)),R(P)};return a.jsx(ol,{value:S,onChange:_=>j(_.currentTarget.value),onFocus:E,onBlur:T,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?x:c||!0,"data-monospace":!0})});Lc.classes=Sr.classes;Lc.displayName="@mantine/core/JsonInput";const[Z7,J7]=xr("List component was not found in tree");var A0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const eI={},P0=ye((e,t)=>{const n=se("ListItem",eI,e),{classNames:r,className:o,style:s,styles:c,vars:d,icon:f,children:p,mod:m,...g}=n,x=J7(),b=f||x.icon,S={classNames:r,styles:c};return a.jsx(ce,{...x.getStyles("item",{...S,className:o,style:s}),component:"li",mod:[{"with-icon":!!b,centered:x.center},m],ref:t,...g,children:a.jsxs("div",{...x.getStyles("itemWrapper",S),children:[b&&a.jsx("span",{...x.getStyles("itemIcon",S),children:b}),a.jsx("span",{...x.getStyles("itemLabel",S),children:p})]})})});P0.classes=A0;P0.displayName="@mantine/core/ListItem";const tI={type:"unordered"},nI=(e,{size:t,spacing:n})=>({root:{"--list-fz":On(t),"--list-lh":bR(t),"--list-spacing":Nn(n)}}),vr=ye((e,t)=>{const n=se("List",tI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,type:m,withPadding:g,icon:x,spacing:b,center:S,listStyleType:j,mod:C,...R}=n,E=Le({name:"List",classes:A0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:nI});return a.jsx(Z7,{value:{center:S,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,...R,children:p})})});vr.classes=A0;vr.displayName="@mantine/core/List";vr.Item=P0;var C_={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const JC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Xr("overlay")},rI=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),$p=ye((e,t)=>{const n=se("LoadingOverlay",JC,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:x,zIndex:b,...S}=n,j=Sn(),C=Le({name:"LoadingOverlay",classes:C_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:rI}),R={...JC.overlayProps,...g};return a.jsx(po,{transition:"fade",...p,mounted:!!x,children:E=>a.jsxs(ce,{...C("root",{style:E}),ref:t,...S,children:[a.jsx(Nr,{...C("loader"),unstyled:d,...m}),a.jsx(xc,{...R,...C("overlay"),darkHidden:!0,unstyled:d,color:g?.color||j.white}),a.jsx(xc,{...R,...C("overlay"),lightHidden:!0,unstyled:d,color:g?.color||j.colors.dark[5]})]})})});$p.classes=C_;$p.displayName="@mantine/core/LoadingOverlay";const[iI,Td]=xr("Menu component was not found in the tree");var Ic={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const oI={},k0=ye((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=se("MenuDivider",oI,e),f=Td();return a.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:o,styles:s,classNames:n}),...d})});k0.classes=Ic;k0.displayName="@mantine/core/MenuDivider";const aI={},N0=ye((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=se("MenuDropdown",aI,e),x=v.useRef(null),b=Td(),S=Ar(p,R=>{(R.key==="ArrowUp"||R.key==="ArrowDown")&&(R.preventDefault(),x.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=Ar(d,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=Ar(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return a.jsxs(zi.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Vn(t,x),...b.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});N0.classes=Ic;N0.displayName="@mantine/core/MenuDropdown";const sI={},O0=cr((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,color:d,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:x,"data-disabled":b,...S}=se("MenuItem",sI,e),j=Td(),C=Sn(),{dir:R}=rl(),E=v.useRef(null),T=j.getItemIndex(E.current),_=S,P=Ar(_.onMouseLeave,()=>j.setHovered(-1)),A=Ar(_.onMouseEnter,()=>j.setHovered(j.getItemIndex(E.current))),k=Ar(_.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),L=Ar(_.onFocus,()=>j.setHovered(j.getItemIndex(E.current))),z=d?C.variantColorResolver({color:d,theme:C,variant:"light"}):void 0,B=d?gi({color:d,theme:C}):null;return a.jsxs(er,{...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:L,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:Vn(E,t),role:"menuitem",disabled:x,"data-menu-item":!0,"data-disabled":x||b||void 0,"data-hovered":j.hovered===T?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:A,onMouseLeave:P,onClick:k,onKeyDown:xR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:_.onKeyDown}),__vars:{"--menu-item-color":B?.isThemeColor&&B?.shade===void 0?`var(--mantine-color-${B.color}-6)`:z?.color,"--menu-item-hover":z?.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})]})});O0.classes=Ic;O0.displayName="@mantine/core/MenuItem";const lI={},M0=ye((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=se("MenuLabel",lI,e),f=Td();return a.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:o,styles:s,classNames:n}),...d})});M0.classes=Ic;M0.displayName="@mantine/core/MenuLabel";const cI={refProp:"ref"},E_=v.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=se("MenuTarget",cI,e);if(!Jo(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=Td(),c=n.props,d=Ar(c.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),f=Ar(c.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),p=Ar(c.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return a.jsx(zi.Target,{refProp:r,popupType:"menu",ref:t,...o,children:v.cloneElement(n,{onClick:d,onMouseEnter:f,onMouseLeave:p,"data-expanded":s.opened?!0:void 0})})});E_.displayName="@mantine/core/MenuTarget";const uI={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",uI,e),{children:n,onOpen:r,onClose:o,opened:s,defaultOpened:c,trapFocus:d,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:x,openDelay:b,closeDelay:S,classNames:j,styles:C,unstyled:R,variant:E,vars:T,menuItemTabIndex:_,keepMounted:P,withInitialFocusPlaceholder:A,...k}=t,L=Le({name:"Menu",classes:Ic,props:t,classNames:j,styles:C,unstyled:R}),[z,{setHovered:B,resetHovered:Z}]=m4(),[K,Y]=Yn({value:s,defaultValue:c,finalValue:!1,onChange:f}),[H,W]=v.useState(!1),M=()=>{Y(!1),W(!1),K&&o?.()},I=()=>{Y(!0),!K&&r?.()},$=()=>{K?M():I()},{openDropdown:q,closeDropdown:N}=D7({open:I,close:M,closeDelay:S,openDelay:b}),F=je=>p4("[data-menu-item]","[data-menu-dropdown]",je),{resolvedClassNames:J,resolvedStyles:ae}=el({classNames:j,styles:C,props:t});return Go(()=>{Z()},[K]),a.jsx(iI,{value:{getStyles:L,opened:K,toggleDropdown:$,getItemIndex:F,hovered:z,setHovered:B,openedViaClick:H,setOpenedViaClick:W,closeOnItemClick:p,closeDropdown:x==="click"?M:N,openDropdown:x==="click"?I:q,closeDropdownImmediately:M,loop:m,trigger:x,unstyled:R,menuItemTabIndex:_,withInitialFocusPlaceholder:A},children:a.jsx(zi,{...k,opened:K,onChange:$,defaultOpened:c,trapFocus:P?!1:d,closeOnEscape:g,__staticSelector:"Menu",classNames:J,styles:ae,unstyled:R,variant:E,keepMounted:P,children:n})})}Ce.extend=e=>e;Ce.withProps=YM(Ce);Ce.classes=Ic;Ce.displayName="@mantine/core/Menu";Ce.Item=O0;Ce.Label=M0;Ce.Dropdown=N0;Ce.Target=E_;Ce.Divider=k0;const[dI,$c]=xr("Modal component was not found in tree");var aa={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const fI={},zp=ye((e,t)=>{const n=se("ModalBody",fI,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=$c();return a.jsx(I2,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:c,className:o}),...f})});zp.classes=aa;zp.displayName="@mantine/core/ModalBody";const hI={},Up=ye((e,t)=>{const n=se("ModalCloseButton",hI,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=$c();return a.jsx($2,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:c,className:o}),...f})});Up.classes=aa;Up.displayName="@mantine/core/ModalCloseButton";const pI={},Bp=ye((e,t)=>{const n=se("ModalContent",pI,e),{classNames:r,className:o,style:s,styles:c,vars:d,children:f,__hidden:p,...m}=n,g=$c(),x=g.scrollAreaComponent||T5;return a.jsx(z2,{...g.getStyles("content",{className:o,style:s,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:o,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})})});Bp.classes=aa;Bp.displayName="@mantine/core/ModalContent";const mI={},Vp=ye((e,t)=>{const n=se("ModalHeader",mI,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=$c();return a.jsx(U2,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:c,className:o}),...f})});Vp.classes=aa;Vp.displayName="@mantine/core/ModalHeader";const gI={},Fp=ye((e,t)=>{const n=se("ModalOverlay",gI,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=$c();return a.jsx(B2,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:c,className:o}),...f})});Fp.classes=aa;Fp.displayName="@mantine/core/ModalOverlay";const vI={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Xr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},yI=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Ut(t),"--modal-size":rt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(o)}}),qp=ye((e,t)=>{const n=se("ModalRoot",vI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:x,centered:b,xOffset:S,__staticSelector:j,...C}=n,R=Le({name:j,classes:aa,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:yI});return a.jsx(dI,{value:{yOffset:p,scrollAreaComponent:m,getStyles:R,fullScreen:x},children:a.jsx(L2,{ref:t,...R("root"),"data-full-screen":x||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Zr.Autosize||void 0,unstyled:d,...C})})});qp.classes=aa;qp.displayName="@mantine/core/ModalRoot";const[xI,bI]=ea();function T_({children:e}){const[t,n]=v.useState([]),[r,o]=v.useState(Xr("modal"));return a.jsx(xI,{value:{stack:t,addModal:(s,c)=>{n(d=>[...new Set([...d,s])]),o(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})}T_.displayName="@mantine/core/ModalStack";const SI={},Hp=ye((e,t)=>{const n=se("ModalTitle",SI,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=$c();return a.jsx(V2,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:c,className:o}),...f})});Hp.classes=aa;Hp.displayName="@mantine/core/ModalTitle";const wI={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Xr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},In=ye((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:s,closeButtonProps:c,children:d,radius:f,opened:p,stackId:m,zIndex:g,...x}=se("Modal",wI,e),b=bI(),S=!!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||Xr("modal")):b.removeModal(m))},[p,m,g]),a.jsxs(qp,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...x,...j,children:[r&&a.jsx(Fp,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...o}),a.jsxs(Bp,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[S&&a.jsxs(Vp,{children:[n&&a.jsx(Hp,{children:n}),s&&a.jsx(Up,{...c})]}),a.jsx(zp,{children:d})]})]})});In.classes=aa;In.displayName="@mantine/core/Modal";In.Root=qp;In.Overlay=Fp;In.Content=Bp;In.Body=zp;In.Header=Vp;In.Title=Hp;In.CloseButton=Up;In.Stack=T_;const[jI,L0]=ea(),[CI,EI]=ea();var Gp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const TI={},RI=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?rt(t):rt(n,"pg-gap")}}),I0=ye((e,t)=>{const n=se("PillGroup",TI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,disabled:m,...g}=n,b=L0()?.size||p||void 0,S=Le({name:"PillGroup",classes:Gp,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:RI,stylesCtx:{size:b},rootSelector:"group"});return a.jsx(CI,{value:{size:b,disabled:m},children:a.jsx(ce,{ref:t,size:b,...S("group"),...g})})});I0.classes=Gp;I0.displayName="@mantine/core/PillGroup";const _I={variant:"default"},DI=(e,{radius:t},{size:n})=>({root:{"--pill-fz":rt(n,"pill-fz"),"--pill-height":rt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ut(t)}}),Yo=ye((e,t)=>{const n=se("Pill",_I,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:x,removeButtonProps:b,radius:S,size:j,disabled:C,mod:R,...E}=n,T=EI(),_=L0(),P=j||T?.size||void 0,A=_?.variant==="filled"?"contrast":p||"default",k=Le({name:"Pill",classes:Gp,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:DI,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||T?.disabled},R],...E,children:[a.jsx("span",{...k("label"),children:m}),g&&a.jsx(ns,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:d,...b,...k("remove",{className:b?.className,style:b?.style}),onMouseDown:L=>{L.preventDefault(),L.stopPropagation(),b?.onMouseDown?.(L)},onClick:L=>{L.stopPropagation(),x?.(),b?.onClick?.(L)}})]})});Yo.classes=Gp;Yo.displayName="@mantine/core/Pill";Yo.Group=I0;var R_={field:"m_45c4369d"};const AI={type:"visible"},$0=ye((e,t)=>{const n=se("PillsInputField",AI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,type:p,disabled:m,id:g,pointer:x,mod:b,...S}=n,j=L0(),C=Nc(),R=Le({name:"PillsInputField",classes:R_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"field"}),E=m||j?.disabled;return a.jsx(ce,{component:"input",ref:Vn(t,j?.fieldRef),"data-type":p,disabled:E,mod:[{disabled:E,pointer:x},b],...R("field"),...S,id:C?.inputId||g,"aria-invalid":j?.hasError,"aria-describedby":C?.describedBy,type:"text",onMouseDown:T=>!x&&T.stopPropagation()})});$0.classes=R_;$0.displayName="@mantine/core/PillsInputField";const PI={},Ka=ye((e,t)=>{const n=se("PillsInput",PI,e),{children:r,onMouseDown:o,onClick:s,size:c,disabled:d,__staticSelector:f,error:p,variant:m,...g}=n,x=v.useRef(null);return a.jsx(jI,{value:{fieldRef:x,size:c,disabled:d,hasError:!!p,variant:m},children:a.jsx(Sr,{size:c,error:p,variant:m,component:"div",ref:t,onMouseDown:b=>{b.preventDefault(),o?.(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})})});Ka.displayName="@mantine/core/PillsInput";Ka.Field=$0;function kI({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,s)=>(Sc(s)?o.push({group:s.group,items:s.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(s.value.toLowerCase().trim())===-1&&o.push(s),o),[])}const NI={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Wp=ye((e,t)=>{const n=se("MultiSelect",NI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,value:m,defaultValue:g,onChange:x,onKeyDown:b,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:R,onDropdownOpen:E,onDropdownClose:T,selectFirstOptionOnChange:_,onOptionSubmit:P,comboboxProps:A,filter:k,limit:L,withScrollArea:z,maxDropdownHeight:B,searchValue:Z,defaultSearchValue:K,onSearchChange:Y,readOnly:H,disabled:W,onFocus:M,onBlur:I,radius:$,rightSection:q,rightSectionWidth:N,rightSectionPointerEvents:F,rightSectionProps:J,leftSection:ae,leftSectionWidth:je,leftSectionPointerEvents:xe,leftSectionProps:we,inputContainer:Qe,inputWrapperOrder:Ee,withAsterisk:ot,labelProps:nt,descriptionProps:Ct,errorProps:Mt,wrapperProps:Lt,description:pt,label:Rt,error:tn,maxValues:Re,searchable:Pe,nothingFoundMessage:Xe,withCheckIcon:Ae,checkIconPosition:pe,hidePickedOptions:Se,withErrorStyles:ze,name:be,form:Me,id:Dt,clearable:bt,clearButtonProps:nn,hiddenInputProps:$t,placeholder:$n,hiddenInputValuesDivider:An,required:Vi,mod:Ei,renderOption:xo,onRemove:Ir,onClear:bo,scrollAreaProps:Jr,chevronColor:ml,...So}=n,da=br(Dt),Fi=K2(j),wr=X2(Fi),Hn=il({opened:C,defaultOpened:R,onDropdownOpen:E,onDropdownClose:()=>{T?.(),Hn.resetSelectedOption()}}),{styleProps:wo,rest:{type:fa,autoComplete:ls,...cs}}=ra(So),[V,X]=Yn({value:m,defaultValue:g,finalValue:[],onChange:x}),[ie,ve]=Yn({value:Z,defaultValue:K,finalValue:"",onChange:Y}),Te=et=>{ve(et),Hn.resetSelectedOption()},Ve=Le({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:d}),{resolvedClassNames:Ye,resolvedStyles:Fe}=el({props:n,styles:c,classNames:r}),Je=et=>{b?.(et),et.key===" "&&!Pe&&(et.preventDefault(),Hn.toggleDropdown()),et.key==="Backspace"&&ie.length===0&&V.length>0&&(Ir?.(V[V.length-1]),X(V.slice(0,V.length-1)))},it=V.map((et,Kt)=>a.jsx(Yo,{withRemoveButton:!H&&!wr[et]?.disabled,onRemove:()=>{X(V.filter(vn=>et!==vn)),Ir?.(et)},unstyled:d,disabled:W,...Ve("pill"),children:wr[et]?.label||et},`${et}-${Kt}`));v.useEffect(()=>{_&&Hn.selectFirstOption()},[_,ie]);const qe=a.jsx(We.ClearButton,{...nn,onClear:()=>{bo?.(),X([]),Te("")}}),Ke=kI({data:Fi,value:V}),ft=bt&&V.length>0&&!W&&!H;return a.jsxs(a.Fragment,{children:[a.jsxs(We,{store:Hn,classNames:Ye,styles:Fe,unstyled:d,size:p,readOnly:H,__staticSelector:"MultiSelect",onOptionSubmit:et=>{P?.(et),Te(""),Hn.updateSelectedOptionIndex("selected"),V.includes(wr[et].value)?(X(V.filter(Kt=>Kt!==wr[et].value)),Ir?.(wr[et].value)):V.length<Re&&X([...V,wr[et].value])},...A,children:[a.jsx(We.DropdownTarget,{children:a.jsx(Ka,{...wo,__staticSelector:"MultiSelect",classNames:Ye,styles:Fe,unstyled:d,size:p,className:o,style:s,variant:S,disabled:W,radius:$,__defaultRightSection:a.jsx(We.Chevron,{size:p,error:tn,unstyled:d,color:ml}),__clearSection:qe,__clearable:ft,rightSection:q,rightSectionPointerEvents:F||(qe?"all":"none"),rightSectionWidth:N,rightSectionProps:J,leftSection:ae,leftSectionWidth:je,leftSectionPointerEvents:xe,leftSectionProps:we,inputContainer:Qe,inputWrapperOrder:Ee,withAsterisk:ot,labelProps:nt,descriptionProps:Ct,errorProps:Mt,wrapperProps:Lt,description:pt,label:Rt,error:tn,withErrorStyles:ze,__stylesApiProps:{...n,rightSectionPointerEvents:F||(ft?"all":"none"),multiline:!0},pointer:!Pe,onClick:()=>Pe?Hn.openDropdown():Hn.toggleDropdown(),"data-expanded":Hn.dropdownOpened||void 0,id:da,required:Vi,mod:Ei,children:a.jsxs(Yo.Group,{disabled:W,unstyled:d,...Ve("pillsList"),children:[it,a.jsx(We.EventsTarget,{autoComplete:ls,children:a.jsx(Ka.Field,{...cs,ref:t,id:da,placeholder:$n,type:!Pe&&!$n?"hidden":"visible",...Ve("inputField"),unstyled:d,onFocus:et=>{M?.(et),Pe&&Hn.openDropdown()},onBlur:et=>{I?.(et),Hn.closeDropdown(),Te("")},onKeyDown:Je,value:ie,onChange:et=>{Te(et.currentTarget.value),Pe&&Hn.openDropdown(),_&&Hn.selectFirstOption()},disabled:W,readOnly:H||!Pe,pointer:!Pe})})]})})}),a.jsx(YL,{data:Se?Ke:Fi,hidden:H||W,filter:k,search:ie,limit:L,hiddenWhenEmpty:!Xe,withScrollArea:z,maxDropdownHeight:B,filterOptions:Pe,value:V,checkIconPosition:pe,withCheckIcon:Ae,nothingFoundMessage:Xe,unstyled:d,labelId:Rt?`${da}-label`:void 0,"aria-label":Rt?void 0:So["aria-label"],renderOption:xo,scrollAreaProps:Jr})]}),a.jsx(We.HiddenInput,{name:be,valuesDivider:An,value:V,form:Me,disabled:W,...$t})]})});Wp.classes={...Sr.classes,...We.classes};Wp.displayName="@mantine/core/MultiSelect";function OI(e){return"group"in e}function z0({data:e}){if(OI(e)){const o=e.items.map(s=>a.jsx(z0,{data:s},s.value));return a.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return a.jsx("option",{value:e.value,...r,children:e.label},e.value)}z0.displayName="@mantine/core/NativeSelectOption";const MI={rightSectionPointerEvents:"none"},sn=ye((e,t)=>{const{data:n,children:r,size:o,error:s,rightSection:c,unstyled:d,...f}=se("NativeSelect",MI,e),p=K2(n).map((m,g)=>a.jsx(z0,{data:m},g));return a.jsx(Sr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:o,pointer:!0,error:s,unstyled:d,rightSection:c||a.jsx(Op,{size:o,error:s,unstyled:d}),children:r||p})});sn.classes=Sr.classes;sn.displayName="@mantine/core/NativeSelect";var __={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const LI={withCloseButton:!0},II=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ut(t),"--notification-color":n?Ft(n,e):void 0}}),U0=ye((e,t)=>{const n=se("Notification",LI,e),{className:r,color:o,radius:s,loading:c,withCloseButton:d,withBorder:f,title:p,icon:m,children:g,onClose:x,closeButtonProps:b,classNames:S,style:j,styles:C,unstyled:R,variant:E,vars:T,mod:_,loaderProps:P,role:A,...k}=n,L=Le({name:"Notification",classes:__,props:n,className:r,style:j,classNames:S,styles:C,unstyled:R,vars:T,varsResolver:II});return a.jsxs(ce,{...L("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",{...L("icon"),children:m}),c&&a.jsx(Nr,{size:28,color:o,...P,...L("loader")}),a.jsxs("div",{...L("body"),children:[p&&a.jsx("div",{...L("title"),children:p}),a.jsx(ce,{...L("description"),mod:{"data-with-title":!!p},children:g})]}),d&&a.jsx(ns,{iconSize:16,color:"gray",...b,unstyled:R,onClick:x,...L("closeButton")})]})});U0.classes=__;U0.displayName="@mantine/core/Notification";function D_(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}var id;(function(e){e.event="event",e.props="prop"})(id||(id={}));function Fa(){}function $I(e){var t,n=void 0;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];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 od(e){return!!(e||"").match(/\d/)}function fc(e){return e==null}function zI(e){return typeof e=="number"&&isNaN(e)}function A_(e){return fc(e)||zI(e)||typeof e=="number"&&!isFinite(e)}function P_(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function UI(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 BI(e,t,n){var r=UI(n),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}function VI(e){var t=v.useRef(e);t.current=e;var n=v.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function B0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),s=o[0],c=o[1]||"";return{beforeDecimal:s,afterDecimal:c,hasNegation:n,addNegation:r}}function FI(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",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}function k_(e,t,n){for(var r="",o=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||o;return r}function eE(e,t){return Array(t+1).join(e)}function N_(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],s=r[1];if(s=Number(s),!s)return n+o;o=o.replace(".","");var c=1+s,d=o.length;return c<0?o="0."+eE("0",Math.abs(c))+o:c>=d?o=o+eE("0",c-d):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function tE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=B0(e),s=o.beforeDecimal,c=o.afterDecimal,d=o.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,R){return j.length>R?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var x=k_(m[1]||"",t,n),b=d?"-":"",S=r?".":"";return""+b+g+S+x}function ks(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 O_=$I(function(e,t){for(var n=0,r=0,o=e.length,s=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[s-1-r]&&s-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:s-r}}}),qI=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function HI(e,t,n){return Math.min(Math.max(e,t),n)}function ey(e){return Math.max(e.selectionStart,e.selectionEnd)}function GI(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function WI(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function QI(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function YI(e,t,n,r,o,s,c){c===void 0&&(c=QI);var d=o.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 S=0,j=m;S<j;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:S});if(C&&g[S]!==!0){x[b]=S,g[S]=!0;break}}}for(var R=r;R<p&&(x[R]===-1||!s(n[R]));)R++;var E=R===p||x[R]===-1?m:x[R];for(R=r-1;R>0&&x[R]===-1;)R--;var T=R===-1||x[R]===-1?0:x[R]+1;return T>E?E:r-T<E-r?T:E}function nE(e,t,n,r){var o=e.length;if(t=HI(t,0,o),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function KI(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(od(e[n])||od(e[n-1]));return t}function M_(e,t,n,r,o,s){s===void 0&&(s=Fa);var c=VI(function(S,j){var C,R;return A_(S)?(R="",C=""):typeof S=="number"||j?(R=typeof S=="number"?N_(S):S,C=r(R)):(R=o(S,void 0),C=r(R)),{formattedValue:C,numAsString:R}}),d=v.useState(function(){return c(fc(e)?t:e,n)}),f=d[0],p=d[1],m=function(S,j){S.formattedValue!==f.formattedValue&&p({formattedValue:S.formattedValue,numAsString:S.value}),s(S,j)},g=e,x=n;fc(e)&&(g=f.numAsString,x=!0);var b=c(g,x);return v.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function XI(e){return e.replace(/[^0-9]/g,"")}function ZI(e){return e}function JI(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,o=e.renderText,s=e.getInputRef,c=e.format;c===void 0&&(c=ZI);var d=e.removeFormatting;d===void 0&&(d=XI);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,x=e.onChange;x===void 0&&(x=Fa);var b=e.onKeyDown;b===void 0&&(b=Fa);var S=e.onMouseUp;S===void 0&&(S=Fa);var j=e.onFocus;j===void 0&&(j=Fa);var C=e.onBlur;C===void 0&&(C=Fa);var R=e.value,E=e.getCaretBoundary;E===void 0&&(E=KI);var T=e.isValidInputCharacter;T===void 0&&(T=od);var _=e.isCharacterSame,P=D_(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=M_(R,f,!!p,c,d,m),k=A[0],L=k.formattedValue,z=k.numAsString,B=A[1],Z=v.useRef(),K=v.useRef({formattedValue:L,numAsString:z}),Y=function(Re,Pe){K.current={formattedValue:Re.formattedValue,numAsString:Re.value},B(Re,Pe)},H=v.useState(!1),W=H[0],M=H[1],I=v.useRef(null),$=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return M(!0),function(){clearTimeout($.current.setCaretTimeout),clearTimeout($.current.focusTimeout)}},[]);var q=c,N=function(Re,Pe){var Xe=parseFloat(Pe);return{formattedValue:Re,value:Pe,floatValue:isNaN(Xe)?void 0:Xe}},F=function(Re,Pe,Xe){Re.selectionStart===0&&Re.selectionEnd===Re.value.length||(ks(Re,Pe),$.current.setCaretTimeout=setTimeout(function(){Re.value===Xe&&Re.selectionStart!==Pe&&ks(Re,Pe)},0))},J=function(Re,Pe,Xe){return nE(Re,Pe,E(Re),Xe)},ae=function(Re,Pe,Xe){var Ae=E(Pe),pe=YI(Pe,L,Re,Xe,Ae,T,_);return pe=nE(Pe,pe,Ae),pe},je=function(Re){var Pe=Re.formattedValue;Pe===void 0&&(Pe="");var Xe=Re.input,Ae=Re.source,pe=Re.event,Se=Re.numAsString,ze;if(Xe){var be=Re.inputValue||Xe.value,Me=ey(Xe);Xe.value=Pe,ze=ae(be,Pe,Me),ze!==void 0&&F(Xe,ze,Pe)}Pe!==L&&Y(N(Pe,Se),{event:pe,source:Ae})};v.useEffect(function(){var Re=K.current,Pe=Re.formattedValue,Xe=Re.numAsString;(L!==Pe||z!==Xe)&&Y(N(L,z),{event:void 0,source:id.props})},[L,z]);var xe=I.current?ey(I.current):void 0,we=typeof window<"u"?v.useLayoutEffect:v.useEffect;we(function(){var Re=I.current;if(L!==K.current.formattedValue&&Re){var Pe=ae(K.current.formattedValue,L,xe);Re.value=L,F(Re,Pe,L)}},[L]);var Qe=function(Re,Pe,Xe){var Ae=Pe.target,pe=Z.current?qI(Z.current,Ae.selectionEnd):O_(L,Re),Se=Object.assign(Object.assign({},pe),{lastValue:L}),ze=d(Re,Se),be=q(ze);if(ze=d(be,void 0),g&&!g(N(be,ze))){var Me=Pe.target,Dt=ey(Me),bt=ae(Re,L,Dt);return Me.value=L,F(Me,bt,L),!1}return je({formattedValue:be,numAsString:ze,inputValue:Re,event:Pe,source:Xe,input:Pe.target}),!0},Ee=function(Re,Pe){Pe===void 0&&(Pe=0);var Xe=Re.selectionStart,Ae=Re.selectionEnd;Z.current={selectionStart:Xe,selectionEnd:Ae+Pe}},ot=function(Re){var Pe=Re.target,Xe=Pe.value,Ae=Qe(Xe,Re,id.event);Ae&&x(Re),Z.current=void 0},nt=function(Re){var Pe=Re.target,Xe=Re.key,Ae=Pe.selectionStart,pe=Pe.selectionEnd,Se=Pe.value;Se===void 0&&(Se="");var ze;Xe==="ArrowLeft"||Xe==="Backspace"?ze=Math.max(Ae-1,0):Xe==="ArrowRight"?ze=Math.min(Ae+1,Se.length):Xe==="Delete"&&(ze=Ae);var be=0;Xe==="Delete"&&Ae===pe&&(be=1);var Me=Xe==="ArrowLeft"||Xe==="ArrowRight";if(ze===void 0||Ae!==pe&&!Me){b(Re),Ee(Pe,be);return}var Dt=ze;if(Me){var bt=Xe==="ArrowLeft"?"left":"right";Dt=J(Se,ze,bt),Dt!==ze&&Re.preventDefault()}else Xe==="Delete"&&!T(Se[ze])?Dt=J(Se,ze,"right"):Xe==="Backspace"&&!T(Se[ze])&&(Dt=J(Se,ze,"left"));Dt!==ze&&F(Pe,Dt,Se),b(Re),Ee(Pe,be)},Ct=function(Re){var Pe=Re.target,Xe=function(){var Ae=Pe.selectionStart,pe=Pe.selectionEnd,Se=Pe.value;if(Se===void 0&&(Se=""),Ae===pe){var ze=J(Se,Ae);ze!==Ae&&F(Pe,ze,Se)}};Xe(),requestAnimationFrame(function(){Xe()}),S(Re),Ee(Pe)},Mt=function(Re){Re.persist&&Re.persist();var Pe=Re.target,Xe=Re.currentTarget;I.current=Pe,$.current.focusTimeout=setTimeout(function(){var Ae=Pe.selectionStart,pe=Pe.selectionEnd,Se=Pe.value;Se===void 0&&(Se="");var ze=J(Se,Ae);ze!==Ae&&!(Ae===0&&pe===Se.length)&&F(Pe,ze,Se),j(Object.assign(Object.assign({},Re),{currentTarget:Xe}))},0)},Lt=function(Re){I.current=null,clearTimeout($.current.focusTimeout),clearTimeout($.current.setCaretTimeout),C(Re)},pt=W&&GI()?"numeric":void 0,Rt=Object.assign({inputMode:pt},P,{type:t,value:L,onChange:ot,onKeyDown:nt,onMouseUp:Ct,onFocus:Mt,onBlur:Lt});if(n==="text")return o?En.createElement(En.Fragment,null,o(L,P)||null):En.createElement("span",Object.assign({},P,{ref:s}),L);if(r){var tn=r;return En.createElement(tn,Object.assign({},Rt,{ref:s}))}return En.createElement("input",Object.assign({},Rt,{ref:s}))}function rE(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");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=Qp(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,x=B0(e,c),b=x.beforeDecimal,S=x.afterDecimal,j=x.addNegation;return n!==void 0&&(S=k_(S,n,!!r)),p&&(b=BI(b,p,d)),o&&(b=o+b),s&&(S=S+s),j&&(b="-"+b),e=b+(g&&m||"")+S,e}function Qp(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 e6(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),s=r.test(e);return e=e.replace(/-/g,""),o&&!s&&t&&(e="-"+e),e}function t6(e,t){return new RegExp("(^-)|[0-9]|"+P_(e),"g")}function n6(e,t,n){return e===""?!0:!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function r6(e,t,n){var r;t===void 0&&(t=WI(e));var o=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=Qp(n),b=x.allowedDecimalSeparators,S=x.decimalSeparator,j=e[g]===S;if(od(e)&&(e===s||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=d===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var R=function(I,$,q){var N=!1,F=!1;s.startsWith("-")?N=!1:I.startsWith("--")?(N=!1,F=!0):c.startsWith("-")&&I.length===c.length?N=!1:I[0]==="-"&&(N=!0);var J=N?1:0;return F&&(J=2),J&&(I=I.substring(J),$-=J,q-=J),{value:I,start:$,end:q,hasNegation:N}},E=R(e,m,g),T=E.hasNegation;r=E,e=r.value,m=r.start,g=r.end;var _=R(t.lastValue,f.start,f.end),P=_.start,A=_.end,k=_.value,L=e.substring(m,g);e.length&&k.length&&(P>k.length-c.length||A<s.length)&&!(L&&c.startsWith(L))&&(e=k);var z=0;e.startsWith(s)?z+=s.length:m<s.length&&(z=m),e=e.substring(z),g-=z;var B=e.length,Z=e.length-c.length;e.endsWith(c)?B=Z:(g>Z||g>e.length-c.length)&&(B=g),e=e.substring(0,B),e=e6(T?"-"+e:e,o),e=(e.match(t6(S))||[]).join("");var K=e.indexOf(S);e=e.replace(new RegExp(P_(S),"g"),function(I,$){return $===K?".":""});var Y=B0(e,o),H=Y.beforeDecimal,W=Y.afterDecimal,M=Y.addNegation;return p.end-p.start<f.end-f.start&&H===""&&j&&!parseFloat(W)&&(e=M?"-":""),e}function i6(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),s=e[0]==="-";o.fill(!1,0,n.length+(s?1:0));var c=e.length;return o.fill(!1,c-r.length+1,c+1),o}function o6(e){var t=Qp(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");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 o.startsWith("-")&&s&&(console.error(`
|
|
73
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
74
|
-
prefix: `+o+`
|
|
75
|
-
allowNegative: `+s+`
|
|
76
|
-
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function a6(e){e=o6(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=Fa);var s=e.onBlur;s===void 0&&(s=Fa);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,S=D_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Qp(e),C=j.decimalSeparator,R=j.allowedDecimalSeparators,E=function(M){return rE(M,e)},T=function(M,I){return r6(M,I,e)},_=fc(g)?m:g,P=x??n6(_,p,t);fc(g)?fc(m)||(P=P||typeof m=="number"):P=P||typeof g=="number";var A=function(M){return A_(M)?M:(typeof M=="number"&&(M=N_(M)),P&&typeof d=="number"?tE(M,d,!!f):M)},k=M_(A(g),A(m),!!P,E,T,b),L=k[0],z=L.numAsString,B=L.formattedValue,Z=k[1],K=function(M){var I=M.target,$=M.key,q=I.selectionStart,N=I.selectionEnd,F=I.value;if(F===void 0&&(F=""),($==="Backspace"||$==="Delete")&&N<p.length){M.preventDefault();return}if(q!==N){o(M);return}$==="Backspace"&&F[0]==="-"&&q===p.length+1&&n&&ks(I,1),d&&f&&($==="Backspace"&&F[q-1]===C?(ks(I,q-1),M.preventDefault()):$==="Delete"&&F[q]===C&&M.preventDefault()),R?.includes($)&&F[q]===C&&ks(I,q+1);var J=c===!0?",":c;$==="Backspace"&&F[q-1]===J&&ks(I,q-1),$==="Delete"&&F[q]===J&&ks(I,q+1),o(M)},Y=function(M){var I=z;if(I.match(/\d/g)||(I=""),r||(I=FI(I)),f&&d&&(I=tE(I,d,f)),I!==z){var $=rE(I,e);Z({formattedValue:$,value:I,floatValue:parseFloat(I)},{event:M,source:id.event})}s(M)},H=function(M){return M===C?!0:od(M)},W=function(M){var I=M.currentValue,$=M.lastValue,q=M.formattedValue,N=M.currentValueIndex,F=M.formattedValueIndex,J=I[N],ae=q[F],je=O_($,I),xe=je.to,we=function(Qe){return T(Qe).indexOf(".")+p.length};return g===0&&f&&d&&I[xe.start]===C&&we(I)<N&&we(q)>F?!1:N>=xe.start&&N<xe.end&&R&&R.includes(J)&&ae===C?!0:J===ae};return Object.assign(Object.assign({},S),{value:B,valueIsNumericString:!1,isValidInputCharacter:H,isCharacterSame:W,onValueChange:Z,format:E,removeFormatting:T,getCaretBoundary:function(M){return i6(M,e)},onKeyDown:K,onBlur:Y})}function s6(e){var t=a6(e);return En.createElement(JI,Object.assign({},t))}function iE({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 Hy={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const l6=/^(0\.0*|-0(\.0*)?)$/,c6=/^-?0\d+(\.\d+)?\.?$/;function Gy(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function ty(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Gy(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function u6(e){return e.toString().replace(".","").length}function d6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&u6(t)<14&&t!==""}function oE(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,o=n===void 0||e<=n;return r&&o}const f6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},h6=(e,{size:t})=>({controls:{"--ni-chevron-size":rt(t,"ni-chevron-size")}});function p6(e,t,n){const r=e.toString().replace(/^0+/,""),o=parseFloat(r);return Number.isNaN(o)?r:o>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:Th(o,n,t)}const wc=ye((e,t)=>{const n=se("NumberInput",f6,e),{className:r,classNames:o,styles:s,unstyled:c,vars:d,onChange:f,onValueChange:p,value:m,defaultValue:g,max:x,min:b,step:S,hideControls:j,rightSection:C,isAllowed:R,clampBehavior:E,onBlur:T,allowDecimal:_,decimalScale:P,onKeyDown:A,onKeyDownCapture:k,handlersRef:L,startValue:z,disabled:B,rightSectionPointerEvents:Z,allowNegative:K,readOnly:Y,size:H,rightSectionWidth:W,stepHoldInterval:M,stepHoldDelay:I,allowLeadingZeros:$,withKeyboardEvents:q,trimLeadingZeroesOnBlur:N,...F}=n,J=Le({name:"NumberInput",classes:Hy,props:n,classNames:o,styles:s,unstyled:c,vars:d,varsResolver:h6}),{resolvedClassNames:ae,resolvedStyles:je}=el({classNames:o,styles:s,props:n}),[xe,we]=Yn({value:m,defaultValue:g,finalValue:"",onChange:f}),Qe=I!==void 0&&M!==void 0,Ee=v.useRef(null),ot=v.useRef(null),nt=v.useRef(0),Ct=(be,Me)=>{Me.source==="event"&&we(d6(be.floatValue,be.value)&&!l6.test(be.value)&&!($&&c6.test(be.value))?be.floatValue:be.value),p?.(be,Me)},Mt=be=>{const Me=String(be).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Me?Math.max(0,(Me[1]?Me[1].length:0)-(Me[2]?+Me[2]:0)):0},Lt=be=>{Ee.current&&typeof be<"u"&&Ee.current.setSelectionRange(be,be)},pt=v.useRef(zh);pt.current=()=>{if(!ty(xe))return;let be;const Me=Mt(xe),Dt=Mt(S),bt=Math.max(Me,Dt),nn=10**bt;if(!Gy(xe)&&(typeof xe!="number"||Number.isNaN(xe)))be=Th(z,b,x);else if(x!==void 0){const $n=(Math.round(Number(xe)*nn)+Math.round(S*nn))/nn;be=$n<=x?$n:x}else be=(Math.round(Number(xe)*nn)+Math.round(S*nn))/nn;const $t=be.toFixed(bt);we(parseFloat($t)),p?.({floatValue:parseFloat($t),formattedValue:$t,value:$t},{source:"increment"}),setTimeout(()=>Lt(Ee.current?.value.length),0)};const Rt=v.useRef(zh);Rt.current=()=>{if(!ty(xe))return;let be;const Me=b!==void 0?b:K?Number.MIN_SAFE_INTEGER:0,Dt=Mt(xe),bt=Mt(S),nn=Math.max(Dt,bt),$t=10**nn;if(!Gy(xe)&&typeof xe!="number"||Number.isNaN(xe))be=Th(z,Me,x);else{const An=(Math.round(Number(xe)*$t)-Math.round(S*$t))/$t;be=Me!==void 0&&An<Me?Me:An}const $n=be.toFixed(nn);we(parseFloat($n)),p?.({floatValue:parseFloat($n),formattedValue:$n,value:$n},{source:"decrement"}),setTimeout(()=>Lt(Ee.current?.value.length),0)};const tn=be=>{A?.(be),!(Y||!q)&&(be.key==="ArrowUp"&&(be.preventDefault(),pt.current()),be.key==="ArrowDown"&&(be.preventDefault(),Rt.current()))},Re=be=>{if(k?.(be),be.key==="Backspace"){const Me=Ee.current;Me.selectionStart===0&&Me.selectionStart===Me.selectionEnd&&(be.preventDefault(),window.setTimeout(()=>Lt(0),0))}},Pe=be=>{let Me=xe;E==="blur"&&typeof Me=="number"&&(Me=Th(Me,b,x)),N&&typeof Me=="string"&&Mt(Me)<15&&(Me=p6(Me,x,b)),xe!==Me&&we(Me),T?.(be)};ed(L,{increment:pt.current,decrement:Rt.current});const Xe=be=>{be?pt.current():Rt.current(),nt.current+=1},Ae=be=>{if(Xe(be),Qe){const Me=typeof M=="number"?M:M(nt.current);ot.current=window.setTimeout(()=>Ae(be),Me)}},pe=(be,Me)=>{be.preventDefault(),Ee.current?.focus(),Xe(Me),Qe&&(ot.current=window.setTimeout(()=>Ae(Me),I))},Se=()=>{ot.current&&window.clearTimeout(ot.current),ot.current=null,nt.current=0},ze=a.jsxs("div",{...J("controls"),children:[a.jsx(er,{...J("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof xe=="number"&&x!==void 0&&xe>=x,mod:{direction:"up"},onMouseDown:be=>be.preventDefault(),onPointerDown:be=>{pe(be,!0)},onPointerUp:Se,onPointerLeave:Se,children:a.jsx(iE,{direction:"up"})}),a.jsx(er,{...J("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof xe=="number"&&b!==void 0&&xe<=b,mod:{direction:"down"},onMouseDown:be=>be.preventDefault(),onPointerDown:be=>{pe(be,!1)},onPointerUp:Se,onPointerLeave:Se,children:a.jsx(iE,{direction:"down"})})]});return a.jsx(Sr,{component:s6,allowNegative:K,className:It(Hy.root,r),size:H,...F,readOnly:Y,disabled:B,value:xe,getInputRef:Vn(t,Ee),onValueChange:Ct,rightSection:j||Y||!ty(xe)?C:C||ze,classNames:ae,styles:je,unstyled:c,__staticSelector:"NumberInput",decimalScale:_?P:0,onKeyDown:tn,onKeyDownCapture:Re,rightSectionPointerEvents:Z??(B?"none":void 0),rightSectionWidth:W??`var(--ni-right-section-width-${H||"sm"})`,allowLeadingZeros:$,onBlur:Pe,isAllowed:be=>E==="strict"?R?R(be)&&oE(be.floatValue,b,x):oE(be.floatValue,b,x):R?R(be):!0})});wc.classes={...Sr.classes,...Hy};wc.displayName="@mantine/core/NumberInput";const[m6,Yp]=xr("Pagination.Root component was not found in tree");var Rd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const g6={withPadding:!0},_d=ye((e,t)=>{const n=se("PaginationControl",g6,e),{classNames:r,className:o,style:s,styles:c,vars:d,active:f,disabled:p,withPadding:m,mod:g,...x}=n,b=Yp(),S=p||b.disabled;return a.jsx(er,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:o,style:s,classNames:r,styles:c,active:!S}),...x})});_d.classes=Rd;_d.displayName="@mantine/core/PaginationControl";function Dd({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 v6=e=>a.jsx(Dd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),y6=e=>a.jsx(Dd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),x6=e=>a.jsx(Dd,{...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"}),b6=e=>a.jsx(Dd,{...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"}),S6=e=>a.jsx(Dd,{...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"}),w6={icon:S6},Kp=ye((e,t)=>{const n=se("PaginationDots",w6,e),{classNames:r,className:o,style:s,styles:c,vars:d,icon:f,...p}=n,m=Yp(),g=f;return a.jsx(ce,{ref:t,...m.getStyles("dots",{className:o,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)"}})})});Kp.classes=Rd;Kp.displayName="@mantine/core/PaginationDots";function Xp({icon:e,name:t,action:n,type:r}){const o={icon:e},s=v.forwardRef((c,d)=>{const{icon:f,...p}=se(t,o,c),m=f,g=Yp(),x=r==="next"?g.active===g.total:g.active===1;return a.jsx(_d,{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 L_=Xp({icon:v6,name:"PaginationNext",action:"onNext",type:"next"}),I_=Xp({icon:y6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),$_=Xp({icon:x6,name:"PaginationFirst",action:"onFirst",type:"previous"}),z_=Xp({icon:b6,name:"PaginationLast",action:"onLast",type:"next"});function V0({dotsIcon:e}){const t=Yp(),n=t.range.map((r,o)=>r==="dots"?a.jsx(Kp,{icon:e},o):a.jsx(_d,{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},o));return a.jsx(a.Fragment,{children:n})}V0.displayName="@mantine/core/PaginationItems";const j6={siblings:1,boundaries:1},C6=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ut(n),"--pagination-control-size":rt(t,"pagination-control-size"),"--pagination-control-fz":On(t),"--pagination-active-bg":r?Ft(r,e):void 0,"--pagination-active-color":tl(o,e)?na({color:r,theme:e,autoContrast:o}):void 0}}),Zp=ye((e,t)=>{const n=se("PaginationRoot",j6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,total:p,value:m,defaultValue:g,onChange:x,disabled:b,siblings:S,boundaries:j,color:C,radius:R,onNextPage:E,onPreviousPage:T,onFirstPage:_,onLastPage:P,getItemProps:A,autoContrast:k,...L}=n,z=Le({name:"Pagination",classes:Rd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:C6}),{range:B,setPage:Z,next:K,previous:Y,active:H,first:W,last:M}=k4({page:m,initialPage:g,onChange:x,total:p,siblings:S,boundaries:j}),I=Ar(E,K),$=Ar(T,Y),q=Ar(_,W),N=Ar(P,M);return a.jsx(m6,{value:{total:p,range:B,active:H,disabled:b,getItemProps:A,onChange:Z,onNext:I,onPrevious:$,onFirst:q,onLast:N,getStyles:z},children:a.jsx(ce,{ref:t,...z("root"),...L})})});Zp.classes=Rd;Zp.displayName="@mantine/core/PaginationRoot";const E6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},ji=ye((e,t)=>{const n=se("Pagination",E6,e),{withEdges:r,withControls:o,getControlProps:s,nextIcon:c,previousIcon:d,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:x,hideWithOnePage:b,withPages:S,...j}=n;return g<=0||b&&g===1?null:a.jsx(Zp,{ref:t,total:g,...j,children:a.jsxs(ge,{gap:x,children:[r&&a.jsx($_,{icon:p,...s?.("first")}),o&&a.jsx(I_,{icon:d,...s?.("previous")}),S&&a.jsx(V0,{dotsIcon:m}),o&&a.jsx(L_,{icon:c,...s?.("next")}),r&&a.jsx(z_,{icon:f,...s?.("last")})]})})});ji.classes=Rd;ji.displayName="@mantine/core/Pagination";ji.Root=Zp;ji.Control=_d;ji.Dots=Kp;ji.First=$_;ji.Last=z_;ji.Next=L_;ji.Previous=I_;ji.Items=V0;const T6=({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 Wy={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const R6={visibilityToggleIcon:T6},_6=(e,{size:t})=>({root:{"--psi-icon-size":rt(t,"psi-icon-size"),"--psi-button-size":rt(t,"psi-button-size")}}),Oi=ye((e,t)=>{const n=se("PasswordInput",R6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,required:p,error:m,leftSection:g,disabled:x,id:b,variant:S,inputContainer:j,description:C,label:R,size:E,errorProps:T,descriptionProps:_,labelProps:P,withAsterisk:A,inputWrapperOrder:k,wrapperProps:L,radius:z,rightSection:B,rightSectionWidth:Z,rightSectionPointerEvents:K,leftSectionWidth:Y,visible:H,defaultVisible:W,onVisibilityChange:M,visibilityToggleIcon:I,visibilityToggleButtonProps:$,rightSectionProps:q,leftSectionProps:N,leftSectionPointerEvents:F,withErrorStyles:J,mod:ae,...je}=n,xe=br(b),[we,Qe]=Yn({value:H,defaultValue:W,finalValue:!1,onChange:M}),Ee=()=>Qe(!we),ot=Le({name:"PasswordInput",classes:Wy,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:_6}),{resolvedClassNames:nt,resolvedStyles:Ct}=el({classNames:r,styles:c,props:n}),{styleProps:Mt,rest:Lt}=ra(je),pt=I,Rt=T?.id||`${xe}-error`,tn=_?.id||`${xe}-description`,Xe=`${!!m&&typeof m!="boolean"?Rt:""} ${!!C?tn:""}`,Ae=Xe.trim().length>0?Xe.trim():void 0,pe=a.jsx(bn,{...ot("visibilityToggle"),disabled:x,radius:z,"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:R,error:m,description:C,size:E,classNames:nt,styles:Ct,__staticSelector:"PasswordInput",unstyled:d,withAsterisk:A,inputWrapperOrder:k,inputContainer:j,variant:S,labelProps:{...P,htmlFor:xe},descriptionProps:{..._,id:tn},errorProps:{...T,id:Rt},mod:ae,...ot("root"),...Mt,...L,children:a.jsx(fn,{component:"div",error:m,leftSection:g,size:E,classNames:{...nt,input:It(Wy.input,nt.input)},styles:Ct,radius:z,disabled:x,__staticSelector:"PasswordInput",rightSectionWidth:Z,rightSection:B??pe,variant:S,unstyled:d,leftSectionWidth:Y,rightSectionPointerEvents:K||"all",rightSectionProps:q,leftSectionProps:N,leftSectionPointerEvents:F,withAria:!1,withErrorStyles:J,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,...Lt,"aria-describedby":Ae,autoComplete:Lt.autoComplete||"off",type:we?"text":"password"})})})});Oi.classes={...Sr.classes,...Wy};Oi.displayName="@mantine/core/PasswordInput";const[D6,U_]=ea(),[A6,P6]=ea();var B_={card:"m_9dc8ae12"};const k6={withBorder:!0},N6=(e,{radius:t})=>({card:{"--card-radius":Ut(t)}}),F0=ye((e,t)=>{const n=se("RadioCard",k6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:x,onClick:b,name:S,onKeyDown:j,...C}=n,R=Le({name:"RadioCard",classes:B_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:N6,rootSelector:"card"}),{dir:E}=rl(),T=U_(),_=typeof p=="boolean"?p:T?.value===x||!1,P=S||T?.name,A=k=>{if(j?.(k),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(k.nativeEvent.code)){k.preventDefault();const L=Array.from(document.querySelectorAll(`[role="radio"][name="${P||"__mantine"}"]`)),z=L.findIndex(K=>K===k.target),B=z+1>=L.length?0:z+1,Z=z-1<0?L.length-1:z-1;k.nativeEvent.code==="ArrowDown"&&(L[B].focus(),L[B].click()),k.nativeEvent.code==="ArrowUp"&&(L[Z].focus(),L[Z].click()),k.nativeEvent.code==="ArrowLeft"&&(L[E==="ltr"?Z:B].focus(),L[E==="ltr"?Z:B].click()),k.nativeEvent.code==="ArrowRight"&&(L[E==="ltr"?B:Z].focus(),L[E==="ltr"?B:Z].click())}};return a.jsx(A6,{value:{checked:_},children:a.jsx(er,{ref:t,mod:[{"with-border":g,checked:_},m],...R("card"),...C,role:"radio","aria-checked":_,name:P,onClick:k=>{b?.(k),T?.onChange(x||"")},onKeyDown:A})})});F0.displayName="@mantine/core/RadioCard";F0.classes=B_;const O6={},q0=ye((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,name:f,readOnly:p,...m}=se("RadioGroup",O6,e),g=br(f),[x,b]=Yn({value:n,defaultValue:r,finalValue:"",onChange:o}),S=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return a.jsx(D6,{value:{value:x,onChange:S,size:s,name:g},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:a.jsx(y0,{role:"radiogroup",children:d})})})});q0.classes=fn.Wrapper.classes;q0.displayName="@mantine/core/RadioGroup";function V_({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 F_={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const M6={icon:V_},L6=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=gi({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":rt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Ut(t),"--radio-color":s==="outline"?f:Ft(n,e),"--radio-icon-size":rt(r,"radio-icon-size"),"--radio-icon-color":o?Ft(o,e):tl(c,e)?na({color:n,theme:e,autoContrast:c}):void 0}}},H0=ye((e,t)=>{const n=se("RadioIndicator",M6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,icon:p,radius:m,color:g,iconColor:x,autoContrast:b,checked:S,mod:j,variant:C,disabled:R,...E}=n,T=p,_=Le({name:"RadioIndicator",classes:F_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:L6,rootSelector:"indicator"}),P=P6(),A=typeof S=="boolean"?S:P?.checked||!1;return a.jsx(ce,{ref:t,..._("indicator",{variant:C}),variant:C,mod:[{checked:A,disabled:R},j],...E,children:a.jsx(T,{..._("icon")})})});H0.displayName="@mantine/core/RadioIndicator";H0.classes=F_;var q_={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const I6={labelPosition:"right"},$6=(e,{size:t,radius:n,color:r,iconColor:o,variant:s,autoContrast:c})=>{const d=gi({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":rt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ut(n),"--radio-color":s==="outline"?f:Ft(r,e),"--radio-icon-color":o?Ft(o,e):tl(c,e)?na({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":rt(t,"radio-icon-size")}}},rr=ye((e,t)=>{const n=se("Radio",I6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,id:p,size:m,label:g,labelPosition:x,description:b,error:S,radius:j,color:C,variant:R,disabled:E,wrapperProps:T,icon:_=V_,rootRef:P,iconColor:A,onChange:k,mod:L,...z}=n,B=Le({name:"Radio",classes:q_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:$6}),Z=U_(),K=Z?.size??m,Y=n.size?m:K,{styleProps:H,rest:W}=ra(z),M=br(p),I=Z?{checked:Z.value===W.value,name:W.name??Z.name,onChange:$=>{Z.onChange($),k?.($)}}:{};return a.jsx(Mp,{...B("root"),__staticSelector:"Radio",__stylesApiProps:n,id:M,size:Y,labelPosition:x,label:g,description:b,error:S,disabled:E,classNames:r,styles:c,unstyled:d,"data-checked":I.checked||void 0,variant:R,ref:P,mod:L,...H,...T,children:a.jsxs(ce,{...B("inner"),mod:{"label-position":x},children:[a.jsx(ce,{...B("radio",{focusable:!0,variant:R}),onChange:k,...W,...I,component:"input",mod:{error:!!S},ref:t,id:M,disabled:E,type:"radio"}),a.jsx(_,{...B("icon"),"aria-hidden":!0})]})})});rr.classes=q_;rr.displayName="@mantine/core/Radio";rr.Group=q0;rr.Card=F0;rr.Indicator=H0;const z6={duration:100,transition:"fade"};function U6(e,t){return{...z6,...t,...e}}function B6({offset:e,position:t,defaultOpened:n}){const[r,o]=v.useState(n),s=v.useRef(null),{x:c,y:d,elements:f,refs:p,update:m,placement:g}=Gx({placement:t,middleware:[Vx({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,S=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",S);const C=Ho(p.floating.current);return C.forEach(R=>{R.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(R=>{R.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:d,opened:r,setOpened:o,boundaryRef:s,floating:p.setFloating}}var Jp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const V6={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Xr("popover")},F6=(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}}),G0=ye((e,t)=>{const n=se("TooltipFloating",V6,e),{children:r,refProp:o,withinPortal:s,style:c,className:d,classNames:f,styles:p,unstyled:m,radius:g,color:x,label:b,offset:S,position:j,multiline:C,zIndex:R,disabled:E,defaultOpened:T,variant:_,vars:P,portalProps:A,...k}=n,L=Sn(),z=Le({name:"TooltipFloating",props:n,classes:Jp,className:d,style:c,classNames:f,styles:p,unstyled:m,rootSelector:"tooltip",vars:P,varsResolver:F6}),{handleMouseMove:B,x:Z,y:K,opened:Y,boundaryRef:H,floating:W,setOpened:M}=B6({offset:S,position:j,defaultOpened:T});if(!Jo(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 I=Vn(H,bp(r),t),$=r.props,q=F=>{$.onMouseEnter?.(F),B(F),M(!0)},N=F=>{$.onMouseLeave?.(F),M(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(ts,{...A,withinPortal:s,children:a.jsx(ce,{...k,...z("tooltip",{style:{...LR(c,L),zIndex:R,display:!E&&Y?"block":"none",top:(K&&Math.round(K))??"",left:(Z&&Math.round(Z))??""}}),variant:_,ref:W,mod:{multiline:C},children:b})}),v.cloneElement(r,{...$,[o]:I,onMouseEnter:q,onMouseLeave:N})]})});G0.classes=Jp;G0.displayName="@mantine/core/TooltipFloating";const H_=v.createContext(!1),q6=H_.Provider,H6=()=>v.useContext(H_),G6={openDelay:0,closeDelay:0};function W0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",G6,e);return a.jsx(q6,{value:!0,children:a.jsx(S9,{delay:{open:t,close:n},children:r})})}W0.displayName="@mantine/core/TooltipGroup";W0.extend=e=>e;function W6(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 Q6(e){const t=W6(e.middlewares),n=[t2(e.offset)];return t.shift&&n.push(Vx(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Hh():Hh(t.flip)),n.push(n2({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Ku():Ku(t.inline)):e.inline&&n.push(Ku()),n}function Y6(e){const[t,n]=v.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,s=H6(),c=br(),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:S,y:j}={}}}=Gx({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:Q6(e)}),{delay:C,currentId:R,setCurrentId:E}=w9(m,{id:c}),{getReferenceProps:T,getFloatingProps:_}=D9([x9(m,{enabled:e.events?.hover,delay:s?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),_9(m,{enabled:e.events?.focus,visibleOnly:!0}),P9(m,{role:"tooltip"}),T9(m,{enabled:typeof e.opened>"u"})]);_2({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:x}}),Go(()=>{e.onPositionChange?.(b)},[b]);const P=o&&R&&R!==c;return{x:f,y:p,arrowX:S,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:_,getReferenceProps:T,isGroupPhase:P,opened:o,placement:b}}const aE={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:Xr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},K6=(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}}),Ko=ye((e,t)=>{const n=se("Tooltip",aE,e),{children:r,position:o,refProp:s,label:c,openDelay:d,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:x,radius:b,color:S,classNames:j,styles:C,unstyled:R,style:E,className:T,withArrow:_,arrowSize:P,arrowOffset:A,arrowRadius:k,arrowPosition:L,offset:z,transitionProps:B,multiline:Z,events:K,zIndex:Y,disabled:H,positionDependencies:W,onClick:M,onMouseEnter:I,onMouseLeave:$,inline:q,variant:N,keepMounted:F,vars:J,portalProps:ae,mod:je,floatingStrategy:xe,middlewares:we,...Qe}=se("Tooltip",aE,n),{dir:Ee}=rl(),ot=v.useRef(null),nt=Y6({position:S2(Ee,o),closeDelay:f,openDelay:d,onPositionChange:p,opened:m,defaultOpened:g,events:K,arrowRef:ot,arrowOffset:A,offset:typeof z=="number"?z+(_?P/2:0):z,positionDependencies:[...W,r],inline:q,strategy:xe,middlewares:we}),Ct=Le({name:"Tooltip",props:n,classes:Jp,className:T,style:E,classNames:j,styles:C,unstyled:R,rootSelector:"tooltip",vars:J,varsResolver:K6});if(!Jo(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 Mt=Vn(nt.reference,bp(r),t),Lt=U6(B,{duration:100,transition:"fade"}),pt=r.props;return a.jsxs(a.Fragment,{children:[a.jsx(ts,{...ae,withinPortal:x,children:a.jsx(po,{...Lt,keepMounted:F,mounted:!H&&!!nt.opened,duration:nt.isGroupPhase?10:Lt.duration,children:Rt=>a.jsxs(ce,{...Qe,"data-fixed":xe==="fixed"||void 0,variant:N,mod:[{multiline:Z},je],...nt.getFloatingProps({ref:nt.floating,className:Ct("tooltip").className,style:{...Ct("tooltip").style,...Rt,zIndex:Y,top:nt.y??0,left:nt.x??0}}),children:[c,a.jsx(Kx,{ref:ot,arrowX:nt.arrowX,arrowY:nt.arrowY,visible:_,position:nt.placement,arrowSize:P,arrowOffset:A,arrowRadius:k,arrowPosition:L,...Ct("arrow")})]})})}),v.cloneElement(r,nt.getReferenceProps({onClick:M,onMouseEnter:I,onMouseLeave:$,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:It(T,pt.className),...pt,[s]:Mt}))]})});Ko.classes=Jp;Ko.displayName="@mantine/core/Tooltip";Ko.Floating=G0;Ko.Group=W0;function X6({size:e,thickness:t,sum:n,value:r,root:o,offset:s}){const c=(e*.9-t*2)/2,d=Math.PI*c*2/100,f=o||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:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:o?0:s||0}}function G_({size:e,value:t,offset:n,sum:r,thickness:o,root:s,color:c,lineRoundCaps:d,tooltip:f,getStyles:p,display:m,...g}){const x=Sn();return a.jsx(Ko.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",...X6({sum:r,size:e,thickness:o,value:t,offset:n,root:s})})})}G_.displayName="@mantine/core/Curve";function Z6({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){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:o},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 W_={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function J6(e,t){return Math.min(e||12,(t||120)/4)}const e$={size:120,thickness:12},t$=(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}}),em=ye((e,t)=>{const n=se("RingProgress",e$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,label:p,sections:m,size:g,thickness:x,roundCaps:b,rootColor:S,transitionDuration:j,...C}=n,R=Le({name:"RingProgress",classes:W_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:t$}),E=J6(x,g),T=Z6({size:g,thickness:E,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:_,sum:P,root:A,lineRoundCaps:k,offset:L},z)=>v.createElement(G_,{..._,key:z,size:g,thickness:E,sum:P,offset:L,color:_?.color,root:A,lineRoundCaps:k,getStyles:R}));return a.jsxs(ce,{...R("root"),size:g,ref:t,...C,children:[a.jsx("svg",{...R("svg"),children:T}),p&&a.jsx("div",{...R("label"),children:p})]})});em.classes=W_;em.displayName="@mantine/core/RingProgress";var Q_={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const n$={withItemsBorders:!0},r$=(e,{radius:t,color:n,transitionDuration:r,size:o,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":rt(o,"sc-padding"),"--sc-font-size":On(o)}}),Ad=ye((e,t)=>{const n=se("SegmentedControl",n$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,data:p,value:m,defaultValue:g,onChange:x,size:b,name:S,disabled:j,readOnly:C,fullWidth:R,orientation:E,radius:T,color:_,transitionDuration:P,transitionTimingFunction:A,variant:k,autoContrast:L,withItemsBorders:z,mod:B,...Z}=n,K=Le({name:"SegmentedControl",props:n,classes:Q_,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:r$}),Y=Sn(),H=p.map(Ee=>typeof Ee=="string"?{label:Ee,value:Ee}:Ee),W=$4(),[M,I]=v.useState(Uh()),[$,q]=v.useState(null),[N,F]=v.useState({}),J=(Ee,ot)=>{N[ot]=Ee,F(N)},[ae,je]=Yn({value:m,defaultValue:g,finalValue:Array.isArray(p)?H.find(Ee=>!Ee.disabled)?.value??p[0]?.value??null:null,onChange:x}),xe=br(S),we=H.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":Y.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=>J(ot,Ee.value),__vars:{"--sc-label-color":_!==void 0?na({color:_,theme:Y,autoContrast:L}):void 0},key:`${Ee.value}-label`},a.jsx("span",{...K("innerLabel"),children:Ee.label})))),Qe=Vn(t,Ee=>q(Ee));return M4(()=>{I(Uh())},[p.length]),p.length===0?null:a.jsxs(ce,{...K("root"),variant:k,size:b,ref:Qe,mod:[{"full-width":R,orientation:E,initialized:W,"with-items-borders":z},B],...Z,role:"radiogroup","data-disabled":j,children:[typeof ae=="string"&&a.jsx(t0,{target:N[ae],parent:$,component:"span",transitionDuration:"var(--sc-transition-duration)",...K("indicator")},M),we]})});Ad.classes=Q_;Ad.displayName="@mantine/core/SegmentedControl";function i$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=Sn(),s=t===void 0?e:t,c=es({"--sg-spacing-x":Nn(Pi(e)),"--sg-spacing-y":Nn(Pi(s)),"--sg-cols":Pi(n)?.toString()}),d=an(o.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=Ju(an(d),o.breakpoints).filter(m=>an(d[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:d[m.value]}));return a.jsx(nl,{styles:c,media:p,selector:r})}function ny(e){return typeof e=="object"&&e!==null?an(e):[]}function o$(e){return e.sort((t,n)=>Zu(t)-Zu(n))}function a$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...ny(e),...ny(t),...ny(n)]));return o$(r)}function s$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=t===void 0?e:t,s=es({"--sg-spacing-x":Nn(Pi(e)),"--sg-spacing-y":Nn(Pi(o)),"--sg-cols":Pi(n)?.toString()}),c=a$({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 o=="object"&&o[m]!==void 0&&(p[m]["--sg-spacing-y"]=Nn(o[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(nl,{styles:s,container:f,selector:r})}var Y_={container:"m_925c2d2c",root:"m_2415a157"};const l$={cols:1,spacing:"md",type:"media"},tm=ye((e,t)=>{const n=se("SimpleGrid",l$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,cols:p,verticalSpacing:m,spacing:g,type:x,...b}=n,S=Le({name:"SimpleGrid",classes:Y_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f}),j=gd();return x==="container"?a.jsxs(a.Fragment,{children:[a.jsx(s$,{...n,selector:`.${j}`}),a.jsx("div",{...S("container"),children:a.jsx(ce,{ref:t,...S("root",{className:j}),...b})})]}):a.jsxs(a.Fragment,{children:[a.jsx(i$,{...n,selector:`.${j}`}),a.jsx(ce,{ref:t,...S("root",{className:j}),...b})]})});tm.classes=Y_;tm.displayName="@mantine/core/SimpleGrid";const c$={},nm=ye((e,t)=>{const{w:n,h:r,miw:o,mih:s,...c}=se("Space",c$,e);return a.jsx(ce,{ref:t,...c,w:n,miw:o??n,h:r,mih:s??r})});nm.displayName="@mantine/core/Space";var K_={root:"m_6d731127"};const u$={gap:"md",align:"stretch",justify:"flex-start"},d$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Nn(t),"--stack-align":n,"--stack-justify":r}}),$e=ye((e,t)=>{const n=se("Stack",u$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,align:p,justify:m,gap:g,variant:x,...b}=n,S=Le({name:"Stack",props:n,classes:K_,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:d$});return a.jsx(ce,{ref:t,...S("root"),variant:x,...b})});$e.classes=K_;$e.displayName="@mantine/core/Stack";const[f$,h$]=xr("Stepper component was not found in tree"),Wh=()=>null;Wh.displayName="@mantine/core/StepperCompleted";var Q0={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 fh=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,p$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Y0=ye((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,step:d,state:f,color:p,icon:m,completedIcon:g,progressIcon:x,label:b,description:S,withIcon:j,iconSize:C,loading:R,allowStepClick:E,allowStepSelect:T,iconPosition:_,orientation:P,mod:A,...k}=se("StepperStep",p$,e),L=h$(),z=Sn(),B={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,{...L.getStyles("step",{className:r,style:o,variant:L.orientation,...B}),mod:[{"icon-position":_||L.iconPosition,"allow-click":E},A],ref:t,...K,...k,__vars:{"--step-color":p?Ft(p,z):void 0},tabIndex:E?0:-1,children:[j&&a.jsxs("span",{...L.getStyles("stepWrapper",B),children:[a.jsxs("span",{...L.getStyles("stepIcon",B),...K,children:[a.jsx(po,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:Y=>a.jsx("span",{...L.getStyles("stepCompletedIcon",{style:Y,...B}),children:R?a.jsx(Nr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...L.getStyles("stepLoader",B)}):fh(g,d)||a.jsx(jd,{size:"60%"})})}),f!=="stepCompleted"?R?a.jsx(Nr,{...L.getStyles("stepLoader",B),size:"calc(var(--stepper-icon-size) / 2)",color:p}):fh(Z||m,d):null]}),P==="vertical"&&a.jsx("span",{...L.getStyles("verticalSeparator",B),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&a.jsxs("span",{...L.getStyles("stepBody",B),"data-orientation":L.orientation,"data-icon-position":_||L.iconPosition,children:[b&&a.jsx("span",{...L.getStyles("stepLabel",B),children:fh(b,d)}),S&&a.jsx("span",{...L.getStyles("stepDescription",B),children:fh(S,d)})]})]})});Y0.classes=Q0;Y0.displayName="@mantine/core/StepperStep";const m$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},g$=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:s,autoContrast:c})=>({root:{"--stepper-color":t?Ft(t,e):void 0,"--stepper-icon-color":tl(c,e)?na({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?rt(r,"stepper-icon-size"):le(n),"--stepper-content-padding":Nn(o),"--stepper-radius":s===void 0?void 0:Ut(s),"--stepper-fz":On(r),"--stepper-spacing":Nn(r)}}),jc=ye((e,t)=>{const n=se("Stepper",m$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,onStepClick:m,active:g,icon:x,completedIcon:b,progressIcon:S,color:j,iconSize:C,contentPadding:R,orientation:E,iconPosition:T,size:_,radius:P,allowNextStepsSelect:A,wrap:k,autoContrast:L,...z}=n,B=Le({name:"Stepper",classes:Q0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:g$}),Z=v.Children.toArray(p),K=Z.filter($=>$.type!==Wh),Y=Z.find($=>$.type===Wh),H=K.reduce(($,q,N)=>{const F=g===N?"stepProgress":g>N?"stepCompleted":"stepInactive",ae=typeof m!="function"?!1:typeof q.props.allowStepSelect=="boolean"?q.props.allowStepSelect:F==="stepCompleted"||A;return $.push(v.cloneElement(q,{icon:q.props.icon||x||N+1,key:N,step:N,state:F,onClick:()=>ae&&m?.(N),allowStepClick:ae,completedIcon:q.props.completedIcon||b,progressIcon:q.props.progressIcon||S,color:q.props.color||j,iconSize:C,iconPosition:q.props.iconPosition||T,orientation:E})),E==="horizontal"&&N!==K.length-1&&$.push(v.createElement("div",{...B("separator"),"data-active":N<g||void 0,"data-orientation":E,key:`separator-${N}`})),$},[]),W=K[g]?.props?.children,M=Y?.props?.children,I=g>K.length-1?M:W;return a.jsx(f$,{value:{getStyles:B,orientation:E,iconPosition:T},children:a.jsxs(ce,{...B("root"),ref:t,size:_,...z,children:[a.jsx(ce,{...B("steps"),mod:{orientation:E,"icon-position":T,wrap:k&&E!=="vertical"},children:H}),I&&a.jsx("div",{...B("content"),children:I})]})})});jc.classes=Q0;jc.displayName="@mantine/core/Stepper";jc.Completed=Wh;jc.Step=Y0;const X_=v.createContext(null),v$=X_.Provider,y$=()=>v.useContext(X_),x$={},K0=ye((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,readOnly:f,...p}=se("SwitchGroup",x$,e),[m,g]=Yn({value:n,defaultValue:r,finalValue:[],onChange:o}),x=b=>{const S=b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return a.jsx(v$,{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(y0,{role:"group",children:d})})})});K0.classes=fn.Wrapper.classes;K0.displayName="@mantine/core/SwitchGroup";var Z_={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const b$={labelPosition:"right"},S$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ut(t),"--switch-height":rt(r,"switch-height"),"--switch-width":rt(r,"switch-width"),"--switch-thumb-size":rt(r,"switch-thumb-size"),"--switch-label-font-size":rt(r,"switch-label-font-size"),"--switch-track-label-padding":rt(r,"switch-track-label-padding"),"--switch-color":n?Ft(n,e):void 0}}),Pd=ye((e,t)=>{const n=se("Switch",b$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,offLabel:g,onLabel:x,id:b,size:S,radius:j,wrapperProps:C,thumbIcon:R,checked:E,defaultChecked:T,onChange:_,labelPosition:P,description:A,error:k,disabled:L,variant:z,rootRef:B,mod:Z,...K}=n,Y=y$(),H=S||Y?.size,W=Le({name:"Switch",props:n,classes:Z_,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:S$}),{styleProps:M,rest:I}=ra(K),$=br(b),q=Y?{checked:Y.value.includes(I.value),onChange:Y.onChange}:{},[N,F]=Yn({value:q.checked??E,defaultValue:T,finalValue:!1});return a.jsxs(Mp,{...W("root"),__staticSelector:"Switch",__stylesApiProps:n,id:$,size:H,labelPosition:P,label:m,description:A,error:k,disabled:L,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:d,"data-checked":q.checked||E||void 0,variant:z,ref:B,mod:Z,...M,...C,children:[a.jsx("input",{...I,disabled:L,checked:N,"data-checked":q.checked||E||void 0,onChange:J=>{Y?q.onChange?.(J):_?.(J),F(J.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:R}),a.jsx("span",{...W("trackLabel"),children:N?x:g})]})]})});Pd.classes={...Z_,...i_};Pd.displayName="@mantine/core/Switch";Pd.Group=K0;const[w$,j$]=xr("Table component was not found in the tree");var kd={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 C$(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 al(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ye((o,s)=>{const c=se(n,{},o),{classNames:d,className:f,style:p,styles:m,...g}=c,x=j$();return a.jsx(ce,{component:e,ref:s,...C$(x,t),...x.getStyles(e,{className:f,classNames:d,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=kd,r}const Qy=al("th",{columnBorder:!0}),J_=al("td",{columnBorder:!0}),Dh=al("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),eD=al("thead",{stickyHeader:!0}),tD=al("tbody"),nD=al("tfoot"),rD=al("caption",{captionSide:!0});function X0({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx(rD,{children:e.caption}),e.head&&a.jsx(eD,{children:a.jsx(Dh,{children:e.head.map((t,n)=>a.jsx(Qy,{children:t},n))})}),e.body&&a.jsx(tD,{children:e.body.map((t,n)=>a.jsx(Dh,{children:t.map((r,o)=>a.jsx(J_,{children:r},o))},n))}),e.foot&&a.jsx(nD,{children:a.jsx(Dh,{children:e.foot.map((t,n)=>a.jsx(Qy,{children:t},n))})})]})}X0.displayName="@mantine/core/TableDataRenderer";const E$={type:"scrollarea"},T$=(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}}),Z0=ye((e,t)=>{const n=se("TableScrollContainer",E$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,minWidth:m,maxHeight:g,type:x,scrollAreaProps:b,...S}=n,j=Le({name:"TableScrollContainer",classes:kd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:T$,rootSelector:"scrollContainer"});return a.jsx(ce,{component:x==="scrollarea"?Zr:"div",...x==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...j("scrollContainer"),...S,children:a.jsx("div",{...j("scrollContainerInner"),children:p})})});Z0.classes=kd;Z0.displayName="@mantine/core/TableScrollContainer";const R$={withRowBorders:!0,verticalSpacing:7},_$=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,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(o),"--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}}),de=ye((e,t)=>{const n=se("Table",R$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:x,highlightOnHoverColor:b,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,withTableBorder:E,borderColor:T,layout:_,variant:P,data:A,children:k,stickyHeader:L,stickyHeaderOffset:z,mod:B,tabularNums:Z,...K}=n,Y=Le({name:"Table",props:n,className:o,style:s,classes:kd,classNames:r,styles:c,unstyled:d,rootSelector:"table",vars:f,varsResolver:_$});return a.jsx(w$,{value:{getStyles:Y,stickyHeader:L,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,captionSide:g||"bottom"},children:a.jsx(ce,{component:"table",variant:P,ref:t,mod:[{"data-with-table-border":E,"data-tabular-nums":Z},B],...Y("table"),...K,children:k||!!A&&a.jsx(X0,{data:A})})})});de.classes=kd;de.displayName="@mantine/core/Table";de.Td=J_;de.Th=Qy;de.Tr=Dh;de.Thead=eD;de.Tbody=tD;de.Tfoot=nD;de.Caption=rD;de.ScrollContainer=Z0;de.DataRenderer=X0;const[D$,J0]=xr("Tabs component was not found in the tree");var Nd={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 A$={},eb=ye((e,t)=>{const n=se("TabsList",A$,e),{children:r,className:o,grow:s,justify:c,classNames:d,styles:f,style:p,mod:m,...g}=n,x=J0();return a.jsx(ce,{...g,...x.getStyles("list",{className:o,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})});eb.classes=Nd;eb.displayName="@mantine/core/TabsList";const P$={},tb=ye((e,t)=>{const n=se("TabsPanel",P$,e),{children:r,className:o,value:s,classNames:c,styles:d,style:f,mod:p,keepMounted:m,...g}=n,x=J0(),b=x.value===s,S=x.keepMounted||m||b?r:null;return a.jsx(ce,{...g,...x.getStyles("panel",{className:o,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:S})});tb.classes=Nd;tb.displayName="@mantine/core/TabsPanel";const k$={},nb=ye((e,t)=>{const n=se("TabsTab",k$,e),{className:r,children:o,rightSection:s,leftSection:c,value:d,onClick:f,onKeyDown:p,disabled:m,color:g,style:x,classNames:b,styles:S,vars:j,mod:C,tabIndex:R,...E}=n,T=Sn(),{dir:_}=rl(),P=J0(),A=d===P.value,k=z=>{P.onChange(P.allowTabDeactivation&&d===P.value?null:d),f?.(z)},L={classNames:b,styles:S,props:n};return a.jsxs(er,{...E,...P.getStyles("tab",{className:r,style:x,variant:P.variant,...L}),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:R!==void 0?R:A||P.value===null?0:-1,"aria-controls":P.getPanelId(d),onClick:k,__vars:{"--tabs-color":g?Ft(g,T):void 0},onKeyDown:xR({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",L),"data-position":"left",children:c}),o&&a.jsx("span",{...P.getStyles("tabLabel",L),children:o}),s&&a.jsx("span",{...P.getStyles("tabSection",L),"data-position":"right",children:s})]})});nb.classes=Nd;nb.displayName="@mantine/core/TabsTab";const sE="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",N$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},O$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ut(t),"--tabs-color":Ft(n,e),"--tabs-text-color":tl(r,e)?na({color:n,theme:e,autoContrast:r}):void 0}}),_t=ye((e,t)=>{const n=se("Tabs",N$,e),{defaultValue:r,value:o,onChange:s,orientation:c,children:d,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:x,color:b,radius:S,inverted:j,placement:C,keepMounted:R,classNames:E,styles:T,unstyled:_,className:P,style:A,vars:k,autoContrast:L,mod:z,...B}=n,Z=br(p),[K,Y]=Yn({value:o,defaultValue:r,finalValue:null,onChange:s}),H=Le({name:"Tabs",props:n,classes:Nd,className:P,style:A,classNames:E,styles:T,unstyled:_,vars:k,varsResolver:O$});return a.jsx(D$,{value:{placement:C,value:K,orientation:c,id:Z,loop:f,activateTabWithKeyboard:m,getTabId:eC(`${Z}-tab`,sE),getPanelId:eC(`${Z}-panel`,sE),onChange:Y,allowTabDeactivation:g,variant:x,color:b,radius:S,inverted:j,keepMounted:R,unstyled:_,getStyles:H},children:a.jsx(ce,{ref:t,id:Z,variant:x,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},z],...H("root"),...B,children:d})})});_t.classes=Nd;_t.displayName="@mantine/core/Tabs";_t.Tab=nb;_t.Panel=tb;_t.List=eb;const M$={},Ue=ye((e,t)=>{const n=se("TextInput",M$,e);return a.jsx(Sr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});Ue.classes=Sr.classes;Ue.displayName="@mantine/core/TextInput";var iD={root:"m_7341320d"};const L$={},I$=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":rt(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}}},rb=ye((e,t)=>{const n=se("ThemeIcon",L$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,autoContrast:p,...m}=n,g=Le({name:"ThemeIcon",classes:iD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:I$});return a.jsx(ce,{ref:t,...g("root"),...m})});rb.classes=iD;rb.displayName="@mantine/core/ThemeIcon";const $$=["h1","h2","h3","h4","h5","h6"],z$=["xs","sm","md","lg","xl"];function U$(e,t){const n=t!==void 0?t:`h${e}`;return $$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:z$.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 oD={root:"m_8a5d1357"};const B$={order:1},V$=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const s=U$(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":o}}},Oe=ye((e,t)=>{const n=se("Title",B$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,order:f,vars:p,size:m,variant:g,lineClamp:x,textWrap:b,mod:S,...j}=n,C=Le({name:"Title",props:n,classes:oD,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:V$});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"},S],size:m,...j}):null});Oe.classes=oD;Oe.displayName="@mantine/core/Title";function F$(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(o){t=typeof o=="function"?o(t):o},setState(o){this.updateState(o),r.forEach(s=>s(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function q$(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function H$(e,t,n){const r=[],o=[],s={};for(const c of e){const d=c.position||t;s[d]=s[d]||0,s[d]+=1,s[d]<=n?o.push(c):r.push(c)}return{notifications:o,queue:r}}const G$=()=>F$({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),sl=G$(),W$=(e=sl)=>q$(e);function zc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=H$(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ne(e,t=sl){const n=e.id||Uh();return zc(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function aD(e,t=sl){return zc(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function Ms(e,t=sl){return zc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function Q$(e=sl){zc(e,()=>[])}function Y$(e=sl){zc(e,t=>t.slice(0,e.getState().limit))}const hi={show:Ne,hide:aD,update:Ms,clean:Q$,cleanQueue:Y$,updateState:zc};function Yy(e,t){return Yy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Yy(e,t)}function sD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yy(e,t)}var ry={exports:{}},iy,lE;function K$(){if(lE)return iy;lE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return iy=e,iy}var oy,cE;function X$(){if(cE)return oy;cE=1;var e=K$();function t(){}function n(){}return n.resetWarningCache=t,oy=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 o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},oy}var uE;function Z$(){return uE||(uE=1,ry.exports=X$()()),ry.exports}var J$=Z$();const on=jx(J$),dE={disabled:!1},Qh=En.createContext(null);var ez=function(t){return t.scrollTop},Qu="unmounted",Ds="exited",As="entering",lc="entered",Ky="exiting",sa=(function(e){sD(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=o,d=c&&!c.isMounting?r.enter:r.appear,f;return s.appearStatus=null,r.in?d?(f=Ds,s.appearStatus=As):f=lc:r.unmountOnExit||r.mountOnEnter?f=Qu:f=Ds,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(o,s){var c=o.in;return c&&s.status===Qu?{status:Ds}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var s=null;if(o!==this.props){var c=this.state.status;this.props.in?c!==As&&c!==lc&&(s=As):(c===As||c===lc)&&(s=Ky)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,s,c,d;return s=c=d=o,o!=null&&typeof o!="number"&&(s=o.exit,c=o.enter,d=o.appear!==void 0?o.appear:c),{exit:s,enter:c,appear:d}},n.updateStatus=function(o,s){if(o===void 0&&(o=!1),s!==null)if(this.cancelNextCallback(),s===As){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:Wu.findDOMNode(this);c&&ez(c)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ds&&this.setState({status:Qu})},n.performEnter=function(o){var s=this,c=this.props.enter,d=this.context?this.context.isMounting:o,f=this.props.nodeRef?[d]:[Wu.findDOMNode(this),d],p=f[0],m=f[1],g=this.getTimeouts(),x=d?g.appear:g.enter;if(!o&&!c||dE.disabled){this.safeSetState({status:lc},function(){s.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:As},function(){s.props.onEntering(p,m),s.onTransitionEnd(x,function(){s.safeSetState({status:lc},function(){s.props.onEntered(p,m)})})})},n.performExit=function(){var o=this,s=this.props.exit,c=this.getTimeouts(),d=this.props.nodeRef?void 0:Wu.findDOMNode(this);if(!s||dE.disabled){this.safeSetState({status:Ds},function(){o.props.onExited(d)});return}this.props.onExit(d),this.safeSetState({status:Ky},function(){o.props.onExiting(d),o.onTransitionEnd(c.exit,function(){o.safeSetState({status:Ds},function(){o.props.onExited(d)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,s){s=this.setNextCallback(s),this.setState(o,s)},n.setNextCallback=function(o){var s=this,c=!0;return this.nextCallback=function(d){c&&(c=!1,s.nextCallback=null,o(d))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(o,s){this.setNextCallback(s);var c=this.props.nodeRef?this.props.nodeRef.current:Wu.findDOMNode(this),d=o==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)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===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=_0(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return En.createElement(Qh.Provider,{value:null},typeof c=="function"?c(o,d):En.cloneElement(En.Children.only(c),d))},t})(En.Component);sa.contextType=Qh;sa.propTypes={};function tc(){}sa.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:tc,onEntering:tc,onEntered:tc,onExit:tc,onExiting:tc,onExited:tc};sa.UNMOUNTED=Qu;sa.EXITED=Ds;sa.ENTERING=As;sa.ENTERED=lc;sa.EXITING=Ky;function tz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ib(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(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function nz(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),o=[];for(var s in e)s in t?o.length&&(r[s]=o,o=[]):o.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<o.length;c++)d[o[c]]=n(o[c]);return d}function Ls(e,t,n){return n[t]!=null?n[t]:e.props[t]}function rz(e,t){return ib(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Ls(n,"appear",e),enter:Ls(n,"enter",e),exit:Ls(n,"exit",e)})})}function iz(e,t,n){var r=ib(e.children),o=nz(t,r);return Object.keys(o).forEach(function(s){var c=o[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)?o[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:Ls(c,"exit",e),enter:Ls(c,"enter",e)}):!f&&d&&!m?o[s]=v.cloneElement(c,{in:!1}):f&&d&&v.isValidElement(p)&&(o[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:Ls(c,"exit",e),enter:Ls(c,"enter",e)}))}}),o}var oz=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},az={component:"div",childFactory:function(t){return t}},Ua=(function(e){sD(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=s.handleExited.bind(tz(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(o,s){var c=s.children,d=s.handleExited,f=s.firstRender;return{children:f?rz(o,d):iz(o,c,d),firstRender:!1}},n.handleExited=function(o,s){var c=ib(this.props.children);o.key in c||(o.props.onExited&&o.props.onExited(s),this.mounted&&this.setState(function(d){var f=Gh({},d.children);return delete f[o.key],{children:f}}))},n.render=function(){var o=this.props,s=o.component,c=o.childFactory,d=_0(o,["component","childFactory"]),f=this.state.contextValue,p=oz(this.state.children).map(c);return delete d.appear,delete d.enter,delete d.exit,s===null?En.createElement(Qh.Provider,{value:f},p):En.createElement(Qh.Provider,{value:f},En.createElement(s,d,p))},t})(En.Component);Ua.propTypes={};Ua.defaultProps=az;const lD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function sz(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),lD.reduce((n,r)=>(n[r]=[],n),{}))}const fE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},lz={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function cz({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,s]=n.split("-"),c=s==="center"?`${o}-center`:s,d={opacity:0,maxHeight:t,transform:fE[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:lz[c]},p={opacity:0,maxHeight:0,transform:fE[c]};return{...d,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function uz(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const cD=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:s,message:c,...d}=e,f=uz(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(U0,{...r,...d,onClose:g,ref:o,onMouseEnter:m,onMouseLeave:x,children:c})});cD.displayName="@mantine/notifications/NotificationContainer";var uD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const dz=sa,fz={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Xr("overlay"),store:sl,withinPortal:!0},hz=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":le(n)}}),la=ye((e,t)=>{const n=se("Notifications",fz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:x,notificationMaxHeight:b,limit:S,zIndex:j,store:C,portalProps:R,withinPortal:E,...T}=n,_=Sn(),P=W$(C),A=_4(),k=_x(),L=v.useRef({}),z=v.useRef(0),Z=(_.respectReducedMotion?k:!1)?1:g,K=Le({name:"Notifications",classes:uD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:hz});v.useEffect(()=>{C?.updateState(W=>({...W,limit:S||5,defaultPosition:p}))},[S,p]),Go(()=>{P.notifications.length>z.current&&setTimeout(()=>A(),0),z.current=P.notifications.length},[P.notifications]);const Y=sz(P.notifications,p),H=lD.reduce((W,M)=>(W[M]=Y[M].map(({style:I,...$})=>a.jsx(dz,{timeout:Z,onEnter:()=>L.current[$.id].offsetHeight,nodeRef:{current:L.current[$.id]},children:q=>a.jsx(cD,{ref:N=>{L.current[$.id]=N},data:$,onHide:N=>aD(N,C),autoClose:m,...K("notification",{style:{...cz({state:q,position:M,transitionDuration:Z,maxHeight:b}),...I}})})},$.id)),W),{});return a.jsxs(ts,{withinPortal:E,...R,children:[a.jsx(ce,{...K("root"),"data-position":"top-center",ref:t,...T,children:a.jsx(Ua,{children:H["top-center"]})}),a.jsx(ce,{...K("root"),"data-position":"top-left",...T,children:a.jsx(Ua,{children:H["top-left"]})}),a.jsx(ce,{...K("root",{className:gc.classNames.fullWidth}),"data-position":"top-right",...T,children:a.jsx(Ua,{children:H["top-right"]})}),a.jsx(ce,{...K("root",{className:gc.classNames.fullWidth}),"data-position":"bottom-right",...T,children:a.jsx(Ua,{children:H["bottom-right"]})}),a.jsx(ce,{...K("root"),"data-position":"bottom-left",...T,children:a.jsx(Ua,{children:H["bottom-left"]})}),a.jsx(ce,{...K("root"),"data-position":"bottom-center",...T,children:a.jsx(Ua,{children:H["bottom-center"]})})]})});la.classes=uD;la.displayName="@mantine/notifications/Notifications";la.show=hi.show;la.hide=hi.hide;la.update=hi.update;la.clean=hi.clean;la.cleanQueue=hi.cleanQueue;la.updateState=hi.updateState;class pz{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Od{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class mz{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(o,s){const c=o.consumeAndParse(n);return r(s,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,s,c){const d=o.consumeAndParse(n);return r(s,c,d)},precedence:n})}construct(t){return new gz(t,this.prefixParselets,this.infixParselets)}}class gz{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 o=r.parse(this,n);for(;t>this.getPrecedence();){const s=this.consume();o=this.getInfixParselet(s).parse(this,o,s)}return o}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 dD{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 Ui="http://hl7.org",fD="ok",vz="created",yz="gone",xz="not-modified",bz="not-found",Sz="unauthorized",wz="forbidden",jz="accepted",Cz={resourceType:"OperationOutcome",id:fD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Ez={resourceType:"OperationOutcome",id:bz,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},ad={resourceType:"OperationOutcome",id:Sz,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},Tz={...ad,issue:[...ad.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},hE={...ad,issue:[...ad.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},Md={resourceType:"OperationOutcome",id:wz,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function io(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function gn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Rz(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function _z(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 hD(e){return e.id===fD||e.id===vz||e.id===xz||e.id===jz}function Dz(e){return e.id===yz}class dt extends Error{constructor(t,n){super(pD(t)),this.outcome=t,this.cause=n}}function Ht(e){return e instanceof dt?e.outcome:rm(e)?e:io(Ge(e))}function Ge(e){return e?typeof e=="string"?e:_z(e)?e.message:rm(e)?pD(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function pD(e){const t=e.issue?.map(mD)??[];return t.length>0?t.join("; "):"Unknown error"}function mD(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 Az(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 Pz(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(([o,s])=>[o,Az(o,s)])),constraints:[],innerTypes:[]};return t}const kz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},Nz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},Oz={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"}]}}},Mz={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"}]}}},Lz={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"}]}}},Iz={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"}]}}},$z={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},zz={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"}]}}},Uz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},Bz={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"}]}}},Vz={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"}]}}},Fz={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"}]}}},qz={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"}]}}},Hz={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"}]}}},Gz={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"}]}}},Wz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},Qz={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"}]}}},Yz={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"]}]}}},Kz={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"]}]}}},Xz={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"}]}}},Zz={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"}]}}},Jz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},e8={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"}]}}},t8={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"}]}}},n8={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"}]}}},r8={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"}]}}},i8={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"]}]}}},o8={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"]}]}}},a8={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"}]}}},s8={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"}]}}},l8={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"}]}}},c8={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"}]}}},u8={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"]}]}}},d8={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"}]}}},f8={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"}]}}},h8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},p8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},m8={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"]}]}}},g8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},v8={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"}]}}},y8={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"}]}}},x8={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"}]}}},b8={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"}]}}},S8={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"]}]}}},w8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},j8={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"}]}}},C8={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"]}]}}},E8={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"}]}}},T8={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"}]}}},R8={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"}]}}},_8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},D8={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"}]}}},A8={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"}]}}},P8={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"}]}}},k8={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"]}]}}},N8={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"}]}}},O8={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"}]}}},M8={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"}]}}},L8={Element:kz,BackboneElement:Nz,Address:Oz,Age:Mz,Annotation:Lz,Attachment:Iz,CodeableConcept:$z,Coding:zz,ContactDetail:Uz,ContactPoint:Bz,Contributor:Vz,Count:Fz,DataRequirement:qz,DataRequirementCodeFilter:Hz,DataRequirementDateFilter:Gz,DataRequirementSort:Wz,Distance:Qz,Dosage:Yz,DosageDoseAndRate:Kz,Duration:Xz,ElementDefinition:Zz,ElementDefinitionSlicingDiscriminator:Jz,ElementDefinitionSlicing:e8,ElementDefinitionBase:t8,ElementDefinitionType:n8,ElementDefinitionExample:r8,ElementDefinitionConstraint:i8,ElementDefinitionBinding:o8,ElementDefinitionMapping:a8,Expression:s8,Extension:l8,HumanName:c8,Identifier:u8,MarketingStatus:d8,Meta:f8,Money:h8,Narrative:p8,ParameterDefinition:m8,Period:g8,Population:v8,ProdCharacteristic:y8,ProductShelfLife:x8,Quantity:b8,Range:S8,Ratio:w8,Reference:j8,RelatedArtifact:C8,SampledData:E8,Signature:T8,SubstanceAmount:R8,SubstanceAmountReferenceRange:_8,Timing:D8,TimingRepeat:A8,TriggerDefinition:P8,UsageContext:k8,MoneyQuantity:N8,SimpleQuantity:O8,IdentityProvider:M8};function I8(e){return new z8(e).parse()}const Yh=Pz(L8),ob=Object.create(null),pE=Object.create(null),$8={"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 gD(e){let t;return t=pE[e],t||(t=pE[e]=Object.create(null)),t}function mE(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");_U(n);for(const r of n)vD(r)}function vD(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=I8(e),n=$8[e.url];let r,o;n?(r=Yh,o=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=Yh,o=e.type):(r=gD(e.url),o=e.type),r[o]=t;for(const s of t.innerTypes)s.parentType=t,r[s.name]=s;ob[e.url]=t}function yD(e){return!!Yh[e]}function im(e,t){if(t){const n=gD(t)[e];if(n)return n}return Yh[e]}function xD(e,t){const n=im(e,t);if(!n)throw new dt(io("Unknown data type: "+e));return n}function ab(e){return!!ob[e]}function Uc(e){return ob[e]}class z8{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:V8(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 o=ay(t,this.root.path);t.isSummary&&this.resourceSchema.summaryProperties?.add(o.replace("[x]","")),n.min>0&&this.resourceSchema.mandatoryProperties?.add(o.replace("[x]","")),this.resourceSchema.elements[o]=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&&!nc(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!nc(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=jE(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:nc(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){B8(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&&!nc(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!nc(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!!(nc(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=jE(t)),r||(r=mo(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=gE(t.max),r=t.base?.max?gE(t.base.max):n,o={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:vE(Cc(o,"fixed[x]")),pattern:vE(Cc(o,"pattern[x]")),binding:t.binding}}}function gE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function ay(e,t=""){return U8(e.path,t)}function U8(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function nc(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function vE(e){return Array.isArray(e)&&e.length>0?e[0]:xn(e)?void 0:e}function B8(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 V8(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 F8(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?q8:Cc,[o,...s]=t.split(".");let c=[r(e,o,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 q8(e,t,n){const r=e.path;return H8(Cc(e,t,n),r,t)}function H8(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((o,s)=>({...o,path:`${r}${n}[${s}]`})):{...e,path:`${r}${n}`}}const bD={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 G8(e,t,n,r){if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const s=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return cb(e,o.pattern);if(o.fixed)return co(e,o.fixed);if(o.binding?.strength==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!s?.length?!1:s.some(c=>c.code===e.type)}return!1}function Ze(e){return[{type:re.boolean,value:e}]}function Yr(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}:pi(e)?{type:re.Quantity,value:e}:go(e)?{type:e.resourceType,value:e}:ND(e)?{type:re.CodeableConcept,value:e}:kD(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function to(e){return e.length===0?!1:!!e[0].value}function Xo(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 Cc(e,t,n){if(!e.value)return;const r=is(e.type,t,n?.profileUrl);return r?SD(e,t,r):Ld(e,t)}function SD(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let s,c="undefined",d;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of o){const g=p.replace("[x]",Ln(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]=sy(s[m],d[m])}else if(!s&&Array.isArray(d)){s=d.slice();for(let m=0;m<d.length;m++)s[m]=sy(void 0,d[m])}else s=sy(s,d);if(!xn(s))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(s)?s.map(m=>yE(m,c)):yE(s,c)}function yE(e,t){return t==="Resource"&&go(e)&&(t=e.resourceType),{type:t,value:e}}function Ld(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const o=n[t];Array.isArray(o)?r=o.map(Yr):r=Yr(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(re)){const c=o+Ln(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 wD(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(to(om(n,o))){r=!0;break}r||t.push(n)}return t}function W8(e){return Ze(!to(e))}function Q8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!1):Ze(e.every((n,r)=>to(om(n,t[r]))))}function Y8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!0):Ze(e.some((n,r)=>!to(om(n,t[r]))))}function om(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?Ze(Math.abs(n-r)<1e-8):pi(n)&&pi(r)?Ze(_D(n,r)):Ze(typeof n=="object"&&typeof r=="object"?sb(e,t):n===r)}function jD(e,t){return e.length===0&&t.length===0?Ze(!0):e.length!==t.length?Ze(!1):(e.sort(xE),t.sort(xE),Ze(e.every((n,r)=>to(K8(n,t[r])))))}function K8(e,t){const{type:n,value:r}=e,{type:o,value:s}=t,c=r?.valueOf(),d=s?.valueOf();return typeof c=="number"&&typeof d=="number"?Ze(Math.abs(c-d)<.01):pi(c)&&pi(d)?Ze(_D(c,d)):Ze(n==="Coding"&&o==="Coding"?typeof c!="object"||typeof d!="object"?!1:c.code===d.code&&c.system===d.system:typeof c=="object"&&typeof d=="object"?sb({...c,id:void 0},{...d,id:void 0}):typeof c=="string"&&typeof d=="string"?c.toLowerCase()===d.toLowerCase():c===d)}function xE(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 CD(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 ED(n);case"DateTime":return sd(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return TD(n);case"Quantity":return pi(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function ED(e){return typeof e=="string"&&!!bD.date.exec(e)}function sd(e){return typeof e=="string"&&!!bD.dateTime.exec(e)}function TD(e){return!!(e&&typeof e=="object"&&("start"in e&&sd(e.start)||"end"in e&&sd(e.end)))}function RD(e){if(e){if(ED(e)||sd(e))return{start:hh(e,"0000-01-01T00:00:00.000"),end:hh(e,"xxxx-12-31T23:59:59.999")};if(TD(e))return{start:e.start?hh(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?hh(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function hh(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 o=e+t.substring(e.length)+n;return new Date(o).toISOString()}function pi(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function _D(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 sb(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o],c=t[o];if(bE(s)&&bE(c)){if(!sb(s,c))return!1}else if(s!==c)return!1}return!0}function bE(e){return e!==null&&typeof e=="object"}function sy(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return X8(e??{},t)}return e}function X8(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function DD(e,t){return go(e,t)&&"id"in e&&typeof e.id=="string"}function qt(e){const t=At(e)??"undefined/undefined",n=Zo(e);return n===t?{reference:t}:{reference:t,display:n}}function At(e){if(ca(e))return e.reference;if(DD(e))return`${e.resourceType}/${e.id}`}function Hs(e){if(e)return ca(e)?e.reference.split("/")[1]:e.id}function Z8(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Zo(e){if(Z8(e)){const t=J8(e);if(t)return t}if(e.resourceType==="Device"){const t=eU(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Xa(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]),ND(t))return Xa(t);if(uU(t))return t.text}return At(e)??""}function J8(e){const t=e.name;if(t&&t.length>0)return Bc(t[0])}function eU(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function tU(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=SE(n);if(r)return r}else return SE(t)}function SE(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function AD(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 o=n.getUTCFullYear(),s=n.getUTCMonth(),c=n.getUTCDate(),d=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=d-o;(f<s||f===s&&p<c)&&m--;let g=d*12+f-(o*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 nU(e,t){const{years:n,months:r,days:o}=AD(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function mo(e,...t){let n=e;for(let r=0;r<t.length&&n;r++)n=n?.extension?.find(o=>o.url===t[r]);return n}function Ii(e,t){const n=lb(e);return JSON.stringify(n,null,t?2:void 0)??""}function lb(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?rU(e):iU(e):e}function rU(e){const t=e.length;if(t===0)return;let n,r=0;for(let o=0;o<t;o++){const s=e[o],c=lb(s);c!==s&&!n&&(n=Array.from(e)),c===void 0?n&&(n[o]=null):(n&&(n[o]=c),r++)}if(r!==0)return n??e}function iU(e){let t,n=0;for(const r in e){const o=e[r],s=lb(o);s!==o&&!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 co(e,t,n){return e===t||xn(e)&&xn(t)?!0:xn(e)||xn(t)?!1:Array.isArray(e)&&Array.isArray(t)?oU(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?aU(e,t,n):(sr(e)||sr(t),!1)}function oU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!co(e[n],t[n]))return!1;return!0}function aU(e,t,n){const r=new Set;Object.keys(e).forEach(o=>r.add(o)),Object.keys(t).forEach(o=>r.add(o)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const s=e[o],c=t[o];if(!co(s,c,o))return!1}return!0}function cb(e,t){return xn(e)?!0:xn(t)?!1:Array.isArray(e)&&Array.isArray(t)?sU(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?lU(e,t):sr(e)||sr(t)?!1:e===t}function sU(e,t){return t.every(n=>e.some(r=>cb(r,n)))}function lU(e,t){return Object.entries(t).every(([n,r])=>n in e&&cb(e[n],r))}function Kr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function PD(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 sr(e){return e!==null&&typeof e=="object"}function cU(e){return typeof e=="string"}function kD(e){return sr(e)&&"code"in e&&typeof e.code=="string"}function ND(e){return sr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(kD)}function uU(e){return sr(e)&&"text"in e&&typeof e.text=="string"}const OD=[];for(let e=0;e<256;e++)OD.push(e.toString(16).padStart(2,"0"));function dU(e){const t=MD(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=OD[n[o]];return r.join("")}function fU(e){const t=MD(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCharCode(n[o]);return window.btoa(r.join(""))}function MD(e){return ArrayBuffer.isView(e)?e.buffer:e}function Ln(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function ub(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Is(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function hU(e,t){return e.coding?.find(n=>n.system===t)?.code}function pU(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const wE=e=>new Promise(t=>{setTimeout(t,e)});function Xy(e,t,n){const r=[];for(let o=0;o<n-1;o++){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 mU(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Bu(e,t){return e?(e.push(t),e):[t]}function Ec(e){return e.sort((t,n)=>t.localeCompare(n))}function db(e){return e.endsWith("/")?e:e+"/"}function gU(e){return e.startsWith("/")?e.slice(1):e}function Zi(e,t){return new URL(gU(t),db(e.toString())).toString()}function vU(e,t){return Zi(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function yU(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 LD(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 xU(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}function Gs(e){if(!e)return"";switch(e.type){case"Address":return ID(e.value);case"CodeableConcept":return Xa(e.value);case"Coding":return Id(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Bc(e.value);case"Quantity":return $s(e.value);case"Reference":return bU(e.value);default:return e.value?.toString()??""}}function bU(e){return e?e.display??e.reference??Ii(e):""}function ID(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 Bc(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=cd(e.text);if(r)return r}return n.join(" ").trim()}function am(e){return e instanceof Date&&!isNaN(e.getTime())}function SU(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return am(r)?r.toLocaleTimeString(t,n):""}function lr(e,t,n){if(!e)return"";const r=new Date(e);return am(r)?r.toLocaleString(t,n):""}function wU(e,t,n){return!e||!e.start&&!e.end?"":lr(e.start,t,n)+" - "+lr(e.end,t,n)}const jU={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},CU={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},EU={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function $D(e){if(!e)return"";const t=[];return TU(t,e.repeat),e.event&&t.push(e.event.map(n=>lr(n)).join(", ")),Ln(t.join(" ").trim())}function TU(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(jU[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+CU[o]):e.push("per "+r+" "+EU[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Ln).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>SU(s)).join(", "))}function ld(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},o=e?.high&&{...e.high,comparator:void 0};return r?.value===void 0&&o?.value===void 0?"":r?.value!==void 0&&o?.value===void 0?`>= ${$s(r)}`:r?.value===void 0&&o?.value!==void 0?`<= ${$s(o)}`:(r?.unit===o?.unit&&delete r?.unit,`${$s(r)} - ${$s(o)}`)}function $s(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 RU(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Xa(e){if(!e)return"";const t=cd(e.text);return t||(e.coding?e.coding.map(n=>Id(n)).join(", "):"")}function Id(e,t){const n=cd(e?.display);return n?`${n}`:cd(e?.code)??""}function zD(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push($s(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Xa(e.valueCodeableConcept));else{const n=cd(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>zD(n)).join(" / ")),t.join(" / ").trim()}function cd(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 _U(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&UD(n.type)}function UD(e){let t=uo.types[e];return t||(t={searchParamsDetails:{}},uo.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 DU(e){for(const t of e.base??[]){const n=UD(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function jE(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?AU((e.base?.path??e.path)?.split(".")):t}function AU(e){return e.length===1?e[0]:e.map(Ln).join("")}function fb(e){return uo.types[e]?.searchParams}function PU(e,t){return uo.types[e]?.searchParams?.[t]}function Ws(e){const t=e.replaceAll("[x]","").split(".").pop();return BD(t)}function BD(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(NU).join(" ").replace("_"," ").replace(/\s+/g," ")}const kU=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function NU(e){const t=e.toUpperCase();return e===t?e:kU.has(t)?t:t.charAt(0)+e.slice(1)}function is(e,t,n){const r=im(e,n);if(r)return OU(r.elements,t)}function OU(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const o=t[r];if(o>="A"&&o<="Z"){const s=t.slice(0,r)+"[x]",c=e[s];if(c)return c}}}function go(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function ca(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const uo={types:{}};function Ah(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 Bo=()=>[],_r={empty:(e,t)=>Ze(t.length===0||t.every(n=>xn(n.value))),hasValue:(e,t)=>Ze(t.length!==0),exists:(e,t,n)=>Ze(n?t.filter(r=>to(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!xn(r.value))),all:(e,t,n)=>Ze(t.every(r=>to(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Ze(!1);return Ze(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Ze(!0);return Ze(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Ze(!1);return Ze(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Ze(!0);return Ze(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Ze(!0);const r=n.eval(e,Ts(e));return r.length===0?Ze(!1):Ze(t.every(o=>r.some(s=>s.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Ts(e));return r.length===0?Ze(!0):t.length===0?Ze(!1):Ze(r.every(o=>t.some(s=>s.value===o.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Ze(t.length===_r.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>to(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:Bo,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,Ts(e)),o=[];for(const s of t)!o.some(c=>c.value===s.value)&&r.some(c=>c.value===s.value)&&o.push(s);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ts(e)),o=[];for(const s of t)r.some(c=>c.value===s.value)||o.push(s);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ts(e));return wD([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ts(e));return[...t,...r]},htmlChecks:(e,t,n)=>[Yr(!0)],iif:(e,t,n,r,o)=>{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 to(s)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Ze(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Ze(!0);if(["false","f","no","n","0","0.0"].includes(r))return Ze(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Ze(_r.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(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?[]:Ze(_r.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:Ah(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Ze(_r.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:Ah(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Ze(_r.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(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?[]:Ze(_r.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return pi(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?[]:Ze(_r.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return n==null?[]:pi(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Ze(_r.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:Ah("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Ze(_r.toTime(e,t).length===1),indexOf:(e,t,n)=>ui((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>ui((o,s,c)=>{const d=s,f=c?d+c:o.length;return d<0||d>=o.length?void 0:o.substring(d,f)},e,t,n,r),startsWith:(e,t,n)=>ui((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>ui((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>ui((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>ui(n=>n.toUpperCase(),e,t),lower:(e,t)=>ui(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>ui((o,s,c)=>o.replaceAll(s,c),e,t,n,r),matches:(e,t,n)=>ui((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>ui((o,s,c)=>o.replaceAll(new RegExp(s,"g"),c.replaceAll(/\$\{(\w+)\}/g,"$<$1>")),e,t,n,r),length:(e,t)=>ui(n=>n.length,e,t),toChars:(e,t)=>ui(n=>n?n.split(""):void 0,e,t),encode:Bo,decode:Bo,escape:Bo,unescape:Bo,trim:Bo,split:Bo,join:(e,t,n)=>{const r=n?.eval(e,Ts(e))[0]?.value??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:re.string,value:t.map(o=>o.value?.toString()??"").join(r)}]},abs:(e,t)=>Ki(Math.abs,e,t),ceiling:(e,t)=>Ki(Math.ceil,e,t),exp:(e,t)=>Ki(Math.exp,e,t),floor:(e,t)=>Ki(Math.floor,e,t),ln:(e,t)=>Ki(Math.log,e,t),log:(e,t,n)=>Ki((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>Ki(Math.pow,e,t,n),round:(e,t,...n)=>Ki((r,o=0)=>{if(typeof o!="number"||o<0)throw new Error("Invalid precision provided to round()");const s=Math.pow(10,o);return Math.round(r*s)/s},e,t,...n),sqrt:(e,t)=>Ki(Math.sqrt,e,t),truncate:(e,t)=>Ki(n=>n|0,e,t),children:Bo,descendants:Bo,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,o)=>{const s=_r.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const c=_r.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const d=o.eval(e,t)[0]?.value;if(d!=="years"&&d!=="months"&&d!=="days")throw new Error("Invalid units");const f=AD(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 Kh?r=n.name:n instanceof hb&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:re.boolean,value:CD(o,r)})):[]},not:(e,t)=>_r.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const s=r;if(s.resource)return Yr(s.resource);s.reference?o=s.reference:s.type&&s.identifier&&(o=`${s.type}?identifier=${s.identifier.system}|${s.identifier.value}`)}if(o?.includes("?")){const[s]=o.split("?");return{type:s,value:{resourceType:s}}}if(o?.includes("/")){const[s,c]=o.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"}}:go(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 o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(s=>({type:re.boolean,value:s.value?.resourceType===o}))},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 o="";return n instanceof Kh&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:re.id,value:Hs(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,o=t?.[0]?.value;if(o){const s=mo(o,r);if(s)return[{type:re.Extension,value:s}]}return[]}};function ui(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Ji(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const s=r.map(d=>d?.eval(t,n)[0]?.value),c=e(o,...s);return c===void 0?[]:Array.isArray(c)?c.map(Yr):[Yr(c)]}function Ki(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Ji(n,1),s=pi(o),c=s?o.value:o;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?{...o,value:d}:d;return[{type:f,value:p}]}function Ji(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 Ts(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class VD{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const o of n)r.push(this.child.eval({parent:t,variables:{$this:o}},[o]));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 rc{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Kh{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(o=>this.evalValue(o)).filter(o=>o?.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 go(n,this.name)?t:Cc(t,this.name)}toString(){return this.name}}class MU{eval(){return[]}toString(){return"{}"}}class LU extends pz{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 Xh extends Od{constructor(t,n){super("as",t,n)}eval(t,n){return _r.ofType(t,this.left.eval(t,n),this.right)}}class Mr extends Od{}class Di extends Mr{constructor(t,n,r,o){super(t,n,r),this.impl=o}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.eval(t,n);if(o.length!==1)return[];const s=r[0].value,c=o[0].value,d=pi(s)?s.value:s,f=pi(c)?c.value:c,p=this.impl(d,f);return typeof p=="boolean"?Ze(p):pi(s)?[{type:re.Quantity,value:{...s,value:p}}]:[Yr(p)]}}class IU extends Od{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),s=[...r,...o];return s.length>0&&s.every(c=>typeof c.value=="string")?[{type:re.string,value:s.map(c=>c.value).join("")}]:s}}class $U extends Mr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Ze(r.some(s=>s.value===o[0].value))}}class zU extends Mr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Xo(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Ze(o.some(s=>om(r,s)[0].value)):[]}}class hb extends Od{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 pb extends Od{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return wD([...r,...o])}}class UU extends Mr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Q8(r,o)}}class BU extends Mr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Y8(r,o)}}class VU extends Mr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return jD(r,o)}}class FU extends Mr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return W8(jD(r,o))}}class mb extends Mr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return Ze(CD(r[0],o))}}class qU extends Mr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Xo(this.left.eval(t,n),"boolean"),o=Xo(this.right.eval(t,n),"boolean");return r?.value===!0&&o?.value===!0?Ze(!0):r?.value===!1||o?.value===!1?Ze(!1):[]}}class HU extends Mr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Xo(this.left.eval(t,n),"boolean"),o=Xo(this.right.eval(t,n),"boolean");return r?.value===!1&&o?.value===!1?Ze(!1):r?.value||o?.value?Ze(!0):[]}}class GU extends Mr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Xo(this.left.eval(t,n),"boolean"),o=Xo(this.right.eval(t,n),"boolean");return!r||!o?[]:Ze(r.value!==o.value)}}class WU extends Mr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Xo(this.left.eval(t,n),"boolean"),o=Xo(this.right.eval(t,n),"boolean");return o?.value===!0||r?.value===!1?Ze(!0):!r||!o?[]:Ze(!1)}}class gb{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=_r[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 vb{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 o=r[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const s=this.left.eval(t,n);return o in s?[s[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const QU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],YU={"'":"'",'"':'"',"`":"`",r:"\r",n:`
|
|
77
|
-
`,t:" ",f:"\f","\\":"\\"};class KU{constructor(t,n,r,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!o?.dateTimeLiterals,this.symbolRegex=o?.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()!==`
|
|
78
|
-
`))}consumeString(t){this.advance();let n="",r;for(;r=this.consumeChar(t);)n+=r;const o=this.buildToken(t==="`"?"Symbol":"String",n);return this.advance(),o}consumeChar(t){const n=this.curr();if(n==="\\"){this.advance();const r=this.curr(),o=YU[r];if(o!==void 0)return this.advance(),o;if(r==="u"){this.advance();const s=/^[0-9a-fA-F]{4}$/.exec(this.str.substring(this.pos.index,this.pos.index+4))?.[0];return s?(this.advance(),this.advance(),this.advance(),this.advance(),String.fromCodePoint(parseInt(s,16))):"u"}return this.consumeChar(t)}return n===t||!n?"":(this.advance(),n)}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 o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}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()===" "&&XU(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]}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()===`
|
|
79
|
-
`?(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 XU(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&QU.includes(e.value)))}const ZU=["true","false"],JU=["!=","!~","<=",">=","{}","->"];function eB(e){return new KU(e,ZU,JU).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},tB={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},nB={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new vb(t,n)},precedence:Yt.Indexer},rB={parse(e,t){if(!(t instanceof Kh))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new gb(t.name,n)},precedence:Yt.FunctionCall};function iB(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 oB(){return new mz().registerPrefix("String",{parse:(e,t)=>new rc({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new rc({type:re.dateTime,value:Ah(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new rc({type:re.Quantity,value:iB(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new rc({type:t.value.includes(".")?re.decimal:re.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new rc({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new rc({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Kh(t.value)}).registerPrefix("{}",{parse:()=>new MU}).registerPrefix("(",tB).registerInfix("[",nB).registerInfix("(",rB).prefix("+",Yt.UnaryAdd,(e,t)=>new LU("+",t,n=>n)).prefix("-",Yt.UnarySubtract,(e,t)=>new Di("-",t,t,(n,r)=>-r)).infixLeft(".",Yt.Dot,(e,t,n)=>new hb(e,n)).infixLeft("/",Yt.Divide,(e,t,n)=>new Di("/",e,n,(r,o)=>r/o)).infixLeft("*",Yt.Multiply,(e,t,n)=>new Di("*",e,n,(r,o)=>r*o)).infixLeft("+",Yt.Add,(e,t,n)=>new Di("+",e,n,(r,o)=>r+o)).infixLeft("-",Yt.Subtract,(e,t,n)=>new Di("-",e,n,(r,o)=>r-o)).infixLeft("|",Yt.Union,(e,t,n)=>new pb(e,n)).infixLeft("=",Yt.Equals,(e,t,n)=>new UU(e,n)).infixLeft("!=",Yt.NotEquals,(e,t,n)=>new BU(e,n)).infixLeft("~",Yt.Equivalent,(e,t,n)=>new VU(e,n)).infixLeft("!~",Yt.NotEquivalent,(e,t,n)=>new FU(e,n)).infixLeft("<",Yt.LessThan,(e,t,n)=>new Di("<",e,n,(r,o)=>r<o)).infixLeft("<=",Yt.LessThanOrEquals,(e,t,n)=>new Di("<=",e,n,(r,o)=>r<=o)).infixLeft(">",Yt.GreaterThan,(e,t,n)=>new Di(">",e,n,(r,o)=>r>o)).infixLeft(">=",Yt.GreaterThanOrEquals,(e,t,n)=>new Di(">=",e,n,(r,o)=>r>=o)).infixLeft("&",Yt.Ampersand,(e,t,n)=>new IU(e,n)).infixLeft("and",Yt.And,(e,t,n)=>new qU(e,n)).infixLeft("as",Yt.As,(e,t,n)=>new Xh(e,n)).infixLeft("contains",Yt.Contains,(e,t,n)=>new $U(e,n)).infixLeft("div",Yt.Divide,(e,t,n)=>new Di("div",e,n,(r,o)=>r/o|0)).infixLeft("in",Yt.In,(e,t,n)=>new zU(e,n)).infixLeft("is",Yt.Is,(e,t,n)=>new mb(e,n)).infixLeft("mod",Yt.Modulo,(e,t,n)=>new Di("mod",e,n,(r,o)=>r%o)).infixLeft("or",Yt.Or,(e,t,n)=>new HU(e,n)).infixLeft("xor",Yt.Xor,(e,t,n)=>new GU(e,n)).infixLeft("implies",Yt.Implies,(e,t,n)=>new WU(e,n))}const aB=oB();function yb(e){return new VD(e,aB.construct(eB(e)).consumeAndParse())}function sB(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const o=n[r];typeof o=="object"&&"type"in o&&"value"in o||(n[r]=Yr(n[r]))}return Za(e,n).map(r=>r.value)}function Za(e,t,n={},r=void 0){let o;if(typeof e=="string"){const s=r?.get(e);o=s??yb(e),r&&!s&&r.set(e,o)}else o=e;return o.eval({variables:n},t).map(s=>({type:s.type,value:s.value?.valueOf()}))}function lB(e){const t=[];for(const n of e){const r=RD(n.value);r&&t.push(r)}return t}function cB(e){const t=[];for(const n of e){const r=Gs(n);r&&t.push(r)}return t}function uB(e){const t=[];for(const n of e){const{value:r}=n;r&&(cU(r)?t.push(r):ca(r)?t.push(r.reference):DD(r)?t.push(At(r)):typeof r.identifier=="object"&&t.push(`identifier:${r.identifier.system}|${r.identifier.value}`))}return t}function dB(e,t={}){const n=[];for(const r of e)fB(t,n,r);return n}function fB(e,t,n){const{type:r,value:o}=n;switch(r){case re.Identifier:hB(t,e,o);break;case re.CodeableConcept:pB(t,e,o);break;case re.Coding:FD(t,e,o);break;case re.ContactPoint:mB(t,e,o);break;default:Qs(t,e,void 0,o?.toString())}}function hB(e,t,n){n?.type?.text&&Qs(e,t,t.textSearchSystem,n.type.text),Qs(e,t,n?.system,n?.value)}function pB(e,t,n){if(n?.text&&Qs(e,t,t.textSearchSystem,n.text),n?.coding)for(const r of n.coding)FD(e,t,r)}function FD(e,t,n){n&&(n.display&&Qs(e,t,t.textSearchSystem,n.display),Qs(e,t,n.system,n.code))}function mB(e,t,n){n&&Qs(e,t,n.system,n.value?.toLocaleLowerCase())}function Qs(e,t,n,r){(n||r)&&!e.some(o=>o.system===n&&o.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"},qD={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},xb={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 HD(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 o;n.includes("/")?o=n.split("/").filter(Boolean).pop():o=n;const s=[];return r&&s.push(...r.entries()),gB(o,s)}function gB(e,t){const n={resourceType:e};for(const[r,o]of t)vB(n,r,o);return n}function vB(e,t,n){let r,o;const s=t.indexOf(":");if(s>=0?(r=t.substring(0,s),o=t.substring(s+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Bu(e.filters,{code:t,operator:ue.EQUALS,value:n});return}switch(r){case"_sort":yB(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=CE(n);o==="iterate"&&(c.modifier=ue.ITERATE),e.include=Bu(e.include,c);break}case"_revinclude":{const c=CE(n);o==="iterate"&&(c.modifier=ue.ITERATE),e.revInclude=Bu(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=uo.types[e.resourceType]?.searchParams?.[r];c?e.filters=Bu(e.filters,bB(c,o,n)):e.filters=Bu(e.filters,SB(r,o,n))}}}}function yB(e,t){for(const n of t.split(",")){let r,o=!1;n.startsWith("-")?(r=n.substring(1),o=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:o})}}const xB=[ue.MISSING,ue.PRESENT];function bB(e,t,n){if(xB.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=wB(n);if(!EE(e,o))throw new dt(io(`Invalid format for ${e.type} search parameter: ${o}`));return{code:e.code,operator:r,value:o}}case"reference":case"string":case"token":case"uri":if(!EE(e,n))throw new dt(io(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:jB(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function SB(e,t,n){let r=ue.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in xb&&(n.length===2||n.at(2)?.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function wB(e){const t=e.substring(0,2),n=xb[t];return n?{operator:n,value:e.substring(2)}:{operator:ue.EQUALS,value:e}}function jB(e){return qD[e]??ue.EQUALS}function CE(e){const t=e.split(":");if(t.includes("*"))throw new dt(io("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new dt(io(`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 dt(io(`Invalid include value '${e}'`))}function EE(e,t){switch(e.type){case"date":return sd(t);default:return!0}}function Wa(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(CB(n))),e.sortRules&&e.sortRules.length>0&&t.push(EB(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(TE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(TE("_revinclude",n))),t.length===0?"":(Ec(t),"?"+t.join("&"))}function CB(e){const t=e.operator in qD?":"+e.operator:"",n=e.operator!==ue.EQUALS&&e.operator in xb?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function EB(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function TE(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 o of e)r?(n+=o,r=!1):o==="\\"?r=!0:o===","?(t.push(n),n=""):n+=o;return t.push(n),t}function TB(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!RB(e,t,n))return!1}return!0}function RB(e,t,n){const r=uo.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const o=Za(r.expression,[Yr(e)]);if(n.operator===ue.MISSING||n.operator===ue.PRESENT)return _B(o,n);switch(r.type){case"reference":return DB(o,n);case"string":case"uri":return kB(o,n);case"token":return AB(o,n);case"date":return OB(o,n);default:return!1}}function _B(e,t){const n=e.length>0;return(t.operator===ue.MISSING&&t.value==="false"||t.operator===ue.PRESENT&&t.value==="true")===n}function DB(e,t){const n=cm(t.operator);if(t.value===""&&e.length===0)return t.operator===ue.EQUALS;const r=uB(e);for(const o of lm(t.value)){let s=r.includes(o);if(!s&&t.code==="_compartment"&&(s=r.some(c=>c?.endsWith("/"+o))),s)return!n}return n}function AB(e,t){const n=dB(e),r=lm(t.value),o=cm(t.operator);for(const s of n)for(const c of r)if(PB(s,c))return!o;return o}function PB(e,t){if(t.includes("|")){const[n,r]=t.split("|").map(o=>o.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 kB(e,t){const n=cB(e),r=lm(t.value),o=cm(t.operator);for(const s of n)for(const c of r)if(NB(s,c))return!o;return o}function NB(e,t){return e.toLowerCase().includes(t.toLowerCase())}function OB(e,t){const n=lB(e),r=lm(t.value),o=cm(t.operator);for(const s of n)for(const c of r)if(MB(s,t.operator,c))return!o;return o}function MB(e,t,n){if(!e)return!1;const r=RD(n);if(!r)return!1;const o=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 o<d&&s>c;case ue.LESS_THAN:return o<c;case ue.GREATER_THAN:return s>d;case ue.LESS_THAN_OR_EQUALS:return o<=d;case ue.GREATER_THAN_OR_EQUALS:return s>=c;case ue.STARTS_AFTER:return o>d;case ue.ENDS_BEFORE:return s<c;default:return!1}}function cm(e){return e===ue.NOT_EQUALS||e===ue.NOT}const LB={resourceType:"*"},IB=["DomainConfiguration","JsonWebKey","Login"],$B=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],zs={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},zB=[zs.READ,zs.VREAD,zs.HISTORY,zs.SEARCH];function UB(e,t){return IB.includes(t)?!1:BB(e,zs.UPDATE,t)}function BB(e,t,n){return!!e.resource?.some(r=>WD(r,n,t))}function GD(e,t,n){return n?n.resource?.find(r=>VB(e,t,r)):LB}function VB(e,t,n){const r=e.resourceType;return WD(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(o=>o.reference===n.compartment?.reference)||n.criteria&&!TB(e,HD(n.criteria))):!1}function WD(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||$B.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||zB.includes(n)}function FB(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 RE(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 qB(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return FB(t)}function _E(){const e=new Uint32Array(28);return crypto.getRandomValues(e),dU(e.buffer)}async function HB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function QD(){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 YD(e){const t={};e=Kr(e);for(const o of e.entry||[]){const s=o.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]=QD(),o.fullUrl="urn:uuid:"+t[c],delete o.resource?.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n?.map(o=>({fullUrl:o.fullUrl,request:{method:"POST",url:o.resource?.resourceType},resource:o.resource}))},(o,s)=>GB(o,s,t),2);return WB(JSON.parse(r))}function GB(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 o=n[r];if(o)return"urn:uuid:"+o}}return t}function WB(e){const t=YB(e),{sorted:n,cycles:r}=QB(t),o={};for(const c of e.entry??[])c.fullUrl&&(o[c.fullUrl]=c);const s=n.map(c=>o[c]);for(const c of r)for(const d of c){const f=o[d],p={...f,request:{...f.request,method:"PUT"}};s.push(p)}return{...e,entry:s}}const ic={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function QB(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=ic.NotVisited;function o(s,c){if(n[s]===ic.Visited)return!0;if(n[s]===ic.Visiting){const f=c.lastIndexOf(s);return f!==-1&&r.push(c.slice(f)),!0}n[s]=ic.Visiting,c.push(s);let d=!1;for(const f of e[s])o(f,c)||(d=!0);return n[s]=ic.Visited,c.pop(),t.unshift(s),!d}for(const s in e)n[s]===ic.NotVisited&&o(s,[]);return{sorted:t,cycles:r}}function KD(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(ca(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else KD(r,t)}}function YB(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&&KD(n.resource,o=>{t[o]&&t[o].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 KB=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 o=0;o<r.length;o++)if(r[o]===n){r.splice(o,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 KB}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 Zy={"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"},XB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],bb=["DiagnosticReport-update"];function ZB(e){return bb.includes(e)}function JB(e){if(bb.includes(e))throw new dt(gn(`'context.version' is required for '${e}'.`))}const eV={"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 tV(e){return XB.includes(e)}function XD(e){return!!e.endpoint}function DE(e){if(!Sb(e))throw new dt(gn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,s={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return XD(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function Sb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:o}=e;if(!(t&&n&&r&&o)||typeof r!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const s of o)if(!Zy[s])return!1;return!(XD(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function nV(e,t,n,r){if(typeof t!="object")throw new dt(gn(`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 dt(gn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new dt(gn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!tV(t.resourceType))throw new dt(gn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new dt(gn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function rV(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),r.reference){if(!ca(t.reference))throw new dt(gn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else nV(e,t.resource,n,r)}function iV(e,t){const n=new Map,r=eV[e];for(let o=0;o<t.length;o++){const s=t[o].key;if(!r[s])throw new dt(gn(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));rV(e,t[o],o,r[s],n)}for(const[o,s]of Object.entries(r)){if(!(s.optional||n.has(o)))throw new dt(gn(`Missing required key '${o}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(o)??0)>1)throw new dt(gn(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function AE(e,t,n,r){if(!(e&&typeof e=="string"))throw new dt(gn("Must provide a topic."));if(!Zy[t])throw new dt(gn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Zy).join(", ")}`));if(typeof n!="object")throw new dt(gn("context must be a context object or array of context objects."));if(bb.includes(t)&&!r)throw new dt(gn(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return iV(t,o),{timestamp:new Date().toISOString(),id:QD(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class oV extends um{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new dt(gn("Subscription request should contain an endpoint."));if(!Sb(t))throw new dt(gn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const o=JSON.parse(r.data);if(o["hub.topic"])return;const s=o;s.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:s}),n.send(JSON.stringify({id:o?.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function aV(e){return JSON.parse(qB(e))}function sV(e){return e.split(".").length===3}function wb(e){const[t,n,r]=e.split(".");return aV(n)}function lV(e){try{return typeof wb(e).login_id=="string"}catch{return!1}}function cV(e){try{const n=wb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class uV{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 ZD;ZD=Symbol.toStringTag;class Ai{constructor(t){this[ZD]="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 dV{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new fV)}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?Ii(n):void 0)}}class fV{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]}}/*!
|
|
80
|
-
* Reconnecting WebSocket
|
|
81
|
-
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
82
|
-
* https://github.com/pladaria/reconnecting-websocket
|
|
83
|
-
* License MIT
|
|
84
|
-
*
|
|
85
|
-
* Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
|
|
86
|
-
* https://github.com/partykit/partykit/blob/main/packages/partysocket
|
|
87
|
-
*/const hc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let PE=!1;function hV(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");hc.Event=globalThis.Event,hc.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},hc.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function pV(e,t){if(!e)throw new Error(t)}function ph(e){return new e.constructor(e.type,e)}const Rs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let kE=!1;class Ba extends um{constructor(t,n,r={}){PE||(hV(),PE=!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=o=>{this._debug("open event");const{minUptime:s=Rs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),s),pV(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(o),this.dispatchEvent(ph(o))},this._handleMessage=o=>{this._debug("message event"),this.onmessage&&this.onmessage(o),this.dispatchEvent(ph(o))},this._handleError=o=>{this._debug("error event",o.message),this._disconnect(void 0,o.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(o),this._debug("exec error listeners"),this.dispatchEvent(ph(o)),this._connect()},this._handleClose=o=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(o),this.dispatchEvent(ph(o))},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 Ba.CONNECTING}get OPEN(){return Ba.OPEN}get CLOSING(){return Ba.CLOSING}get CLOSED(){return Ba.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?Ba.CLOSED:Ba.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=Rs.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=Rs.reconnectionDelayGrowFactor,minReconnectionDelay:n=Rs.minReconnectionDelay,maxReconnectionDelay:r=Rs.maxReconnectionDelay}=this._options;let o=0;return this._retryCount>0&&(o=n*Math.pow(t,this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Rs.maxRetries,connectionTimeout:n=Rs.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"&&!kE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),kE=!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 hc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new hc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new hc.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 mV=5e3;class Jy 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 gV{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Jy(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class vV{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof eA))throw new dt(gn("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new dt(gn("Not a valid URL"))}const s=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new Ba(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new Jy,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??mV,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 o=r,s=o?.entry?.[0]?.resource;if(s.type==="heartbeat"){this.masterSubEmitter?.dispatchEvent({type:"heartbeat",payload:o});return}if(s.type==="handshake"){const d=Hs(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:o});const c=this.criteriaEntriesBySubscriptionId.get(Hs(s.subscription));if(!c){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}c.emitter.dispatchEvent({type:"message",payload:o})}catch(r){console.error(r);const o={type:"error",payload:r};this.masterSubEmitter?.dispatchEvent(o);for(const s of this.getAllCriteriaEmitters())s.dispatchEvent({...o})}}),t.addEventListener("error",()=>{const n={type:"error",payload:new dt(Rz(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 ${At(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`),o=r?.find(c=>c.name==="token")?.valueString,s=r?.find(c=>c.name==="websocket-url")?.valueUrl;if(!o)throw new dt(gn("Failed to get token"));if(!s)throw new dt(gn("Failed to get URL from $get-ws-binding-token"));return[n,o]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const o of r.criteriaWithProps)if(co(n,o.subscriptionProps))return o}}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 o;this.criteriaEntries.has(n)?o=this.criteriaEntries.get(n):(o={criteriaWithProps:[]},this.criteriaEntries.set(n,o)),r?o.criteriaWithProps.push(t):o.bareCriteria=t}removeCriteriaEntry(t){const{criteria:n,subscriptionProps:r,subscriptionId:o,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!co(r,f)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),this.masterSubEmitter?._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),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 o=new gV(t,n);return this.addCriteriaEntry(o),this.subscribeToCriteria(o).catch(console.error),o.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 Jy(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const JD="4.4.1-0900190f6",yV=un.FHIR_JSON+", */*; q=0.1",xV="https://api.medplum.com/",bV=1e3,SV=6e4,wV=0,jV=3e5,CV="Binary/",NE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},oc={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"},EV={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},TV={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class eA 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??RV(),this.storage=t?.storage??new dV,this.createPdfImpl=t?.createPdf,this.baseUrl=db(t?.baseUrl??xV),this.fhirBaseUrl=Zi(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=Zi(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=Zi(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=Zi(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=Zi(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??jV,this.cacheTime=t?.cacheTime??(typeof window>"u"?wV:SV),this.cacheTime>0?this.requestCache=new dD(t?.resourceCacheSize??bV):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=Zi(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 o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?o=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))}):o=this.request("GET",t,n);const s=new Ai(o);return this.setCacheEntry(t,s),s}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}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:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},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,o,s=!0){let c=o;s&&(c=await this.ensureCodeChallenge(o)),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:oc.TokenExchange,subject_token_type:EV.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,o,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",o.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(o)),s){const{codeChallenge:d,codeChallengeMethod:f}=o;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(Zi(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=yU(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),s="search-"+o.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=this.getBundle(o,r);return this.setCacheEntry(s,d),d}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const s="searchOne-"+o.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Ai(this.search(t,o.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 Ai(this.search(t,n,r).then(LE));return this.setCacheEntry(s,d),d}async*searchResourcePages(t,n,r){let o=this.fhirSearchUrl(t,n);for(;o;){const s=new URL(o).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 LE(c),o=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 NE;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}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 Ai(Promise.reject(new Error("Missing reference")));if(r==="system")return new Ai(Promise.resolve(NE));const[o,s]=r.split("/");return!o||!s?new Ai(Promise.reject(new Error("Invalid reference"))):this.readResource(o,s,n)}requestSchema(t){if(yD(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Ai((async()=>{const s=`{
|
|
88
|
-
StructureDefinitionList(_filter: "name eq ${t}") {
|
|
89
|
-
resourceType,
|
|
90
|
-
name,
|
|
91
|
-
kind,
|
|
92
|
-
description,
|
|
93
|
-
type,
|
|
94
|
-
url,
|
|
95
|
-
snapshot {
|
|
96
|
-
element {
|
|
97
|
-
id,
|
|
98
|
-
path,
|
|
99
|
-
definition,
|
|
100
|
-
min,
|
|
101
|
-
max,
|
|
102
|
-
base {
|
|
103
|
-
path,
|
|
104
|
-
min,
|
|
105
|
-
max
|
|
106
|
-
},
|
|
107
|
-
contentReference,
|
|
108
|
-
type {
|
|
109
|
-
code,
|
|
110
|
-
profile,
|
|
111
|
-
targetProfile
|
|
112
|
-
},
|
|
113
|
-
binding {
|
|
114
|
-
strength,
|
|
115
|
-
valueSet
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
121
|
-
base,
|
|
122
|
-
code,
|
|
123
|
-
type,
|
|
124
|
-
expression,
|
|
125
|
-
target
|
|
126
|
-
}
|
|
127
|
-
}`.replace(/\s+/g," "),c=await this.graphql(s);mE(c.data.StructureDefinitionList);for(const d of c.data.SearchParameterList)DU(d)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!n?.expandProfile&&ab(t))return Promise.resolve();const r=t+"-requestSchema"+(n?.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const s=new Ai((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(),{});mE(d)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}vD(c)}})());return this.setCacheEntry(r,s),s}readHistory(t,n,r,o){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(),o)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}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 o=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(o,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 o=this.fhirSearchUrl(t.resourceType,n);let s=await this.put(o,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,o,s){let c=IE(t,n,r,o);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,o,s){const c=IE(t,n,r,o),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,o,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")),o&&(f.upload.onprogress=g=>o(g),f.upload.onload=g=>o(g)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new dt(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,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=AV(t,n,r,o),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 o=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:o?qt(o):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,o){const s=await this.patch(this.fhirUrl(t,n),r,o);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,o){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,o)}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,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},un.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,s,c){const{waitTimeout:d,...f}=c??{};return this.post(this.fhirUrl("Agent",Hs(t),"$push"),{destination:typeof n=="string"?n:At(n),body:r,contentType:o,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||At(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=cV(t),this.medplumServer=lV(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 o=this.sessionDetails?.profile?.id!==r.profile.id;this.sessionDetails=r,o&&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(CV)&&(t=this.fhirUrl(r));let o=n.headers;return o||(o={},n.headers=o),o.Accept||(o.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...o}=t,s=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=qt(s));const c=await this.createAttachment(o,n);return this.updateResource({...s,status:"completed",content:c})}async uploadMedia(t,n,r,o,s){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},s)}async createDocumentReference(t,n){const{additionalFields:r,...o}=t,s=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});o.securityContext||(o.securityContext=qt(s));const c=await this.createAttachment(o,n);return this.updateResource({...s,content:[{attachment:c}]})}async bulkExport(t="",n,r,o){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(),o)}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 uV(this)),this.keyValueClient}getBundle(t,n){return new Ai((async()=>{const r=await this.get(t,n);if(r.entry)for(const o of r.entry)this.cacheResource(o.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 Ai(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},o={}){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 dt(Ez);const f=await this.parseBody(s,d);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await ME(s,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const m=await ME(s,f)??o.statusUrl;if(m)return this.pollStatus(m,r,o)}if(s.status>=400)throw new dt(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(o){throw console.error("Error parsing response",t.status,o),o}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Zi(this.baseUrl,t));const r=n?.maxRetries??2;for(let o=0;o<=r;o++)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),o>=r||!PV(s))return s;const c=this.getRetryDelay(o),d=n.maxRetryTime??2e3;if(c>d)return s;await wE(c)}catch(s){if(s.message==="Failed to fetch"&&o===0&&this.dispatchEvent({type:"offline"}),s.name==="AbortError"||o===r)throw s}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of Ec(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}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 o=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(!o||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:o,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const o of n)o.remainingUnits||(r=Math.max(r,o.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const o={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(o.headers={...n.headers},delete o.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const s=n.pollStatusPeriod??1e3;await wE(s),r.pollCount++}return this.request("GET",t,o,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 o=t[0];try{o.resolve(await this.request(o.method,Zi(this.fhirBaseUrl,o.url),o.options))}catch(s){o.reject(new dt(Ht(s)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(o=>({request:{method:o.method,url:o.url},resource:o.options.body?JSON.parse(o.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let o=0;o<t.length;o++){const s=t[o],c=r.entry?.[o];c?.response?.outcome&&!hD(c.response.outcome)?s.reject(new dt(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",yV,!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,o=!1){t.headers||(t.headers={});const s=t.headers;o&&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 dt(ad)))}async startPkce(){const t=_E();sessionStorage.setItem("pkceState",t);const n=_E().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await HB(n);return{codeChallengeMethod:"S256",codeChallenge:fU(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??OE()),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:oc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??OE()};if(typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&(r.code_verifier=o)}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:oc.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:oc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:oc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:oc.ClientCredentials,client_assertion_type:TV.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=RE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new dt(gn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new dt(gn("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,DE(r),un.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!Sb(t))throw new dt(gn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new dt(gn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,DE(t),un.FORM_URL_ENCODED)}fhircastConnect(t){return new oV(t)}async fhircastPublish(t,n,r,o){return ZB(n)?this.post(this.fhircastHubUrl,AE(t,n,r,o),un.JSON):(JB(n),this.post(this.fhircastHubUrl,AE(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 ${RE(t.client_id+":"+t.client_secret)}`));const o={method:"POST",headers:r,body:n.toString(),credentials:"include"};let s;try{s=await this.fetchWithRetry(this.tokenUrl,o)}catch(d){throw this.refreshPromise=void 0,d}if(!s.ok){this.clearActiveLogin();try{const d=await s.json();throw new dt(io(d.error_description))}catch(d){throw new dt(io("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(sV(n)){const r=wb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new dt(Tz);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new dt(hE)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new dt(hE)}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 vV(this,vU(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 RV(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function OE(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function ME(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 LE(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function _V(e){return sr(e)&&"data"in e&&"contentType"in e}function IE(e,t,n,r){return _V(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function DV(e){return sr(e)&&"docDefinition"in e}function AV(e,t,n,r){return DV(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function PV(e){return e.status===429||e.status>=500}function Tc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:s}){if(t===e?.path)return;o??=e?.debugMode??!1,s??=e?.accessPolicyResource;let c=kV(t,n,e,!!o);const d=Xy(t,".",2)[1];c=NV(c,s,d),c=OV(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=Xy(g,".",2)[1];if(x){if(!m[x]){const b=Zh(x,s?.hiddenFields);m[x]={hidden:b,readonly:b||Zh(x,s?.readonlyFields)}}return m[x]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:o,getExtendedProps:p,accessPolicyResource:s}}function kV(e,t,n,r){const o=Object.create(null);if(n)for(const[c,d]of Object.entries(n.elementsByPath)){const f=Is(e,c);f!==void 0&&(o[f]=d)}let s=!1;if(t)for(const[c,d]of Object.entries(t))c in o||(o[c]=d,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),o}function NV(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Zh(r+o,t.hiddenFields)))}function OV(e,t,n){if(!t?.readonlyFields?.length)return e;const r=Object.create(null),o=n?n+".":"";for(const[s,c]of Object.entries(e))Zh(o+s,t.readonlyFields)?r[s]={...c,readonly:!0}:r[s]=c;return r}function Zh(e,t){if(!t?.length)return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const o=n.slice(0,r).join(".");if(t.includes(o))return!0}return!1}function tA(e){return e.type!==void 0&&e.type.length>0}function MV(e,t,n,r){const o=F8(e,t.path,{profileUrl:r});if(o){const s=n.typeSchema?.elements??n.elements;return o.some(c=>G8(c,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function nA(e,t,n,r){if(e)for(const o of t){const s={value:e,type:o.typeSchema?.type??o.type?.[0].code};if(n.every(c=>MV(s,c,o,o.typeSchema?.url??r)))return o.name}}class LV{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Tc({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(o===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[o],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 o=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([s])=>s.startsWith(n)));this.crawlElementsImpl(o,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const o=this.prepareSlices(r.slices,r);if(!Tn(o.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(o.slices[0],n.path,o),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=IV(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const o of t.children)this.crawlElementNode(o,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(!tA(s))continue;const c=s.type.find(d=>Tn(d.profile))?.profile?.[0];if(Tn(c)){const d=Uc(c);d&&(s.typeSchema=d)}r.push(s)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const o of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(o))&&this.crawlSliceImpl(o,n,r)}crawlSliceImpl(t,n,r){const o=t.typeSchema;o&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(o),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let s;const c=o?.elements??t.elements;Tn(c)&&(s=Tc({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),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function IV(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 o=Object.entries(e);o.sort((s,c)=>s[0].localeCompare(c[0]));for(const[s,c]of o){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 ly="__sliceName";function $V(e,t){const n=new zV(e,e.resourceType,"resource");return new LV(t,n).crawlResource(),n.getDefaultValue()}function $E(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Jh(e,r,o,t);continue}const s=Is(n,r);s!==void 0&&Jh(e,s,o,t)}return e}class zV{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Kr(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 o=this.value.values,s=this.value.path,c=Is(s,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const d=[];for(const f of o){if(f===void 0)continue;const p=Is(r.path,s),m=Array.isArray(f)?f:[f];for(const g of m){UV(g,c,n,r.elements,p),Jh(g,c,n,r.elements);const x=tx(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=Is(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=Is(r.path,this.value.path);for(const d of this.value.values){const f=tx(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)&&ex(d,void 0,s,n)}}onEnterSlice(t,n,r){const o=this.value.values,s=[];for(const c of o)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 o=[];for(const s of t)(s[ly]??nA(s,[n],r.discriminator,this.schema.url))===n.name&&o.push(s);for(let s=o.length;s<n.min;s++)if(ub(n.type[0].code)){const c=Object.create(null);o.push(c),t.push(c)}return o}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 o=n[r];ly in o&&delete o[ly]}}getDefaultValue(){return this.rootValue}}function UV(e,t,n,r,o){const s=tx(e,t,r,o);n.min>0&&s===void 0&&ub(n.type[0].code)&&(n.isArray?ex(e,[Object.create(null)],t,n):ex(e,Object.create(null),t,n))}function ex(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const s=r.type[0].code;o=n.replace("[x]",Ln(s))}t===void 0?delete e[o]:e[o]=t}function tx(e,t,n,r){const o=t.split(".");let s=e,c;for(let d=0;d<o.length;d++){let f=o[d];if(f.includes("[x]")){const p=(r?r+".":"")+o.slice(0,d+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",Ln(g))}if(d===o.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(sr(s)){if(s[f]===void 0)return;s=s[f]}else return}return c}function Jh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(d=>Jh(d,t,n,r));e==null&&(e=Object.create(null));const o=e,s=t.split(".");let c=o;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]",Ln(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]=rA(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 o}function rA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:Kr(t);if(sr(t)&&(sr(e)&&!Array.isArray(e)||e===void 0)){const n=Kr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=rA(n[r],t[r]);return n}return e}const ir={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function dm(e,t){let n=uo.types[e]?.searchParamsDetails?.[t.code];return n||(n=VV(e,t)),n}function BV(e,t,n){let r=uo.types[e];r||(r={},uo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function VV(e,t){const n=t.code,r=GV(e,t.expression),o={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const d=Ph(c),f=mU(()=>d.join("."));d.length===1&&d[0]instanceof Mr?o.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?o.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(o.array=!0,o.propertyTypes.clear(),o.propertyTypes.add("code")):iA(o,d,e,1),f().endsWith("extension.valueDateTime")&&(o.array=!1,o.propertyTypes.clear(),o.propertyTypes.add("dateTime"))}const s={type:HV(t,o.propertyTypes),elementDefinitions:o.elementDefinitions.map(c=>({...c,type:c.type?.filter(d=>o.propertyTypes.has(d.code))})).filter(c=>c.type&&c.type.length>0),parsedExpression:WV(e,t.expression),array:o.array};return BV(e,n,s),s}function iA(e,t,n,r){const o=t[r];if(o instanceof Xh){e.propertyTypes.add(o.right.toString());return}if(o instanceof gb){FV(e,o);return}const s=o.toString(),c=is(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 vb&&(d=!0,f++);const p=t[f];if(c.isArray&&!d&&(e.array=!0),f===t.length-1&&p instanceof Xh){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;qV(g)&&(g=c.type[0].code),iA(e,t,g,f)}}function FV(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 mb){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function qV(e){return e==="Element"||e==="BackboneElement"}function HV(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?ir.DATE:ir.DATETIME;case"number":return ir.NUMBER;case"quantity":return ir.QUANTITY;case"reference":return t.has(re.canonical)?ir.CANONICAL:ir.REFERENCE;case"token":return t.size===1&&t.has(re.boolean)?ir.BOOLEAN:ir.TEXT;default:return ir.TEXT}}function GV(e,t){const n=[],r=yb(t);return ep(e,r.child,n),n}function WV(e,t){const n=[],r=yb(t);if(ep(e,r.child,n),n.length===0)return r;let o=n[0];for(let s=1;s<n.length;s++)o=new pb(o,n[s]);return new VD("<original-not-available>",o)}function ep(e,t,n){t instanceof pb?(ep(e,t.left,n),ep(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function Ph(e){if(e instanceof Xh||e instanceof vb)return[Ph(e.left),e].flat();if(e instanceof Mr)return[e];if(e instanceof hb)return[Ph(e.left),Ph(e.right)].flat();if(e instanceof gb){if(e.name==="where"&&!(e.args[0]instanceof mb))return[];if(e.name==="last")return[]}return[e]}const QV="https://meta.medplum.com/releases",cy=new Map;function YV(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 KV(e,t,n){let r=cy.get("latest");if(!r){const o="latest",s=new URL(`${QV}/${o}.json`);s.searchParams.set("a",e),s.searchParams.set("c",JD);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();YV(d),r=d,cy.set("latest",r),cy.set(r.tag_name.slice(1),r)}return r}async function XV(e){const t=await KV(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 oA=v.createContext(void 0);function fm(){return v.useContext(oA)}function De(){return fm().medplum}function hm(){return fm().navigate}function pm(){return fm().profile}const zE=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function ZV(e){const t=e.medplum,n=e.navigate??JV,[r,o]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){o(d=>({...d,profile:t.getProfile(),loading:t.isLoading()}))}for(const d of zE)t.addEventListener(d,c);return()=>{for(const d of zE)t.removeEventListener(d,c)}},[t]);const s=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(oA.Provider,{value:s,children:e.children})}function JV(e){window.location.assign(e)}const UE=new Map,aA=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 o=UE.get(t);if(o){const c=new URLSearchParams(new URL(o).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return o}return UE.set(t,e),e},[e]);function Gt(e,t){const n=De(),[r,o]=v.useState(()=>BE(n,e)),s=v.useCallback(c=>{co(c,r)||o(c)},[r]);return v.useEffect(()=>{let c=!0;const d=BE(n,e);return!d&&ca(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 BE(e,t){if(t){if(go(t))return t;if(ca(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"},jb=`${Ui}/fhir/StructureDefinition/questionnaire-itemControl`,eF=`${Ui}/fhir/StructureDefinition/questionnaire-referenceFilter`,nx=`${Ui}/fhir/StructureDefinition/questionnaire-referenceResource`,tF=`${Ui}/fhir/StructureDefinition/questionnaire-validationError`,nF=`${Ui}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,rF=`${Ui}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,iF=`${Ui}/fhir/StructureDefinition/questionnaire-signatureRequired`,kh=`${Ui}/fhir/StructureDefinition/questionnaireresponse-signature`;function oF(e){return e.type==="choice"||e.type==="open-choice"}function aF(e,t){const n=sF(e,t);return n!==void 0?n:lF(e,t)}function sF(e,t){const n=mo(e,nF);if(t&&n){const r=n.valueExpression?.expression;if(r){const o=Yr(t),s=Za(r,[o],{"%resource":o});return to(s)}}}function lF(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=cA(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!o?.length){if(n==="any")return!0;continue}const{anyMatch:s,allMatch:c}=pF(r,o,n);if(n==="any"&&s)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function sA(e,t,n=t.item){for(const r of e){const o=n?.find(s=>s.linkId===r.linkId);o&&(cF(t,r,o),r.item&&o.item&&sA(r.item,t,o.item))}}function cF(e,t,n){try{const r=fF(t,e);if(!r)return;const o=dF(t,r);if(!o)return;n.answer=[o]}catch(r){n.extension=[{url:tF,valueString:`Expression evaluation failed: ${Ge(r)}`}]}}const uF={[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 dF(e,t){if(!e.type)return;if(e.type===wt.choice||e.type===wt.openChoice)return{[`value${Ln(t.type)}`]:t.value};if(e.type===wt.string||e.type===wt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(uF[e.type]?.includes(t.type))return{[`value${Ln(e.type)}`]:t.value}}function fF(e,t){if(!t)return;const n=mo(e,rF);if(n){const r=n.valueExpression?.expression;if(r){const o=Yr(t),s=Za(r,[o],{"%resource":o});return s.length!==0?s[0]:void 0}}}function lA(e,t,n){const r=[];for(const o of e){const s=n.answerOption?.find(c=>Gs(fo(c))===o);if(s){const c=fo(s);c&&r.push({[t]:c.value})}}return r}function cA(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=cA(n.item,t);if(r)return r}}}function hF(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:o}]=Za(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function pF(e,t,n){const r=t||[],o=vF(e);let s=!1,c=!0;for(const d of r){const f=yF(d),{operator:p}=e;if(hF(f,o,p)?s=!0:c=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:c}}function uA(e){const t=mo(e,nx);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function uy(e,t){const n=Kr(e);let r=mo(n,nx);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(o=>o!==r)),n):(r||(n.extension??=[],r={url:nx},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(o=>({code:o}))},delete r.valueCode),n)}function mF(e,t,n){const r=mo(e,eF);if(!r?.valueString)return;let o=r.valueString;t?.reference&&(o=o.replaceAll("$subj",t.reference)),n?.reference&&(o=o.replaceAll("$encounter",n.reference));const s={},c=o.split("&");for(const d of c){const[f,p]=Xy(d,"=",2);s[f]=p}return s}function VE(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??At(e),item:Cb(e.item,t?.item),status:"in-progress"}}function Cb(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===wt.display)continue;const o=t?.filter(s=>s.linkId===r.linkId);if(o&&o?.length>0)for(const s of o)s.id=s.id??fA(),s.text=s.text??r.text,s.item=Cb(r.item,s.item),s.answer=hA(r,s),n.push(s);else n.push(dA(r))}return n}function dA(e){return{id:fA(),linkId:e.linkId,text:e.text,item:Cb(e.item,void 0),answer:hA(e)}}let gF=1;function fA(){return"id-"+gF++}function hA(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 Eb(e){return Ld({value:e},"value")}function fo(e){return Ld({value:e},"value")}function vF(e){return Ld({value:e},"answer")}function yF(e){return Ld({value:e},"value")}function xF(e){const t=Gt(e.questionnaire),n=Gt(e.defaultValue),[,r]=v.useReducer(S=>S+1,0),o=v.useRef({activePage:0});if(!o.current.questionnaire&&t&&(o.current.questionnaire=t,o.current.pages=e.disablePagination?void 0:bF(t)),t&&e.defaultValue&&n&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=VE(t,n),b()),t&&!e.defaultValue&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=VE(t),b()),!o.current.questionnaire||!o.current.questionnaireResponse)return{loading:!0};function s(S,j){let C=o.current.questionnaireResponse;for(const R of S)C=C?.item?.find(E=>R.id?E.id===R.id:E.linkId===R.linkId);return j&&(C=C?.item?.find(R=>R.linkId===j.linkId)),C}function c(){o.current.activePage=(o.current.activePage??0)+1,r()}function d(){o.current.activePage=(o.current.activePage??0)-1,r()}function f(S,j){const C=s(S);C&&(C.item??=[],C.item.push(dA(j)),b())}function p(S,j){const C=s(S,j);C&&(C.answer??=[],C.answer.push({}),b())}function m(S,j,C){const R=s(S,j);R&&(R.answer=C,b())}function g(S){const j=o.current.questionnaireResponse;j&&(S?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==kh),j.extension.push({url:kh,valueSignature:S})):j.extension=j.extension?.filter(C=>C.url!==kh),b())}function x(){const S=o.current.questionnaire;if(S?.item){const j=o.current.questionnaireResponse;sA(S.item,j)}}function b(){const S=o.current.questionnaireResponse;S&&(x(),r(),e.onChange?.(S))}return{loading:!1,pagination:!!o.current.pages,questionnaire:o.current.questionnaire,questionnaireResponse:o.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:o.current.activePage,pages:o.current.pages,items:SF(o.current.questionnaire,o.current.pages,o.current.activePage),responseItems:wF(o.current.questionnaireResponse,o.current.pages,o.current.activePage),onNextPage:c,onPrevPage:d,onAddGroup:f,onAddAnswer:p,onChangeAnswer:m,onChangeSignature:g}}function bF(e){if(!(!e?.item||mo(e?.item?.[0],jb)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function SF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function wF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function jF(e,t,n={leading:!1}){const[r,o]=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,o(e)):(f(),c.current=setTimeout(()=>{d.current=!1,o(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(s.current=!0,f),[f]),[r,f]}const CF=250;function EF(e,t,n){return pA("searchOne",e,t)}function Rc(e,t,n){return pA("searchResources",e,t)}function pA(e,t,n,r){const o=De(),[s,c]=v.useState(),[d,f]=v.useState(!0),[p,m]=v.useState(),[g,x]=v.useState(),b=o.fhirSearchUrl(t,n).toString(),[S]=jF(b,CF,{leading:!0});return v.useEffect(()=>{S!==s&&(c(S),o[e](t,n).then(j=>{f(!1),m(j),x(Cz)}).catch(j=>{f(!1),m(void 0),x(Ht(j))}))},[o,e,t,n,s,S]),[p,d,g]}function TF(e){const t=e.value;return t?a.jsx(a.Fragment,{children:ID(t)}):null}const mA=["meta","implicitRules","contained","extension","modifierExtension"],gA=["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 Tb=["extension","modifierExtension"],RF=["id",...mA].filter(e=>!Tb.includes(e));function _F(e){return Object.entries(e).filter(([n,r])=>!Tn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Tb.includes(n)&&!Tn(r.slicing?.slices)||RF.includes(n)?!1:!(gA.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function FE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function qE(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function DF(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(ln),[s,c,d,f,p,m,g]=v.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(_=>o(e.path+"."+_)),[o,e.path]);function x(_){n(_),e.onChange&&e.onChange(_)}function b(_){x({...r.current,use:_})}function S(_){x({...r.current,type:_})}function j(_){x(qE(r.current||{},0,_))}function C(_){x(qE(r.current||{},1,_))}function R(_){x({...r.current,city:_})}function E(_){x({...r.current,state:_})}function T(_){x({...r.current,postalCode:_})}return a.jsxs(ge,{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:_=>S(_.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(Ue,{disabled:e.disabled||d?.readonly,placeholder:"Line 1",defaultValue:FE(t,0),onChange:_=>j(_.currentTarget.value)}),a.jsx(Ue,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:FE(t,1),onChange:_=>C(_.currentTarget.value)}),a.jsx(Ue,{disabled:e.disabled||p?.readonly,placeholder:"City",defaultValue:t.city,onChange:_=>R(_.currentTarget.value)}),a.jsx(Ue,{disabled:e.disabled||m?.readonly,placeholder:"State",defaultValue:t.state,onChange:_=>E(_.currentTarget.value)}),a.jsx(Ue,{disabled:e.disabled||g?.readonly,placeholder:"Postal Code",defaultValue:t.postalCode,onChange:_=>T(_.currentTarget.value)})]})}function AF(e){const t=pm(),[n,r]=v.useState(e.defaultValue||{});function o(s){const c=s?{text:s,authorReference:t&&qt(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return a.jsx(Ue,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:s=>o(s.currentTarget.value)})}/**
|
|
128
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the MIT license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/var PF={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"}};/**
|
|
133
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the MIT license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const Be=(e,t,n,r)=>{const o=v.forwardRef(({color:s="currentColor",size:c=24,stroke:d=2,title:f,className:p,children:m,...g},x)=>v.createElement("svg",{ref:x,...PF[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,S])=>v.createElement(b,S)),...Array.isArray(m)?m:[m]]));return o.displayName=`${n}`,o};/**
|
|
138
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the MIT license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const kF=[["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"}]],NF=Be("outline","adjustments-horizontal","AdjustmentsHorizontal",kF);/**
|
|
143
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the MIT license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const OF=[["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"}]],ll=Be("outline","alert-circle","AlertCircle",OF);/**
|
|
148
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the MIT license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const MF=[["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"}]],LF=Be("outline","arrow-down","ArrowDown",MF);/**
|
|
153
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the MIT license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const IF=[["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"}]],$F=Be("outline","arrow-up","ArrowUp",IF);/**
|
|
158
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the MIT license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const zF=[["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"}]],UF=Be("outline","bleach-off","BleachOff",zF);/**
|
|
163
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the MIT license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const BF=[["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"}]],VF=Be("outline","bleach","Bleach",BF);/**
|
|
168
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the MIT license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const FF=[["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"}]],qF=Be("outline","box-multiple","BoxMultiple",FF);/**
|
|
173
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the MIT license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const HF=[["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"}]],GF=Be("outline","brackets-contain","BracketsContain",HF);/**
|
|
178
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the MIT license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const WF=[["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"}]],QF=Be("outline","brand-asana","BrandAsana",WF);/**
|
|
183
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the MIT license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const YF=[["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"}]],KF=Be("outline","bucket-off","BucketOff",YF);/**
|
|
188
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the MIT license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const XF=[["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"}]],ZF=Be("outline","bucket","Bucket",XF);/**
|
|
193
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the MIT license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const JF=[["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"}]],eq=Be("outline","building","Building",JF);/**
|
|
198
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the MIT license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const tq=[["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"}]],$a=Be("outline","calendar","Calendar",tq);/**
|
|
203
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the MIT license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const nq=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],vo=Be("outline","check","Check",nq);/**
|
|
208
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the MIT license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const rq=[["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"}]],iq=Be("outline","checkbox","Checkbox",rq);/**
|
|
213
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the MIT license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const oq=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Rb=Be("outline","chevron-down","ChevronDown",oq);/**
|
|
218
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the MIT license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const aq=[["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"}]],sq=Be("outline","circle-check","CircleCheck",aq);/**
|
|
223
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the MIT license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const lq=[["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"}]],tp=Be("outline","circle-minus","CircleMinus",lq);/**
|
|
228
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the MIT license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const cq=[["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"}]],np=Be("outline","circle-plus","CirclePlus",cq);/**
|
|
233
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the MIT license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const uq=[["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"}]],_b=Be("outline","cloud-upload","CloudUpload",uq);/**
|
|
238
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the MIT license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const dq=[["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"}]],fq=Be("outline","columns","Columns",dq);/**
|
|
243
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the MIT license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const hq=[["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"}]],Db=Be("outline","copy","Copy",hq);/**
|
|
248
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the MIT license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const pq=[["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"}]],mq=Be("outline","currency-dollar","CurrencyDollar",pq);/**
|
|
253
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the MIT license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const gq=[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],vq=Be("outline","database","Database",gq);/**
|
|
258
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the MIT license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const yq=[["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"}]],xq=Be("outline","device-floppy","DeviceFloppy",yq);/**
|
|
263
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the MIT license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/const bq=[["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"}]],Sq=Be("outline","dots","Dots",bq);/**
|
|
268
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the MIT license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/const wq=[["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"}]],vA=Be("outline","edit","Edit",wq);/**
|
|
273
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the MIT license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/const jq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],$d=Be("outline","equal-not","EqualNot",jq);/**
|
|
278
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the MIT license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/const Cq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],zd=Be("outline","equal","Equal",Cq);/**
|
|
283
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the MIT license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/const Eq=[["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"}]],Tq=Be("outline","eye-off","EyeOff",Eq);/**
|
|
288
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the MIT license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/const Rq=[["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"}]],_q=Be("outline","eye","Eye",Rq);/**
|
|
293
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the MIT license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/const Dq=[["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"}]],HE=Be("outline","file-alert","FileAlert",Dq);/**
|
|
298
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the MIT license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/const Aq=[["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"}]],Pq=Be("outline","file-plus","FilePlus",Aq);/**
|
|
303
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the MIT license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/const kq=[["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"}]],Nq=Be("outline","filter","Filter",kq);/**
|
|
308
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the MIT license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/const Oq=[["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"}]],Mq=Be("outline","forms","Forms",Oq);/**
|
|
313
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the MIT license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/const Lq=[["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"}]],Iq=Be("outline","id","Id",Lq);/**
|
|
318
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the MIT license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/const $q=[["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"}]],GE=Be("outline","list-details","ListDetails",$q);/**
|
|
323
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the MIT license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/const zq=[["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"}]],Uq=Be("outline","lock-access","LockAccess",zq);/**
|
|
328
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the MIT license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/const Bq=[["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"}]],Vq=Be("outline","lock","Lock",Bq);/**
|
|
333
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the MIT license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/const Fq=[["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"}]],qq=Be("outline","logout","Logout",Fq);/**
|
|
338
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the MIT license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/const Hq=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],yA=Be("outline","math-greater","MathGreater",Hq);/**
|
|
343
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
344
|
-
*
|
|
345
|
-
* This source code is licensed under the MIT license.
|
|
346
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/const Gq=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],xA=Be("outline","math-lower","MathLower",Gq);/**
|
|
348
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
349
|
-
*
|
|
350
|
-
* This source code is licensed under the MIT license.
|
|
351
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
-
*/const Wq=[["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"}]],Qq=Be("outline","message","Message",Wq);/**
|
|
353
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the MIT license.
|
|
356
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/const Yq=[["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"}]],Kq=Be("outline","microscope","Microscope",Yq);/**
|
|
358
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the MIT license.
|
|
361
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/const Xq=[["path",{d:"M5 12l14 0",key:"svg-0"}]],Zq=Be("outline","minus","Minus",Xq);/**
|
|
363
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the MIT license.
|
|
366
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/const Jq=[["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"}]],eH=Be("outline","packages","Packages",Jq);/**
|
|
368
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the MIT license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/const tH=[["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"}]],nH=Be("outline","pin","Pin",tH);/**
|
|
373
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
374
|
-
*
|
|
375
|
-
* This source code is licensed under the MIT license.
|
|
376
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
-
*/const rH=[["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"}]],iH=Be("outline","pinned-off","PinnedOff",rH);/**
|
|
378
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the MIT license.
|
|
381
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/const oH=[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]],aH=Be("outline","player-play","PlayerPlay",oH);/**
|
|
383
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
384
|
-
*
|
|
385
|
-
* This source code is licensed under the MIT license.
|
|
386
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
-
*/const sH=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],bA=Be("outline","plus","Plus",sH);/**
|
|
388
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
389
|
-
*
|
|
390
|
-
* This source code is licensed under the MIT license.
|
|
391
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
-
*/const lH=[["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"}]],cH=Be("outline","receipt","Receipt",lH);/**
|
|
393
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
394
|
-
*
|
|
395
|
-
* This source code is licensed under the MIT license.
|
|
396
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
-
*/const uH=[["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"}]],SA=Be("outline","refresh","Refresh",uH);/**
|
|
398
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the MIT license.
|
|
401
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
-
*/const dH=[["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"}]],fH=Be("outline","repeat","Repeat",dH);/**
|
|
403
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
404
|
-
*
|
|
405
|
-
* This source code is licensed under the MIT license.
|
|
406
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
-
*/const hH=[["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"}]],pH=Be("outline","report-medical","ReportMedical",hH);/**
|
|
408
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
409
|
-
*
|
|
410
|
-
* This source code is licensed under the MIT license.
|
|
411
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
-
*/const mH=[["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"}]],gH=Be("outline","router","Router",mH);/**
|
|
413
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
414
|
-
*
|
|
415
|
-
* This source code is licensed under the MIT license.
|
|
416
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
-
*/const vH=[["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"}]],yH=Be("outline","search","Search",vH);/**
|
|
418
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
419
|
-
*
|
|
420
|
-
* This source code is licensed under the MIT license.
|
|
421
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
-
*/const xH=[["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"}]],rx=Be("outline","settings","Settings",xH);/**
|
|
423
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
424
|
-
*
|
|
425
|
-
* This source code is licensed under the MIT license.
|
|
426
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
-
*/const bH=[["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"}]],Ab=Be("outline","sort-ascending","SortAscending",bH);/**
|
|
428
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
429
|
-
*
|
|
430
|
-
* This source code is licensed under the MIT license.
|
|
431
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
-
*/const SH=[["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"}]],Pb=Be("outline","sort-descending","SortDescending",SH);/**
|
|
433
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
434
|
-
*
|
|
435
|
-
* This source code is licensed under the MIT license.
|
|
436
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
-
*/const wH=[["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"}]],jH=Be("outline","square","Square",wH);/**
|
|
438
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
439
|
-
*
|
|
440
|
-
* This source code is licensed under the MIT license.
|
|
441
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
-
*/const CH=[["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"}]],EH=Be("outline","star","Star",CH);/**
|
|
443
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
444
|
-
*
|
|
445
|
-
* This source code is licensed under the MIT license.
|
|
446
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
-
*/const TH=[["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"}]],RH=Be("outline","switch-horizontal","SwitchHorizontal",TH);/**
|
|
448
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
449
|
-
*
|
|
450
|
-
* This source code is licensed under the MIT license.
|
|
451
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
-
*/const _H=[["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"}]],DH=Be("outline","table-export","TableExport",_H);/**
|
|
453
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
454
|
-
*
|
|
455
|
-
* This source code is licensed under the MIT license.
|
|
456
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
457
|
-
*/const AH=[["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"}]],PH=Be("outline","text-recognition","TextRecognition",AH);/**
|
|
458
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
459
|
-
*
|
|
460
|
-
* This source code is licensed under the MIT license.
|
|
461
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
462
|
-
*/const kH=[["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",kH);/**
|
|
463
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
464
|
-
*
|
|
465
|
-
* This source code is licensed under the MIT license.
|
|
466
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
467
|
-
*/const NH=[["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"}]],WE=Be("outline","upload","Upload",NH);/**
|
|
468
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
469
|
-
*
|
|
470
|
-
* This source code is licensed under the MIT license.
|
|
471
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
472
|
-
*/const OH=[["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"}]],MH=Be("outline","webhook","Webhook",OH);/**
|
|
473
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
474
|
-
*
|
|
475
|
-
* This source code is licensed under the MIT license.
|
|
476
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
477
|
-
*/const LH=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Ys=Be("outline","x","X",LH);/**
|
|
478
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
479
|
-
*
|
|
480
|
-
* This source code is licensed under the MIT license.
|
|
481
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
482
|
-
*/const IH=[["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"}]],$H=Be("filled","circle-filled","CircleFilled",IH);class wA 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(oa,{icon:a.jsx(ll,{size:16}),title:"Something went wrong",color:"red",children:Ge(this.state.error)}):this.props.children}}function yi(){return a.jsx(Jn,{style:{width:"100%",height:"100vh"},children:a.jsx(Nr,{})})}const zH="_main_6f7o5_1",UH={main:zH};function dn(e){e.preventDefault(),e.stopPropagation()}function jA(e){return e.button===1||e.ctrlKey||e.metaKey}function CA(e){if(QE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&QE(t[0]))return!0}return!1}function QE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Xu(e,t){return new Promise((n,r)=>{const o=new MessageChannel;o.port1.onmessage=({data:s})=>{o.port1.close(),s.error?r(s.error):n(s.result)},e.contentWindow?.postMessage(t,new URL(e.src).origin,[o.port2])})}function EA(e,t){const n=new Blob([e],{type:un.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const s=t??new Date().toISOString().replace(/\D/g,"");o.download=`${s}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function vt(e){const t=hm(),{to:n,suffix:r,label:o,onClick:s,children:c,...d}=e;let f=BH(n);return r&&(f+="/"+r),a.jsx(Pt,{href:f,"aria-label":o,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),s?(p.preventDefault(),s(p)):n&&(jA(p)||(p.preventDefault(),t(f)))},...d,children:c})}function BH(e){if(e){if(typeof e=="string")return VH(e);if(go(e))return FH(e);if(ca(e))return qH(e)}return"#"}function VH(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function FH(e){return`/${e.resourceType}/${e.id}`}function qH(e){return`/${e.reference}`}function HH(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 os(e){const t=Gt(e.value),n=t?Zo(t):e.alt??"",r=HH(n),o=(t&&tU(t))??e.src,s=aA(o??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(qs,{src:s,alt:n,radius:c,...d,children:r})}):a.jsx(qs,{src:s,alt:n,radius:c,...d,children:r})}const GH="_logoButton_189g3_1",WH="_user_189g3_11",QH="_userName_189g3_21",YH="_userActive_189g3_31",mh={logoButton:GH,user:WH,userName:QH,userActive:YH};function kb(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Bc(t,e.options)}):null}function KH(e){const t=fm(),{medplum:n,profile:r,navigate:o}=t,s=n.getLogins(),{colorScheme:c,setColorScheme:d}=DM();return a.jsxs(a.Fragment,{children:[a.jsxs($e,{align:"center",p:"xl",children:[a.jsx(os,{size:"xl",radius:100,value:t.profile}),a.jsx(kb,{value:t.profile?.name?.[0]}),a.jsx(_e,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),s.length>1&&a.jsx(Ce.Divider,{}),s.map(f=>f.profile.reference!==At(t.profile)&&a.jsx(Ce.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:a.jsxs(ge,{children:[a.jsx(qs,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(_e,{size:"sm",fw:500,children:f.profile.display}),a.jsx(_e,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),a.jsx(Ce.Divider,{}),a.jsx(ge,{justify:"center",children:a.jsx(Ad,{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(RH,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(Ce.Item,{leftSection:a.jsx(rx,{size:14,stroke:1.5}),onClick:()=>o(`/${At(r)}`),children:"Account settings"}),a.jsx(Ce.Item,{leftSection:a.jsx(qq,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsx(_e,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const YE={selectedItems:"selected-items",options:"options"};function Nb(e){const t=il({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:s,defaultValue:c,toOption:d,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:x,onCreate:b,creatable:S,clearable:j,required:C,placeholder:R,leftSection:E,maxValues:T,optionsDropdownMaxHeight:_=320,minInputLength:P=0,...A}=e,k=A.disabled,L=XH(c),[z,B]=v.useState(""),[Z,K]=v.useState(),[Y,H]=v.useState(),[W,M]=v.useState(),[I,$]=v.useState(L.map(d)),[q,N]=v.useState([]),F=p??ZH,J=m??JH,ae=g??eG,je=v.useRef(z);je.current=z;const xe=v.useRef(void 0),we=v.useRef(void 0),Qe=v.useRef(Z);Qe.current=Z;const Ee=v.useRef(Y);Ee.current=Y;const ot=v.useRef(W);ot.current=W;const nt=v.useRef(q);nt.current=q;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 Ae=new AbortController;H(Ae),f(je.current??"",Ae.signal).then(pe=>{Ae.signal.aborted||(N(pe.map(d)),ot.current?(pe.length>0&&x(pe.slice(0,1)),M(!1)):pe.length>0&&t.openDropdown())}).catch(pe=>{Ae.signal.aborted||pe.message.includes("aborted")||Ne({color:"red",message:Ge(pe)})}).finally(()=>{Ae.signal.aborted||H(void 0)})},[t,f,x,d,P]),Mt=v.useCallback(Ae=>{(q&&q.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),B(Ae.currentTarget.value),Ee.current&&(Ee.current.abort(),H(void 0)),Qe.current!==void 0&&window.clearTimeout(Qe.current);const pe=window.setTimeout(()=>Ct(),100);K(pe)},[t,q,S,Ct]),Lt=v.useCallback(Ae=>{const pe=I.some(be=>be.value===Ae),Se=pe?I.filter(be=>be.value!==Ae):[...I];let ze=q?.find(be=>be.value===Ae);if(!ze&&S!==!1&&b){const be=b(Ae);ze=d(be)}if(ze){if(T===0){x([ze.resource]),I.length>0&&$([]);return}pe||Se.push(ze)}if(T!==void 0)for(;Se.length>T;)Se.shift();x(Se.map(be=>be.resource)),$(Se)},[S,q,I,T,x,b,d]),pt=v.useMemo(()=>{if(!k)return Ae=>{k||(T===1&&(B(""),N([]),t.closeDropdown()),we.current=void 0,Ae==="$create"?(B(""),Lt(z)):Lt(Ae))}},[Lt,t,k,T,z]),Rt=v.useCallback(Ae=>{const pe=I.filter(Se=>Se.value!==Ae.value);x(pe.map(Se=>Se.resource)),$(pe)},[I,x]),tn=v.useCallback(Ae=>{Ae.key==="Enter"?(Z||Y)&&M(!0):Ae.key==="Backspace"&&z.length===0&&(dn(Ae),Rt(I[I.length-1]))},[Y,Rt,z.length,I,Z]);v.useEffect(()=>()=>{Ee.current&&Ee.current.abort()},[]);const Re=!k&&j&&I.length>0&&a.jsx(We.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{B(""),$([]),x([]),t.closeDropdown()}}),Pe=S&&z.trim().length>0,Xe=q.length>0||Pe;return a.jsxs(We,{store:t,onOptionSubmit:pt,withinPortal:!0,shadow:"xl",...A,children:[a.jsx(We.DropdownTarget,{children:a.jsx(Ka,{label:r,description:o,error:s,className:e.className,leftSection:E,rightSection:Y?a.jsx(Nr,{size:16}):Re,required:C,disabled:k,children:a.jsxs(Yo.Group,{"data-testid":YE.selectedItems,children:[I.map(Ae=>a.jsx(J,{item:Ae,disabled:k,onRemove:()=>Rt(Ae)},Ae.value)),!k&&(T===void 0||T===0||I.length<T)&&a.jsx(We.EventsTarget,{children:a.jsx(Ka.Field,{role:"searchbox",name:n,value:z,placeholder:R,onFocus:Mt,onBlur:()=>{t.closeDropdown(),B("")},onKeyDown:tn,onChange:Mt})})]})})}),a.jsx(We.Dropdown,{hidden:!Xe,"data-testid":YE.options,children:a.jsx(We.Options,{children:a.jsxs(Ap,{type:"scroll",mah:_,children:[q.map(Ae=>{const pe=I.some(Se=>Se.value===Ae.value);return a.jsx(We.Option,{value:Ae.value,active:pe,children:a.jsx(F,{...Ae,active:pe})},Ae.value)}),Pe&&a.jsxs(We.Option,{value:"$create",children:["+ Create ",z]}),!S&&z.trim().length>0&&q.length===0&&a.jsx(ae,{search:z})]})})})]})}function XH(e){return e?Array.isArray(e)?e:[e]:[]}function ZH(e){return a.jsxs(ge,{gap:"xs",children:[e.active&&a.jsx(vo,{size:12}),a.jsx("span",{children:e.label})]})}function JH({item:e,disabled:t,onRemove:n}){return a.jsx(Yo,{withRemoveButton:!t,onRemove:n,children:e.label})}function eG(){return a.jsx(We.Empty,{children:"Nothing found"})}const tG="_searchInput_dick8_1",nG={searchInput:tG};function rG(e){return{value:e.id,label:Zo(e),resource:e}}function iG(e){const t=hm(),n=De(),r=v.useCallback(async(s,c)=>{const d=aG(s),f={signal:c},p=await n.graphql(d,void 0,void 0,f);return sG(p,s)},[n]),o=v.useCallback(s=>{s.length>0&&t(`/${At(s[0])}`)},[t]);return a.jsx(Nb,{size:"sm",radius:"md",className:nG.searchInput,leftSection:a.jsx(yH,{size:16}),placeholder:"Search",itemComponent:oG,toOption:rG,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const oG=v.forwardRef(({resource:e,active:t,...n},r)=>{let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=e.subject?.display),a.jsx("div",{ref:r,...n,children:a.jsxs(ge,{wrap:"nowrap",children:[a.jsx(os,{value:e}),a.jsxs("div",{children:[a.jsx(_e,{children:Zo(e)}),a.jsx(_e,{size:"xs",c:"dimmed",children:o})]})]})})});function aG(e){const t=JSON.stringify(e);return PD(e)?`{
|
|
483
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
484
|
-
resourceType
|
|
485
|
-
id
|
|
486
|
-
identifier {
|
|
487
|
-
system
|
|
488
|
-
value
|
|
489
|
-
}
|
|
490
|
-
name {
|
|
491
|
-
given
|
|
492
|
-
family
|
|
493
|
-
}
|
|
494
|
-
birthDate
|
|
495
|
-
}
|
|
496
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
497
|
-
resourceType
|
|
498
|
-
id
|
|
499
|
-
identifier {
|
|
500
|
-
system
|
|
501
|
-
value
|
|
502
|
-
}
|
|
503
|
-
subject {
|
|
504
|
-
display
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
}`.replace(/\s+/g," "):`{
|
|
508
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
509
|
-
resourceType
|
|
510
|
-
id
|
|
511
|
-
identifier {
|
|
512
|
-
system
|
|
513
|
-
value
|
|
514
|
-
}
|
|
515
|
-
name {
|
|
516
|
-
given
|
|
517
|
-
family
|
|
518
|
-
}
|
|
519
|
-
birthDate
|
|
520
|
-
}
|
|
521
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
522
|
-
resourceType
|
|
523
|
-
id
|
|
524
|
-
identifier {
|
|
525
|
-
system
|
|
526
|
-
value
|
|
527
|
-
}
|
|
528
|
-
name {
|
|
529
|
-
given
|
|
530
|
-
family
|
|
531
|
-
}
|
|
532
|
-
birthDate
|
|
533
|
-
}
|
|
534
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
535
|
-
resourceType
|
|
536
|
-
id
|
|
537
|
-
identifier {
|
|
538
|
-
system
|
|
539
|
-
value
|
|
540
|
-
}
|
|
541
|
-
subject {
|
|
542
|
-
display
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}`.replace(/\s+/g," ")}function sG(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),cG(lG(n),t).slice(0,5)}function lG(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 cG(e,t){return e.sort((n,r)=>KE(r,t)-KE(n,t))}function KE(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,XE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,XE(Bc(r),t));return n}function XE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function uG(e){const t=pm(),[n,r]=v.useState(!1);return a.jsx(kr.Header,{p:8,style:{zIndex:101},children:a.jsxs(ge,{justify:"space-between",children:[a.jsxs(ge,{gap:"xs",children:[a.jsx(er,{className:mh.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(iG,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(ge,{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(mh.user,{[mh.userActive]:n}),onClick:()=>r(o=>!o),children:a.jsxs(ge,{gap:7,children:[a.jsx(os,{value:t,radius:"xl",size:24}),a.jsx(_e,{size:"sm",className:mh.userName,children:Bc(t?.name?.[0])}),a.jsx(Rb,{size:12,stroke:1.5})]})})}),a.jsx(Ce.Dropdown,{children:a.jsx(KH,{version:e.version})})]})]})]})})}const Ob=v.createContext({submitting:!1});Ob.displayName="FormContext";function dG(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?fG(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&hG(t,n);return t}function fG(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function hG(e,t){e[t.name]=t.value}function ut(e){const[t,n]=v.useState(!1);return a.jsx(Ob.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const o=dG(r.target);if(e.onSubmit){n(!0);const s=e.onSubmit(o);s?.then?s.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function ur(e){const{children:t,...n}=e,{submitting:r}=v.useContext(Ob);return a.jsx(ke,{type:"submit",loading:r,...n,children:t})}function pG(e){const t=De(),n=t.getUserConfiguration();function r(o){const{menuname:s,bookmarkname:c}=o,d=`${e.pathname}?${e.searchParams.toString()}`,f=Kr(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(In,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(ut,{onSubmit:r,children:a.jsxs($e,{children:[a.jsx(mG,{config:n}),a.jsx(Ue,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(ge,{justify:"flex-end",children:a.jsx(ur,{mt:"sm",children:"OK"})})]})})})}function mG(e){function t(r){return r?.menu?.map(o=>o.title)}const n=t(e.config);return a.jsx(sn,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function TA(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function gG(e){return typeof e.display=="string"?e.display:TA(e)}function vG(e){return{value:TA(e),label:gG(e),resource:e}}function yG(e){return{code:e,display:e}}function gm(e){const t=De(),{binding:n,creatable:r,clearable:o,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 S of x)S.code&&!b.some(j=>j.code===S.code)&&b.push(S);return b},[t,s,n]);return a.jsx(Nb,{...d,creatable:r??!0,clearable:o??!0,toOption:vG,loadOptions:f,onCreate:yG,itemComponent:c?xG:void 0})}const xG=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(ge,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(vo,{size:12}),a.jsxs("div",{children:[a.jsx(_e,{children:e}),a.jsx(_e,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function RA(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[s,c]=v.useState(t);function d(f){const p=f[0],m=SG(p);c(m),n&&n(m)}return a.jsx(gm,{defaultValue:bG(s),onChange:d,withHelpText:r??!0,...o})}function bG(e){return e?{code:e}:void 0}function SG(e){return e?.code}function Mb(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,o=v.useCallback(s=>{n(s),r&&r(s)},[r]);return a.jsx(RA,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,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 wG="_menuTitle_9g6l5_1",jG="_link_9g6l5_9",CG="_linkActive_9g6l5_38",ix={menuTitle:wG,link:jG,linkActive:CG};function EG(e){const t=hm(),n=_G(e.pathname,e.searchParams,e.menus),[r,o]=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(kr.Navbar,{children:a.jsxs(Zr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(kr.Section,{mb:"sm",children:a.jsx(Mb,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:d=>c(d)},window.location.pathname)}),a.jsxs(kr.Section,{grow:!0,children:[e.menus?.map(d=>a.jsxs(v.Fragment,{children:[a.jsx(_e,{className:ix.menuTitle,children:d.title}),d.links?.map(f=>a.jsxs(TG,{to:f.href,active:f.href===n?.href,onClick:p=>s(p,f.href),children:[a.jsx(RG,{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(bA,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(pG,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function TG(e){return a.jsx(vt,{onClick:e.onClick,to:e.to,className:It(ix.link,{[ix.linkActive]:e.active}),children:e.children})}function RG(e){return e.icon?e.icon:a.jsx(nm,{w:30})}function _G(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const s of n)if(s.links)for(const c of s.links){const d=DG(e,t,c.href);d>o&&(o=d,r=c)}return r}function DG(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[c,d]of r.searchParams.entries())if(!o.includes(c)&&t.get(c)!==d)return 0;let s=1;for(const[c,d]of t.entries())o.includes(c)||r.searchParams.get(c)===d&&s++;return s}function AG(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),r=De(),o=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(yi,{}):a.jsxs(kr,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&a.jsx(uG,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:d,notifications:e.notifications}),o&&t?a.jsx(EG,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(kr.Main,{className:UH.main,children:a.jsx(wA,{children:a.jsx(v.Suspense,{fallback:a.jsx(yi,{}),children:e.children})})})]})}const PG="https://ccda.medplum.com",kG="https://ccda-validator.medplum.com/";function NG(e){const{url:t}=e,[n,r]=v.useState(!1),o=v.useRef(null),[s,c]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{t&&n&&o.current&&(Xu(o.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(),S=new FormData;S.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${kG}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:S,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const R=await C.json();c(R)}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);EA(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:o,src:PG,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 Ud(e){const{contentType:t,url:n,title:r}=e.value??{},o=aA(n);return o?a.jsxs("div",{"data-testid":"attachment-display",children:[t?.startsWith("image/")&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,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:o})}),(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:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===un.CDA_XML&&a.jsx(NG,{url:o}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Pt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:OG(r),children:r||"Download"})})]}):null}function OG(e){return e?.includes(".")?e:void 0}const MG="_root_17n8t_1",LG="_compact_17n8t_25",ZE={root:MG,compact:LG};function vm(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:It(ZE.root,{[ZE.compact]:n}),children:t})}function mi(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function IG(e){const t=e.values?.map((r,o)=>a.jsx("div",{children:a.jsx(Ud,{value:r,maxWidth:e.maxWidth})},"attatchment-"+o));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(mi,{term:Ws(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function Lb(e){const t=De(),n=v.useRef(null);function r(c){dn(c),n.current?.click()}function o(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=>o(c)}),e.children({onClick:r,disabled:e.disabled})]})}function $G(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function o(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(Ud,{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),o(f)},children:a.jsx(tp,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(Lb,{disabled:e.disabled,onUpload:s=>{o([...r.current,s])},children:s=>a.jsx(bn,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:a.jsx(_b,{})})})})]})]})]})}function _A(e){const[t,n]=v.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Ud,{value:t,maxWidth:200}),a.jsx(ke,{disabled:e.disabled,onClick:o=>{dn(o),r(void 0)},children:"Remove"})]}):a.jsx(Lb,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(ke,{...o,children:"Upload..."})})}function Ci(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 rp(e){const[t,n]=v.useState();return a.jsx(ut,{onSubmit:r=>{n(void 0),e.onSubmit(r)?.catch(o=>n(Ge(o)))},children:a.jsxs($e,{children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{children:e.title})]}),t&&a.jsx(oa,{icon:a.jsx(ll,{size:16}),title:"Error",color:"red",children:t}),e.qrCodeUrl&&a.jsxs($e,{align:"center",children:[a.jsx(_e,{children:"Scan this QR code with your authenticator app."}),a.jsx("img",{src:e.qrCodeUrl,alt:"Multi Factor Auth QR Code"})]}),a.jsx($e,{children:a.jsx(Ue,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),a.jsx(ge,{justify:"flex-end",mt:"xl",children:a.jsx(ur,{children:e.buttonText})})]})})}const zG="_root_1vii2_1",UG={root:zG};function Vc(e){const{children:t,...n}=e;return a.jsx(Ed,{className:UG.root,...n,children:t})}const BG="_paper_1igaj_1",VG="_fill_1igaj_20",JE={paper:BG,fill:VG};function cl(e){const{width:t,fill:n,className:r,children:o,...s}=e,c=t?{maxWidth:t}:void 0;return a.jsx(yr,{className:It(JE.paper,n&&JE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...s,children:o})}function lt(e){const{children:t,...n}=e;return a.jsx(Vc,{children:a.jsx(cl,{...n,children:t})})}function kt(e,t){return e?.issue?.filter(n=>DA(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
|
|
546
|
-
`)}function Fc(e,t){return e?.issue?.filter(n=>DA(n.expression?.[0],t))}const gh=/\[\d+\]/;function DA(e,t){const n=typeof e=="string"&&gh.test(e),r=typeof t=="string"&&gh.test(t);if(n!==r&&(e=e?.replace(gh,""),t=t?.replace(gh,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const s=t.indexOf(".");return s>=0&&t.substring(s+1)===e}function AA(e){const t=De(),[n,r]=v.useState();return a.jsxs(ut,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(s){r(Ht(s))}},children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{children:"Create project"})]}),a.jsxs($e,{gap:"xl",children:[a.jsx(Ue,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:kt(n,"projectName")}),a.jsxs(_e,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(ge,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ur,{children:"Create project"})})]})}function PA(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 kA(e){const t=De(),{googleClientId:n,handleGoogleCredential:r}=e,o=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"){PA("https://accounts.google.com/gsi/client",()=>c(!0));return}d||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),o.current&&!p&&(google.accounts.id.renderButton(o.current,{}),m(!0))},[t,n,d,s,o,p,r]),n?a.jsx("div",{ref:o}):null}function NA(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 dr(e){const t=e.outcome?.issue||e.issues;return!t||t.length===0?null:a.jsx(oa,{icon:a.jsx(ll,{size:16}),color:"red",children:t.map(n=>a.jsx("div",{"data-testid":"text-field-error",children:mD(n)},n.details?.text))})}function OA(e){typeof grecaptcha>"u"&&PA("https://www.google.com/recaptcha/api.js?render="+e)}function MA(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function FG(e){const t=NA(e.googleClientId),n=e.recaptchaSiteKey,r=De(),[o,s]=v.useState(),c=Fc(o,void 0);return v.useEffect(()=>{n&&OA(n)},[n]),a.jsxs(ut,{onSubmit:async d=>{s(void 0);try{let f="";n&&(f=await MA(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(dr,{issues:c}),t&&a.jsxs(a.Fragment,{children:[a.jsx(ge,{justify:"center",p:"xl",style:{height:70},children:a.jsx(kA,{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(pn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs($e,{gap:"xl",children:[a.jsx(Ue,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:kt(o,"firstName")}),a.jsx(Ue,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:kt(o,"lastName")}),a.jsx(Ue,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:kt(o,"email")}),a.jsx(Oi,{name:"password",label:"Password",autoComplete:"off",required:!0,error:kt(o,"password")}),a.jsxs(_e,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(_e,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Pt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Pt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(ge,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Dn,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(ur,{children:"Create account"})]})]})}function qG(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,onSuccess:c}=e,d=De(),[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(FG,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,handleAuthResponse:x,children:e.children}),f&&t==="project"&&a.jsx(AA,{login:f,handleAuthResponse:x})]})}function HG(e){const[t,n]=v.useState();return t?a.jsx(WG,{email:t,...e}):a.jsx(GG,{setEmail:n,...e})}function GG(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:s,...c}=e,d=De(),f=!e.disableGoogleAuth&&NA(e.googleClientId),[p,m]=v.useState(),g=Fc(p,void 0),x=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await d.ensureCodeChallenge(c),domain:j.domain}),R=new URL(j.authorizeUrl);return R.searchParams.set("state",C),window.location.assign(R.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]),S=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(ut,{onSubmit:b,children:[a.jsx(Jn,{style:{flexDirection:"column"},children:o}),a.jsx(dr,{issues:g}),f&&a.jsxs(a.Fragment,{children:[a.jsx(ge,{justify:"center",p:"xl",style:{height:70},children:a.jsx(kA,{googleClientId:f,handleGoogleCredential:S})}),!s&&a.jsx(pn,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&a.jsx(Ue,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:kt(p,"email")}),a.jsxs(ge,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(Pt,{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(ur,{children:"Next"})]})]})}function WG(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,s=De(),[c,d]=v.useState(),f=Fc(c,void 0),p=v.useCallback(m=>{s.startLogin({...o,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>d(Ht(g)))},[s,o,n]);return a.jsxs(ut,{onSubmit:p,children:[a.jsx(Jn,{style:{flexDirection:"column"},children:r}),a.jsx(dr,{issues:f}),a.jsx($e,{gap:"xl",children:a.jsx(Oi,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:kt(c,"password")})}),a.jsxs(ge,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(Pt,{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(ur,{children:"Sign in"})]})]})}function QG(e){const t=De(),n=il(),[r,o]=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(We.Option,{value:g.id,children:a.jsx(YG,{...g})},g.id));return a.jsxs($e,{children:[a.jsxs(lo,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{order:3,children:"Choose profile"})]}),a.jsx(dr,{outcome:s}),a.jsxs(We,{store:n,onOptionSubmit:p,children:[a.jsx(We.EventsTarget,{children:a.jsx(Ue,{placeholder:"Search",value:r,onChange:g=>{o(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(We.Options,{children:m.length>0?m:a.jsx(We.Empty,{children:"Nothing found..."})})})]})]})}function YG(e){return a.jsxs(ge,{children:[a.jsx(qs,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(_e,{fz:"sm",fw:500,children:e.profile?.display}),a.jsx(_e,{fz:"xs",opacity:.6,children:e.project?.display})]})]})}const KG=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,XG="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",ZG="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",JG="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",eW=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,tW="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",nW="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",rW="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",iW="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",oW="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",aW="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function sW(e){const t=De();return a.jsx(ut,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs($e,{children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{children:"Choose scope"})]}),a.jsx($e,{children:(e.scope??"openid").split(" ").map(n=>{let r;return KG.test(n)?r=[n+XG,n+ZG,n+JG]:eW.test(n)&&(r=[n+tW,n+nW,n+rW,n+iW,n+oW,n+aW]),a.jsxs(a.Fragment,{children:[a.jsx(Dn,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(o=>a.jsx(Dn,{id:o,name:o,label:o},o))]},n+"_group")})}),a.jsx(ge,{justify:"flex-end",mt:"xl",children:a.jsx(ur,{children:"Set scope"})})]})})}function LA(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:s,onCode:c,...d}=e,f=De(),[p,m]=v.useState(),g=v.useRef(!1),[x,b]=v.useState(!1),[S,j]=v.useState(),[C,R]=v.useState(!1),[E,T]=v.useState(),_=v.useCallback(k=>{c?c(k):f.processCode(k).then(()=>{r&&r()}).catch(L=>Ne({color:"red",message:Ge(L)}))},[f,c,r]),P=v.useCallback(k=>{b(!!k.mfaEnrollRequired),j(k.enrollQrCode),R(!!k.mfaRequired),k.login&&m(k.login),k.memberships&&T(k.memberships),k.code&&(n?T(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&&S?a.jsx(rp,{title:"Enroll in MFA",buttonText:"Enroll",qrCodeUrl:S,onSubmit:async k=>{const L=await f.post("auth/mfa/login-enroll",{login:p,token:k.token});P(L)}}):C?a.jsx(rp,{title:"Enter MFA code",buttonText:"Submit code",onSubmit:async k=>{const L=await f.post("auth/mfa/verify",{login:p,token:k.token});P(L)}}):E?a.jsx(QG,{login:p,memberships:E,handleAuthResponse:P}):e.projectId==="new"?a.jsx(AA,{login:p,handleAuthResponse:P}):e.chooseScopes?a.jsx(sW,{login:p,scope:e.scope,handleAuthResponse:A}):a.jsx("div",{children:"Success"}):a.jsx(HG,{onForgotPassword:o,onRegister:s,handleAuthResponse:P,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...d,children:e.children})})}function oo(e){return a.jsx(a.Fragment,{children:Xa(e.value)})}function lW(e){return a.jsx(a.Fragment,{children:Id(e.value)})}function IA(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 cW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(IA,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function ym(e,t,n){const r=Cc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function uW(e,t,n){const r=SD(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function dW(e){const{elementDefinitionType:t}=e,n=De(),r=v.useContext(ln),[o,s]=v.useState(xD("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=Uc(c);f(!1),g&&s(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(d||!ab(c)))return a.jsx("div",{children:"Loading..."});if(o.elements["value[x]"]?.max!==0){const[g,x]=ym({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx($i,{propertyType:x,value:g})}return a.jsx(op,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function fW(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function hW(e){return a.jsx(a.Fragment,{children:RU(e.value)})}function ud(e){return a.jsx(a.Fragment,{children:$s(e.value)})}function Ib(e){return a.jsx(a.Fragment,{children:ld(e.value)})}function pW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(ud,{value:t.numerator})," / ",a.jsx(ud,{value:t.denominator})]}):null}function ip(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Ii(e.value);return e.link!==!1&&e.value.reference?a.jsx(vt,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function $A(e,t,n,r){if(!Tn(n?.slices))return[e];const o=new Array(t.length+1);for(let s=0;s<o.length;s++)o[s]=[];for(const s of e){const c=nA(s,t,n.discriminator,r);let d=c?t.findIndex(f=>f.name===c):-1;d===-1&&(d=t.length),o[d].push(s)}return o}async function zA({medplum:e,property:t}){return new Promise((n,r)=>{if(!t.slicing){n([]);return}const o=[],s=[],c=[];for(const d of t.slicing.slices){if(!tA(d)){console.debug("Unsupported slice definition",d);continue}let f;Tn(d.elements)||(f=d.type[0]?.profile?.[0]),o.push(d),s.push(f),f&&c.push(e.requestProfileSchema(f))}Promise.all(c).then(()=>{for(let d=0;d<o.length;d++){const f=o[d],p=s[d];if(p){const m=Uc(p);f.typeSchema=m}}n(o)}).catch(r)})}function xm(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function mW(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,o=v.useContext(ln),s=v.useMemo(()=>{if(Tn(r))return Tc({parentContext:o,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[o,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($i,{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 eT=50;function gW(e){const{property:t,propertyType:n}=e,r=De(),o=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[s,c]=v.useState(!0),[d,f]=v.useState([]),[p,m]=v.useState(()=>[o]),[g,x]=v.useState(0),b=v.useContext(ln);if(v.useEffect(()=>{zA({medplum:r,property:t}).then(C=>{x(o.length),f(C);const R=o.slice(0,eT),E=$A(R,C,t.slicing,b.profileUrl);m(E),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,b.profileUrl,m,o]),s)return a.jsx("div",{children:"Loading..."});let S;if(t.type[0]?.code!=="Extension"){const C=p[d.length],R=C.map((E,T)=>a.jsx("div",{children:a.jsx($i,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:E,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${T}-${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();S=a.jsx(mi,{term:Ws(E),children:R})}else S=a.jsx(a.Fragment,{children:R})}return a.jsxs(a.Fragment,{children:[d.map((C,R)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let E=a.jsx(mW,{path:e.path,slice:C,property:t,value:p[R],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(E=a.jsx(mi,{term:Ws(C.name),children:E},C.name)),E}),S,g>eT&&a.jsx(ge,{justify:"right",children:a.jsxs(_e,{children:["... ",g," total values"]})})]})}function $i(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(lo,{gap:3,align:"center",children:[r,!xn(r)&&a.jsx(E0,{value:r,timeout:2e3,children:({copied:s,copy:c})=>a.jsx(Ko,{label:s?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(bn,{variant:"subtle",color:s?"teal":"gray",onClick:c,children:s?a.jsx(vo,{size:"1rem"}):a.jsx(Db,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?a.jsx(IG,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(gW,{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(vW,{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(ip,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return a.jsx(a.Fragment,{children:lr(r)});case re.markdown:return a.jsx("pre",{children:r});case re.Address:return a.jsx(TF,{value:r});case re.Annotation:return a.jsx(a.Fragment,{children:r?.text});case re.Attachment:return a.jsx(Ud,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return a.jsx(oo,{value:r});case re.Coding:return a.jsx(lW,{value:r});case re.ContactDetail:return a.jsx(cW,{value:r});case re.ContactPoint:return a.jsx(IA,{value:r});case re.HumanName:return a.jsx(kb,{value:r});case re.Identifier:return a.jsx(fW,{value:r});case re.Money:return a.jsx(hW,{value:r});case re.Period:return a.jsx(a.Fragment,{children:wU(r)});case re.Quantity:case re.Duration:return a.jsx(ud,{value:r});case re.Range:return a.jsx(Ib,{value:r});case re.Ratio:return a.jsx(pW,{value:r});case re.Reference:return a.jsx(ip,{value:r,link:e.link});case re.Timing:return a.jsx(a.Fragment,{children:$D(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(op,{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(dW,{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(op,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function vW(e){const[t,n]=v.useState(!1),r=e.value??"",o=!xn(r),s="•".repeat(8);return a.jsxs(lo,{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:o?s:""}),o&&a.jsxs(a.Fragment,{children:[a.jsx(E0,{value:e.value,timeout:2e3,children:({copied:c,copy:d})=>a.jsx(Ko,{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(vo,{size:"1rem"}):a.jsx(Db,{size:"1rem"})})})}),a.jsx(Ko,{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(Tq,{size:"1rem"}):a.jsx(_q,{size:"1rem"})})})]})]})}const UA=["extension","modifierExtension"],yW=mA.filter(e=>!UA.includes(e));function op(e){const t=e.value,{value:n,type:r}=t,o=v.useContext(ln),s=e.profileUrl??o?.profileUrl,c=v.useMemo(()=>im(r,s),[s,r]),d=v.useMemo(()=>{if(c)return Tc({parentContext:o,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,o,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??o;return xm(ln.Provider,d,a.jsx(vm,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{if(UA.includes(p)&&xn(m.slicing?.slices))return null;if(yW.includes(p))return null;if(gA.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,S=a.jsx($i,{property:m,propertyType:x,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?S:a.jsx(mi,{term:Ws(p),children:S},p)})}))}const xW="_dimmed_11me5_1",bW="_preserveBreaks_11me5_5",ox={dimmed:xW,preserveBreaks:bW},BA="Read Only";function VA(e,t){return e?a.jsx(Ko.Floating,{label:e,children:t}):t}function FA(e){const{debugMode:t}=v.useContext(ln);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,VA(e?.readonly?BA:void 0,a.jsxs(ge,{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?ox.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Ot(e){const{debugMode:t}=v.useContext(ln);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,VA(e?.readonly?BA:void 0,a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:It({[ox.dimmed]:e?.readonly},ox.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:kt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function SW(e,t,n,r,o){const s=r.type;if(s.length>1)for(const c of s){const d=t.replace("[x]",Ln(c.code));d in e&&delete e[d]}return xn(o)?e[n]=void 0:e[n]=o,e}function wW(e){return!!e&&!xn(e.url)&&!xn(e.name)}function jW(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:s,valuePath:c,...d}=e,[f,p]=v.useState(t);function m(g){const x=EW(g);p(x),n&&n(x)}return a.jsx(gm,{defaultValue:f&&CW(f),onChange:m,withHelpText:r??!0,...d})}function CW(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function EW(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function TW(e){const{defaultValue:t,onChange:n,withHelpText:r,response:o,...s}=e,[c,d]=v.useState(o?.answer?.[0]?.valueCoding??t);function f(p){const m=p[0],g=m&&_W(m);d(g),n&&n(g)}return a.jsx(gm,{defaultValue:c?RW(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...s})}function RW(e){return{system:e.system,code:e.code,display:e.display}}function _W(e){return{system:e.system,code:e.code,display:e.display}}function qA(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=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(T=>r[t+"."+T]),[r,t]),[g,x,b]=v.useMemo(()=>["system","use","value"].map(T=>o(t+"."+T)),[o,t]);function S(T){T&&Object.keys(T).length===0&&(T=void 0),c(T),e.onChange&&e.onChange(T)}function j(T){const _={...d.current,system:T};T||delete _.system,S(_)}function C(T){const _={...d.current,use:T};T||delete _.use,S(_)}function R(T){const _={...d.current,value:T};T||delete _.value,S(_)}const E=e.valuePath??t;return a.jsxs(ge,{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:T=>j(T.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:kt(n,E+".system")}),a.jsx(sn,{disabled:e.disabled||x?.readonly,"data-testid":"use",defaultValue:s?.use,required:(p?.min??0)>0,onChange:T=>C(T.currentTarget.value),data:["","home","work","temp","old","mobile"],error:kt(n,E+".use")}),a.jsx(Ue,{disabled:e.disabled||b?.readonly,placeholder:"Value",defaultValue:s?.value,required:(m?.min??0)>0,onChange:T=>R(T.currentTarget.value),error:kt(n,E+".value")})]})}function DW(e){const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(ln),[s,c]=v.useMemo(()=>["name","telecom"].map(m=>o(e.path+"."+m)),[o,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(ge,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ue,{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(qA,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:p,outcome:e.outcome})]})}function AW(e){if(!e)return"";const t=new Date(e);return am(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function $b(e){if(!e)return"";const t=new Date(e);return am(t)?t.toISOString():""}function ao(e){return a.jsx(Ue,{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:PW(),step:1,defaultValue:AW(e.defaultValue),autoFocus:e.autoFocus,error:kt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange($b(n))}}})}function PW(){return"datetime-local"}function kW(e){const{propertyType:t}=e,n=De(),r=v.useMemo(()=>{if(Tn(t.profile))return t.profile[0]},[t]),[o,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&&(o||!ab(r))?a.jsx("div",{children:"Loading..."}):a.jsx(Vb,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function NW(e){const{outcome:t,path:n}=e,[r,o]=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){o(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 S(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 R=e.valuePath??n;return a.jsxs(ge,{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:kt(t,R+".use")}),a.jsx(Ue,{disabled:e.disabled||d?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:E=>b(E.currentTarget.value),error:kt(t,R+".prefix")}),a.jsx(Ue,{disabled:e.disabled||f?.readonly,placeholder:"Given",name:e.name+"-given",defaultValue:r?.given?.join(" "),onChange:E=>S(E.currentTarget.value),error:kt(t,R+".given")}),a.jsx(Ue,{disabled:e.disabled||p?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:E=>j(E.currentTarget.value),error:kt(t,R+".family")}),a.jsx(Ue,{disabled:e.disabled||m?.readonly,placeholder:"Suffix",name:e.name+"-suffix",defaultValue:r?.suffix?.join(" "),onChange:E=>C(E.currentTarget.value),error:kt(t,R+".suffix")})]})}function OW(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=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=>o(e.path+"."+g)),[o,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return a.jsxs(ge,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(Ue,{disabled:e.disabled||d?.readonly,placeholder:"System",required:(s?.min??0)>0,defaultValue:t?.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:kt(e.outcome,m+".system")}),a.jsx(Ue,{disabled:e.disabled||f?.readonly,placeholder:"Value",required:(c?.min??0)>0,defaultValue:t?.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:kt(e.outcome,m+".value")})]})}const MW=["USD","EUR","CAD","GBP","AUD"];function LW(e){const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:o}=v.useContext(ln),[s,c]=v.useMemo(()=>["currency","value"].map(g=>o(e.path+"."+g)),[o,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:MW,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return a.jsx(Ue,{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(mq,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function IW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[o,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(ge,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ao,{disabled:e.disabled||o?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:d=>c({...t,start:d})}),a.jsx(ao,{disabled:e.disabled||s?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:d=>c({...t,end:d})})]})}function Ks(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[o,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(ge,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(sn,{disabled:e.disabled||o?.readonly,style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t?.comparator,data:["","<","<=",">=",">"],onChange:f=>d({...t,comparator:f.currentTarget.value})}),a.jsx(Ue,{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:$W(f.currentTarget.value)})}}),a.jsx(Ue,{disabled:e.disabled||c?.readonly,placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t?.unit,onChange:f=>d({...t,unit:f.currentTarget.value})})]})}function $W(e){if(e)return parseFloat(e)}function zb(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[o,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(ge,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ks,{path:e.path+".low",disabled:e.disabled||o?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:d=>c({...t,low:d})}),a.jsx(Ks,{path:e.path+".high",disabled:e.disabled||s?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:d=>c({...t,high:d})})]})}function zW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[o,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(ge,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ks,{path:e.path+".numerator",disabled:e.disabled||o?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:d=>c({...t,numerator:d})}),a.jsx(Ks,{path:e.path+".denominator",disabled:e.disabled||s?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:d=>c({...t,denominator:d})})]})}const UW={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},BW=["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 VW(e){return{value:At(e)??"",label:Zo(e),resource:e}}function ul(e){const t=De(),{resourceType:n,searchCriteria:r}=e,[o,s]=v.useState(),c=Gt(e.defaultValue,s),d=e.itemComponent??FW,f=e.onChange,p=v.useCallback(async(g,x)=>{const b=qW(n),S=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,S,{signal:x})},[t,n,r]),m=v.useCallback(g=>{f&&f(g[0])},[f]);return Tn(e.defaultValue)&&!o&&!c?null:a.jsx(Nb,{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:VW,loadOptions:p,onChange:m,clearable:!0})}const FW=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(ge,{wrap:"nowrap",children:[a.jsx(os,{value:t}),a.jsxs("div",{children:[a.jsx(_e,{children:e}),a.jsx(_e,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function qW(e){return UW[e]??(BW.includes(e)?"name":"_id")}function Qa(e){const{onChange:t}=e,n=De(),[r,o]=v.useState(e.defaultValue),[s,c]=v.useState(()=>HW(e.targetTypes)),[d,f]=v.useState(()=>GW(e.defaultValue,s)),p=v.useRef(new dD),m=v.useMemo(()=>d?.type==="profile"?{...e.searchCriteria,_profile:d.value}:e.searchCriteria,[e.searchCriteria,d]);v.useEffect(()=>{let b=!1;const S=s?.map(j=>{if(!QW(j))return Promise.resolve(j);b=!0;const C=j.value,R=p.current.get(C);if(R)return R;const E=WW(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:_})),T=new Ai(E);return p.current.set(C,T),T});!S||!b||Promise.all(S).then(j=>{if(c(j),!d)return;const C=j.findIndex(R=>R.value===d.value||R.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 S=b?qt(b):void 0;o(S),t&&t(S)},[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(ge,{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 S=b.currentTarget.value,j=s.find(C=>C.value===S);f(j)},data:x}),!s&&a.jsx(Mb,{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(ul,{resourceType:d?.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function HW(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 GW(e,t){const n=e?.reference?.split("/")[0];if(n){const r=t?.find(o=>o.resourceType===n);return r||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function WW(e,t){const n=Uc(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
547
|
-
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
548
|
-
type,
|
|
549
|
-
name,
|
|
550
|
-
title,
|
|
551
|
-
}
|
|
552
|
-
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function QW(e){return e.type==="profile"&&!e?.error&&xn(e.resourceType)}function YW(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const KW="_indented_ldk1d_1",HA={indented:KW};function Ub({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(np,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(bn,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(np,{size:"1.25rem"})})}function GA({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(tp,{size:"1.25rem"})})}function XW(e){const{slice:t,property:n}=e,[r,o]=v.useState(e.defaultValue),s=t.typeSchema?.elements??t.elements,c=v.useContext(ln),d=v.useMemo(()=>{if(Tn(s))return Tc({parentContext:c,elements:s,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,s]);function f(b){o(b),e.onChange&&e.onChange(b)}const p=t.min>0,m=xn(t.elements),g=BD(t.name),x=e.property.readonly&&r.length===0;return xm(ln.Provider,d,a.jsx(Ot,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:x?a.jsx(_e,{c:"dimmed",children:"(empty)"}):a.jsxs($e,{className:m?HA.indented:void 0,children:[r.map((b,S)=>a.jsxs(ge,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${S}`,children:a.jsx(Bb,{elementDefinitionType:t.type[0],name:t.name,defaultValue:b,onChange:j=>{const C=[...r];C[S]=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(GA,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${S}`,onClick:j=>{dn(j);const C=[...r];C.splice(S,1),f(C)}})]},`${S}-${r.length}`)),!e.property.readonly&&r.length<t.max&&a.jsx(ge,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(Ub,{propertyDisplayName:g,onClick:b=>{dn(b);const S=[...r,void 0];f(S)},testId:e.testId&&`${e.testId}-add`})})]})}))}function ZW(e){const{property:t}=e,n=De(),[r,o]=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(()=>{zA({medplum:n,property:t}).then(E=>{c(E);const T=$A(d,E,t.slicing,m.profileUrl);JW(T,E),p(T),o(!1)}).catch(E=>{console.error(E),o(!1)})},[n,t,d,m.profileUrl,p]);function x(E,T){const _=[...f];if(_[T]=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,S=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&s.length>0)),C=Ws(t.path),R=e.property.readonly&&s.length===0&&d.length===0;return a.jsxs($e,{className:e.indent?HA.indented:void 0,children:[R&&a.jsx(_e,{c:"dimmed",children:"(empty)"}),s.map((E,T)=>a.jsx(XW,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[T],onChange:_=>{x(_,T)},testId:`slice-${E.name}`},E.name)),j&&S.map((E,T)=>a.jsxs(ge,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(Bd,{arrayElement:!0,property:e.property,name:e.name+"."+T,path:e.path,valuePath:YW(e.path,e.valuePath,T),defaultValue:E,onChange:_=>{const P=[...S];P[T]=_,x(P,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(GA,{propertyDisplayName:C,testId:`nonsliced-remove-${T}`,onClick:_=>{dn(_);const P=[...S];P.splice(T,1),x(P,b)}})]},`${T}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(ge,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(Ub,{propertyDisplayName:C,onClick:E=>{dn(E);const T=[...S];T.push(void 0),x(T,b)},testId:"nonsliced-add"})})]})}function JW(e,t){for(let n=0;n<t.length;n++){const r=t[n],o=e[n];for(;o.length<r.min;)o.push(void 0)}}function eQ(e){const[t,n]=v.useState(!1),r=SR(),o=v.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),a.jsxs(lo,{gap:"xs",children:[a.jsx(ol,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(bn,{title:"Copy secret",onClick:()=>{r.copy(o.current?.value),Ne({color:"green",message:"Copied"})},children:a.jsx(Db,{})})]})}const tQ=["sun","mon","tue","wed","thu","fri","sat"];function nQ(e){const[t,n]=v.useState(e.defaultValue),[r,o]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),s=v.useRef(t);return s.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(ge,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:$D(s.current)||"No repeat"}),a.jsx(ke,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&a.jsx(rQ,{path:e.path,visible:r,defaultValue:s.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),o(!1)},onCancel:()=>o(!1)})]})}const tT={repeat:{period:1,periodUnit:"d"}};function rQ(e){const[t,n]=v.useState(e.defaultValue||tT),{getExtendedProps:r}=v.useContext(ln),[o,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 S(j){g({...p.current?.repeat,dayOfWeek:j})}return a.jsx(In,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs($e,{children:[a.jsx(Ot,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(ao,{disabled:o?.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),a.jsx(Pd,{disabled:s?.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?tT.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(Ot,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(ge,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ue,{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(Ot,{title:"Repeat on",children:a.jsx(rd.Group,{multiple:!0,onChange:S,children:a.jsx(ge,{justify:"space-between",mt:"md",gap:"xs",children:tQ.map(j=>a.jsx(rd,{value:j,size:"xs",radius:"xl",disabled:f?.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),a.jsx(ge,{justify:"flex-end",children:a.jsx(ke,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Bd(e){const{property:t,name:n,onChange:r,defaultValue:o}=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($G,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const d=c[0]?.code!==re.Extension;return a.jsx(ZW,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:d,onChange:r,outcome:e.outcome})}else return c.length>1?a.jsx(iQ,{elementDefinitionTypes:c,...e}):a.jsx(Bb,{name:n,defaultValue:o,onChange:d=>{if(e.onChange){const f=e.name.replace("[x]",Ln(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 iQ(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(s=>s.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=v.useState(n);return a.jsxs(ge,{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=>{o(t.find(c=>c.code===s.currentTarget.value))},data:t.map(s=>({value:s.code,label:s.code}))}),a.jsx(Bb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:s=>{e.onChange&&e.onChange(s,e.name.replace("[x]",Ln(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 Bb(e){const{name:t,onChange:n,outcome:r,binding:o,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(!ub(p)||!xn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)$E(S,m.elements);else{const j=Is(m.path,e.path);if(j===void 0)return e.defaultValue;$E(S,m.elements,j)}return Tn(S)?S: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 S=kt(e.outcome,c??s);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,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(eQ,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):a.jsx(Ue,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case re.date:return a.jsx(Ue,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case re.dateTime:case re.instant:return a.jsx(ao,{...b(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return a.jsx(Ue,{...b(),type:"number",step:p===re.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case re.code:return a.jsx(RA,{...b(),error:void 0,onChange:n,binding:o?.valueSet,creatable:!0,maxValues:1});case re.boolean:return a.jsx(Dn,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case re.base64Binary:case re.markdown:return a.jsx(ol,{...b(),spellCheck:p!==re.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case re.Address:return a.jsx(DF,{...x()});case re.Annotation:return a.jsx(AF,{...x()});case re.Attachment:return a.jsx(_A,{...x()});case re.CodeableConcept:return a.jsx(jW,{binding:o?.valueSet,...x()});case re.Coding:return a.jsx(TW,{binding:o?.valueSet,...x()});case re.ContactDetail:return a.jsx(DW,{...x()});case re.ContactPoint:return a.jsx(qA,{...x()});case re.Extension:return a.jsx(kW,{...x(),propertyType:e.elementDefinitionType});case re.HumanName:return a.jsx(NW,{...x()});case re.Identifier:return a.jsx(OW,{...x()});case re.Money:return a.jsx(LW,{...x()});case re.Period:return a.jsx(IW,{...x()});case re.Duration:case re.Quantity:return a.jsx(Ks,{...x()});case re.Range:return a.jsx(zb,{...x()});case re.Ratio:return a.jsx(zW,{...x()});case re.Reference:return a.jsx(Qa,{...x(),targetTypes:aQ(e.elementDefinitionType)});case re.Timing:return a.jsx(nQ,{...x()});case re.Dosage:case re.UsageContext:default:return a.jsx(Vb,{...x(),typeName:p})}}const oQ=[`${Ui}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function aQ(e){return e?.targetProfile?.map(t=>{const n=oQ.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function sQ(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(ln),o=v.useMemo(()=>_F(r.elements),[r.elements]);function s(d){n(d),e.onChange&&e.onChange(d)}const c={type:e.type,value:t};return a.jsx($e,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([d,f])=>{const[p,m]=uW(c,d,f),g=f.min!==void 0&&f.min>0,x=e.valuePath?e.valuePath+"."+d:void 0,b=a.jsx(Bd,{property:f,name:d,path:e.path+"."+d,valuePath:x,defaultValue:p,defaultPropertyType:m,onChange:(S,j)=>{s(SW({...t},d,j??d,f,S))},outcome:e.outcome},d);return e.type==="Extension"||Tb.includes(d)?b:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(FA,{title:Ws(d),description:f.description,htmlFor:d,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},d):a.jsx(Ot,{title:Ws(d),description:f.description,withAsterisk:g,htmlFor:d,outcome:e.outcome,fhirPath:f.path,errorExpression:x,readonly:f.readonly,children:b},d)})})}function Vb(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(ln),r=e.profileUrl??n?.profileUrl,o=v.useMemo(()=>im(e.typeName,r),[e.typeName,r]),s=o?.type??e.typeName,c=v.useMemo(()=>{if(o)return Tc({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?xm(ln.Provider,c,a.jsx(sQ,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):a.jsxs("div",{children:[s," not implemented"]})}const lQ="_noteCite_10swh_5",cQ="_noteRoot_10swh_10",nT={noteCite:lQ,noteRoot:cQ};function WA({value:e}){return e?a.jsx($e,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(w0,{classNames:{cite:nT.noteCite,root:nT.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function dl(e){const{value:t,link:n,...r}=e,[o,s]=v.useState(),c=Gt(t,s);let d;if(o&&!hD(o))d=`[${Ge(o)}]`;else if(c)d=Zo(c);else return null;return n?a.jsx(vt,{to:t,...r,children:d}):a.jsx(_e,{component:"span",...r,children:d})}function pc(e){return a.jsxs(ge,{gap:"xs",children:[a.jsx(os,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(dl,{value:e.value,link:e.link})]})}const uQ={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(Ip,{color:e.color||uQ[t],...n,children:t.replace(/-/g," ")})}const dQ="_table_pe9td_1",fQ="_criticalRow_pe9td_12",QA={table:dQ,criticalRow:fQ};Fb.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function Fb(e){const t=De(),n=Gt(e.value),[r,o]=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(o).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($e,{children:[a.jsx(Oe,{children:"Diagnostic Report"}),a.jsx(hQ,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&pQ(r),n.result&&a.jsx(mQ,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&a.jsx(WA,{value:s})]})}function hQ({value:e,hideSubject:t=!1}){return a.jsxs(ge,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(pc,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(pc,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(pc,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(_e,{children:lr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(bm,{status:e.status})]})]})}function pQ(e){return a.jsxs($e,{gap:"xs",children:[a.jsx(Oe,{order:2,size:"h6",children:"Specimens"}),a.jsx(vr,{type:"ordered",children:e?.map(t=>a.jsx(vr.Item,{ml:"sm",children:a.jsxs(ge,{gap:20,children:[a.jsxs(ge,{gap:5,children:[a.jsx(_e,{fw:500,children:"Collected:"})," ",lr(t.collection?.collectedDateTime)]}),a.jsxs(ge,{gap:5,children:[a.jsx(_e,{fw:500,children:"Received:"})," ",lr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function mQ(e){return a.jsxs("table",{className:QA.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(YA,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function YA(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(gQ,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${ca(t)?t.reference:t.id}`))})}function gQ(e){const t=Gt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=xQ(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:It({[QA.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(vt,{to:t,children:a.jsx(oo,{value:t.code})})}),a.jsx("td",{children:a.jsx(vQ,{value:t})}),a.jsx("td",{children:a.jsx(yQ,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(oo,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(o=>a.jsx("div",{children:a.jsx(oo,{value:o})},`category-${Xa(o)}`))})}),a.jsx("td",{children:t.performer?.map(o=>a.jsx(ip,{value:o},o.reference))}),a.jsx("td",{children:t.status&&a.jsx(bm,{status:t.status})})]}),t.hasMember&&a.jsx(YA,{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(WA,{value:t.note})})})]})}function vQ(e){const t=e.value;return a.jsx(a.Fragment,{children:zD(t)})}function yQ(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(Ib,{value:t}):null}function xQ(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var dy={},Vo={},rT;function KA(){if(rT)return Vo;rT=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.Pointer=Vo.escapeToken=Vo.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}Vo.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}Vo.escapeToken=t;var n=(function(){function r(o){o===void 0&&(o=[""]),this.tokens=o}return r.fromJSON=function(o){var s=o.split("/").map(e);if(s[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(o));return new r(s)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(o){for(var s=null,c="",d=o,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(o){return this.evaluate(o).value},r.prototype.set=function(o,s){var c=this.evaluate(o);c.parent&&(c.parent[c.key]=s)},r.prototype.push=function(o){this.tokens.push(o)},r.prototype.add=function(o){var s=this.tokens.concat(String(o));return new r(s)},r})();return Vo.Pointer=n,Vo}var hn={},fy={},iT;function XA(){return iT||(iT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var s=o.length,c=new Array(s),d=0;d<s;d++)c[d]=r(o[d]);return c}if(o.constructor==Date){var f=new Date(+o);return f}var p={};for(var m in o)e.hasOwnProperty.call(o,m)&&(p[m]=r(o[m]));return p}e.clone=r})(fy)),fy}var mr={},oT;function ZA(){if(oT)return mr;oT=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.diffAny=mr.diffObjects=mr.diffArrays=mr.intersection=mr.subtract=mr.isDestructive=void 0;var e=XA();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}mr.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 S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete x[S];return Object.keys(x)}mr.subtract=n;function r(m){for(var g=m.length,x={},b=0;b<g;b++){var S=m[b];for(var j in S)e.hasOwnProperty.call(S,j)&&S[j]!==void 0&&(x[j]=(x[j]||0)+1)}for(var j in x)x[j]<g&&delete x[j];return Object.keys(x)}mr.intersection=r;function o(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 S={"0,0":{operations:[],cost:0}};function j(_,P){var A="".concat(_,",").concat(P),k=S[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 L=[];if(_>0){var z=j(_-1,P),B={op:"remove",index:_-1};L.push(c(z,B))}if(P>0){var Z=j(_,P-1),K={op:"add",index:_-1,value:g[P-1]};L.push(c(Z,K))}if(_>0&&P>0){var Y=j(_-1,P-1),H={op:"replace",index:_-1,original:m[_-1],value:g[P-1]};L.push(c(Y,H))}var W=L.sort(function(M,I){return M.cost-I.cost})[0];k=W}S[A]=k}return k}var C=isNaN(m.length)||m.length<=0?0:m.length,R=isNaN(g.length)||g.length<=0?0:g.length,E=j(C,R).operations,T=E.reduce(function(_,P){var A=_[0],k=_[1];if(o(P)){var L=P.index+1+k,z=L<C+k?String(L):"-",B={op:P.op,path:x.add(z).toString(),value:P.value};return[A.concat(B),k+1]}else if(s(P)){var B={op:P.op,path:x.add(String(P.index+k)).toString()};return[A.concat(B),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 T}mr.diffArrays=d;function f(m,g,x,b){b===void 0&&(b=p);var S=[];return n(m,g).forEach(function(j){S.push({op:"remove",path:x.add(j).toString()})}),n(g,m).forEach(function(j){S.push({op:"add",path:x.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){S.push.apply(S,b(m[j],g[j],x.add(j)))}),S}mr.diffObjects=f;function p(m,g,x,b){if(b===void 0&&(b=p),m===g)return[];var S=(0,e.objectType)(m),j=(0,e.objectType)(g);return S=="array"&&j=="array"?d(m,g,x,b):S=="object"&&j=="object"?f(m,g,x,b):[{op:"replace",path:x.toString(),value:g}]}return mr.diffAny=p,mr}var aT;function bQ(){if(aT)return hn;aT=1;var e=hn&&hn.__extends||(function(){var C=function(R,E){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,_){T.__proto__=_}||function(T,_){for(var P in _)Object.prototype.hasOwnProperty.call(_,P)&&(T[P]=_[P])},C(R,E)};return function(R,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");C(R,E);function T(){this.constructor=R}R.prototype=E===null?Object.create(E):(T.prototype=E.prototype,new T)}})();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=KA(),n=XA(),r=ZA(),o=(function(C){e(R,C);function R(E){var T=C.call(this,"Value required at path: ".concat(E))||this;return T.path=E,T.name="MissingError",T}return R})(Error);hn.MissingError=o;var s=(function(C){e(R,C);function R(E,T){var _=C.call(this,"Test failed: ".concat(E," != ").concat(T))||this;return _.actual=E,_.expected=T,_.name="TestError",_}return R})(Error);hn.TestError=s;function c(C,R,E){if(Array.isArray(C))if(R=="-")C.push(E);else{var T=parseInt(R,10);C.splice(T,0,E)}else C[R]=E}function d(C,R){if(Array.isArray(C)){var E=parseInt(R,10);C.splice(E,1)}else delete C[R]}function f(C,R){var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.parent===void 0?new o(R.path):(c(E.parent,E.key,(0,n.clone)(R.value)),null)}hn.add=f;function p(C,R){var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.value===void 0?new o(R.path):(d(E.parent,E.key),null)}hn.remove=p;function m(C,R){var E=t.Pointer.fromJSON(R.path).evaluate(C);if(E.parent===null)return new o(R.path);if(Array.isArray(E.parent)){if(parseInt(E.key,10)>=E.parent.length)return new o(R.path)}else if(E.value===void 0)return new o(R.path);return E.parent[E.key]=(0,n.clone)(R.value),null}hn.replace=m;function g(C,R){var E=t.Pointer.fromJSON(R.from).evaluate(C);if(E.value===void 0)return new o(R.from);var T=t.Pointer.fromJSON(R.path).evaluate(C);return T.parent===void 0?new o(R.path):(d(E.parent,E.key),c(T.parent,T.key,E.value),null)}hn.move=g;function x(C,R){var E=t.Pointer.fromJSON(R.from).evaluate(C);if(E.value===void 0)return new o(R.from);var T=t.Pointer.fromJSON(R.path).evaluate(C);return T.parent===void 0?new o(R.path):(c(T.parent,T.key,(0,n.clone)(E.value)),null)}hn.copy=x;function b(C,R){var E=t.Pointer.fromJSON(R.path).evaluate(C);return(0,r.diffAny)(E.value,R.value,new t.Pointer).length?new s(E.value,R.value):null}hn.test=b;var S=(function(C){e(R,C);function R(E){var T=C.call(this,"Invalid operation: ".concat(E.op))||this;return T.operation=E,T.name="InvalidOperationError",T}return R})(Error);hn.InvalidOperationError=S;function j(C,R){switch(R.op){case"add":return f(C,R);case"remove":return p(C,R);case"replace":return m(C,R);case"move":return g(C,R);case"copy":return x(C,R);case"test":return b(C,R)}return new S(R)}return hn.apply=j,hn}var sT;function SQ(){return sT||(sT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=KA();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=bQ(),r=ZA();function o(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=o;function s(p){function m(g,x,b){var S=p(g,x,b);return Array.isArray(S)?S:(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 S=d(p,x.from);S&&g.push(S)}}),g}e.createTests=f})(dy)),dy}var JA=SQ();const wQ="_removed_el5zk_1",jQ="_added_el5zk_6",lT={removed:wQ,added:jQ};function CQ(e){const{name:t,path:n,property:r,originalValue:o,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(de.Tr,{children:[a.jsx(de.Td,{children:t}),a.jsx(de.Td,{className:lT.removed,children:o&&a.jsx($i,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})}),a.jsx(de.Td,{className:lT.added,children:s&&a.jsx($i,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:t}),a.jsx(de.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(ke,{onClick:p,variant:"light",children:"Expand"})})]})})}const EQ="_root_15xvr_1",TQ={root:EQ};function RQ(e){const t=De(),{original:n,revised:r}=e,[o,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(!o)return null;const d=[Yr(n)],f=[Yr(r)],p=[],m=_Q(JA.createPatch(n,r));for(const g of m){const x=g.path,b=DQ(x),S=AQ(n.resourceType,b),j=g.op==="add"?void 0:Za(b,d),C=g.op==="remove"?void 0:Za(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${Ln(g.op)} ${b}`,path:S?.path??n.resourceType+"."+b,property:S,originalValue:cT(S,j),revisedValue:cT(S,C)})}return p},[o,n,r]);return c?a.jsxs(de,{className:TQ.root,children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{}),a.jsx(de.Th,{children:"Before"}),a.jsx(de.Th,{children:"After"})]})}),a.jsx(de.Tbody,{children:c.map(d=>{const{key:f,...p}=d;return a.jsx(CQ,{...p},f)})})]}):null}function _Q(e){const t=[];for(const n of e){const{op:r,path:o}=n;if(o.startsWith("/meta/author")||o.startsWith("/meta/compartment")||o.startsWith("/meta/lastUpdated")||o.startsWith("/meta/versionId"))continue;const s=e.filter(d=>d.op===r&&d.path===o).length,c={op:r,path:o};s>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(c.op="replace",c.path=o.replace(/\/[^/]+$/,"")),t.some(d=>d.op===c.op&&d.path===c.path)||t.push(c)}return t}function DQ(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const o=t[r];o==="-"?n+=".last()":/^\d+$/.test(o)?n+=`[${o}]`:(r>0&&(n+="."),n+=o)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function AQ(e,t){return dm(e,{code:e+"."+t,expression:e+"."+t})?.elementDefinitions?.[0]}function cT(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:PQ(t,!!e?.isArray)}}function PQ(e,t){const n=pU(e).flatMap(r=>r.value);return t?n:n[0]}function qb(e){const{profileUrl:t}=e,n=De(),r=n.getAccessPolicy(),o=Gt(e.value),[s,c]=v.useState(!1);v.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Uc(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=o.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,o]);const d=v.useMemo(()=>o&&GD(o,zs.READ,r),[r,o]);return!s||!o?null:a.jsx(op,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:d})}const kQ="_item_5q6yx_1",NQ="_itemPadding_5q6yx_5",uT={item:kQ,itemPadding:NQ};function OQ(e){return a.jsx(Vc,{children:e.children})}function Xs(e){const{resource:t,profile:n,padding:r,popupMenuItems:o,...s}=e,c=n??t.meta?.author,d=e.dateTime??t.meta?.lastUpdated;return a.jsxs(cl,{"data-testid":"timeline-item",fill:!0,...s,children:[a.jsxs(ge,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(os,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(_e,{size:"sm",children:a.jsx(dl,{c:"dark",fw:500,value:c,link:!0})}),a.jsxs(_e,{size:"xs",children:[a.jsx(vt,{c:"dimmed",to:e.resource,children:lr(d)}),a.jsx(_e,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(vt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&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 ${At(e.resource)}`,children:a.jsx(Sq,{})})}),o]})]}),a.jsx(wA,{children:a.jsx("div",{className:It(uT.item,{[uT.itemPadding]:r}),children:e.children})})]})}function eP(e,t){e.sort((n,r)=>{const o=dT(n,t),s=dT(r,t);return o>s?1:o<s?-1:fT(n,t)-fT(r,t)})}function dT(e,t){if(!tP(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function fT(e,t){if(!tP(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 tP(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const MQ="_pinnedComment_u08s5_1",LQ={pinnedComment:MQ};function Sm(e){const t=De(),n=t.getProfile(),r=v.useRef(null),o=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=>{eP(k,o),k.reverse(),f(k)},[o]),S=v.useCallback(k=>{const L=[];for(const z of k){if(z.status!=="fulfilled")continue;const B=z.value;if(B.type==="history"&&c(B),B.entry)for(const Z of B.entry)L.push(Z.resource)}b(L)},[b]),j=v.useCallback(k=>b([...x.current,k]),[b]),C=v.useCallback(()=>{let k,L;"resourceType"in e.value?(k=e.value.resourceType,L=e.value.id):[k,L]=e.value.reference?.split("/"),g(t,k,L).then(S).catch(console.error)},[t,e.value,g,S]);v.useEffect(()=>C(),[C]);function R(k){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,k)).then(L=>j(L)).catch(console.error)}function E(k){!o||!e.createMedia||t.createResource(e.createMedia(o,n,k)).then(L=>j(L)).then(()=>Ms({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(vo,{size:16}),autoClose:2e3})).catch(L=>Ms({id:"upload-notification",color:"red",title:"Upload error",message:Ge(L),icon:a.jsx(HE,{size:16}),autoClose:2e3}))}function T(){Ne({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(k){Ms({id:"upload-notification",loading:!0,title:"Uploading...",message:FQ(k),autoClose:!1,withCloseButton:!1})}function P(k){Ms({id:"upload-notification",color:"red",title:"Upload error",message:Ge(k),icon:a.jsx(HE,{size:16}),autoClose:2e3})}if(!o)return a.jsx(Jn,{style:{width:"100%",height:"100%"},children:a.jsx(Nr,{})});const A=d.filter(k=>k).slice(0,p);return a.jsxs(OQ,{children:[e.createCommunication&&a.jsx(cl,{children:a.jsx(ut,{testid:"timeline-form",onSubmit:k=>{R(k.text);const L=r.current;L&&(L.value="",L.focus())},children:a.jsxs(ge,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(os,{value:n}),a.jsx(Ue,{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(Qq,{size:16})}),a.jsx(Lb,{securityContext:qt(o),onUpload:E,onUploadStart:T,onUploadProgress:_,onUploadError:P,children:k=>a.jsx(bn,{...k,radius:"xl",color:"blue",variant:"filled",children:a.jsx(_b,{size:16})})})]})})}),A.map(k=>{const L=`${k.resourceType}/${k.id}/${k.meta?.versionId}`,z=e.getMenu?e.getMenu({primaryResource:o,currentResource:k,reloadTimeline:C}):void 0;if(k.resourceType===o.resourceType&&k.id===o.id)return a.jsx(IQ,{history:s,resource:k,popupMenuItems:z},L);switch(k.resourceType){case"AuditEvent":return a.jsx(BQ,{resource:k,popupMenuItems:z},L);case"Communication":return a.jsx(zQ,{resource:k,popupMenuItems:z},L);case"DiagnosticReport":return a.jsx(VQ,{resource:k,popupMenuItems:z},L);case"Media":return a.jsx(UQ,{resource:k,popupMenuItems:z},L);default:return a.jsx(Xs,{resource:k,padding:!0,children:a.jsx(qb,{value:k,ignoreMissingValues:!0})},L)}}),p<d.length&&a.jsx(ge,{justify:"center",pb:"lg",children:a.jsx(ke,{onClick:()=>m(p+10),children:"Show More"})})]})}function IQ(e){const{history:t,resource:n,...r}=e,o=$Q(t,n);return o?a.jsx(Xs,{resource:n,padding:!0,...r,children:a.jsx(RQ,{original:o,revised:e.resource})}):a.jsxs(Xs,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx(qb,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function $Q(e,t){const n=e.entry??[],r=n.findIndex(o=>o.resource?.meta?.versionId===t.meta?.versionId);if(!(r>=n.length-1))return n[r+1].resource}function zQ(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:LQ.pinnedComment;return a.jsx(Xs,{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 UQ(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(Xs,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(Ud,{value:e.resource.content})})}function BQ(e){return a.jsx(Xs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Zr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function VQ(e){return a.jsx(Xs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Fb,{value:e.resource})})}function FQ(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${hy(e.loaded)} / ${hy(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${hy(e.loaded)}`}function hy(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 qQ(e){const{resource:t,...n}=e;return a.jsx(Sm,{value:t,loadTimelineResources:async(r,o,s)=>{const c=`${o}/${s}`;return Promise.allSettled([r.readHistory(o,s),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function HQ(e){const{encounter:t,...n}=e;return a.jsx(Sm,{value:t,loadTimelineResources:async(r,o,s)=>Promise.allSettled([r.readHistory("Encounter",s),r.search("Communication","encounter=Encounter/"+s),r.search("Media","encounter=Encounter/"+s)]),createCommunication:(r,o,s)=>({resourceType:"Communication",status:"completed",encounter:qt(r),subject:r.subject,sender:qt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",encounter:qt(r),subject:r.subject,operator:qt(o),issued:new Date().toISOString(),content:s}),...n})}function GQ(e){let t;try{t=sB(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($i,{value:t[0]||"",propertyType:e.propertyType})}function WQ(e){return a.jsxs(In,{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(hT,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(hT,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(_e,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function hT(e){return a.jsx(ke,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const QQ={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]},YQ={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 Hb(e,t){return{...e,filters:t,offset:0,name:void 0}}function nP(e,t){return Hb(e,(e.filters??[]).filter(n=>n.code!==t))}function wm(e,t,n,r,o){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),Hb(e,s)}function KQ(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function XQ(e,t){return Gb(e,t,-1)}function ZQ(e,t){return Gb(e,t,0)}function JQ(e,t){return Gb(e,t,1)}function Gb(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),jm(e,t,r,o)}function eY(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return jm(e,t,n,r)}function tY(e,t){return Wb(e,t,-1)}function nY(e,t){return Wb(e,t,0)}function rY(e,t){return Wb(e,t,1)}function Wb(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),jm(e,t,r,o)}function iY(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=nP(e,t),e=pT(e,t,ue.GREATER_THAN_OR_EQUALS,n),e=pT(e,t,ue.LESS_THAN_OR_EQUALS,r),e}function pT(e,t,n,r){return wm(e,t,n,r.toISOString())}function mT(e,t,n=!0){return wm(e,t,ue.MISSING,n.toString())}function oY(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function aY(e,t){const n=e.count??sm,r=(t-1)*n;return oY(e,r)}function sY(e,t,n){return t===lY(e)&&n!==void 0&&n===cY(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function lY(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function cY(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function uY(e){return QQ[e.type]}function rP(e){return YQ[e]??""}function Zs(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(Ln).join(" "))}function dY(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"?lr(e.meta?.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?fY(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?hY(e,t.searchParams[0]):null}function fY(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,o]=ym({type:e.resourceType,value:e},n);return r?a.jsx($i,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function hY(e,t){const n=Za(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx($i,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function pY(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(Ii(e.search))}),[o,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=xD(f),m=fb(f);return Ec(mY(p,m)).map(g=>({value:g,label:Zs(g)}))},[e.visible,e.search.resourceType]);function d(f){r({search:{...n.search,fields:f}})}return a.jsx(In,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs($e,{children:[a.jsx(Wp,{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(ge,{justify:"flex-end",children:a.jsx(ke,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function mY(e,t){const n=[],r=new Set,o=new Set;for(const s of Object.keys(e.elements))n.push(s),r.add(s.toLowerCase()),o.add(Zs(s));if(t)for(const s of Object.keys(t)){const c=Zs(s);!r.has(s)&&!o.has(c)&&(n.push(s),r.add(s),o.add(c))}return n}function iP(e){const t=dm(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case ir.REFERENCE:return a.jsx(Qa,{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 ir.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 ir.DATE:return a.jsx(Ue,{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 ir.DATETIME:return a.jsx(ao,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case ir.NUMBER:return a.jsx(Ue,{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 ir.QUANTITY:return a.jsx(Ks,{name:n,path:"",defaultValue:gY(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(Ue,{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 gY(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function vY(e){const[t,n]=v.useState(Kr(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(Kr(e.search))},[e.search]);function o(f){n(wm(r.current,f.code,f.operator,f.value))}const s=e.search.resourceType,c=fb(s)??{},d=t.filters||[];return a.jsx(In,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:a.jsxs(ut,{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(yY,{id:`filter-${p}-row`,resourceType:s,searchParams:c,value:f,onChange:m=>{const g=[...d];g[p]=m,n(Hb(r.current,g))},onDelete:()=>n(KQ(r.current,p))},`filter-${p}-row`))})]}),a.jsx(Ub,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),a.jsx(ge,{justify:"flex-end",mt:"xl",children:a.jsx(ur,{children:"OK"})})]})})}function yY(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 o(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&&uY(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:Zs(f)}))]})}),a.jsx("td",{children:d&&a.jsx(sn,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>o(f.currentTarget.value),data:["",...d.map(f=>({value:f,label:rP(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(iP,{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(Ys,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function xY(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(In,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(ut,{onSubmit:r,children:a.jsxs(ar,{children:[a.jsx(ar.Col,{span:10,children:a.jsx(iP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(ar.Col,{span:2,children:a.jsx(ke,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function bY(e){const{resourceType:t,filter:n}=e,r=uo.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===ue.EQUALS||n.operator===ue.NOT_EQUALS))return a.jsx(dl,{value:{reference:n.value}});const o=dm(t,r);if(n.code==="_lastUpdated"||o.type===ir.DATETIME)return a.jsx(a.Fragment,{children:lr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function SY(e){if(!e.searchParams)return null;function t(s,c){o(sY(e.search,s.code,c))}function n(s){o(nP(e.search,s.code))}function r(s,c){e.onPrompt(s,{code:s.code,operator:c,value:""})}function o(s){e.onChange(s)}return e.searchParams.length===1?a.jsx(wY,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(Ce.Dropdown,{children:e.searchParams.map(s=>a.jsx(Ce.Item,{children:Zs(s.code)},s.code))})}function wY(e){switch(e.searchParam.type){case"date":return a.jsx(jY,{...e});case"number":case"quantity":return a.jsx(CY,{...e});case"reference":return a.jsx(EY,{...e});case"string":return a.jsx(TY,{...e});case"token":case"uri":return a.jsx(RY,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function jY(e){const{searchParam:t}=e,n=t.code;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(Ab,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(Ce.Item,{leftSection:a.jsx(Pb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(zd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx($d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(xA,{size:14}),onClick:()=>e.onPrompt(t,ue.ENDS_BEFORE),children:"Before..."}),a.jsx(Ce.Item,{leftSection:a.jsx(yA,{size:14}),onClick:()=>e.onPrompt(t,ue.STARTS_AFTER),children:"After..."}),a.jsx(Ce.Item,{leftSection:a.jsx(GF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Between..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx($a,{size:14}),onClick:()=>e.onChange(JQ(e.search,n)),children:"Tomorrow"}),a.jsx(Ce.Item,{leftSection:a.jsx($a,{size:14}),onClick:()=>e.onChange(ZQ(e.search,n)),children:"Today"}),a.jsx(Ce.Item,{leftSection:a.jsx($a,{size:14}),onClick:()=>e.onChange(XQ(e.search,n)),children:"Yesterday"}),a.jsx(Ce.Item,{leftSection:a.jsx($a,{size:14}),onClick:()=>e.onChange(eY(e.search,n)),children:"Next 24 Hours"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx($a,{size:14}),onClick:()=>e.onChange(rY(e.search,n)),children:"Next Month"}),a.jsx(Ce.Item,{leftSection:a.jsx($a,{size:14}),onClick:()=>e.onChange(nY(e.search,n)),children:"This Month"}),a.jsx(Ce.Item,{leftSection:a.jsx($a,{size:14}),onClick:()=>e.onChange(tY(e.search,n)),children:"Last Month"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx($a,{size:14}),onClick:()=>e.onChange(iY(e.search,n)),children:"Year to date"}),a.jsx(Vd,{...e})]})}function CY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(Ab,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(Ce.Item,{leftSection:a.jsx(Pb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(zd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx($d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(yA,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN),children:"Greater than..."}),a.jsx(Ce.Item,{leftSection:a.jsx(rx,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(Ce.Item,{leftSection:a.jsx(xA,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN),children:"Less than..."}),a.jsx(Ce.Item,{leftSection:a.jsx(rx,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Vd,{...e})]})}function EY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(zd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx($d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Vd,{...e})]})}function TY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(Ab,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(Ce.Item,{leftSection:a.jsx(Pb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(zd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx($d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(ZF,{size:14}),onClick:()=>e.onPrompt(t,ue.CONTAINS),children:"Contains..."}),a.jsx(Ce.Item,{leftSection:a.jsx(KF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Does not contain..."}),a.jsx(Vd,{...e})]})}function RY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(zd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx($d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Vd,{...e})]})}function Vd(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(VF,{size:14}),onClick:()=>e.onChange(mT(e.search,n)),children:"Missing"}),a.jsx(Ce.Item,{leftSection:a.jsx(UF,{size:14}),onClick:()=>e.onChange(mT(e.search,n,!1)),children:"Not missing"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Ys,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function oP(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 _Y="_root_vlout_1",DY="_table_vlout_8",AY="_tr_vlout_12",PY="_control_vlout_22",kY="_icon_vlout_31",Vu={root:_Y,table:DY,tr:AY,control:PY,icon:kY};function NY(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(OY(t,r));return n}function OY(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=is(e,t),r=PU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=fb(e);let s;if(o){const c=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(o).filter(d=>!!d.expression&&c.test(d?.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const o=dm(e,r);return{name:t,elementDefinition:o.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class MY extends Event{constructor(t){super("change"),this.definition=t}}class LY extends Event{constructor(t){super("load"),this.response=t}}class ap extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function qc(e){const t=De(),[n,r]=v.useState(),{search:o,onLoad:s}=e,[c,d]=v.useState(o);co(o,c)||d(o);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(H=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,Wa({...c,total:g,fields:void 0}),H)).then(W=>{p({...m.current,searchResponse:W}),s&&s(new LY(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 S(H,W){H.stopPropagation();const I=H.target.checked,$={...m.current.selected};I?$[W]=!0:delete $[W],p({...m.current,selected:$})}function j(H){H.stopPropagation();const M=H.target.checked,I={},$=m.current.searchResponse;M&&$?.entry&&$.entry.forEach(q=>{q.resource?.id&&(I[q.resource.id]=!0)}),p({...m.current,selected:I})}function C(){const H=m.current;if(!H.searchResponse?.entry||H.searchResponse.entry.length===0)return!1;for(const W of H.searchResponse.entry)if(W.resource?.id&&!H.selected[W.resource.id])return!1;return!0}function R(H){e.onChange&&e.onChange(new MY(H))}function E(H,W){if(CA(H.target)||H.button===2)return;dn(H);const M=jA(H);!M&&e.onClick&&e.onClick(new ap(W,H)),M&&e.onAuxClick&&e.onAuxClick(new ap(W,H))}function T(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(dr,{outcome:n});if(!yD(c.resourceType))return a.jsx(Jn,{style:{width:"100%",height:"100%"},children:a.jsx(Nr,{})});const _=e.checkboxesEnabled,P=NY(c),A=c.resourceType,k=f.searchResponse,z=k?.entry?.map(H=>H.resource),B="subtle",Z="gray",K=16,Y=window.innerWidth<768;return a.jsxs("div",{className:Vu.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(ge,{justify:"space-between",mb:"xl",children:[a.jsxs(ge,{gap:2,children:[a.jsx(ke,{size:"compact-md",variant:B,color:Z,leftSection:a.jsx(fq,{size:K}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(ke,{size:"compact-md",variant:B,color:Z,leftSection:a.jsx(Nq,{size:K}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(ke,{size:"compact-md",variant:B,color:Z,leftSection:a.jsx(Pq,{size:K}),onClick:e.onNew,children:"New..."}),!Y&&T()&&a.jsx(ke,{size:"compact-md",variant:B,color:Z,leftSection:a.jsx(DH,{size:K}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!Y&&e.onDelete&&a.jsx(ke,{size:"compact-md",variant:B,color:Z,leftSection:a.jsx(mm,{size:K}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!Y&&e.onBulk&&a.jsx(ke,{size:"compact-md",variant:B,color:Z,leftSection:a.jsx(qF,{size:K}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(ge,{gap:2,children:[k&&a.jsxs(_e,{size:"xs",c:"dimmed","data-testid":"count-display",children:[aP(c,k).toLocaleString(),"-",BY(c,k).toLocaleString(),k.total!==void 0&&` of ${c.total==="estimate"?"~":""}${k.total?.toLocaleString()}`]}),a.jsx(bn,{variant:B,color:Z,title:"Refresh",onClick:b,children:a.jsx(SA,{size:K})})]})]}),a.jsxs(de,{className:Vu.table,children:[a.jsxs(de.Thead,{children:[a.jsxs(de.Tr,{children:[_&&a.jsx(de.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:H=>j(H)})}),P.map(H=>a.jsx(de.Th,{children:a.jsxs(Ce,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(Ce.Target,{children:a.jsx(er,{className:Vu.control,p:2,children:a.jsxs(ge,{justify:"space-between",wrap:"nowrap",children:[a.jsx(_e,{fw:500,children:Zs(H.name)}),a.jsx(Jn,{className:Vu.icon,children:a.jsx(NF,{size:14,stroke:1.5})})]})})}),a.jsx(SY,{search:c,searchParams:H.searchParams,onPrompt:(W,M)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:W,filterDialogFilter:M,dialogOpenTime:Date.now()})},onChange:W=>{R(W)}})]})},H.name))]}),!e.hideFilters&&a.jsxs(de.Tr,{children:[_&&a.jsx(de.Th,{}),P.map(H=>a.jsx(de.Th,{children:H.searchParams&&a.jsx($Y,{resourceType:A,searchParams:H.searchParams,filters:c.filters})},H.name))]})]}),a.jsx(de.Tbody,{children:z?.map(H=>H&&a.jsxs(de.Tr,{className:Vu.tr,"data-testid":"search-control-row",onClick:W=>E(W,H),onAuxClick:W=>E(W,H),children:[_&&a.jsx(de.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${H.id}`,checked:!!f.selected[H.id],onChange:W=>S(W,H.id)})}),P.map(W=>a.jsx(de.Td,{children:dY(H,W)},W.name))]},H.id))})]}),!z?.length&&a.jsx(Vc,{children:a.jsx(Jn,{style:{height:150},children:a.jsx(_e,{size:"xl",c:"dimmed",children:"No results"})})}),k&&a.jsx(Jn,{m:"md",p:"md",children:a.jsx(ji,{value:zY(c),total:UY(c,k),onChange:H=>R(aY(c,H)),getControlProps:oP})}),a.jsx(pY,{search:c,visible:m.current.fieldEditorVisible,onOk:H=>{R(H),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(vY,{search:c,visible:m.current.filterEditorVisible,onOk:H=>{R(H),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(WQ,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(xY,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?Zs(f.filterDialogSearchParam.code):"",resourceType:A,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:H=>{R(wm(c,H.code,H.operator,H.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const IY=qc;function $Y(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:[rP(n.operator)," ",a.jsx(bY,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function zY(e){return Math.floor((e.offset??0)/(e.count??sm))+1}function UY(e,t){const n=e.count??sm,r=sP(e,t);return Math.ceil(r/n)}function aP(e,t){return Math.min(sP(e,t),(e.offset??0)+1)}function BY(e,t){return Math.max(aP(e,t)+(t.entry?.length??0)-1,0)}function sP(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 VY(e){const t=De(),[n,r]=v.useState(!1),[o,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(T=>s(Ht(T)))},[t,c]);function S(T,_){T.stopPropagation();const A=T.target.checked,k={...b.current};A?k[_]=!0:delete k[_],g(k)}function j(T){T.stopPropagation();const P=T.target.checked,A={},k=x.current?.data.ResourceList;P&&k&&k.forEach(L=>{L.id&&(A[L.id]=!0)}),g(A)}function C(){const T=x.current?.data.ResourceList;if(!T||T.length===0)return!1;for(const _ of T)if(_.id&&!b.current[_.id])return!1;return!0}function R(T,_){CA(T.target)||(dn(T),T.button!==1&&e.onClick&&e.onClick(new ap(_,T)),T.button===1&&e.onAuxClick&&e.onAuxClick(new ap(_,T)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(Nr,{});const E=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:T=>dn(T),"data-testid":"search-control",children:[a.jsxs(de,{children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[E&&a.jsx(de.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:T=>j(T)})}),d.map(T=>a.jsx(de.Th,{children:T.name},T.name))]})}),a.jsx(de.Tbody,{children:f?.data.ResourceList.map(T=>T&&a.jsxs(de.Tr,{"data-testid":"search-control-row",onClick:_=>R(_,T),onAuxClick:_=>R(_,T),children:[E&&a.jsx(de.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${T.id}`,checked:!!m[T.id],onChange:_=>S(_,T.id)})}),d.map(_=>a.jsx(de.Td,{children:a.jsx(GQ,{propertyType:_.propertyType,path:_.fhirPath,resource:T})},_.name))]},T.id))})]}),f?.data.ResourceList.length===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&a.jsx(ke,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const FY=v.memo(VY),qY="_root_1fbwr_1",HY="_entry_1fbwr_8",GY="_key_1fbwr_13",WY="_value_1fbwr_20",Cm={root:qY,entry:HY,key:GY,value:WY};function ht(e){return a.jsx(Zr,{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 QY(e){const{group:t}=e;return a.jsx(yr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(ge,{children:[t.measureScore&&a.jsx(XY,{group:t}),!t.measureScore&&a.jsx(KY,{group:t})]})})}function YY(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(_e,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(_e,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function KY(e){const{group:t}=e,n=t.population,r=n?.find(f=>Xa(f.code)==="numerator"),o=n?.find(f=>Xa(f.code)==="denominator"),s=r?.count,c=o?.count;if(c===0)return a.jsxs(ce,{children:[a.jsx(Oe,{order:3,children:"Not Applicable"}),a.jsx(_e,{children:`Denominator: ${c}`})]});if(s===void 0||c===void 0)return a.jsxs(ce,{children:[a.jsx(Oe,{order:3,children:"Insufficient Data"}),a.jsx(_e,{children:`Numerator: ${s}`}),a.jsx(_e,{children:`Denominator: ${c}`})]});const d=s/c*100;return a.jsx(em,{size:120,thickness:12,roundCaps:!0,sections:[{value:d,color:lP(d)}],label:a.jsx(lo,{justify:"center",children:a.jsxs(_e,{fw:700,fz:18,children:[s," / ",c]})})})}function XY(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(em,{size:120,thickness:12,roundCaps:!0,sections:[{value:ZY(t),color:lP(t?.measureScore?.value??0)}],label:a.jsx(lo,{justify:"center",children:a.jsx(_e,{fw:700,fz:18,children:a.jsx(ud,{value:t.measureScore})})})}):a.jsx(lo,{h:120,align:"center",children:a.jsx(Oe,{order:3,children:a.jsx(ud,{value:t.measureScore})})})})}function ZY(e){const t=e.measureScore?.value,n=e.measureScore?.unit;return t?t<=1&&n==="%"?t*100:t:0}function lP(e){return e<=33?"red":e<=67?"yellow":"green"}function JY(e){const t=Gt(e.measureReport),[n]=EF("Measure",{url:t?.measure});return t?a.jsxs(ce,{children:[n&&a.jsx(YY,{measure:n}),a.jsx(tm,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,o)=>a.jsx(QY,{group:r},r.id??o))})]}):null}const py="patient-export",my="Patient Export",eK={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 tK(e){const t=De(),{patient:n}=e,r=v.useCallback(async o=>{const s=Hs(n),c=o.format,{operation:d,type:f,contentType:p,extension:m}=eK[c],g=t.fhirUrl("Patient",s,d),x={};f&&(x.type=f),o.author&&(x.author={reference:o.author}),o.authoredOn&&(x.authoredOn=$b(o.authoredOn)),o.startDate&&(x.start=o.startDate),o.endDate&&(x.end=o.endDate),hi.show({id:py,title:my,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,x,void 0,{cache:"no-cache",headers:{Accept:p}}),S=`Patient-export-${s}-${new Date().toISOString().replaceAll(":","-")}.${m}`;nK(b,S,p),hi.update({id:py,title:my,color:"green",message:"Done",icon:a.jsx(vo,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){hi.update({id:py,title:my,color:"red",message:Ge(b),icon:a.jsx(Ys,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(ut,{onSubmit:r,children:a.jsxs($e,{children:[a.jsx(Ot,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(Ad,{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(Ot,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(Qa,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx(Ot,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(ao,{name:"authoredOn",placeholder:"Authored on"})}),a.jsx(Ot,{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(ao,{name:"startDate",placeholder:"Start date"})}),a.jsx(Ot,{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(ao,{name:"endDate",placeholder:"End date"})}),a.jsx(ge,{justify:"right",children:a.jsx(ur,{children:"Request Export"})})]})})}function nK(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),o=new Blob([r],{type:n}),s=window.URL.createObjectURL(o),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 rK(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function cP(e){const t=Gt(e.patient);return t?a.jsxs(ht,{children:[a.jsx(os,{value:t,size:"lg",color:rK(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(kb,{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:nU(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 iK(e){const{patient:t,...n}=e,r=v.useCallback((o,s,c)=>{const d=`${s}/${c}`,f=100;return Promise.allSettled([o.readHistory("Patient",c),o.search("Communication",{subject:d,_count:f}),o.search("Device",{patient:d,_count:f}),o.search("DeviceRequest",{patient:d,_count:f}),o.search("DiagnosticReport",{subject:d,_count:f}),o.search("Media",{subject:d,_count:f}),o.search("ServiceRequest",{subject:d,_count:f}),o.search("Task",{subject:d,_count:f})])},[]);return a.jsx(Sm,{value:t,loadTimelineResources:r,createCommunication:(o,s,c)=>({resourceType:"Communication",status:"completed",subject:qt(o),sender:qt(s),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(o,s,c)=>({resourceType:"Media",status:"completed",subject:qt(o),operator:qt(s),issued:new Date().toISOString(),content:c}),...n})}const oK="_section_pqpwm_1",aK="_hovering_pqpwm_7",ax={section:oK,hovering:aK};function sK(e){const t=De(),n=Gt(e.value),[r,o]=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(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(fK(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 S(j,C){m({...b.current,[j]:C})}return a.jsx("div",{children:a.jsxs(ut,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[a.jsx(Ue,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>S("title",j.currentTarget.value)}),a.jsx(lK,{actions:p.action||[],selectedKey:s,setSelectedKey:c,hoverKey:d,setHoverKey:f,onChange:j=>S("action",j)}),a.jsx(ur,{children:"Save"})]})})}function lK(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 o(s){e.onChange(t.current.filter(c=>c!==s))}return a.jsxs($e,{gap:"md",className:ax.section,children:[e.actions.map(s=>a.jsx(cK,{action:s,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(s)},s.id)),a.jsx("div",{children:a.jsx(ke,{variant:"outline",onClick:s=>{dn(s),r({id:uP()})},children:"Add action"})})]})}function cK(e){const{action:t}=e,n=dK(t);function r(s){s.stopPropagation(),e.setSelectedKey(e.action.id)}function o(s){dn(s),e.setHoverKey(e.action.id)}return a.jsx("div",{onClick:r,onMouseOver:o,onFocus:o,children:a.jsx(uK,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function uK(e){const{action:t}=e,[n,r]=v.useState(e.actionType),o=e.selectedKey===e.action.id,s=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const d=It(ax.section,{[ax.hovering]:s&&!o});return a.jsxs(yr,{"data-testid":t.id,className:d,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(lo,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[a.jsx(Ue,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),a.jsx(ns,{"data-testid":"close-button",onClick:e.onRemove})]}),o&&a.jsxs($e,{gap:"xl",p:"md",children:[a.jsx(ce,{children:a.jsx(Ue,{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($e,{gap:0,children:[a.jsxs(ge,{gap:0,mb:"xs",children:[a.jsx(_e,{fw:600,children:"Select questionnaire"}),a.jsx(_e,{c:"red",children:"*"})]}),a.jsxs(_e,{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(Pt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),a.jsx(gT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&a.jsxs($e,{gap:0,children:[a.jsxs(ge,{gap:0,mb:"xs",children:[a.jsx(_e,{fw:600,children:"Select activity definition"}),a.jsx(_e,{c:"red",children:"*"})]}),a.jsxs(_e,{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(Pt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),a.jsx(gT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function gT(e){const{id:t,definitionCanonical:n}=e.action,r=n?.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(ul,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:At(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function dK(e){return e.definitionCanonical?.startsWith("Questionnaire")?"questionnaire":e.definitionCanonical?.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let gy=1;function uP(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(gy=Math.max(gy,t+1))}return e}return"id-"+gy++}function fK(e){return{...e,action:dP(e.action)}}function dP(e){if(e)return e.map(t=>({...t,id:uP(t.id),action:dP(t.action)}))}const Vs=30,sp=50;function lp(e){const t=e.formState,n=e.item,r=e.responseItem;function o(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=Yb(r,e.index)??Eb(d),p=mo(r,`${Ui}/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(FA,{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=>o([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case wt.decimal:m=a.jsx(Ue,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueDecimal:g.currentTarget.valueAsNumber}])});break;case wt.integer:m=a.jsx(Ue,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueInteger:g.currentTarget.valueAsNumber}])});break;case wt.date:m=a.jsx(Ue,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDate:g.currentTarget.value}])});break;case wt.dateTime:m=a.jsx(ao,{name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDateTime:g}])});break;case wt.time:m=a.jsx(Ue,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueTime:g.currentTarget.value}])});break;case wt.string:case wt.url:m=a.jsx(Ue,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const x=g.currentTarget.value;o(x===""?[]:[{valueString:x}])}});break;case wt.text:m=a.jsx(ol,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const x=g.currentTarget.value;o(x===""?[]:[{valueString:x}])}});break;case wt.attachment:m=a.jsx(ge,{py:4,children:a.jsx(_A,{path:"",name:c,defaultValue:f?.value,onChange:g=>o([{valueAttachment:g}])})});break;case wt.reference:m=a.jsx(Qa,{name:c,required:e.required??n.required,targetTypes:uA(n),searchCriteria:mF(n,t?.subject,t?.encounter),defaultValue:f?.value,onChange:g=>o([{valueReference:g}])});break;case wt.quantity:m=a.jsx(Ks,{path:"",name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueQuantity:g}]),disableWheel:!0});break;case wt.choice:case wt.openChoice:xK(n)?m=a.jsx(gK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):yK(n)||n.answerValueSet&&!bK(n)?m=a.jsx(hK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):m=a.jsx(mK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)});break;default:return null}return a.jsxs(a.Fragment,{children:[m,p?.valueString&&a.jsx(_e,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function hK(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(Qb,{});const d=Eb(o),f=Yb(c)??d,p=pP(c),m=n.repeats||SK(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}=wK(n);return a.jsx(Wp,{data:x,placeholder:"Select items",searchable:!0,defaultValue:p||[Gs(d)],required:r,onChange:b=>{if(b.length===0)s([{}]);else{const S=lA(b,g,n);s(S)}}})}else{const g=[""];if(n.answerOption)for(const x of n.answerOption){const b=fo(x);g.push(Gs(b))}return a.jsx(sn,{id:t,name:t,required:r,onChange:x=>{const b=x.currentTarget.selectedIndex;if(b===0){s([{}]);return}const S=n.answerOption[b-1],j=fo(S),C="value"+Ln(j.type);s([{[C]:j.value}])},defaultValue:Id(f?.value)||f?.value,data:g})}}function pK(e,t){return e?t.valueSetExpand({url:e,count:Vs+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function fP(e){const t=De(),[n,r]=v.useState([]),[o,s]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){s(!0);try{const d=await pK(e,t);r(d)}catch(d){console.error("Error loading value set:",d)}finally{s(!1)}}}c().catch(console.error)},[e,t]),[n,o]}function hP(e,t){return e.map((n,r)=>{const o=`${t}-valueset-${r}`,s={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[o,s]})}function mK(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e,d=is("QuestionnaireItemAnswerOption","value[x]"),f=Eb(o),[p,m]=fP(n.answerValueSet),g=[];let x;if(n.answerValueSet)g.push(...hP(p,t));else if(n.answerOption){const C=n.answerOption.slice(0,sp).map((R,E)=>{const T=`${t}-option-${E}`,_=fo(R);return _?.value?(f&&Ii(_)===Ii(f)&&(x=T),[T,_]):null}).filter(R=>R!==null);g.push(...C)}const b=Yb(c),S=vK(g,b);if(m)return a.jsx(_e,{children:"Loading options..."});if(g.length===0)return a.jsx(Qb,{});const j=g.slice(0,Vs);return a.jsxs(a.Fragment,{children:[a.jsx(rr.Group,{name:t,value:S??x,required:r,onChange:C=>{const R=g.find(E=>E[0]===C);if(R){const E=R[1],T="value"+Ln(E.type);s([{[T]:E.value}])}},children:j.map(([C,R])=>a.jsx(rr,{id:C,value:C,py:4,required:r,label:a.jsx($i,{property:d,propertyType:R.type,value:R.value})},C))}),(n.answerValueSet&&g.length>Vs||n.answerOption&&g.length>sp)&&a.jsxs(_e,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",Vs," options"]})]})}function gK(e){const{name:t,item:n,onChangeAnswer:r,response:o}=e,s=is("QuestionnaireItemAnswerOption","value[x]"),[c,d]=fP(n.answerValueSet),f=n.answerValueSet?(o?.answer?.map(S=>S.valueCoding)||[]).filter(S=>S!==void 0):pP(o),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...hP(c,t));else if(n.answerOption){const S=n.answerOption.slice(0,sp).map((j,C)=>{const R=`${t}-option-${C}`,E=fo(j);return E?.value?[R,E]:null}).filter(j=>j!==null);g.push(...S)}if(d)return a.jsx(_e,{children:"Loading options..."});if(g.length===0)return a.jsx(Qb,{});const x=g.slice(0,Vs),b=(S,j)=>{if(n.answerValueSet){const C=p;let R;j?R=[...C,S.value]:R=C.filter(E=>!co(E,S.value)),m(R),R.length===0?r([{}]):r(R.map(E=>({valueCoding:E})))}else{const C=p,R=Gs(S);let E;if(j?E=[...C,R]:E=C.filter(T=>T!==R),m(E),E.length===0)r([{}]);else{const T=lA(E,"value"+Ln(S.type),n);r(T)}}};return a.jsxs(ge,{style:{flexDirection:"column",alignItems:"flex-start"},children:[x.map(([S,j])=>{const C=Gs(j),R=n.answerValueSet?p.some(E=>co(E,j.value)):p.includes(C);return a.jsx(Dn,{id:S,label:a.jsx($i,{property:s,propertyType:j.type,value:j.value}),checked:R,onChange:E=>b(j,E.currentTarget.checked)},S)}),(n.answerValueSet&&g.length>Vs||n.answerOption&&g.length>sp)&&a.jsxs(_e,{size:"sm",c:"dimmed",children:["Showing first ",Vs," options"]})]})}function Qb(){return a.jsx(Ue,{disabled:!0,placeholder:"No Answers Defined"})}function Yb(e,t=0){return fo(e?.answer?.[t]??{})}function pP(e){const t=e?.answer;return t?t.map(r=>fo(r)).map(r=>Id(r?.value)||r?.value).filter(Boolean):[]}function vK(e,t){return e.find(n=>co(n[1].value,t?.value))?.[0]}function Em(e,t){return!!e.extension?.some(n=>n.url===jb&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function yK(e){return Em(e,"drop-down")}function xK(e){return Em(e,"check-box")}function bK(e){return Em(e,"radio-button")}function SK(e){return Em(e,"multi-select")}function wK(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=fo(t),r="value"+Ln(n.type),o=(e.answerOption??[]).map(s=>{const c=fo(s),d=Gs(c);return{value:d,label:d}});return{propertyName:r,data:o}}const jK="_section_my8o4_1",CK="_hovering_my8o4_10",EK="_editing_my8o4_14",TK="_questionBody_my8o4_20",RK="_topActions_my8o4_24",_K="_bottomActions_my8o4_33",DK="_movementActions_my8o4_44",AK="_movementIcons_my8o4_56",PK="_columnAlignment_my8o4_60",kK="_linkIdInput_my8o4_65",NK="_typeSelect_my8o4_70",OK="_preserveBreaks_my8o4_74",Gr={section:jK,hovering:CK,editing:EK,questionBody:TK,topActions:RK,bottomActions:_K,movementActions:DK,movementIcons:AK,columnAlignment:PK,linkIdInput:kK,typeSelect:NK,preserveBreaks:OK};function MK(e){const t=De(),n=Gt(e.questionnaire),[r,o]=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(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(zK(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",x),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",x)}),[n]);const b=(S,j)=>{c(S),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(S)};return!r||!s?null:a.jsx("div",{children:a.jsxs(ut,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[a.jsx(mP,{item:s,selectedKey:d,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),a.jsx(ur,{children:"Save"})]})})}function mP(e){const t=e.item,n=e.item,r=go(e.item),o=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(T){dn(T),e.setSelectedKey(e.item.id)}function m(T){dn(T),e.setHoverKey(e.item.id)}function g(T){const _=f.current;e.onChange({..._,item:_.item?.map(P=>P.id===T.id?T:P)})}function x(T,_){e.onChange({...e.item,item:[...e.item.item??[],T]},_)}function b(T){e.onChange({...e.item,item:e.item.item?.filter(_=>_!==T)})}function S(T,_){e.onChange({...f.current,[T]:_})}function j(T){e.onChange({...e.item,...T})}function C(T){e.onChange({...e.item,item:e.item.item?.map(_=>_===T?{..._,repeats:!_.repeats}:_)})}function R(T,_){const P=VK(e.item.item,T,_);e.onChange({...e.item,item:P})}const E=It(Gr.section,{[Gr.editing]:c,[Gr.hovering]:d&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:E,onClick:p,onMouseOver:m,onFocus:m,children:[a.jsx("div",{className:Gr.questionBody,children:c?a.jsxs(a.Fragment,{children:[r&&a.jsx(Ue,{size:"xl",defaultValue:t.title,onBlur:T=>S("title",T.currentTarget.value)}),!r&&a.jsx(ol,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:T=>S("text",T.currentTarget.value)}),n.type==="reference"&&a.jsx($K,{item:n,onChange:j}),oF(n)&&a.jsx(LK,{item:n,onChange:T=>j(T)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(Oe,{children:t.title}),n.text&&a.jsx("div",{className:Gr.preserveBreaks,children:n.text}),!o&&a.jsx(lp,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((T,_)=>a.jsx("div",{children:a.jsx(mP,{item:T,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(T),onRepeatable:C,onMoveUp:()=>R(_,-1),onMoveDown:()=>R(_,1)})},T.id)),!o&&a.jsx("div",{className:Gr.topActions,children:c?a.jsxs(a.Fragment,{children:[a.jsx(Ue,{size:"xs",className:Gr.linkIdInput,defaultValue:n.linkId,onBlur:T=>S("linkId",T.currentTarget.value)}),!o&&a.jsx(sn,{size:"xs",className:Gr.typeSelect,defaultValue:n.type,onChange:T=>S("type",T.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:Gr.movementActions,children:a.jsxs(ce,{className:Gr.columnAlignment,children:[!e.isFirst&&a.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx($F,{"data-testid":"up-button",size:15,className:Gr.movementIcons})}),!e.isLast&&a.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(LF,{"data-testid":"down-button",size:15,className:Gr.movementIcons})})]})}),a.jsxs("div",{className:Gr.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),x({id:Js(),linkId:cx("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),x({id:Js(),linkId:cx("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),x(BK(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function LK(e){const t=is("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(Ue,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(IK,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(ce,{display:"flex",children:[a.jsx(Pt,{href:"#",onClick:r=>{dn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Js()}]})},children:"Add choice"}),a.jsx(nm,{w:"lg"}),a.jsx(Pt,{href:"#",onClick:r=>{dn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function IK(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(Bd,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,s)=>{const c=[...e.options],d=c.findIndex(f=>f.id===t.id);c[d]={id:t.id,[s]:o},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Pt,{href:"#",onClick:o=>{dn(o),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function $K(e){const t=uA(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(ge,{children:[a.jsx(Mb,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(uy(e.item,t.map(s=>s===n?o:s)))}}),a.jsx(Pt,{href:"#",onClick:o=>{dn(o),e.onChange(uy(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Pt,{href:"#",onClick:n=>{dn(n),e.onChange(uy(e.item,[...t,""]))},children:"Add Resource Type"})]})}let sx=1,lx=1;function cx(e){return e+sx++}function Js(){return"id-"+lx++}function zK(e){return{...e,id:e.id||Js(),item:gP(e.item)}}function gP(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(lx=Math.max(lx,parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(sx=Math.max(sx,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Js(),item:gP(t.item),answerOption:UK(t.answerOption)}))}function UK(e){if(e)return e.map(t=>({...t,id:t.id||Js()}))}function BK(){return{id:Js(),linkId:cx("s"),type:"group",text:"New Page",extension:[{url:jb,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function VK(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const s=[...r];return[s[t],s[o]]=[s[o],s[t]],s}/*!
|
|
553
|
-
* Signature Pad v5.1.1 | https://github.com/szimek/signature_pad
|
|
554
|
-
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
555
|
-
*/var cp=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}},FK=class vP{constructor(t,n,r,o,s,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=o,this.startWidth=s,this.endWidth=c}static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,o=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new vP(t[1],r,o,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const o=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(o*o+s*s),g=Math.sqrt(c*c+d*d),x=f.x-p.x,b=f.y-p.y,S=m+g==0?0:g/(m+g),j={x:p.x+x*S,y:p.y+b*S},C=n.x-j.x,R=n.y-j.y;return{c1:new cp(f.x+C,f.y+R),c2:new cp(p.x+C,p.y+R)}}length(){let n=0,r,o;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-o;n+=Math.sqrt(p*p+m*m)}r=d,o=f}return n}point(t,n,r,o,s){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*o*(1-t)*t*t+s*t*t*t}},qK=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 HK(e,t=250){let n=0,r=null,o,s,c;const d=()=>{n=Date.now(),r=null,o=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,o=e.apply(s,c),r||(s=null,c=[])):r||(r=window.setTimeout(d,g)),o}}var GK=class ux extends qK{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?HK(ux.prototype._strokeUpdate,this.throttle):ux.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,o)=>{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=>{o(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 o=this._getPointGroupOptions(),s={...o,points:[]};this._data.push(s),this._reset(o),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],o=r.points,s=o.length>0&&o[o.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),o.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 o=this.canvas.getBoundingClientRect();return new cp(t-o.left,n-o.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 o=this._calculateCurveWidths(r[1],r[2],n),s=FK.fromPoints(r,o);return r.shift(),s}return null}_calculateCurveWidths(t,n,r){const o=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(o,r),c={end:s,start:this._lastWidth};return this._lastVelocity=o,this._lastWidth=s,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const o=this._ctx;o.moveTo(t,n),o.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,o=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 S=x*t.startPoint.y;S+=3*g*d*t.control1.y,S+=3*m*f*t.control2.y,S+=p*t.endPoint.y;const j=Math.min(t.startWidth+p*o,n.maxWidth);this._drawCurveSegment(b,S,j)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,o=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,o),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const o of t){const{points:s}=o,c=this._getPointGroupOptions(o);if(s.length>1)for(let d=0;d<s.length;d+=1){const f=s[d],p=new cp(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,o=Math.max(window.devicePixelRatio||1,1),s=0,c=0,d=this.canvas.width/o,f=this.canvas.height/o,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,S=this._dataUrlOptions?.yOffset||0,j=document.createElement("image");j.setAttribute("x",b.toString()),j.setAttribute("y",S.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:S})=>{const j=document.createElement("circle"),C=x>0?x:(b+S)/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 WK(e){const t=De(),{width:n=500,height:r=200,defaultValue:o,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:Ui+"/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 GK(f.current);o?.data&&b.fromDataURL(o.data).catch(console.error),b.addEventListener("endStroke",x),p.current=b}return()=>{p.current&&p.current.removeEventListener("beginStroke",x)}},[t,o,s]);const g=()=>{p.current&&p.current.clear(),m.current?.(void 0)};return a.jsxs(yr,{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 yP(e){const t=[...e.context,e.responseItem];return a.jsxs("div",{children:[e.item.text&&a.jsx(Oe,{order:3,mb:"md",children:e.item.text}),a.jsx(dx,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function QK(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx(yP,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),a.jsx(Pt,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function YK(e){const{formState:t,context:n,item:r,responseItem:o}=e,s=r.type!==wt.choice&&r.type!==wt.openChoice,c=o.answer&&o.answer.length>0?o.answer:[{}];return a.jsxs(Ot,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[a.jsx($e,{gap:"xs",children:c?.map((d,f)=>a.jsx(lp,{formState:t,context:n,item:r,responseItem:o,index:f},`${r.linkId}-${f}`))}),s&&a.jsx(Pt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function dx(e){const{formState:t,context:n,items:r,responseItems:o}=e;return a.jsx($e,{children:r.map((s,c)=>{if(!aF(s,t.questionnaireResponse))return null;if(s.type===wt.display)return a.jsx("p",{children:s.text},`display-${s.id}-${c}`);const d=o.filter(f=>f.linkId===s.linkId);return s.type===wt.group&&s.repeats?a.jsx(QK,{formState:t,context:n,item:s,responseItems:d},`repeating-group-${s.id}-${c}`):s.type===wt.group?a.jsx(yP,{formState:t,context:n,item:s,responseItem:d[0]},`group-${s.id}-${c}`):s.type===wt.boolean?a.jsx(lp,{formState:t,context:n,item:s,responseItem:d[0],index:0},`boolean-item-${s.id}-${c}`):s.repeats?a.jsx(YK,{formState:t,context:n,item:s,responseItem:d[0]},`repeating-item-${s.id}-${c}`):a.jsx(Ot,{htmlFor:s.linkId,title:s.text,withAsterisk:s.required,children:a.jsx(lp,{formState:t,context:n,item:s,responseItem:d[0],index:0})},`repeating-item-${s.id}-${c}`)})})}function KK(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:o}=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(jc,{active:c,allowNextStepsSelect:!1,p:6,children:s.map((m,g)=>a.jsx(jc.Step,{label:m.title,children:g===c&&o},m.linkId))}),!r&&a.jsxs(ge,{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(ur,{children:n??"Submit"})]})]})}function xP(e){const t=De(),[n,r]=v.useState(!1),o=v.useRef(e);o.current=e;const s=v.useCallback(g=>{r(!1),o.current.onChange?.(g)},[]),c=xF({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:!!mo(c.questionnaire,iF),[c]),p=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===kh),[c]),m=v.useCallback(()=>{const g=d.current;if(g.loading)return;const x=o.current.onSubmit;if(!x)return;if(f&&!p){r(!0);return}const b=g.questionnaire,S=g.questionnaireResponse,j=o.current.subject;let C=o.current.source;if(!C){const R=t.getProfile();R&&(C=qt(R))}x({...S,questionnaire:b.url??At(b),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,p]);return c.loading?null:a.jsxs(ut,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&a.jsx(Oe,{children:c.questionnaire.title}),c.pagination?a.jsx(KK,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(dx,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(dx,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs($e,{mt:"md",gap:0,children:[a.jsx(_e,{size:"sm",fw:500,children:"Signature"}),a.jsx(WK,{onChange:c.onChangeSignature}),!p&&n&&a.jsx(_e,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(ge,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(ur,{children:e.submitButtonText??"Submit"})})]})]})}const XK="_section_4m5it_1",ZK={section:XK},JK=["gender","age","gestationalAge","context","appliesTo","category"],eX={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function tX(e){e=Object.assign(eX,e);const t=e.definition,[n,r]=v.useState([]),[o,s]=v.useState(1),[c,d]=v.useState(1);return v.useEffect(()=>{const S=iX(t,d);r(oX(S.qualifiedInterval||[],s))},[t]),a.jsxs(ut,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx($e,{children:n.map(S=>a.jsx(nX,{unit:sX(t.quantitativeDetails?.unit),onChange:g,onAdd:x,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`))}),a.jsx(bn,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{dn(S),p({id:`group-id-${o}`,filters:{},intervals:[]}),s(j=>j+1)},children:a.jsx(np,{})}),a.jsx(ge,{justify:"flex-end",children:a.jsx(ur,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!lX(j));e.onSubmit({...t,qualifiedInterval:S})}function p(S){r(j=>[...j,S])}function m(S){r(j=>j.filter(C=>C.id!==S.id))}function g(S,j){r(C=>{C=[...C];const R=C.find(T=>T.id===S),E=R?.intervals.findIndex(T=>T.id===j.id);return E!==void 0&&R?.intervals[E]&&(R.intervals[E]=j),C})}function x(S,j){j.id===void 0&&(j.id=`id-${c}`,d(C=>C+1)),r(C=>{C=[...C];const R=C.findIndex(E=>E.id===S);if(R!==-1){const E={...C[R]};j={...j,...E.filters},E.intervals=[...E.intervals,j],C[R]=E}return C})}function b(S,j){r(C=>{C=[...C];const R=C.find(E=>E.id===S);return R&&(R.intervals=R.intervals.filter(E=>E.id!==j.id)),C})}}function nX(e){const{intervalGroup:t,unit:n}=e;return a.jsx(Vc,{"data-testid":t.id,className:ZK.section,children:a.jsxs($e,{gap:"lg",children:[a.jsx(ge,{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(tp,{})},`remove-group-button-${t.id}`)}),a.jsx(rX,{intervalGroup:t,onChange:e.onChange}),a.jsx(pn,{}),t.intervals.map(r=>a.jsxs($e,{gap:"xs",children:[a.jsxs(ge,{children:[a.jsx(Ue,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{dn(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(bn,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{dn(o),e.onRemove(t.id,r)},children:a.jsx(tp,{})},`remove-interval-${r.id}`)]}),a.jsx(zb,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},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(np,{})})]})})}function rX(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($e,{style:{maxWidth:"50%"},children:[a.jsx(ge,{children:a.jsx(sn,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:r=>{for(const o of t.intervals){let s=r.currentTarget.value;s===""&&(s=void 0),n(t.id,{...o,gender:s})}}})}),a.jsxs(ge,{gap:"xs",children:[a.jsx(_e,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(zb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:r=>{for(const o of t.intervals)n(t.id,{...o,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 o of t.intervals){let s=r.currentTarget.value;s===""?(s=void 0,n(t.id,{...o,context:void 0})):n(t.id,{...o,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 o of t.intervals){const s=r.currentTarget.value;s===""?n(t.id,{...o,category:void 0}):n(t.id,{...o,category:s})}}})]})}function iX(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{const s=parseInt(o.id?.substring(3)||"",10);return isNaN(s)?Number.NEGATIVE_INFINITY:s}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function oX(e,t){let n=1;const r={};for(const o of e){const s=aX(o);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(JK.map(c=>[c,o[c]])),intervals:[]}),r[s].intervals.push(o)}return t(n),Object.values(r)}function aX(e){return[`gender=${e.gender}`,`age=${ld(e.age)}`,`gestationalAge=${ld(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function sX(e){return e&&(hU(e,"http://unitsofmeasure.org")||e.text)}function lX(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function cX(e){const t=De(),n=Gt(e.value),[r,o]=v.useState(!1),[s,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(d(n)).then(c).catch(console.log),o(!0))},[t,n,r]),!n||!s)return null;return a.jsx(ar,{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(ar.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(iq,{}):a.jsx(jH,{color:"gray"})}),a.jsxs(ar.Col,{span:9,p:"xs",children:[a.jsx(_e,{fw:500,children:p.title}),p.description&&a.jsx("div",{children:p.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(dl,{value:g?.meta?.author})," on ",lr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(bm,{status:g?.status||"unknown"})]})]}),a.jsxs(ar.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===At(m.resource))return m.resource}}function bP(e,t){const n=uX(e,t);return dX(n,e,t)}function uX(e,t){const n=e.length,r=t.length,o=n+r+1,s=1+2*o,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<o;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,x=m-1,b=d[g],S=d[x];let j,C=0;p===-f||p!==f&&S.i<b.i?(C=b.i,j=b):(C=S.i+1,j=S),d[x]=void 0;let R=C-p,E={i:C,j:R,prev:fX(j),snake:!1};for(;C<n&&R<r&&e[C]===t[R];)C++,R++;if(C>E.i&&(E={i:C,j:R,prev:E,snake:!0}),d[m]=E,C>=n&&R>=r)return d[m]}d[c+f-1]=void 0}}function dX(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o?.prev&&o.prev.j>=0;){const s=o.i,c=o.j;o=o.prev;const d=o.i,f=o.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}),o.snake&&(o=o.prev)}return r}function fX(e){return e&&!e.snake&&e.prev?e.prev:e}function hX(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:Ii(r.resource,!0).match(/[^\r\n]+/g)})).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.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 pX(n,t),mX(n),n}function pX(e,t){for(let n=1;n<t.length;n++){const r=bP(t[n-1].lines,t[n].lines);for(const o of r){const s=o.original.position,c=o.original.lines,d=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(s,c.length),o.type==="insert"||o.type==="change")for(let f=0;f<o.revised.lines.length;f++)e.splice(s+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:d[f],span:1})}}}function mX(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 gX="_container_1tyf3_1",vX="_root_1tyf3_5",yX="_startRow_1tyf3_20",xX="_normalRow_1tyf3_25",bX="_author_1tyf3_30",SX="_dateTime_1tyf3_34",wX="_lineNumber_1tyf3_40",jX="_line_1tyf3_40",CX="_pre_1tyf3_55",Fo={container:gX,root:vX,startRow:yX,normalRow:xX,author:bX,dateTime:SX,lineNumber:wX,line:jX,pre:CX};function EX(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function TX(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return ac(n,"year");const r=Math.floor(t/2592e3);if(r>0)return ac(r,"month");const o=Math.floor(t/86400);if(o>0)return ac(o,"day");const s=Math.floor(t/3600);if(s>0)return ac(s,"hour");const c=Math.floor(t/60);return c>0?ac(c,"minute"):ac(t,"second")}function ac(e,t){return`${e} ${e===1?t:t+"s"} ago`}function RX(e){const t=De(),[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 o=n.entry?.[0]?.resource;if(!o)return null;const s=hX(n);return a.jsx("div",{className:Fo.container,children:a.jsx("table",{className:Fo.root,children:a.jsx("tbody",{children:s.map((c,d)=>a.jsxs("tr",{className:c.span>0?Fo.startRow:Fo.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:Fo.author,rowSpan:c.span,children:a.jsx(dl,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:Fo.dateTime,rowSpan:c.span,children:a.jsx(vt,{to:EX(o,c.meta.versionId),fz:"xs",children:TX(c.meta.lastUpdated)})})]}),a.jsx("td",{className:Fo.lineNumber,children:d+1}),a.jsx("td",{className:Fo.line,children:a.jsx("pre",{className:Fo.pre,children:c.value})})]},"row-"+d))})})})}const _X="_removed_el5zk_1",DX="_added_el5zk_6",vT={removed:_X,added:DX};function AX(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Ii(t,!0).match(/[^\r\n]+/g),o=Ii(n,!0).match(/[^\r\n]+/g),s=bP(r,o);return a.jsx("pre",{style:{color:"gray"},children:s.map((c,d)=>a.jsx(PX,{delta:c},"delta"+d))})}function PX(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:vT.removed,children:e.delta.original.lines.join(`
|
|
556
|
-
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:vT.added,children:e.delta.revised.lines.join(`
|
|
557
|
-
`)}),"...",a.jsx("br",{})]})}const kX="_splitButton_1i0gi_1",NX="_menuControl_1i0gi_6",yT={splitButton:kX,menuControl:NX};function up(e){const{outcome:t}=e,n=De(),r=Gt(e.defaultValue),o=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 S=Uc(b);if(S){c(!0);const j=$V(r,S);f(j)}else console.error(`Schema not found for ${b}`)}).catch(S=>{console.error("Error in requestProfileSchema",S)})}else n.requestSchema(o).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const g=v.useMemo(()=>r&&GD(r,zs.READ,p),[p,r]),x=v.useMemo(()=>n.isSuperAdmin()||!p||!Tn(d?.resourceType)?!0:UB(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($e,{mb:"xl",children:[a.jsx(Ot,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(Ue,{name:"resourceType",defaultValue:d.resourceType,disabled:!0})}),a.jsx(Ot,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(Ue,{name:"id",defaultValue:d.id,disabled:!0})})]}),a.jsx(Vb,{path:d.resourceType,valuePath:d.resourceType,typeName:o,defaultValue:d,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),a.jsxs(ge,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[a.jsx(ke,{type:"submit",className:It((e.onPatch||e.onDelete)&&yT.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:yT.menuControl,"aria-label":"More actions",children:a.jsx(Rb,{size:14,stroke:1.5})})}),a.jsxs(Ce.Dropdown,{children:[e.onPatch&&a.jsx(Ce.Item,{leftSection:a.jsx(vA,{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(oa,{color:"red",title:"Permission denied",icon:a.jsx(ll,{}),children:["Your access level prevents you from editing and creating ",d.resourceType," resources."]})}function OX(e){const t=De(),[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(de,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{children:"Author"}),a.jsx(de.Th,{children:"Date"}),a.jsx(de.Th,{children:"Version"})]})}),a.jsx(de.Tbody,{children:n.entry?.map((o,s)=>a.jsx(MX,{entry:o},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function MX(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:a.jsx(pc,{value:n.meta?.author,link:!0})}),a.jsx(de.Td,{children:lr(n.meta?.lastUpdated)}),a.jsx(de.Td,{children:a.jsx(vt,{to:LX(n),children:n.meta?.versionId})})]}):a.jsx(de.Tr,{children:a.jsx(de.Td,{colSpan:3,children:Ge(t?.outcome)})})}function LX(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function IX(e){const{serviceRequest:t,...n}=e;return a.jsx(Sm,{value:t,loadTimelineResources:async(r,o,s)=>{const c=`${o}/${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,o,s)=>({resourceType:"Communication",status:"completed",basedOn:[qt(r)],subject:r.subject,sender:qt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",basedOn:[qt(r)],subject:r.subject,operator:qt(o),issued:new Date().toISOString(),content:s}),...n})}function $X(e){const t=De(),{client:n,patient:r,encounter:o,children:s,...c}=e;function d(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",db(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(Pt,{onClick:()=>d(),...c,children:s})}var vy={exports:{}},Fu={},yy={exports:{}},xy={};/**
|
|
558
|
-
* @license React
|
|
559
|
-
* scheduler.production.js
|
|
560
|
-
*
|
|
561
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
562
|
-
*
|
|
563
|
-
* This source code is licensed under the MIT license found in the
|
|
564
|
-
* LICENSE file in the root directory of this source tree.
|
|
565
|
-
*/var xT;function zX(){return xT||(xT=1,(function(e){function t(M,I){var $=M.length;M.push(I);e:for(;0<$;){var q=$-1>>>1,N=M[q];if(0<o(N,I))M[q]=I,M[$]=N,$=q;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var I=M[0],$=M.pop();if($!==I){M[0]=$;e:for(var q=0,N=M.length,F=N>>>1;q<F;){var J=2*(q+1)-1,ae=M[J],je=J+1,xe=M[je];if(0>o(ae,$))je<N&&0>o(xe,ae)?(M[q]=xe,M[je]=$,q=je):(M[q]=ae,M[J]=$,q=J);else if(je<N&&0>o(xe,$))M[q]=xe,M[je]=$,q=je;else break e}}return I}function o(M,I){var $=M.sortIndex-I.sortIndex;return $!==0?$:M.id-I.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,S=!1,j=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function _(M){for(var I=n(p);I!==null;){if(I.callback===null)r(p);else if(I.startTime<=M)r(p),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(p)}}function P(M){if(j=!1,_(M),!S)if(n(f)!==null)S=!0,A||(A=!0,K());else{var I=n(p);I!==null&&W(P,I.startTime-M)}}var A=!1,k=-1,L=5,z=-1;function B(){return C?!0:!(e.unstable_now()-z<L)}function Z(){if(C=!1,A){var M=e.unstable_now();z=M;var I=!0;try{e:{S=!1,j&&(j=!1,E(k),k=-1),b=!0;var $=x;try{t:{for(_(M),g=n(f);g!==null&&!(g.expirationTime>M&&B());){var q=g.callback;if(typeof q=="function"){g.callback=null,x=g.priorityLevel;var N=q(g.expirationTime<=M);if(M=e.unstable_now(),typeof N=="function"){g.callback=N,_(M),I=!0;break t}g===n(f)&&r(f),_(M)}else r(f);g=n(f)}if(g!==null)I=!0;else{var F=n(p);F!==null&&W(P,F.startTime-M),I=!1}}break e}finally{g=null,x=$,b=!1}I=void 0}}finally{I?K():A=!1}}}var K;if(typeof T=="function")K=function(){T(Z)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,H=Y.port2;Y.port1.onmessage=Z,K=function(){H.postMessage(null)}}else K=function(){R(Z,0)};function W(M,I){k=R(function(){M(e.unstable_now())},I)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(M){switch(x){case 1:case 2:case 3:var I=3;break;default:I=x}var $=x;x=I;try{return M()}finally{x=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,I){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var $=x;x=M;try{return I()}finally{x=$}},e.unstable_scheduleCallback=function(M,I,$){var q=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?q+$:q):$=q,M){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=$+N,M={id:m++,callback:I,priorityLevel:M,startTime:$,expirationTime:N,sortIndex:-1},$>q?(M.sortIndex=$,t(p,M),n(f)===null&&M===n(p)&&(j?(E(k),k=-1):j=!0,W(P,$-q))):(M.sortIndex=N,t(f,M),S||b||(S=!0,A||(A=!0,K()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var I=x;return function(){var $=x;x=I;try{return M.apply(this,arguments)}finally{x=$}}}})(xy)),xy}var bT;function UX(){return bT||(bT=1,yy.exports=zX()),yy.exports}/**
|
|
566
|
-
* @license React
|
|
567
|
-
* react-dom-client.production.js
|
|
568
|
-
*
|
|
569
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
570
|
-
*
|
|
571
|
-
* This source code is licensed under the MIT license found in the
|
|
572
|
-
* LICENSE file in the root directory of this source tree.
|
|
573
|
-
*/var ST;function BX(){if(ST)return Fu;ST=1;var e=UX(),t=Cx(),n=BR();function r(i){var l="https://react.dev/errors/"+i;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 #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var l=i,u=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(u=l.return),i=l.return;while(i)}return l.tag===3?u:null}function c(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function d(i){if(s(i)!==i)throw Error(r(188))}function f(i){var l=i.alternate;if(!l){if(l=s(i),l===null)throw Error(r(188));return l!==i?null:i}for(var u=i,h=l;;){var y=u.return;if(y===null)break;var w=y.alternate;if(w===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===u)return d(y),i;if(w===h)return d(y),l;w=w.sibling}throw Error(r(188))}if(u.return!==h.return)u=y,h=w;else{for(var D=!1,O=y.child;O;){if(O===u){D=!0,u=y,h=w;break}if(O===h){D=!0,h=y,u=w;break}O=O.sibling}if(!D){for(O=w.child;O;){if(O===u){D=!0,u=w,h=y;break}if(O===h){D=!0,h=w,u=y;break}O=O.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?i:l}function p(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=p(i),l!==null)return l;i=i.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),E=Symbol.for("react.consumer"),T=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"),L=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function K(i){return i===null||typeof i!="object"?null:(i=Z&&i[Z]||i["@@iterator"],typeof i=="function"?i:null)}var Y=Symbol.for("react.client.reference");function H(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Y?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case T:return(i.displayName||"Context")+".Provider";case E:return(i._context.displayName||"Context")+".Consumer";case _:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case k:return l=i.displayName||null,l!==null?l:H(i.type)||"Memo";case L:l=i._payload,i=i._init;try{return H(i(l))}catch{}}return null}var W=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},q=[],N=-1;function F(i){return{current:i}}function J(i){0>N||(i.current=q[N],q[N]=null,N--)}function ae(i,l){N++,q[N]=i.current,i.current=l}var je=F(null),xe=F(null),we=F(null),Qe=F(null);function Ee(i,l){switch(ae(we,l),ae(xe,i),ae(je,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?xj(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=xj(l),i=bj(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}J(je),ae(je,i)}function ot(){J(je),J(xe),J(we)}function nt(i){i.memoizedState!==null&&ae(Qe,i);var l=je.current,u=bj(l,i.type);l!==u&&(ae(xe,i),ae(je,u))}function Ct(i){xe.current===i&&(J(je),J(xe)),Qe.current===i&&(J(Qe),ku._currentValue=$)}var Mt=Object.prototype.hasOwnProperty,Lt=e.unstable_scheduleCallback,pt=e.unstable_cancelCallback,Rt=e.unstable_shouldYield,tn=e.unstable_requestPaint,Re=e.unstable_now,Pe=e.unstable_getCurrentPriorityLevel,Xe=e.unstable_ImmediatePriority,Ae=e.unstable_UserBlockingPriority,pe=e.unstable_NormalPriority,Se=e.unstable_LowPriority,ze=e.unstable_IdlePriority,be=e.log,Me=e.unstable_setDisableYieldValue,Dt=null,bt=null;function nn(i){if(typeof be=="function"&&Me(i),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Dt,i)}catch{}}var $t=Math.clz32?Math.clz32:Vi,$n=Math.log,An=Math.LN2;function Vi(i){return i>>>=0,i===0?32:31-($n(i)/An|0)|0}var Ei=256,xo=4194304;function Ir(i){var l=i&42;if(l!==0)return l;switch(i&-i){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 i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function bo(i,l,u){var h=i.pendingLanes;if(h===0)return 0;var y=0,w=i.suspendedLanes,D=i.pingedLanes;i=i.warmLanes;var O=h&134217727;return O!==0?(h=O&~w,h!==0?y=Ir(h):(D&=O,D!==0?y=Ir(D):u||(u=O&~i,u!==0&&(y=Ir(u))))):(O=h&~w,O!==0?y=Ir(O):D!==0?y=Ir(D):u||(u=h&~i,u!==0&&(y=Ir(u)))),y===0?0:l!==0&&l!==y&&(l&w)===0&&(w=y&-y,u=l&-l,w>=u||w===32&&(u&4194048)!==0)?l:y}function Jr(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function ml(i,l){switch(i){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 So(){var i=Ei;return Ei<<=1,(Ei&4194048)===0&&(Ei=256),i}function da(){var i=xo;return xo<<=1,(xo&62914560)===0&&(xo=4194304),i}function Fi(i){for(var l=[],u=0;31>u;u++)l.push(i);return l}function wr(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Hn(i,l,u,h,y,w){var D=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var O=i.entanglements,U=i.expirationTimes,te=i.hiddenUpdates;for(u=D&~u;0<u;){var fe=31-$t(u),me=1<<fe;O[fe]=0,U[fe]=-1;var ne=te[fe];if(ne!==null)for(te[fe]=null,fe=0;fe<ne.length;fe++){var oe=ne[fe];oe!==null&&(oe.lane&=-536870913)}u&=~me}h!==0&&wo(i,h,0),w!==0&&y===0&&i.tag!==0&&(i.suspendedLanes|=w&~(D&~l))}function wo(i,l,u){i.pendingLanes|=l,i.suspendedLanes&=~l;var h=31-$t(l);i.entangledLanes|=l,i.entanglements[h]=i.entanglements[h]|1073741824|u&4194090}function fa(i,l){var u=i.entangledLanes|=l;for(i=i.entanglements;u;){var h=31-$t(u),y=1<<h;y&l|i[h]&l&&(i[h]|=l),u&=~y}}function ls(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function cs(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function V(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:zj(i.type))}function X(i,l){var u=I.p;try{return I.p=i,l()}finally{I.p=u}}var ie=Math.random().toString(36).slice(2),ve="__reactFiber$"+ie,Te="__reactProps$"+ie,Ve="__reactContainer$"+ie,Ye="__reactEvents$"+ie,Fe="__reactListeners$"+ie,Je="__reactHandles$"+ie,it="__reactResources$"+ie,qe="__reactMarker$"+ie;function Ke(i){delete i[ve],delete i[Te],delete i[Ye],delete i[Fe],delete i[Je]}function ft(i){var l=i[ve];if(l)return l;for(var u=i.parentNode;u;){if(l=u[Ve]||u[ve]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(i=Cj(i);i!==null;){if(u=i[ve])return u;i=Cj(i)}return l}i=u,u=i.parentNode}return null}function et(i){if(i=i[ve]||i[Ve]){var l=i.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return i}return null}function Kt(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function vn(i){var l=i[it];return l||(l=i[it]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function mt(i){i[qe]=!0}var Xt=new Set,qi={};function $r(i,l){fr(i,l),fr(i+"Capture",l)}function fr(i,l){for(qi[i]=l,i=0;i<l.length;i++)Xt.add(l[i])}var ei=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]*$"),gl={},ha={};function jo(i){return Mt.call(ha,i)?!0:Mt.call(gl,i)?!1:ei.test(i)?ha[i]=!0:(gl[i]=!0,!1)}function Co(i,l,u){if(jo(l))if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+u)}}function Eo(i,l,u){if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+u)}}function gt(i,l,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(l,u,""+h)}}var zn,To;function jr(i){if(zn===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);zn=l&&l[1]||"",To=-1<u.stack.indexOf(`
|
|
574
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
575
|
-
`+zn+i+To}var jn=!1;function pa(i,l){if(!i||jn)return"";jn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(oe){var ne=oe}Reflect.construct(i,[],me)}else{try{me.call()}catch(oe){ne=oe}i.call(me.prototype)}}else{try{throw Error()}catch(oe){ne=oe}(me=i())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(oe){if(oe&&ne&&typeof oe.stack=="string")return[oe.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 w=h.DetermineComponentFrameRoot(),D=w[0],O=w[1];if(D&&O){var U=D.split(`
|
|
576
|
-
`),te=O.split(`
|
|
577
|
-
`);for(y=h=0;h<U.length&&!U[h].includes("DetermineComponentFrameRoot");)h++;for(;y<te.length&&!te[y].includes("DetermineComponentFrameRoot");)y++;if(h===U.length||y===te.length)for(h=U.length-1,y=te.length-1;1<=h&&0<=y&&U[h]!==te[y];)y--;for(;1<=h&&0<=y;h--,y--)if(U[h]!==te[y]){if(h!==1||y!==1)do if(h--,y--,0>y||U[h]!==te[y]){var fe=`
|
|
578
|
-
`+U[h].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=h&&0<=y);break}}}finally{jn=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?jr(u):""}function Qd(i){switch(i.tag){case 26:case 27:case 5:return jr(i.type);case 16:return jr("Lazy");case 13:return jr("Suspense");case 19:return jr("SuspenseList");case 0:case 15:return pa(i.type,!1);case 11:return pa(i.type.render,!1);case 1:return pa(i.type,!0);case 31:return jr("Activity");default:return""}}function Yd(i){try{var l="";do l+=Qd(i),i=i.return;while(i);return l}catch(u){return`
|
|
579
|
-
Error generating stack: `+u.message+`
|
|
580
|
-
`+u.stack}}function ti(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function pS(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function mk(i){var l=pS(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),h=""+i[l];if(!i.hasOwnProperty(l)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,w=u.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return y.call(this)},set:function(D){h=""+D,w.call(this,D)}}),Object.defineProperty(i,l,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(D){h=""+D},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Kd(i){i._valueTracker||(i._valueTracker=mk(i))}function mS(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return i&&(h=pS(i)?i.checked?"true":"false":i.value),i=h,i!==u?(l.setValue(i),!0):!1}function Xd(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var gk=/[\n"\\]/g;function ni(i){return i.replace(gk,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Dm(i,l,u,h,y,w,D,O){i.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.type=D:i.removeAttribute("type"),l!=null?D==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+ti(l)):i.value!==""+ti(l)&&(i.value=""+ti(l)):D!=="submit"&&D!=="reset"||i.removeAttribute("value"),l!=null?Am(i,D,ti(l)):u!=null?Am(i,D,ti(u)):h!=null&&i.removeAttribute("value"),y==null&&w!=null&&(i.defaultChecked=!!w),y!=null&&(i.checked=y&&typeof y!="function"&&typeof y!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?i.name=""+ti(O):i.removeAttribute("name")}function gS(i,l,u,h,y,w,D,O){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.type=w),l!=null||u!=null){if(!(w!=="submit"&&w!=="reset"||l!=null))return;u=u!=null?""+ti(u):"",l=l!=null?""+ti(l):u,O||l===i.value||(i.value=l),i.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=O?i.checked:!!h,i.defaultChecked=!!h,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(i.name=D)}function Am(i,l,u){l==="number"&&Xd(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function vl(i,l,u,h){if(i=i.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<i.length;u++)y=l.hasOwnProperty("$"+i[u].value),i[u].selected!==y&&(i[u].selected=y),y&&h&&(i[u].defaultSelected=!0)}else{for(u=""+ti(u),l=null,y=0;y<i.length;y++){if(i[y].value===u){i[y].selected=!0,h&&(i[y].defaultSelected=!0);return}l!==null||i[y].disabled||(l=i[y])}l!==null&&(l.selected=!0)}}function vS(i,l,u){if(l!=null&&(l=""+ti(l),l!==i.value&&(i.value=l),u==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=u!=null?""+ti(u):""}function yS(i,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=ti(l),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h)}function yl(i,l){if(l){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=l;return}}i.textContent=l}var vk=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 xS(i,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":h?i.setProperty(l,u):typeof u!="number"||u===0||vk.has(l)?l==="float"?i.cssFloat=u:i[l]=(""+u).trim():i[l]=u+"px"}function bS(i,l,u){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&u[y]!==h&&xS(i,y,h)}else for(var w in l)l.hasOwnProperty(w)&&xS(i,w,l[w])}function Pm(i){if(i.indexOf("-")===-1)return!1;switch(i){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 yk=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"]]),xk=/^[\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 Zd(i){return xk.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var km=null;function Nm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var xl=null,bl=null;function SS(i){var l=et(i);if(l&&(i=l.stateNode)){var u=i[Te]||null;e:switch(i=l.stateNode,l.type){case"input":if(Dm(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+ni(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==i&&h.form===i.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===i.form&&mS(h)}break e;case"textarea":vS(i,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&vl(i,!!u.multiple,l,!1)}}}var Om=!1;function wS(i,l,u){if(Om)return i(l,u);Om=!0;try{var h=i(l);return h}finally{if(Om=!1,(xl!==null||bl!==null)&&($f(),xl&&(l=xl,i=bl,bl=xl=null,SS(l),i)))for(l=0;l<i.length;l++)SS(i[l])}}function Hc(i,l){var u=i.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)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,l,typeof u));return u}var Ro=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mm=!1;if(Ro)try{var Gc={};Object.defineProperty(Gc,"passive",{get:function(){Mm=!0}}),window.addEventListener("test",Gc,Gc),window.removeEventListener("test",Gc,Gc)}catch{Mm=!1}var ma=null,Lm=null,Jd=null;function jS(){if(Jd)return Jd;var i,l=Lm,u=l.length,h,y="value"in ma?ma.value:ma.textContent,w=y.length;for(i=0;i<u&&l[i]===y[i];i++);var D=u-i;for(h=1;h<=D&&l[u-h]===y[w-h];h++);return Jd=y.slice(i,1<h?1-h:void 0)}function ef(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function tf(){return!0}function CS(){return!1}function Cr(i){function l(u,h,y,w,D){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=w,this.target=D,this.currentTarget=null;for(var O in i)i.hasOwnProperty(O)&&(u=i[O],this[O]=u?u(w):w[O]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?tf:CS,this.isPropagationStopped=CS,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=tf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=tf)},persist:function(){},isPersistent:tf}),l}var us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nf=Cr(us),Wc=m({},us,{view:0,detail:0}),bk=Cr(Wc),Im,$m,Qc,rf=m({},Wc,{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(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Qc&&(Qc&&i.type==="mousemove"?(Im=i.screenX-Qc.screenX,$m=i.screenY-Qc.screenY):$m=Im=0,Qc=i),Im)},movementY:function(i){return"movementY"in i?i.movementY:$m}}),ES=Cr(rf),Sk=m({},rf,{dataTransfer:0}),wk=Cr(Sk),jk=m({},Wc,{relatedTarget:0}),zm=Cr(jk),Ck=m({},us,{animationName:0,elapsedTime:0,pseudoElement:0}),Ek=Cr(Ck),Tk=m({},us,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Rk=Cr(Tk),_k=m({},us,{data:0}),TS=Cr(_k),Dk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ak={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"},Pk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kk(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=Pk[i])?!!l[i]:!1}function Um(){return kk}var Nk=m({},Wc,{key:function(i){if(i.key){var l=Dk[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=ef(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Ak[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Um,charCode:function(i){return i.type==="keypress"?ef(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ef(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Ok=Cr(Nk),Mk=m({},rf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),RS=Cr(Mk),Lk=m({},Wc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Um}),Ik=Cr(Lk),$k=m({},us,{propertyName:0,elapsedTime:0,pseudoElement:0}),zk=Cr($k),Uk=m({},rf,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Bk=Cr(Uk),Vk=m({},us,{newState:0,oldState:0}),Fk=Cr(Vk),qk=[9,13,27,32],Bm=Ro&&"CompositionEvent"in window,Yc=null;Ro&&"documentMode"in document&&(Yc=document.documentMode);var Hk=Ro&&"TextEvent"in window&&!Yc,_S=Ro&&(!Bm||Yc&&8<Yc&&11>=Yc),DS=" ",AS=!1;function PS(i,l){switch(i){case"keyup":return qk.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kS(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Sl=!1;function Gk(i,l){switch(i){case"compositionend":return kS(l);case"keypress":return l.which!==32?null:(AS=!0,DS);case"textInput":return i=l.data,i===DS&&AS?null:i;default:return null}}function Wk(i,l){if(Sl)return i==="compositionend"||!Bm&&PS(i,l)?(i=jS(),Jd=Lm=ma=null,Sl=!1,i):null;switch(i){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 _S&&l.locale!=="ko"?null:l.data;default:return null}}var Qk={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 NS(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!Qk[i.type]:l==="textarea"}function OS(i,l,u,h){xl?bl?bl.push(h):bl=[h]:xl=h,l=qf(l,"onChange"),0<l.length&&(u=new nf("onChange","change",null,u,h),i.push({event:u,listeners:l}))}var Kc=null,Xc=null;function Yk(i){pj(i,0)}function of(i){var l=Kt(i);if(mS(l))return i}function MS(i,l){if(i==="change")return l}var LS=!1;if(Ro){var Vm;if(Ro){var Fm="oninput"in document;if(!Fm){var IS=document.createElement("div");IS.setAttribute("oninput","return;"),Fm=typeof IS.oninput=="function"}Vm=Fm}else Vm=!1;LS=Vm&&(!document.documentMode||9<document.documentMode)}function $S(){Kc&&(Kc.detachEvent("onpropertychange",zS),Xc=Kc=null)}function zS(i){if(i.propertyName==="value"&&of(Xc)){var l=[];OS(l,Xc,i,Nm(i)),wS(Yk,l)}}function Kk(i,l,u){i==="focusin"?($S(),Kc=l,Xc=u,Kc.attachEvent("onpropertychange",zS)):i==="focusout"&&$S()}function Xk(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return of(Xc)}function Zk(i,l){if(i==="click")return of(l)}function Jk(i,l){if(i==="input"||i==="change")return of(l)}function eN(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var zr=typeof Object.is=="function"?Object.is:eN;function Zc(i,l){if(zr(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var u=Object.keys(i),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!Mt.call(l,y)||!zr(i[y],l[y]))return!1}return!0}function US(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function BS(i,l){var u=US(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=l&&h>=l)return{node:u,offset:l-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=US(u)}}function VS(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?VS(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function FS(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Xd(i.document);l instanceof i.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)i=l.contentWindow;else break;l=Xd(i.document)}return l}function qm(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var tN=Ro&&"documentMode"in document&&11>=document.documentMode,wl=null,Hm=null,Jc=null,Gm=!1;function qS(i,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Gm||wl==null||wl!==Xd(h)||(h=wl,"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}),Jc&&Zc(Jc,h)||(Jc=h,h=qf(Hm,"onSelect"),0<h.length&&(l=new nf("onSelect","select",null,l,u),i.push({event:l,listeners:h}),l.target=wl)))}function ds(i,l){var u={};return u[i.toLowerCase()]=l.toLowerCase(),u["Webkit"+i]="webkit"+l,u["Moz"+i]="moz"+l,u}var jl={animationend:ds("Animation","AnimationEnd"),animationiteration:ds("Animation","AnimationIteration"),animationstart:ds("Animation","AnimationStart"),transitionrun:ds("Transition","TransitionRun"),transitionstart:ds("Transition","TransitionStart"),transitioncancel:ds("Transition","TransitionCancel"),transitionend:ds("Transition","TransitionEnd")},Wm={},HS={};Ro&&(HS=document.createElement("div").style,"AnimationEvent"in window||(delete jl.animationend.animation,delete jl.animationiteration.animation,delete jl.animationstart.animation),"TransitionEvent"in window||delete jl.transitionend.transition);function fs(i){if(Wm[i])return Wm[i];if(!jl[i])return i;var l=jl[i],u;for(u in l)if(l.hasOwnProperty(u)&&u in HS)return Wm[i]=l[u];return i}var GS=fs("animationend"),WS=fs("animationiteration"),QS=fs("animationstart"),nN=fs("transitionrun"),rN=fs("transitionstart"),iN=fs("transitioncancel"),YS=fs("transitionend"),KS=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 Ti(i,l){KS.set(i,l),$r(l,[i])}var XS=new WeakMap;function ri(i,l){if(typeof i=="object"&&i!==null){var u=XS.get(i);return u!==void 0?u:(l={value:i,source:l,stack:Yd(l)},XS.set(i,l),l)}return{value:i,source:l,stack:Yd(l)}}var ii=[],Cl=0,Ym=0;function af(){for(var i=Cl,l=Ym=Cl=0;l<i;){var u=ii[l];ii[l++]=null;var h=ii[l];ii[l++]=null;var y=ii[l];ii[l++]=null;var w=ii[l];if(ii[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}w!==0&&ZS(u,y,w)}}function sf(i,l,u,h){ii[Cl++]=i,ii[Cl++]=l,ii[Cl++]=u,ii[Cl++]=h,Ym|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function Km(i,l,u,h){return sf(i,l,u,h),lf(i)}function El(i,l){return sf(i,null,null,l),lf(i)}function ZS(i,l,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var y=!1,w=i.return;w!==null;)w.childLanes|=u,h=w.alternate,h!==null&&(h.childLanes|=u),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(y=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,y&&l!==null&&(y=31-$t(u),i=w.hiddenUpdates,h=i[y],h===null?i[y]=[l]:h.push(l),l.lane=u|536870912),w):null}function lf(i){if(50<Cu)throw Cu=0,nv=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var Tl={};function oN(i,l,u,h){this.tag=i,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 Ur(i,l,u,h){return new oN(i,l,u,h)}function Xm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function _o(i,l){var u=i.alternate;return u===null?(u=Ur(i.tag,l,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=l,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,l=i.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function JS(i,l){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,l=u.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function cf(i,l,u,h,y,w){var D=0;if(h=i,typeof i=="function")Xm(i)&&(D=1);else if(typeof i=="string")D=sO(i,u,je.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case z:return i=Ur(31,u,l,y),i.elementType=z,i.lanes=w,i;case S:return hs(u.children,y,w,l);case j:D=8,y|=24;break;case C:return i=Ur(12,u,l,y|2),i.elementType=C,i.lanes=w,i;case P:return i=Ur(13,u,l,y),i.elementType=P,i.lanes=w,i;case A:return i=Ur(19,u,l,y),i.elementType=A,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:case T:D=10;break e;case E:D=9;break e;case _:D=11;break e;case k:D=14;break e;case L:D=16,h=null;break e}D=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return l=Ur(D,u,l,y),l.elementType=i,l.type=h,l.lanes=w,l}function hs(i,l,u,h){return i=Ur(7,i,h,l),i.lanes=u,i}function Zm(i,l,u){return i=Ur(6,i,null,l),i.lanes=u,i}function Jm(i,l,u){return l=Ur(4,i.children!==null?i.children:[],i.key,l),l.lanes=u,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var Rl=[],_l=0,uf=null,df=0,oi=[],ai=0,ps=null,Do=1,Ao="";function ms(i,l){Rl[_l++]=df,Rl[_l++]=uf,uf=i,df=l}function e1(i,l,u){oi[ai++]=Do,oi[ai++]=Ao,oi[ai++]=ps,ps=i;var h=Do;i=Ao;var y=32-$t(h)-1;h&=~(1<<y),u+=1;var w=32-$t(l)+y;if(30<w){var D=y-y%5;w=(h&(1<<D)-1).toString(32),h>>=D,y-=D,Do=1<<32-$t(l)+y|u<<y|h,Ao=w+i}else Do=1<<w|u<<y|h,Ao=i}function eg(i){i.return!==null&&(ms(i,1),e1(i,1,0))}function tg(i){for(;i===uf;)uf=Rl[--_l],Rl[_l]=null,df=Rl[--_l],Rl[_l]=null;for(;i===ps;)ps=oi[--ai],oi[ai]=null,Ao=oi[--ai],oi[ai]=null,Do=oi[--ai],oi[ai]=null}var hr=null,Rn=null,Vt=!1,gs=null,Hi=!1,ng=Error(r(519));function vs(i){var l=Error(r(418,""));throw nu(ri(l,i)),ng}function t1(i){var l=i.stateNode,u=i.type,h=i.memoizedProps;switch(l[ve]=i,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<Tu.length;u++)Tt(Tu[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),gS(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Kd(l);break;case"select":Tt("invalid",l);break;case"textarea":Tt("invalid",l),yS(l,h.value,h.defaultValue,h.children),Kd(l)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||yj(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=Hf),l=!0):l=!1,l||vs(i)}function n1(i){for(hr=i.return;hr;)switch(hr.tag){case 5:case 13:Hi=!1;return;case 27:case 3:Hi=!0;return;default:hr=hr.return}}function eu(i){if(i!==hr)return!1;if(!Vt)return n1(i),Vt=!0,!1;var l=i.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||yv(i.type,i.memoizedProps)),u=!u),u&&Rn&&vs(i),n1(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8)if(u=i.data,u==="/$"){if(l===0){Rn=_i(i.nextSibling);break e}l--}else u!=="$"&&u!=="$!"&&u!=="$?"||l++;i=i.nextSibling}Rn=null}}else l===27?(l=Rn,Pa(i.type)?(i=wv,wv=null,Rn=i):Rn=l):Rn=hr?_i(i.stateNode.nextSibling):null;return!0}function tu(){Rn=hr=null,Vt=!1}function r1(){var i=gs;return i!==null&&(Rr===null?Rr=i:Rr.push.apply(Rr,i),gs=null),i}function nu(i){gs===null?gs=[i]:gs.push(i)}var rg=F(null),ys=null,Po=null;function ga(i,l,u){ae(rg,l._currentValue),l._currentValue=u}function ko(i){i._currentValue=rg.current,J(rg)}function ig(i,l,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),i===u)break;i=i.return}}function og(i,l,u,h){var y=i.child;for(y!==null&&(y.return=i);y!==null;){var w=y.dependencies;if(w!==null){var D=y.child;w=w.firstContext;e:for(;w!==null;){var O=w;w=y;for(var U=0;U<l.length;U++)if(O.context===l[U]){w.lanes|=u,O=w.alternate,O!==null&&(O.lanes|=u),ig(w.return,u,i),h||(D=null);break e}w=O.next}}else if(y.tag===18){if(D=y.return,D===null)throw Error(r(341));D.lanes|=u,w=D.alternate,w!==null&&(w.lanes|=u),ig(D,u,i),D=null}else D=y.child;if(D!==null)D.return=y;else for(D=y;D!==null;){if(D===i){D=null;break}if(y=D.sibling,y!==null){y.return=D.return,D=y;break}D=D.return}y=D}}function ru(i,l,u,h){i=null;for(var y=l,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!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 O=y.type;zr(y.pendingProps.value,D.value)||(i!==null?i.push(O):i=[O])}}else if(y===Qe.current){if(D=y.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(i!==null?i.push(ku):i=[ku])}y=y.return}i!==null&&og(l,i,u,h),l.flags|=262144}function ff(i){for(i=i.firstContext;i!==null;){if(!zr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function xs(i){ys=i,Po=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function tr(i){return i1(ys,i)}function hf(i,l){return ys===null&&xs(i),i1(i,l)}function i1(i,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},Po===null){if(i===null)throw Error(r(308));Po=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else Po=Po.next=l;return u}var aN=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){l.aborted=!0,i.forEach(function(u){return u()})}},sN=e.unstable_scheduleCallback,lN=e.unstable_NormalPriority,Fn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ag(){return{controller:new aN,data:new Map,refCount:0}}function iu(i){i.refCount--,i.refCount===0&&sN(lN,function(){i.controller.abort()})}var ou=null,sg=0,Dl=0,Al=null;function cN(i,l){if(ou===null){var u=ou=[];sg=0,Dl=cv(),Al={status:"pending",value:void 0,then:function(h){u.push(h)}}}return sg++,l.then(o1,o1),l}function o1(){if(--sg===0&&ou!==null){Al!==null&&(Al.status="fulfilled");var i=ou;ou=null,Dl=0,Al=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function uN(i,l){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return i.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 a1=M.S;M.S=function(i,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&cN(i,l),a1!==null&&a1(i,l)};var bs=F(null);function lg(){var i=bs.current;return i!==null?i:cn.pooledCache}function pf(i,l){l===null?ae(bs,bs.current):ae(bs,l.pool)}function s1(){var i=lg();return i===null?null:{parent:Fn._currentValue,pool:i}}var au=Error(r(460)),l1=Error(r(474)),mf=Error(r(542)),cg={then:function(){}};function c1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function gf(){}function u1(i,l,u){switch(u=i[u],u===void 0?i.push(l):u!==l&&(l.then(gf,gf),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,f1(i),i;default:if(typeof l.status=="string")l.then(gf,gf);else{if(i=cn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.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 i=l.reason,f1(i),i}throw su=l,au}}var su=null;function d1(){if(su===null)throw Error(r(459));var i=su;return su=null,i}function f1(i){if(i===au||i===mf)throw Error(r(483))}var va=!1;function ug(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dg(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function ya(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function xa(i,l,u){var h=i.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=lf(i),ZS(i,null,u),l}return sf(i,h,l,u),lf(i)}function lu(i,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=i.pendingLanes,u|=h,l.lanes=u,fa(i,u)}}function fg(i,l){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var D={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?y=w=D:w=w.next=D,u=u.next}while(u!==null);w===null?y=w=l:w=w.next=l}else y=w=l;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=l:i.next=l,u.lastBaseUpdate=l}var hg=!1;function cu(){if(hg){var i=Al;if(i!==null)throw i}}function uu(i,l,u,h){hg=!1;var y=i.updateQueue;va=!1;var w=y.firstBaseUpdate,D=y.lastBaseUpdate,O=y.shared.pending;if(O!==null){y.shared.pending=null;var U=O,te=U.next;U.next=null,D===null?w=te:D.next=te,D=U;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,O=fe.lastBaseUpdate,O!==D&&(O===null?fe.firstBaseUpdate=te:O.next=te,fe.lastBaseUpdate=U))}if(w!==null){var me=y.baseState;D=0,fe=te=U=null,O=w;do{var ne=O.lane&-536870913,oe=ne!==O.lane;if(oe?(Nt&ne)===ne:(h&ne)===ne){ne!==0&&ne===Dl&&(hg=!0),fe!==null&&(fe=fe.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var ct=i,at=O;ne=l;var en=u;switch(at.tag){case 1:if(ct=at.payload,typeof ct=="function"){me=ct.call(en,me,ne);break e}me=ct;break e;case 3:ct.flags=ct.flags&-65537|128;case 0:if(ct=at.payload,ne=typeof ct=="function"?ct.call(en,me,ne):ct,ne==null)break e;me=m({},me,ne);break e;case 2:va=!0}}ne=O.callback,ne!==null&&(i.flags|=64,oe&&(i.flags|=8192),oe=y.callbacks,oe===null?y.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:O.tag,payload:O.payload,callback:O.callback,next:null},fe===null?(te=fe=oe,U=me):fe=fe.next=oe,D|=ne;if(O=O.next,O===null){if(O=y.shared.pending,O===null)break;oe=O,O=oe.next,oe.next=null,y.lastBaseUpdate=oe,y.shared.pending=null}}while(!0);fe===null&&(U=me),y.baseState=U,y.firstBaseUpdate=te,y.lastBaseUpdate=fe,w===null&&(y.shared.lanes=0),Ra|=D,i.lanes=D,i.memoizedState=me}}function h1(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function p1(i,l){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)h1(u[i],l)}var Pl=F(null),vf=F(0);function m1(i,l){i=zo,ae(vf,i),ae(Pl,l),zo=i|l.baseLanes}function pg(){ae(vf,zo),ae(Pl,Pl.current)}function mg(){zo=vf.current,J(Pl),J(vf)}var ba=0,St=null,Zt=null,Un=null,yf=!1,kl=!1,Ss=!1,xf=0,du=0,Nl=null,dN=0;function Pn(){throw Error(r(321))}function gg(i,l){if(l===null)return!1;for(var u=0;u<l.length&&u<i.length;u++)if(!zr(i[u],l[u]))return!1;return!0}function vg(i,l,u,h,y,w){return ba=w,St=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=i===null||i.memoizedState===null?Z1:J1,Ss=!1,w=u(h,y),Ss=!1,kl&&(w=v1(l,u,h,y)),g1(i),w}function g1(i){M.H=Ef;var l=Zt!==null&&Zt.next!==null;if(ba=0,Un=Zt=St=null,yf=!1,du=0,Nl=null,l)throw Error(r(300));i===null||Gn||(i=i.dependencies,i!==null&&ff(i)&&(Gn=!0))}function v1(i,l,u,h){St=i;var y=0;do{if(kl&&(Nl=null),du=0,kl=!1,25<=y)throw Error(r(301));if(y+=1,Un=Zt=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}M.H=yN,w=l(u,h)}while(kl);return w}function fN(){var i=M.H,l=i.useState()[0];return l=typeof l.then=="function"?fu(l):l,i=i.useState()[0],(Zt!==null?Zt.memoizedState:null)!==i&&(St.flags|=1024),l}function yg(){var i=xf!==0;return xf=0,i}function xg(i,l,u){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~u}function bg(i){if(yf){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}yf=!1}ba=0,Un=Zt=St=null,kl=!1,du=xf=0,Nl=null}function Er(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Un===null?St.memoizedState=Un=i:Un=Un.next=i,Un}function Bn(){if(Zt===null){var i=St.alternate;i=i!==null?i.memoizedState:null}else i=Zt.next;var l=Un===null?St.memoizedState:Un.next;if(l!==null)Un=l,Zt=i;else{if(i===null)throw St.alternate===null?Error(r(467)):Error(r(310));Zt=i,i={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},Un===null?St.memoizedState=Un=i:Un=Un.next=i}return Un}function Sg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fu(i){var l=du;return du+=1,Nl===null&&(Nl=[]),i=u1(Nl,i,l),l=St,(Un===null?l.memoizedState:Un.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?Z1:J1),i}function bf(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return fu(i);if(i.$$typeof===T)return tr(i)}throw Error(r(438,String(i)))}function wg(i){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(i),h=0;h<i;h++)u[h]=B;return l.index++,u}function No(i,l){return typeof l=="function"?l(i):l}function Sf(i){var l=Bn();return jg(l,Zt,i)}function jg(i,l,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var y=i.baseQueue,w=h.pending;if(w!==null){if(y!==null){var D=y.next;y.next=w.next,w.next=D}l.baseQueue=y=w,h.pending=null}if(w=i.baseState,y===null)i.memoizedState=w;else{l=y.next;var O=D=null,U=null,te=l,fe=!1;do{var me=te.lane&-536870913;if(me!==te.lane?(Nt&me)===me:(ba&me)===me){var ne=te.revertLane;if(ne===0)U!==null&&(U=U.next={lane:0,revertLane:0,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),me===Dl&&(fe=!0);else if((ba&ne)===ne){te=te.next,ne===Dl&&(fe=!0);continue}else me={lane:0,revertLane:te.revertLane,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},U===null?(O=U=me,D=w):U=U.next=me,St.lanes|=ne,Ra|=ne;me=te.action,Ss&&u(w,me),w=te.hasEagerState?te.eagerState:u(w,me)}else ne={lane:me,revertLane:te.revertLane,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},U===null?(O=U=ne,D=w):U=U.next=ne,St.lanes|=me,Ra|=me;te=te.next}while(te!==null&&te!==l);if(U===null?D=w:U.next=O,!zr(w,i.memoizedState)&&(Gn=!0,fe&&(u=Al,u!==null)))throw u;i.memoizedState=w,i.baseState=D,i.baseQueue=U,h.lastRenderedState=w}return y===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function Cg(i){var l=Bn(),u=l.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,y=u.pending,w=l.memoizedState;if(y!==null){u.pending=null;var D=y=y.next;do w=i(w,D.action),D=D.next;while(D!==y);zr(w,l.memoizedState)||(Gn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),u.lastRenderedState=w}return[w,h]}function y1(i,l,u){var h=St,y=Bn(),w=Vt;if(w){if(u===void 0)throw Error(r(407));u=u()}else u=l();var D=!zr((Zt||y).memoizedState,u);D&&(y.memoizedState=u,Gn=!0),y=y.queue;var O=S1.bind(null,h,y,i);if(hu(2048,8,O,[i]),y.getSnapshot!==l||D||Un!==null&&Un.memoizedState.tag&1){if(h.flags|=2048,Ol(9,wf(),b1.bind(null,h,y,u,l),null),cn===null)throw Error(r(349));w||(ba&124)!==0||x1(h,l,u)}return u}function x1(i,l,u){i.flags|=16384,i={getSnapshot:l,value:u},l=St.updateQueue,l===null?(l=Sg(),St.updateQueue=l,l.stores=[i]):(u=l.stores,u===null?l.stores=[i]:u.push(i))}function b1(i,l,u,h){l.value=u,l.getSnapshot=h,w1(l)&&j1(i)}function S1(i,l,u){return u(function(){w1(l)&&j1(i)})}function w1(i){var l=i.getSnapshot;i=i.value;try{var u=l();return!zr(i,u)}catch{return!0}}function j1(i){var l=El(i,2);l!==null&&Hr(l,i,2)}function Eg(i){var l=Er();if(typeof i=="function"){var u=i;if(i=u(),Ss){nn(!0);try{u()}finally{nn(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:i},l}function C1(i,l,u,h){return i.baseState=u,jg(i,Zt,typeof h=="function"?h:No)}function hN(i,l,u,h,y){if(Cf(i))throw Error(r(485));if(i=l.action,i!==null){var w={payload:y,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){w.listeners.push(D)}};M.T!==null?u(!0):w.isTransition=!1,h(w),u=l.pending,u===null?(w.next=l.pending=w,E1(l,w)):(w.next=u.next,l.pending=u.next=w)}}function E1(i,l){var u=l.action,h=l.payload,y=i.state;if(l.isTransition){var w=M.T,D={};M.T=D;try{var O=u(y,h),U=M.S;U!==null&&U(D,O),T1(i,l,O)}catch(te){Tg(i,l,te)}finally{M.T=w}}else try{w=u(y,h),T1(i,l,w)}catch(te){Tg(i,l,te)}}function T1(i,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){R1(i,l,h)},function(h){return Tg(i,l,h)}):R1(i,l,u)}function R1(i,l,u){l.status="fulfilled",l.value=u,_1(l),i.state=u,l=i.pending,l!==null&&(u=l.next,u===l?i.pending=null:(u=u.next,l.next=u,E1(i,u)))}function Tg(i,l,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,_1(l),l=l.next;while(l!==h)}i.action=null}function _1(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function D1(i,l){return l}function A1(i,l){if(Vt){var u=cn.formState;if(u!==null){e:{var h=St;if(Vt){if(Rn){t:{for(var y=Rn,w=Hi;y.nodeType!==8;){if(!w){y=null;break t}if(y=_i(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){Rn=_i(y.nextSibling),h=y.data==="F!";break e}}vs(h)}h=!1}h&&(l=u[0])}}return u=Er(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D1,lastRenderedState:l},u.queue=h,u=Y1.bind(null,St,h),h.dispatch=u,h=Eg(!1),w=Pg.bind(null,St,!1,h.queue),h=Er(),y={state:l,dispatch:null,action:i,pending:null},h.queue=y,u=hN.bind(null,St,y,w,u),y.dispatch=u,h.memoizedState=i,[l,u,!1]}function P1(i){var l=Bn();return k1(l,Zt,i)}function k1(i,l,u){if(l=jg(i,l,D1)[0],i=Sf(No)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=fu(l)}catch(D){throw D===au?mf:D}else h=l;l=Bn();var y=l.queue,w=y.dispatch;return u!==l.memoizedState&&(St.flags|=2048,Ol(9,wf(),pN.bind(null,y,u),null)),[h,w,i]}function pN(i,l){i.action=l}function N1(i){var l=Bn(),u=Zt;if(u!==null)return k1(l,u,i);Bn(),l=l.memoizedState,u=Bn();var h=u.queue.dispatch;return u.memoizedState=i,[l,h,!1]}function Ol(i,l,u,h){return i={tag:i,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=i.next=i:(h=u.next,u.next=i,i.next=h,l.lastEffect=i),i}function wf(){return{destroy:void 0,resource:void 0}}function O1(){return Bn().memoizedState}function jf(i,l,u,h){var y=Er();h=h===void 0?null:h,St.flags|=i,y.memoizedState=Ol(1|l,wf(),u,h)}function hu(i,l,u,h){var y=Bn();h=h===void 0?null:h;var w=y.memoizedState.inst;Zt!==null&&h!==null&&gg(h,Zt.memoizedState.deps)?y.memoizedState=Ol(l,w,u,h):(St.flags|=i,y.memoizedState=Ol(1|l,w,u,h))}function M1(i,l){jf(8390656,8,i,l)}function L1(i,l){hu(2048,8,i,l)}function I1(i,l){return hu(4,2,i,l)}function $1(i,l){return hu(4,4,i,l)}function z1(i,l){if(typeof l=="function"){i=i();var u=l(i);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function U1(i,l,u){u=u!=null?u.concat([i]):null,hu(4,4,z1.bind(null,l,i),u)}function Rg(){}function B1(i,l){var u=Bn();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&gg(l,h[1])?h[0]:(u.memoizedState=[i,l],i)}function V1(i,l){var u=Bn();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&gg(l,h[1]))return h[0];if(h=i(),Ss){nn(!0);try{i()}finally{nn(!1)}}return u.memoizedState=[h,l],h}function _g(i,l,u){return u===void 0||(ba&1073741824)!==0?i.memoizedState=l:(i.memoizedState=u,i=Hw(),St.lanes|=i,Ra|=i,u)}function F1(i,l,u,h){return zr(u,l)?u:Pl.current!==null?(i=_g(i,u,h),zr(i,l)||(Gn=!0),i):(ba&42)===0?(Gn=!0,i.memoizedState=u):(i=Hw(),St.lanes|=i,Ra|=i,l)}function q1(i,l,u,h,y){var w=I.p;I.p=w!==0&&8>w?w:8;var D=M.T,O={};M.T=O,Pg(i,!1,l,u);try{var U=y(),te=M.S;if(te!==null&&te(O,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var fe=uN(U,h);pu(i,l,fe,qr(i))}else pu(i,l,h,qr(i))}catch(me){pu(i,l,{then:function(){},status:"rejected",reason:me},qr())}finally{I.p=w,M.T=D}}function mN(){}function Dg(i,l,u,h){if(i.tag!==5)throw Error(r(476));var y=H1(i).queue;q1(i,y,l,$,u===null?mN:function(){return G1(i),u(h)})}function H1(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:$},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:u},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function G1(i){var l=H1(i).next.queue;pu(i,l,{},qr())}function Ag(){return tr(ku)}function W1(){return Bn().memoizedState}function Q1(){return Bn().memoizedState}function gN(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var u=qr();i=ya(u);var h=xa(l,i,u);h!==null&&(Hr(h,l,u),lu(h,l,u)),l={cache:ag()},i.payload=l;return}l=l.return}}function vN(i,l,u){var h=qr();u={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},Cf(i)?K1(l,u):(u=Km(i,l,u,h),u!==null&&(Hr(u,i,h),X1(u,l,h)))}function Y1(i,l,u){var h=qr();pu(i,l,u,h)}function pu(i,l,u,h){var y={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(Cf(i))K1(l,y);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var D=l.lastRenderedState,O=w(D,u);if(y.hasEagerState=!0,y.eagerState=O,zr(O,D))return sf(i,l,y,0),cn===null&&af(),!1}catch{}finally{}if(u=Km(i,l,y,h),u!==null)return Hr(u,i,h),X1(u,l,h),!0}return!1}function Pg(i,l,u,h){if(h={lane:2,revertLane:cv(),action:h,hasEagerState:!1,eagerState:null,next:null},Cf(i)){if(l)throw Error(r(479))}else l=Km(i,u,h,2),l!==null&&Hr(l,i,2)}function Cf(i){var l=i.alternate;return i===St||l!==null&&l===St}function K1(i,l){kl=yf=!0;var u=i.pending;u===null?l.next=l:(l.next=u.next,u.next=l),i.pending=l}function X1(i,l,u){if((u&4194048)!==0){var h=l.lanes;h&=i.pendingLanes,u|=h,l.lanes=u,fa(i,u)}}var Ef={readContext:tr,use:bf,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},Z1={readContext:tr,use:bf,useCallback:function(i,l){return Er().memoizedState=[i,l===void 0?null:l],i},useContext:tr,useEffect:M1,useImperativeHandle:function(i,l,u){u=u!=null?u.concat([i]):null,jf(4194308,4,z1.bind(null,l,i),u)},useLayoutEffect:function(i,l){return jf(4194308,4,i,l)},useInsertionEffect:function(i,l){jf(4,2,i,l)},useMemo:function(i,l){var u=Er();l=l===void 0?null:l;var h=i();if(Ss){nn(!0);try{i()}finally{nn(!1)}}return u.memoizedState=[h,l],h},useReducer:function(i,l,u){var h=Er();if(u!==void 0){var y=u(l);if(Ss){nn(!0);try{u(l)}finally{nn(!1)}}}else y=l;return h.memoizedState=h.baseState=y,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:y},h.queue=i,i=i.dispatch=vN.bind(null,St,i),[h.memoizedState,i]},useRef:function(i){var l=Er();return i={current:i},l.memoizedState=i},useState:function(i){i=Eg(i);var l=i.queue,u=Y1.bind(null,St,l);return l.dispatch=u,[i.memoizedState,u]},useDebugValue:Rg,useDeferredValue:function(i,l){var u=Er();return _g(u,i,l)},useTransition:function(){var i=Eg(!1);return i=q1.bind(null,St,i.queue,!0,!1),Er().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,u){var h=St,y=Er();if(Vt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=l(),cn===null)throw Error(r(349));(Nt&124)!==0||x1(h,l,u)}y.memoizedState=u;var w={value:u,getSnapshot:l};return y.queue=w,M1(S1.bind(null,h,w,i),[i]),h.flags|=2048,Ol(9,wf(),b1.bind(null,h,w,u,l),null),u},useId:function(){var i=Er(),l=cn.identifierPrefix;if(Vt){var u=Ao,h=Do;u=(h&~(1<<32-$t(h)-1)).toString(32)+u,l="«"+l+"R"+u,u=xf++,0<u&&(l+="H"+u.toString(32)),l+="»"}else u=dN++,l="«"+l+"r"+u.toString(32)+"»";return i.memoizedState=l},useHostTransitionStatus:Ag,useFormState:A1,useActionState:A1,useOptimistic:function(i){var l=Er();l.memoizedState=l.baseState=i;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,[i,l]},useMemoCache:wg,useCacheRefresh:function(){return Er().memoizedState=gN.bind(null,St)}},J1={readContext:tr,use:bf,useCallback:B1,useContext:tr,useEffect:L1,useImperativeHandle:U1,useInsertionEffect:I1,useLayoutEffect:$1,useMemo:V1,useReducer:Sf,useRef:O1,useState:function(){return Sf(No)},useDebugValue:Rg,useDeferredValue:function(i,l){var u=Bn();return F1(u,Zt.memoizedState,i,l)},useTransition:function(){var i=Sf(No)[0],l=Bn().memoizedState;return[typeof i=="boolean"?i:fu(i),l]},useSyncExternalStore:y1,useId:W1,useHostTransitionStatus:Ag,useFormState:P1,useActionState:P1,useOptimistic:function(i,l){var u=Bn();return C1(u,Zt,i,l)},useMemoCache:wg,useCacheRefresh:Q1},yN={readContext:tr,use:bf,useCallback:B1,useContext:tr,useEffect:L1,useImperativeHandle:U1,useInsertionEffect:I1,useLayoutEffect:$1,useMemo:V1,useReducer:Cg,useRef:O1,useState:function(){return Cg(No)},useDebugValue:Rg,useDeferredValue:function(i,l){var u=Bn();return Zt===null?_g(u,i,l):F1(u,Zt.memoizedState,i,l)},useTransition:function(){var i=Cg(No)[0],l=Bn().memoizedState;return[typeof i=="boolean"?i:fu(i),l]},useSyncExternalStore:y1,useId:W1,useHostTransitionStatus:Ag,useFormState:N1,useActionState:N1,useOptimistic:function(i,l){var u=Bn();return Zt!==null?C1(u,Zt,i,l):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:wg,useCacheRefresh:Q1},Ml=null,mu=0;function Tf(i){var l=mu;return mu+=1,Ml===null&&(Ml=[]),u1(Ml,i,l)}function gu(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function Rf(i,l){throw l.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function ew(i){var l=i._init;return l(i._payload)}function tw(i){function l(Q,G){if(i){var ee=Q.deletions;ee===null?(Q.deletions=[G],Q.flags|=16):ee.push(G)}}function u(Q,G){if(!i)return null;for(;G!==null;)l(Q,G),G=G.sibling;return null}function h(Q){for(var G=new Map;Q!==null;)Q.key!==null?G.set(Q.key,Q):G.set(Q.index,Q),Q=Q.sibling;return G}function y(Q,G){return Q=_o(Q,G),Q.index=0,Q.sibling=null,Q}function w(Q,G,ee){return Q.index=ee,i?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<G?(Q.flags|=67108866,G):ee):(Q.flags|=67108866,G)):(Q.flags|=1048576,G)}function D(Q){return i&&Q.alternate===null&&(Q.flags|=67108866),Q}function O(Q,G,ee,he){return G===null||G.tag!==6?(G=Zm(ee,Q.mode,he),G.return=Q,G):(G=y(G,ee),G.return=Q,G)}function U(Q,G,ee,he){var He=ee.type;return He===S?fe(Q,G,ee.props.children,he,ee.key):G!==null&&(G.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===L&&ew(He)===G.type)?(G=y(G,ee.props),gu(G,ee),G.return=Q,G):(G=cf(ee.type,ee.key,ee.props,null,Q.mode,he),gu(G,ee),G.return=Q,G)}function te(Q,G,ee,he){return G===null||G.tag!==4||G.stateNode.containerInfo!==ee.containerInfo||G.stateNode.implementation!==ee.implementation?(G=Jm(ee,Q.mode,he),G.return=Q,G):(G=y(G,ee.children||[]),G.return=Q,G)}function fe(Q,G,ee,he,He){return G===null||G.tag!==7?(G=hs(ee,Q.mode,he,He),G.return=Q,G):(G=y(G,ee),G.return=Q,G)}function me(Q,G,ee){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Zm(""+G,Q.mode,ee),G.return=Q,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case x:return ee=cf(G.type,G.key,G.props,null,Q.mode,ee),gu(ee,G),ee.return=Q,ee;case b:return G=Jm(G,Q.mode,ee),G.return=Q,G;case L:var he=G._init;return G=he(G._payload),me(Q,G,ee)}if(W(G)||K(G))return G=hs(G,Q.mode,ee,null),G.return=Q,G;if(typeof G.then=="function")return me(Q,Tf(G),ee);if(G.$$typeof===T)return me(Q,hf(Q,G),ee);Rf(Q,G)}return null}function ne(Q,G,ee,he){var He=G!==null?G.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return He!==null?null:O(Q,G,""+ee,he);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:return ee.key===He?U(Q,G,ee,he):null;case b:return ee.key===He?te(Q,G,ee,he):null;case L:return He=ee._init,ee=He(ee._payload),ne(Q,G,ee,he)}if(W(ee)||K(ee))return He!==null?null:fe(Q,G,ee,he,null);if(typeof ee.then=="function")return ne(Q,G,Tf(ee),he);if(ee.$$typeof===T)return ne(Q,G,hf(Q,ee),he);Rf(Q,ee)}return null}function oe(Q,G,ee,he,He){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Q=Q.get(ee)||null,O(G,Q,""+he,He);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case x:return Q=Q.get(he.key===null?ee:he.key)||null,U(G,Q,he,He);case b:return Q=Q.get(he.key===null?ee:he.key)||null,te(G,Q,he,He);case L:var jt=he._init;return he=jt(he._payload),oe(Q,G,ee,he,He)}if(W(he)||K(he))return Q=Q.get(ee)||null,fe(G,Q,he,He,null);if(typeof he.then=="function")return oe(Q,G,ee,Tf(he),He);if(he.$$typeof===T)return oe(Q,G,ee,hf(G,he),He);Rf(G,he)}return null}function ct(Q,G,ee,he){for(var He=null,jt=null,tt=G,st=G=0,Qn=null;tt!==null&&st<ee.length;st++){tt.index>st?(Qn=tt,tt=null):Qn=tt.sibling;var zt=ne(Q,tt,ee[st],he);if(zt===null){tt===null&&(tt=Qn);break}i&&tt&&zt.alternate===null&&l(Q,tt),G=w(zt,G,st),jt===null?He=zt:jt.sibling=zt,jt=zt,tt=Qn}if(st===ee.length)return u(Q,tt),Vt&&ms(Q,st),He;if(tt===null){for(;st<ee.length;st++)tt=me(Q,ee[st],he),tt!==null&&(G=w(tt,G,st),jt===null?He=tt:jt.sibling=tt,jt=tt);return Vt&&ms(Q,st),He}for(tt=h(tt);st<ee.length;st++)Qn=oe(tt,Q,st,ee[st],he),Qn!==null&&(i&&Qn.alternate!==null&&tt.delete(Qn.key===null?st:Qn.key),G=w(Qn,G,st),jt===null?He=Qn:jt.sibling=Qn,jt=Qn);return i&&tt.forEach(function(La){return l(Q,La)}),Vt&&ms(Q,st),He}function at(Q,G,ee,he){if(ee==null)throw Error(r(151));for(var He=null,jt=null,tt=G,st=G=0,Qn=null,zt=ee.next();tt!==null&&!zt.done;st++,zt=ee.next()){tt.index>st?(Qn=tt,tt=null):Qn=tt.sibling;var La=ne(Q,tt,zt.value,he);if(La===null){tt===null&&(tt=Qn);break}i&&tt&&La.alternate===null&&l(Q,tt),G=w(La,G,st),jt===null?He=La:jt.sibling=La,jt=La,tt=Qn}if(zt.done)return u(Q,tt),Vt&&ms(Q,st),He;if(tt===null){for(;!zt.done;st++,zt=ee.next())zt=me(Q,zt.value,he),zt!==null&&(G=w(zt,G,st),jt===null?He=zt:jt.sibling=zt,jt=zt);return Vt&&ms(Q,st),He}for(tt=h(tt);!zt.done;st++,zt=ee.next())zt=oe(tt,Q,st,zt.value,he),zt!==null&&(i&&zt.alternate!==null&&tt.delete(zt.key===null?st:zt.key),G=w(zt,G,st),jt===null?He=zt:jt.sibling=zt,jt=zt);return i&&tt.forEach(function(xO){return l(Q,xO)}),Vt&&ms(Q,st),He}function en(Q,G,ee,he){if(typeof ee=="object"&&ee!==null&&ee.type===S&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:e:{for(var He=ee.key;G!==null;){if(G.key===He){if(He=ee.type,He===S){if(G.tag===7){u(Q,G.sibling),he=y(G,ee.props.children),he.return=Q,Q=he;break e}}else if(G.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===L&&ew(He)===G.type){u(Q,G.sibling),he=y(G,ee.props),gu(he,ee),he.return=Q,Q=he;break e}u(Q,G);break}else l(Q,G);G=G.sibling}ee.type===S?(he=hs(ee.props.children,Q.mode,he,ee.key),he.return=Q,Q=he):(he=cf(ee.type,ee.key,ee.props,null,Q.mode,he),gu(he,ee),he.return=Q,Q=he)}return D(Q);case b:e:{for(He=ee.key;G!==null;){if(G.key===He)if(G.tag===4&&G.stateNode.containerInfo===ee.containerInfo&&G.stateNode.implementation===ee.implementation){u(Q,G.sibling),he=y(G,ee.children||[]),he.return=Q,Q=he;break e}else{u(Q,G);break}else l(Q,G);G=G.sibling}he=Jm(ee,Q.mode,he),he.return=Q,Q=he}return D(Q);case L:return He=ee._init,ee=He(ee._payload),en(Q,G,ee,he)}if(W(ee))return ct(Q,G,ee,he);if(K(ee)){if(He=K(ee),typeof He!="function")throw Error(r(150));return ee=He.call(ee),at(Q,G,ee,he)}if(typeof ee.then=="function")return en(Q,G,Tf(ee),he);if(ee.$$typeof===T)return en(Q,G,hf(Q,ee),he);Rf(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,G!==null&&G.tag===6?(u(Q,G.sibling),he=y(G,ee),he.return=Q,Q=he):(u(Q,G),he=Zm(ee,Q.mode,he),he.return=Q,Q=he),D(Q)):u(Q,G)}return function(Q,G,ee,he){try{mu=0;var He=en(Q,G,ee,he);return Ml=null,He}catch(tt){if(tt===au||tt===mf)throw tt;var jt=Ur(29,tt,null,Q.mode);return jt.lanes=he,jt.return=Q,jt}finally{}}}var Ll=tw(!0),nw=tw(!1),si=F(null),Gi=null;function Sa(i){var l=i.alternate;ae(qn,qn.current&1),ae(si,i),Gi===null&&(l===null||Pl.current!==null||l.memoizedState!==null)&&(Gi=i)}function rw(i){if(i.tag===22){if(ae(qn,qn.current),ae(si,i),Gi===null){var l=i.alternate;l!==null&&l.memoizedState!==null&&(Gi=i)}}else wa()}function wa(){ae(qn,qn.current),ae(si,si.current)}function Oo(i){J(si),Gi===i&&(Gi=null),J(qn)}var qn=F(0);function _f(i){for(var l=i;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===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function kg(i,l,u,h){l=i.memoizedState,u=u(h,l),u=u==null?l:m({},l,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Ng={enqueueSetState:function(i,l,u){i=i._reactInternals;var h=qr(),y=ya(h);y.payload=l,u!=null&&(y.callback=u),l=xa(i,y,h),l!==null&&(Hr(l,i,h),lu(l,i,h))},enqueueReplaceState:function(i,l,u){i=i._reactInternals;var h=qr(),y=ya(h);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=xa(i,y,h),l!==null&&(Hr(l,i,h),lu(l,i,h))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var u=qr(),h=ya(u);h.tag=2,l!=null&&(h.callback=l),l=xa(i,h,u),l!==null&&(Hr(l,i,u),lu(l,i,u))}};function iw(i,l,u,h,y,w,D){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,w,D):l.prototype&&l.prototype.isPureReactComponent?!Zc(u,h)||!Zc(y,w):!0}function ow(i,l,u,h){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==i&&Ng.enqueueReplaceState(l,l.state,null)}function ws(i,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(i=i.defaultProps){u===l&&(u=m({},u));for(var y in i)u[y]===void 0&&(u[y]=i[y])}return u}var Df=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function aw(i){Df(i)}function sw(i){console.error(i)}function lw(i){Df(i)}function Af(i,l){try{var u=i.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function cw(i,l,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Og(i,l,u){return u=ya(u),u.tag=3,u.payload={element:null},u.callback=function(){Af(i,l)},u}function uw(i){return i=ya(i),i.tag=3,i}function dw(i,l,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var w=h.value;i.payload=function(){return y(w)},i.callback=function(){cw(l,u,h)}}var D=u.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(i.callback=function(){cw(l,u,h),typeof y!="function"&&(_a===null?_a=new Set([this]):_a.add(this));var O=h.stack;this.componentDidCatch(h.value,{componentStack:O!==null?O:""})})}function xN(i,l,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&ru(l,u,y,!0),u=si.current,u!==null){switch(u.tag){case 13:return Gi===null?iv():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(i,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(i,h,y)),!1}throw Error(r(435,u.tag))}return av(i,h,y),iv(),!1}if(Vt)return l=si.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==ng&&(i=Error(r(422),{cause:h}),nu(ri(i,u)))):(h!==ng&&(l=Error(r(423),{cause:h}),nu(ri(l,u))),i=i.current.alternate,i.flags|=65536,y&=-y,i.lanes|=y,h=ri(h,u),y=Og(i.stateNode,h,y),fg(i,y),_n!==4&&(_n=2)),!1;var w=Error(r(520),{cause:h});if(w=ri(w,u),ju===null?ju=[w]:ju.push(w),_n!==4&&(_n=2),l===null)return!0;h=ri(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,i=y&-y,u.lanes|=i,i=Og(u.stateNode,h,i),fg(u,i),!1;case 1:if(l=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(_a===null||!_a.has(w))))return u.flags|=65536,y&=-y,u.lanes|=y,y=uw(y),dw(y,i,u,h),fg(u,y),!1}u=u.return}while(u!==null);return!1}var fw=Error(r(461)),Gn=!1;function Kn(i,l,u,h){l.child=i===null?nw(l,null,u,h):Ll(l,i.child,u,h)}function hw(i,l,u,h,y){u=u.render;var w=l.ref;if("ref"in h){var D={};for(var O in h)O!=="ref"&&(D[O]=h[O])}else D=h;return xs(l),h=vg(i,l,u,D,w,y),O=yg(),i!==null&&!Gn?(xg(i,l,y),Mo(i,l,y)):(Vt&&O&&eg(l),l.flags|=1,Kn(i,l,h,y),l.child)}function pw(i,l,u,h,y){if(i===null){var w=u.type;return typeof w=="function"&&!Xm(w)&&w.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=w,mw(i,l,w,h,y)):(i=cf(u.type,null,h,l,l.mode,y),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,!Vg(i,y)){var D=w.memoizedProps;if(u=u.compare,u=u!==null?u:Zc,u(D,h)&&i.ref===l.ref)return Mo(i,l,y)}return l.flags|=1,i=_o(w,h),i.ref=l.ref,i.return=l,l.child=i}function mw(i,l,u,h,y){if(i!==null){var w=i.memoizedProps;if(Zc(w,h)&&i.ref===l.ref)if(Gn=!1,l.pendingProps=h=w,Vg(i,y))(i.flags&131072)!==0&&(Gn=!0);else return l.lanes=i.lanes,Mo(i,l,y)}return Mg(i,l,u,h,y)}function gw(i,l,u){var h=l.pendingProps,y=h.children,w=i!==null?i.memoizedState:null;if(h.mode==="hidden"){if((l.flags&128)!==0){if(h=w!==null?w.baseLanes|u:u,i!==null){for(y=l.child=i.child,w=0;y!==null;)w=w|y.lanes|y.childLanes,y=y.sibling;l.childLanes=w&~h}else l.childLanes=0,l.child=null;return vw(i,l,h,u)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&pf(l,w!==null?w.cachePool:null),w!==null?m1(l,w):pg(),rw(l);else return l.lanes=l.childLanes=536870912,vw(i,l,w!==null?w.baseLanes|u:u,u)}else w!==null?(pf(l,w.cachePool),m1(l,w),wa(),l.memoizedState=null):(i!==null&&pf(l,null),pg(),wa());return Kn(i,l,y,u),l.child}function vw(i,l,u,h){var y=lg();return y=y===null?null:{parent:Fn._currentValue,pool:y},l.memoizedState={baseLanes:u,cachePool:y},i!==null&&pf(l,null),pg(),rw(l),i!==null&&ru(i,l,h,!0),null}function Pf(i,l){var u=l.ref;if(u===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(l.flags|=4194816)}}function Mg(i,l,u,h,y){return xs(l),u=vg(i,l,u,h,void 0,y),h=yg(),i!==null&&!Gn?(xg(i,l,y),Mo(i,l,y)):(Vt&&h&&eg(l),l.flags|=1,Kn(i,l,u,y),l.child)}function yw(i,l,u,h,y,w){return xs(l),l.updateQueue=null,u=v1(l,h,u,y),g1(i),h=yg(),i!==null&&!Gn?(xg(i,l,w),Mo(i,l,w)):(Vt&&h&&eg(l),l.flags|=1,Kn(i,l,u,w),l.child)}function xw(i,l,u,h,y){if(xs(l),l.stateNode===null){var w=Tl,D=u.contextType;typeof D=="object"&&D!==null&&(w=tr(D)),w=new u(h,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Ng,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=h,w.state=l.memoizedState,w.refs={},ug(l),D=u.contextType,w.context=typeof D=="object"&&D!==null?tr(D):Tl,w.state=l.memoizedState,D=u.getDerivedStateFromProps,typeof D=="function"&&(kg(l,u,D,h),w.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(D=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),D!==w.state&&Ng.enqueueReplaceState(w,w.state,null),uu(l,h,w,y),cu(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(i===null){w=l.stateNode;var O=l.memoizedProps,U=ws(u,O);w.props=U;var te=w.context,fe=u.contextType;D=Tl,typeof fe=="object"&&fe!==null&&(D=tr(fe));var me=u.getDerivedStateFromProps;fe=typeof me=="function"||typeof w.getSnapshotBeforeUpdate=="function",O=l.pendingProps!==O,fe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O||te!==D)&&ow(l,w,h,D),va=!1;var ne=l.memoizedState;w.state=ne,uu(l,h,w,y),cu(),te=l.memoizedState,O||ne!==te||va?(typeof me=="function"&&(kg(l,u,me,h),te=l.memoizedState),(U=va||iw(l,u,U,h,ne,te,D))?(fe||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=te),w.props=h,w.state=te,w.context=D,h=U):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{w=l.stateNode,dg(i,l),D=l.memoizedProps,fe=ws(u,D),w.props=fe,me=l.pendingProps,ne=w.context,te=u.contextType,U=Tl,typeof te=="object"&&te!==null&&(U=tr(te)),O=u.getDerivedStateFromProps,(te=typeof O=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D!==me||ne!==U)&&ow(l,w,h,U),va=!1,ne=l.memoizedState,w.state=ne,uu(l,h,w,y),cu();var oe=l.memoizedState;D!==me||ne!==oe||va||i!==null&&i.dependencies!==null&&ff(i.dependencies)?(typeof O=="function"&&(kg(l,u,O,h),oe=l.memoizedState),(fe=va||iw(l,u,fe,h,ne,oe,U)||i!==null&&i.dependencies!==null&&ff(i.dependencies))?(te||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,oe,U),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,oe,U)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||D===i.memoizedProps&&ne===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===i.memoizedProps&&ne===i.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=oe),w.props=h,w.state=oe,w.context=U,h=fe):(typeof w.componentDidUpdate!="function"||D===i.memoizedProps&&ne===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===i.memoizedProps&&ne===i.memoizedState||(l.flags|=1024),h=!1)}return w=h,Pf(i,l),h=(l.flags&128)!==0,w||h?(w=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,i!==null&&h?(l.child=Ll(l,i.child,null,y),l.child=Ll(l,null,u,y)):Kn(i,l,u,y),l.memoizedState=w.state,i=l.child):i=Mo(i,l,y),i}function bw(i,l,u,h){return tu(),l.flags|=256,Kn(i,l,u,h),l.child}var Lg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ig(i){return{baseLanes:i,cachePool:s1()}}function $g(i,l,u){return i=i!==null?i.childLanes&~u:0,l&&(i|=li),i}function Sw(i,l,u){var h=l.pendingProps,y=!1,w=(l.flags&128)!==0,D;if((D=w)||(D=i!==null&&i.memoizedState===null?!1:(qn.current&2)!==0),D&&(y=!0,l.flags&=-129),D=(l.flags&32)!==0,l.flags&=-33,i===null){if(Vt){if(y?Sa(l):wa(),Vt){var O=Rn,U;if(U=O){e:{for(U=O,O=Hi;U.nodeType!==8;){if(!O){O=null;break e}if(U=_i(U.nextSibling),U===null){O=null;break e}}O=U}O!==null?(l.memoizedState={dehydrated:O,treeContext:ps!==null?{id:Do,overflow:Ao}:null,retryLane:536870912,hydrationErrors:null},U=Ur(18,null,null,0),U.stateNode=O,U.return=l,l.child=U,hr=l,Rn=null,U=!0):U=!1}U||vs(l)}if(O=l.memoizedState,O!==null&&(O=O.dehydrated,O!==null))return Sv(O)?l.lanes=32:l.lanes=536870912,null;Oo(l)}return O=h.children,h=h.fallback,y?(wa(),y=l.mode,O=kf({mode:"hidden",children:O},y),h=hs(h,y,u,null),O.return=l,h.return=l,O.sibling=h,l.child=O,y=l.child,y.memoizedState=Ig(u),y.childLanes=$g(i,D,u),l.memoizedState=Lg,h):(Sa(l),zg(l,O))}if(U=i.memoizedState,U!==null&&(O=U.dehydrated,O!==null)){if(w)l.flags&256?(Sa(l),l.flags&=-257,l=Ug(i,l,u)):l.memoizedState!==null?(wa(),l.child=i.child,l.flags|=128,l=null):(wa(),y=h.fallback,O=l.mode,h=kf({mode:"visible",children:h.children},O),y=hs(y,O,u,null),y.flags|=2,h.return=l,y.return=l,h.sibling=y,l.child=h,Ll(l,i.child,null,u),h=l.child,h.memoizedState=Ig(u),h.childLanes=$g(i,D,u),l.memoizedState=Lg,l=y);else if(Sa(l),Sv(O)){if(D=O.nextSibling&&O.nextSibling.dataset,D)var te=D.dgst;D=te,h=Error(r(419)),h.stack="",h.digest=D,nu({value:h,source:null,stack:null}),l=Ug(i,l,u)}else if(Gn||ru(i,l,u,!1),D=(u&i.childLanes)!==0,Gn||D){if(D=cn,D!==null&&(h=u&-u,h=(h&42)!==0?1:ls(h),h=(h&(D.suspendedLanes|u))!==0?0:h,h!==0&&h!==U.retryLane))throw U.retryLane=h,El(i,h),Hr(D,i,h),fw;O.data==="$?"||iv(),l=Ug(i,l,u)}else O.data==="$?"?(l.flags|=192,l.child=i.child,l=null):(i=U.treeContext,Rn=_i(O.nextSibling),hr=l,Vt=!0,gs=null,Hi=!1,i!==null&&(oi[ai++]=Do,oi[ai++]=Ao,oi[ai++]=ps,Do=i.id,Ao=i.overflow,ps=l),l=zg(l,h.children),l.flags|=4096);return l}return y?(wa(),y=h.fallback,O=l.mode,U=i.child,te=U.sibling,h=_o(U,{mode:"hidden",children:h.children}),h.subtreeFlags=U.subtreeFlags&65011712,te!==null?y=_o(te,y):(y=hs(y,O,u,null),y.flags|=2),y.return=l,h.return=l,h.sibling=y,l.child=h,h=y,y=l.child,O=i.child.memoizedState,O===null?O=Ig(u):(U=O.cachePool,U!==null?(te=Fn._currentValue,U=U.parent!==te?{parent:te,pool:te}:U):U=s1(),O={baseLanes:O.baseLanes|u,cachePool:U}),y.memoizedState=O,y.childLanes=$g(i,D,u),l.memoizedState=Lg,h):(Sa(l),u=i.child,i=u.sibling,u=_o(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,i!==null&&(D=l.deletions,D===null?(l.deletions=[i],l.flags|=16):D.push(i)),l.child=u,l.memoizedState=null,u)}function zg(i,l){return l=kf({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function kf(i,l){return i=Ur(22,i,null,l),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Ug(i,l,u){return Ll(l,i.child,null,u),i=zg(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function ww(i,l,u){i.lanes|=l;var h=i.alternate;h!==null&&(h.lanes|=l),ig(i.return,l,u)}function Bg(i,l,u,h,y){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=u,w.tailMode=y)}function jw(i,l,u){var h=l.pendingProps,y=h.revealOrder,w=h.tail;if(Kn(i,l,h.children,u),h=qn.current,(h&2)!==0)h=h&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&ww(i,u,l);else if(i.tag===19)ww(i,u,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}switch(ae(qn,h),y){case"forwards":for(u=l.child,y=null;u!==null;)i=u.alternate,i!==null&&_f(i)===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,w);break;case"backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(i=y.alternate,i!==null&&_f(i)===null){l.child=y;break}i=y.sibling,y.sibling=u,u=y,y=i}Bg(l,!0,u,null,w);break;case"together":Bg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Mo(i,l,u){if(i!==null&&(l.dependencies=i.dependencies),Ra|=l.lanes,(u&l.childLanes)===0)if(i!==null){if(ru(i,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(r(153));if(l.child!==null){for(i=l.child,u=_o(i,i.pendingProps),l.child=u,u.return=l;i.sibling!==null;)i=i.sibling,u=u.sibling=_o(i,i.pendingProps),u.return=l;u.sibling=null}return l.child}function Vg(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&ff(i)))}function bN(i,l,u){switch(l.tag){case 3:Ee(l,l.stateNode.containerInfo),ga(l,Fn,i.memoizedState.cache),tu();break;case 27:case 5:nt(l);break;case 4:Ee(l,l.stateNode.containerInfo);break;case 10:ga(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Sa(l),l.flags|=128,null):(u&l.child.childLanes)!==0?Sw(i,l,u):(Sa(l),i=Mo(i,l,u),i!==null?i.sibling:null);Sa(l);break;case 19:var y=(i.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(ru(i,l,u,!1),h=(u&l.childLanes)!==0),y){if(h)return jw(i,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,gw(i,l,u);case 24:ga(l,Fn,i.memoizedState.cache)}return Mo(i,l,u)}function Cw(i,l,u){if(i!==null)if(i.memoizedProps!==l.pendingProps)Gn=!0;else{if(!Vg(i,u)&&(l.flags&128)===0)return Gn=!1,bN(i,l,u);Gn=(i.flags&131072)!==0}else Gn=!1,Vt&&(l.flags&1048576)!==0&&e1(l,df,l.index);switch(l.lanes=0,l.tag){case 16:e:{i=l.pendingProps;var h=l.elementType,y=h._init;if(h=y(h._payload),l.type=h,typeof h=="function")Xm(h)?(i=ws(h,i),l.tag=1,l=xw(null,l,h,i,u)):(l.tag=0,l=Mg(null,l,h,i,u));else{if(h!=null){if(y=h.$$typeof,y===_){l.tag=11,l=hw(null,l,h,i,u);break e}else if(y===k){l.tag=14,l=pw(null,l,h,i,u);break e}}throw l=H(h)||h,Error(r(306,l,""))}}return l;case 0:return Mg(i,l,l.type,l.pendingProps,u);case 1:return h=l.type,y=ws(h,l.pendingProps),xw(i,l,h,y,u);case 3:e:{if(Ee(l,l.stateNode.containerInfo),i===null)throw Error(r(387));h=l.pendingProps;var w=l.memoizedState;y=w.element,dg(i,l),uu(l,h,null,u);var D=l.memoizedState;if(h=D.cache,ga(l,Fn,h),h!==w.cache&&og(l,[Fn],u,!0),cu(),h=D.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:D.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=bw(i,l,h,u);break e}else if(h!==y){y=ri(Error(r(424)),l),nu(y),l=bw(i,l,h,u);break e}else{switch(i=l.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Rn=_i(i.firstChild),hr=l,Vt=!0,gs=null,Hi=!0,u=nw(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(tu(),h===y){l=Mo(i,l,u);break e}Kn(i,l,h,u)}l=l.child}return l;case 26:return Pf(i,l),i===null?(u=_j(l.type,null,l.pendingProps,null))?l.memoizedState=u:Vt||(u=l.type,i=l.pendingProps,h=Gf(we.current).createElement(u),h[ve]=l,h[Te]=i,Zn(h,u,i),mt(h),l.stateNode=h):l.memoizedState=_j(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return nt(l),i===null&&Vt&&(h=l.stateNode=Ej(l.type,l.pendingProps,we.current),hr=l,Hi=!0,y=Rn,Pa(l.type)?(wv=y,Rn=_i(h.firstChild)):Rn=y),Kn(i,l,l.pendingProps.children,u),Pf(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&Vt&&((y=h=Rn)&&(h=QN(h,l.type,l.pendingProps,Hi),h!==null?(l.stateNode=h,hr=l,Rn=_i(h.firstChild),Hi=!1,y=!0):y=!1),y||vs(l)),nt(l),y=l.type,w=l.pendingProps,D=i!==null?i.memoizedProps:null,h=w.children,yv(y,w)?h=null:D!==null&&yv(y,D)&&(l.flags|=32),l.memoizedState!==null&&(y=vg(i,l,fN,null,null,u),ku._currentValue=y),Pf(i,l),Kn(i,l,h,u),l.child;case 6:return i===null&&Vt&&((i=u=Rn)&&(u=YN(u,l.pendingProps,Hi),u!==null?(l.stateNode=u,hr=l,Rn=null,i=!0):i=!1),i||vs(l)),null;case 13:return Sw(i,l,u);case 4:return Ee(l,l.stateNode.containerInfo),h=l.pendingProps,i===null?l.child=Ll(l,null,h,u):Kn(i,l,h,u),l.child;case 11:return hw(i,l,l.type,l.pendingProps,u);case 7:return Kn(i,l,l.pendingProps,u),l.child;case 8:return Kn(i,l,l.pendingProps.children,u),l.child;case 12:return Kn(i,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,ga(l,l.type,h.value),Kn(i,l,h.children,u),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,xs(l),y=tr(y),h=h(y),l.flags|=1,Kn(i,l,h,u),l.child;case 14:return pw(i,l,l.type,l.pendingProps,u);case 15:return mw(i,l,l.type,l.pendingProps,u);case 19:return jw(i,l,u);case 31:return h=l.pendingProps,u=l.mode,h={mode:h.mode,children:h.children},i===null?(u=kf(h,u),u.ref=l.ref,l.child=u,u.return=l,l=u):(u=_o(i.child,h),u.ref=l.ref,l.child=u,u.return=l,l=u),l;case 22:return gw(i,l,u);case 24:return xs(l),h=tr(Fn),i===null?(y=lg(),y===null&&(y=cn,w=ag(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=u),y=w),l.memoizedState={parent:h,cache:y},ug(l),ga(l,Fn,y)):((i.lanes&u)!==0&&(dg(i,l),uu(l,null,null,u),cu()),y=i.memoizedState,w=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),ga(l,Fn,h)):(h=w.cache,ga(l,Fn,h),h!==y.cache&&og(l,[Fn],u,!0))),Kn(i,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Lo(i){i.flags|=4}function Ew(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Nj(l)){if(l=si.current,l!==null&&((Nt&4194048)===Nt?Gi!==null:(Nt&62914560)!==Nt&&(Nt&536870912)===0||l!==Gi))throw su=cg,l1;i.flags|=8192}}function Nf(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?da():536870912,i.lanes|=l,Ul|=l)}function vu(i,l){if(!Vt)switch(i.tailMode){case"hidden":l=i.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function Cn(i){var l=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(l)for(var y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=i,y=y.sibling;else for(y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=i,y=y.sibling;return i.subtreeFlags|=h,i.childLanes=u,l}function SN(i,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,i!==null&&(h=i.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),ko(Fn),ot(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(eu(l)?Lo(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,r1())),Cn(l),null;case 26:return u=l.memoizedState,i===null?(Lo(l),u!==null?(Cn(l),Ew(l,u)):(Cn(l),l.flags&=-16777217)):u?u!==i.memoizedState?(Lo(l),Cn(l),Ew(l,u)):(Cn(l),l.flags&=-16777217):(i.memoizedProps!==h&&Lo(l),Cn(l),l.flags&=-16777217),null;case 27:Ct(l),u=we.current;var y=l.type;if(i!==null&&l.stateNode!=null)i.memoizedProps!==h&&Lo(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return Cn(l),null}i=je.current,eu(l)?t1(l):(i=Ej(y,h,u),l.stateNode=i,Lo(l))}return Cn(l),null;case 5:if(Ct(l),u=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&Lo(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return Cn(l),null}if(i=je.current,eu(l))t1(l);else{switch(y=Gf(we.current),i){case 1:i=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:i=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":i=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":i=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":i=y.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?i.multiple=!0:h.size&&(i.size=h.size);break;default:i=typeof h.is=="string"?y.createElement(u,{is:h.is}):y.createElement(u)}}i[ve]=l,i[Te]=h;e:for(y=l.child;y!==null;){if(y.tag===5||y.tag===6)i.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=i;e:switch(Zn(i,u,h),u){case"button":case"input":case"select":case"textarea":i=!!h.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Lo(l)}}return Cn(l),l.flags&=-16777217,null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==h&&Lo(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(i=we.current,eu(l)){if(i=l.stateNode,u=l.memoizedProps,h=null,y=hr,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}i[ve]=l,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||yj(i.nodeValue,u)),i||vs(l)}else i=Gf(i).createTextNode(h),i[ve]=l,l.stateNode=i}return Cn(l),null;case 13:if(h=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(y=eu(l),h!==null&&h.dehydrated!==null){if(i===null){if(!y)throw Error(r(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[ve]=l}else tu(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Cn(l),y=!1}else y=r1(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Oo(l),l):(Oo(l),null)}if(Oo(l),(l.flags&128)!==0)return l.lanes=u,l;if(u=h!==null,i=i!==null&&i.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 w=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==y&&(h.flags|=2048)}return u!==i&&u&&(l.child.flags|=8192),Nf(l,l.updateQueue),Cn(l),null;case 4:return ot(),i===null&&hv(l.stateNode.containerInfo),Cn(l),null;case 10:return ko(l.type),Cn(l),null;case 19:if(J(qn),y=l.memoizedState,y===null)return Cn(l),null;if(h=(l.flags&128)!==0,w=y.rendering,w===null)if(h)vu(y,!1);else{if(_n!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(w=_f(i),w!==null){for(l.flags|=128,vu(y,!1),i=w.updateQueue,l.updateQueue=i,Nf(l,i),l.subtreeFlags=0,i=u,u=l.child;u!==null;)JS(u,i),u=u.sibling;return ae(qn,qn.current&1|2),l.child}i=i.sibling}y.tail!==null&&Re()>Lf&&(l.flags|=128,h=!0,vu(y,!1),l.lanes=4194304)}else{if(!h)if(i=_f(w),i!==null){if(l.flags|=128,h=!0,i=i.updateQueue,l.updateQueue=i,Nf(l,i),vu(y,!0),y.tail===null&&y.tailMode==="hidden"&&!w.alternate&&!Vt)return Cn(l),null}else 2*Re()-y.renderingStartTime>Lf&&u!==536870912&&(l.flags|=128,h=!0,vu(y,!1),l.lanes=4194304);y.isBackwards?(w.sibling=l.child,l.child=w):(i=y.last,i!==null?i.sibling=w:l.child=w,y.last=w)}return y.tail!==null?(l=y.tail,y.rendering=l,y.tail=l.sibling,y.renderingStartTime=Re(),l.sibling=null,i=qn.current,ae(qn,h?i&1|2:i&1),l):(Cn(l),null);case 22:case 23:return Oo(l),mg(),h=l.memoizedState!==null,i!==null?i.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&&Nf(l,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),i!==null&&J(bs),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),ko(Fn),Cn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function wN(i,l){switch(tg(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return ko(Fn),ot(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return Ct(l),null;case 13:if(Oo(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));tu()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return J(qn),null;case 4:return ot(),null;case 10:return ko(l.type),null;case 22:case 23:return Oo(l),mg(),i!==null&&J(bs),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return ko(Fn),null;case 25:return null;default:return null}}function Tw(i,l){switch(tg(l),l.tag){case 3:ko(Fn),ot();break;case 26:case 27:case 5:Ct(l);break;case 4:ot();break;case 13:Oo(l);break;case 19:J(qn);break;case 10:ko(l.type);break;case 22:case 23:Oo(l),mg(),i!==null&&J(bs);break;case 24:ko(Fn)}}function yu(i,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&i)===i){h=void 0;var w=u.create,D=u.inst;h=w(),D.destroy=h}u=u.next}while(u!==y)}}catch(O){rn(l,l.return,O)}}function ja(i,l,u){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var w=y.next;h=w;do{if((h.tag&i)===i){var D=h.inst,O=D.destroy;if(O!==void 0){D.destroy=void 0,y=l;var U=u,te=O;try{te()}catch(fe){rn(y,U,fe)}}}h=h.next}while(h!==w)}}catch(fe){rn(l,l.return,fe)}}function Rw(i){var l=i.updateQueue;if(l!==null){var u=i.stateNode;try{p1(l,u)}catch(h){rn(i,i.return,h)}}}function _w(i,l,u){u.props=ws(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){rn(i,l,h)}}function xu(i,l){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(y){rn(i,l,y)}}function Wi(i,l){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){rn(i,l,y)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){rn(i,l,y)}else u.current=null}function Dw(i){var l=i.type,u=i.memoizedProps,h=i.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(i,i.return,y)}}function Fg(i,l,u){try{var h=i.stateNode;FN(h,i.type,u,l),h[Te]=l}catch(y){rn(i,i.return,y)}}function Aw(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Pa(i.type)||i.tag===4}function qg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Aw(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Pa(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Hg(i,l,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(i),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=Hf));else if(h!==4&&(h===27&&Pa(i.type)&&(u=i.stateNode,l=null),i=i.child,i!==null))for(Hg(i,l,u),i=i.sibling;i!==null;)Hg(i,l,u),i=i.sibling}function Of(i,l,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?u.insertBefore(i,l):u.appendChild(i);else if(h!==4&&(h===27&&Pa(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Of(i,l,u),i=i.sibling;i!==null;)Of(i,l,u),i=i.sibling}function Pw(i){var l=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Zn(l,h,u),l[ve]=i,l[Te]=u}catch(w){rn(i,i.return,w)}}var Io=!1,kn=!1,Gg=!1,kw=typeof WeakSet=="function"?WeakSet:Set,Wn=null;function jN(i,l){if(i=i.containerInfo,gv=Zf,i=FS(i),qm(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var D=0,O=-1,U=-1,te=0,fe=0,me=i,ne=null;t:for(;;){for(var oe;me!==u||y!==0&&me.nodeType!==3||(O=D+y),me!==w||h!==0&&me.nodeType!==3||(U=D+h),me.nodeType===3&&(D+=me.nodeValue.length),(oe=me.firstChild)!==null;)ne=me,me=oe;for(;;){if(me===i)break t;if(ne===u&&++te===y&&(O=D),ne===w&&++fe===h&&(U=D),(oe=me.nextSibling)!==null)break;me=ne,ne=me.parentNode}me=oe}u=O===-1||U===-1?null:{start:O,end:U}}else u=null}u=u||{start:0,end:0}}else u=null;for(vv={focusedElem:i,selectionRange:u},Zf=!1,Wn=l;Wn!==null;)if(l=Wn,i=l.child,(l.subtreeFlags&1024)!==0&&i!==null)i.return=l,Wn=i;else for(;Wn!==null;){switch(l=Wn,w=l.alternate,i=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,u=l,y=w.memoizedProps,w=w.memoizedState,h=u.stateNode;try{var ct=ws(u.type,y,u.elementType===u.type);i=h.getSnapshotBeforeUpdate(ct,w),h.__reactInternalSnapshotBeforeUpdate=i}catch(at){rn(u,u.return,at)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,u=i.nodeType,u===9)bv(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":bv(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=l.sibling,i!==null){i.return=l.return,Wn=i;break}Wn=l.return}}function Nw(i,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Ca(i,u),h&4&&yu(5,u);break;case 1:if(Ca(i,u),h&4)if(i=u.stateNode,l===null)try{i.componentDidMount()}catch(D){rn(u,u.return,D)}else{var y=ws(u.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(y,l,i.__reactInternalSnapshotBeforeUpdate)}catch(D){rn(u,u.return,D)}}h&64&&Rw(u),h&512&&xu(u,u.return);break;case 3:if(Ca(i,u),h&64&&(i=u.updateQueue,i!==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{p1(i,l)}catch(D){rn(u,u.return,D)}}break;case 27:l===null&&h&4&&Pw(u);case 26:case 5:Ca(i,u),l===null&&h&4&&Dw(u),h&512&&xu(u,u.return);break;case 12:Ca(i,u);break;case 13:Ca(i,u),h&4&&Lw(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=kN.bind(null,u),KN(i,u))));break;case 22:if(h=u.memoizedState!==null||Io,!h){l=l!==null&&l.memoizedState!==null||kn,y=Io;var w=kn;Io=h,(kn=l)&&!w?Ea(i,u,(u.subtreeFlags&8772)!==0):Ca(i,u),Io=y,kn=w}break;case 30:break;default:Ca(i,u)}}function Ow(i){var l=i.alternate;l!==null&&(i.alternate=null,Ow(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&Ke(l)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var yn=null,Tr=!1;function $o(i,l,u){for(u=u.child;u!==null;)Mw(i,l,u),u=u.sibling}function Mw(i,l,u){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Dt,u)}catch{}switch(u.tag){case 26:kn||Wi(u,l),$o(i,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:kn||Wi(u,l);var h=yn,y=Tr;Pa(u.type)&&(yn=u.stateNode,Tr=!1),$o(i,l,u),_u(u.stateNode),yn=h,Tr=y;break;case 5:kn||Wi(u,l);case 6:if(h=yn,y=Tr,yn=null,$o(i,l,u),yn=h,Tr=y,yn!==null)if(Tr)try{(yn.nodeType===9?yn.body:yn.nodeName==="HTML"?yn.ownerDocument.body:yn).removeChild(u.stateNode)}catch(w){rn(u,l,w)}else try{yn.removeChild(u.stateNode)}catch(w){rn(u,l,w)}break;case 18:yn!==null&&(Tr?(i=yn,jj(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Lu(i)):jj(yn,u.stateNode));break;case 4:h=yn,y=Tr,yn=u.stateNode.containerInfo,Tr=!0,$o(i,l,u),yn=h,Tr=y;break;case 0:case 11:case 14:case 15:kn||ja(2,u,l),kn||ja(4,u,l),$o(i,l,u);break;case 1:kn||(Wi(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&_w(u,l,h)),$o(i,l,u);break;case 21:$o(i,l,u);break;case 22:kn=(h=kn)||u.memoizedState!==null,$o(i,l,u),kn=h;break;default:$o(i,l,u)}}function Lw(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Lu(i)}catch(u){rn(l,l.return,u)}}function CN(i){switch(i.tag){case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new kw),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new kw),l;default:throw Error(r(435,i.tag))}}function Wg(i,l){var u=CN(i);l.forEach(function(h){var y=NN.bind(null,i,h);u.has(h)||(u.add(h),h.then(y,y))})}function Br(i,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],w=i,D=l,O=D;e:for(;O!==null;){switch(O.tag){case 27:if(Pa(O.type)){yn=O.stateNode,Tr=!1;break e}break;case 5:yn=O.stateNode,Tr=!1;break e;case 3:case 4:yn=O.stateNode.containerInfo,Tr=!0;break e}O=O.return}if(yn===null)throw Error(r(160));Mw(w,D,y),yn=null,Tr=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Iw(l,i),l=l.sibling}var Ri=null;function Iw(i,l){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Br(l,i),Vr(i),h&4&&(ja(3,i,i.return),yu(3,i),ja(5,i,i.return));break;case 1:Br(l,i),Vr(i),h&512&&(kn||u===null||Wi(u,u.return)),h&64&&Io&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=Ri;if(Br(l,i),Vr(i),h&512&&(kn||u===null||Wi(u,u.return)),h&4){var w=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":w=y.getElementsByTagName("title")[0],(!w||w[qe]||w[ve]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(h),y.head.insertBefore(w,y.querySelector("head > title"))),Zn(w,h,u),w[ve]=i,mt(w),h=w;break e;case"link":var D=Pj("link","href",y).get(h+(u.href||""));if(D){for(var O=0;O<D.length;O++)if(w=D[O],w.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&w.getAttribute("rel")===(u.rel==null?null:u.rel)&&w.getAttribute("title")===(u.title==null?null:u.title)&&w.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){D.splice(O,1);break t}}w=y.createElement(h),Zn(w,h,u),y.head.appendChild(w);break;case"meta":if(D=Pj("meta","content",y).get(h+(u.content||""))){for(O=0;O<D.length;O++)if(w=D[O],w.getAttribute("content")===(u.content==null?null:""+u.content)&&w.getAttribute("name")===(u.name==null?null:u.name)&&w.getAttribute("property")===(u.property==null?null:u.property)&&w.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&w.getAttribute("charset")===(u.charSet==null?null:u.charSet)){D.splice(O,1);break t}}w=y.createElement(h),Zn(w,h,u),y.head.appendChild(w);break;default:throw Error(r(468,h))}w[ve]=i,mt(w),h=w}i.stateNode=h}else kj(y,i.type,i.stateNode);else i.stateNode=Aj(y,h,i.memoizedProps);else w!==h?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,h===null?kj(y,i.type,i.stateNode):Aj(y,h,i.memoizedProps)):h===null&&i.stateNode!==null&&Fg(i,i.memoizedProps,u.memoizedProps)}break;case 27:Br(l,i),Vr(i),h&512&&(kn||u===null||Wi(u,u.return)),u!==null&&h&4&&Fg(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Br(l,i),Vr(i),h&512&&(kn||u===null||Wi(u,u.return)),i.flags&32){y=i.stateNode;try{yl(y,"")}catch(oe){rn(i,i.return,oe)}}h&4&&i.stateNode!=null&&(y=i.memoizedProps,Fg(i,y,u!==null?u.memoizedProps:y)),h&1024&&(Gg=!0);break;case 6:if(Br(l,i),Vr(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(oe){rn(i,i.return,oe)}}break;case 3:if(Yf=null,y=Ri,Ri=Wf(l.containerInfo),Br(l,i),Ri=y,Vr(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Lu(l.containerInfo)}catch(oe){rn(i,i.return,oe)}Gg&&(Gg=!1,$w(i));break;case 4:h=Ri,Ri=Wf(i.stateNode.containerInfo),Br(l,i),Vr(i),Ri=h;break;case 12:Br(l,i),Vr(i);break;case 13:Br(l,i),Vr(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Jg=Re()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Wg(i,h)));break;case 22:y=i.memoizedState!==null;var U=u!==null&&u.memoizedState!==null,te=Io,fe=kn;if(Io=te||y,kn=fe||U,Br(l,i),kn=fe,Io=te,Vr(i),h&8192)e:for(l=i.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||U||Io||kn||js(i)),u=null,l=i;;){if(l.tag===5||l.tag===26){if(u===null){U=u=l;try{if(w=U.stateNode,y)D=w.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{O=U.stateNode;var me=U.memoizedProps.style,ne=me!=null&&me.hasOwnProperty("display")?me.display:null;O.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(oe){rn(U,U.return,oe)}}}else if(l.tag===6){if(u===null){U=l;try{U.stateNode.nodeValue=y?"":U.memoizedProps}catch(oe){rn(U,U.return,oe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Wg(i,u))));break;case 19:Br(l,i),Vr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Wg(i,h)));break;case 30:break;case 21:break;default:Br(l,i),Vr(i)}}function Vr(i){var l=i.flags;if(l&2){try{for(var u,h=i.return;h!==null;){if(Aw(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,w=qg(i);Of(i,w,y);break;case 5:var D=u.stateNode;u.flags&32&&(yl(D,""),u.flags&=-33);var O=qg(i);Of(i,O,D);break;case 3:case 4:var U=u.stateNode.containerInfo,te=qg(i);Hg(i,te,U);break;default:throw Error(r(161))}}catch(fe){rn(i,i.return,fe)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function $w(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;$w(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function Ca(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Nw(i,l.alternate,l),l=l.sibling}function js(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:ja(4,l,l.return),js(l);break;case 1:Wi(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&_w(l,l.return,u),js(l);break;case 27:_u(l.stateNode);case 26:case 5:Wi(l,l.return),js(l);break;case 22:l.memoizedState===null&&js(l);break;case 30:js(l);break;default:js(l)}i=i.sibling}}function Ea(i,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=i,w=l,D=w.flags;switch(w.tag){case 0:case 11:case 15:Ea(y,w,u),yu(4,w);break;case 1:if(Ea(y,w,u),h=w,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(te){rn(h,h.return,te)}if(h=w,y=h.updateQueue,y!==null){var O=h.stateNode;try{var U=y.shared.hiddenCallbacks;if(U!==null)for(y.shared.hiddenCallbacks=null,y=0;y<U.length;y++)h1(U[y],O)}catch(te){rn(h,h.return,te)}}u&&D&64&&Rw(w),xu(w,w.return);break;case 27:Pw(w);case 26:case 5:Ea(y,w,u),u&&h===null&&D&4&&Dw(w),xu(w,w.return);break;case 12:Ea(y,w,u);break;case 13:Ea(y,w,u),u&&D&4&&Lw(y,w);break;case 22:w.memoizedState===null&&Ea(y,w,u),xu(w,w.return);break;case 30:break;default:Ea(y,w,u)}l=l.sibling}}function Qg(i,l){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&iu(u))}function Yg(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&iu(i))}function Qi(i,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)zw(i,l,u,h),l=l.sibling}function zw(i,l,u,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:Qi(i,l,u,h),y&2048&&yu(9,l);break;case 1:Qi(i,l,u,h);break;case 3:Qi(i,l,u,h),y&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&iu(i)));break;case 12:if(y&2048){Qi(i,l,u,h),i=l.stateNode;try{var w=l.memoizedProps,D=w.id,O=w.onPostCommit;typeof O=="function"&&O(D,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(U){rn(l,l.return,U)}}else Qi(i,l,u,h);break;case 13:Qi(i,l,u,h);break;case 23:break;case 22:w=l.stateNode,D=l.alternate,l.memoizedState!==null?w._visibility&2?Qi(i,l,u,h):bu(i,l):w._visibility&2?Qi(i,l,u,h):(w._visibility|=2,Il(i,l,u,h,(l.subtreeFlags&10256)!==0)),y&2048&&Qg(D,l);break;case 24:Qi(i,l,u,h),y&2048&&Yg(l.alternate,l);break;default:Qi(i,l,u,h)}}function Il(i,l,u,h,y){for(y=y&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var w=i,D=l,O=u,U=h,te=D.flags;switch(D.tag){case 0:case 11:case 15:Il(w,D,O,U,y),yu(8,D);break;case 23:break;case 22:var fe=D.stateNode;D.memoizedState!==null?fe._visibility&2?Il(w,D,O,U,y):bu(w,D):(fe._visibility|=2,Il(w,D,O,U,y)),y&&te&2048&&Qg(D.alternate,D);break;case 24:Il(w,D,O,U,y),y&&te&2048&&Yg(D.alternate,D);break;default:Il(w,D,O,U,y)}l=l.sibling}}function bu(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=i,h=l,y=h.flags;switch(h.tag){case 22:bu(u,h),y&2048&&Qg(h.alternate,h);break;case 24:bu(u,h),y&2048&&Yg(h.alternate,h);break;default:bu(u,h)}l=l.sibling}}var Su=8192;function $l(i){if(i.subtreeFlags&Su)for(i=i.child;i!==null;)Uw(i),i=i.sibling}function Uw(i){switch(i.tag){case 26:$l(i),i.flags&Su&&i.memoizedState!==null&&cO(Ri,i.memoizedState,i.memoizedProps);break;case 5:$l(i);break;case 3:case 4:var l=Ri;Ri=Wf(i.stateNode.containerInfo),$l(i),Ri=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=Su,Su=16777216,$l(i),Su=l):$l(i));break;default:$l(i)}}function Bw(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function wu(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wn=h,Fw(h,i)}Bw(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Vw(i),i=i.sibling}function Vw(i){switch(i.tag){case 0:case 11:case 15:wu(i),i.flags&2048&&ja(9,i,i.return);break;case 3:wu(i);break;case 12:wu(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,Mf(i)):wu(i);break;default:wu(i)}}function Mf(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wn=h,Fw(h,i)}Bw(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:ja(8,l,l.return),Mf(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Mf(l));break;default:Mf(l)}i=i.sibling}}function Fw(i,l){for(;Wn!==null;){var u=Wn;switch(u.tag){case 0:case 11:case 15:ja(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:iu(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Wn=h;else e:for(u=i;Wn!==null;){h=Wn;var y=h.sibling,w=h.return;if(Ow(h),h===u){Wn=null;break e}if(y!==null){y.return=w,Wn=y;break e}Wn=w}}}var EN={getCacheForType:function(i){var l=tr(Fn),u=l.data.get(i);return u===void 0&&(u=i(),l.data.set(i,u)),u}},TN=typeof WeakMap=="function"?WeakMap:Map,Wt=0,cn=null,Et=null,Nt=0,Qt=0,Fr=null,Ta=!1,zl=!1,Kg=!1,zo=0,_n=0,Ra=0,Cs=0,Xg=0,li=0,Ul=0,ju=null,Rr=null,Zg=!1,Jg=0,Lf=1/0,If=null,_a=null,Xn=0,Da=null,Bl=null,Vl=0,ev=0,tv=null,qw=null,Cu=0,nv=null;function qr(){if((Wt&2)!==0&&Nt!==0)return Nt&-Nt;if(M.T!==null){var i=Dl;return i!==0?i:cv()}return V()}function Hw(){li===0&&(li=(Nt&536870912)===0||Vt?So():536870912);var i=si.current;return i!==null&&(i.flags|=32),li}function Hr(i,l,u){(i===cn&&(Qt===2||Qt===9)||i.cancelPendingCommit!==null)&&(Fl(i,0),Aa(i,Nt,li,!1)),wr(i,u),((Wt&2)===0||i!==cn)&&(i===cn&&((Wt&2)===0&&(Cs|=u),_n===4&&Aa(i,Nt,li,!1)),Yi(i))}function Gw(i,l,u){if((Wt&6)!==0)throw Error(r(327));var h=!u&&(l&124)===0&&(l&i.expiredLanes)===0||Jr(i,l),y=h?DN(i,l):ov(i,l,!0),w=h;do{if(y===0){zl&&!h&&Aa(i,l,0,!1);break}else{if(u=i.current.alternate,w&&!RN(u)){y=ov(i,l,!1),w=!1;continue}if(y===2){if(w=l,i.errorRecoveryDisabledLanes&w)var D=0;else D=i.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){l=D;e:{var O=i;y=ju;var U=O.current.memoizedState.isDehydrated;if(U&&(Fl(O,D).flags|=256),D=ov(O,D,!1),D!==2){if(Kg&&!U){O.errorRecoveryDisabledLanes|=w,Cs|=w,y=4;break e}w=Rr,Rr=y,w!==null&&(Rr===null?Rr=w:Rr.push.apply(Rr,w))}y=D}if(w=!1,y!==2)continue}}if(y===1){Fl(i,0),Aa(i,l,0,!0);break}e:{switch(h=i,w=y,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Aa(h,l,li,!Ta);break e;case 2:Rr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(y=Jg+300-Re(),10<y)){if(Aa(h,l,li,!Ta),bo(h,0,!0)!==0)break e;h.timeoutHandle=Sj(Ww.bind(null,h,u,Rr,If,Zg,l,li,Cs,Ul,Ta,w,2,-0,0),y);break e}Ww(h,u,Rr,If,Zg,l,li,Cs,Ul,Ta,w,0,-0,0)}}break}while(!0);Yi(i)}function Ww(i,l,u,h,y,w,D,O,U,te,fe,me,ne,oe){if(i.timeoutHandle=-1,me=l.subtreeFlags,(me&8192||(me&16785408)===16785408)&&(Pu={stylesheets:null,count:0,unsuspend:lO},Uw(l),me=uO(),me!==null)){i.cancelPendingCommit=me(ej.bind(null,i,l,w,u,h,y,D,O,U,fe,1,ne,oe)),Aa(i,w,D,!te);return}ej(i,l,w,u,h,y,D,O,U)}function RN(i){for(var l=i;;){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],w=y.getSnapshot;y=y.value;try{if(!zr(w(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Aa(i,l,u,h){l&=~Xg,l&=~Cs,i.suspendedLanes|=l,i.pingedLanes&=~l,h&&(i.warmLanes|=l),h=i.expirationTimes;for(var y=l;0<y;){var w=31-$t(y),D=1<<w;h[w]=-1,y&=~D}u!==0&&wo(i,u,l)}function $f(){return(Wt&6)===0?(Eu(0),!1):!0}function rv(){if(Et!==null){if(Qt===0)var i=Et.return;else i=Et,Po=ys=null,bg(i),Ml=null,mu=0,i=Et;for(;i!==null;)Tw(i.alternate,i),i=i.return;Et=null}}function Fl(i,l){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,HN(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),rv(),cn=i,Et=u=_o(i.current,null),Nt=l,Qt=0,Fr=null,Ta=!1,zl=Jr(i,l),Kg=!1,Ul=li=Xg=Cs=Ra=_n=0,Rr=ju=null,Zg=!1,(l&8)!==0&&(l|=l&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=l;0<h;){var y=31-$t(h),w=1<<y;l|=i[y],h&=~w}return zo=l,af(),u}function Qw(i,l){St=null,M.H=Ef,l===au||l===mf?(l=d1(),Qt=3):l===l1?(l=d1(),Qt=4):Qt=l===fw?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Fr=l,Et===null&&(_n=1,Af(i,ri(l,i.current)))}function Yw(){var i=M.H;return M.H=Ef,i===null?Ef:i}function Kw(){var i=M.A;return M.A=EN,i}function iv(){_n=4,Ta||(Nt&4194048)!==Nt&&si.current!==null||(zl=!0),(Ra&134217727)===0&&(Cs&134217727)===0||cn===null||Aa(cn,Nt,li,!1)}function ov(i,l,u){var h=Wt;Wt|=2;var y=Yw(),w=Kw();(cn!==i||Nt!==l)&&(If=null,Fl(i,l)),l=!1;var D=_n;e:do try{if(Qt!==0&&Et!==null){var O=Et,U=Fr;switch(Qt){case 8:rv(),D=6;break e;case 3:case 2:case 9:case 6:si.current===null&&(l=!0);var te=Qt;if(Qt=0,Fr=null,ql(i,O,U,te),u&&zl){D=0;break e}break;default:te=Qt,Qt=0,Fr=null,ql(i,O,U,te)}}_N(),D=_n;break}catch(fe){Qw(i,fe)}while(!0);return l&&i.shellSuspendCounter++,Po=ys=null,Wt=h,M.H=y,M.A=w,Et===null&&(cn=null,Nt=0,af()),D}function _N(){for(;Et!==null;)Xw(Et)}function DN(i,l){var u=Wt;Wt|=2;var h=Yw(),y=Kw();cn!==i||Nt!==l?(If=null,Lf=Re()+500,Fl(i,l)):zl=Jr(i,l);e:do try{if(Qt!==0&&Et!==null){l=Et;var w=Fr;t:switch(Qt){case 1:Qt=0,Fr=null,ql(i,l,w,1);break;case 2:case 9:if(c1(w)){Qt=0,Fr=null,Zw(l);break}l=function(){Qt!==2&&Qt!==9||cn!==i||(Qt=7),Yi(i)},w.then(l,l);break e;case 3:Qt=7;break e;case 4:Qt=5;break e;case 7:c1(w)?(Qt=0,Fr=null,Zw(l)):(Qt=0,Fr=null,ql(i,l,w,7));break;case 5:var D=null;switch(Et.tag){case 26:D=Et.memoizedState;case 5:case 27:var O=Et;if(!D||Nj(D)){Qt=0,Fr=null;var U=O.sibling;if(U!==null)Et=U;else{var te=O.return;te!==null?(Et=te,zf(te)):Et=null}break t}}Qt=0,Fr=null,ql(i,l,w,5);break;case 6:Qt=0,Fr=null,ql(i,l,w,6);break;case 8:rv(),_n=6;break e;default:throw Error(r(462))}}AN();break}catch(fe){Qw(i,fe)}while(!0);return Po=ys=null,M.H=h,M.A=y,Wt=u,Et!==null?0:(cn=null,Nt=0,af(),_n)}function AN(){for(;Et!==null&&!Rt();)Xw(Et)}function Xw(i){var l=Cw(i.alternate,i,zo);i.memoizedProps=i.pendingProps,l===null?zf(i):Et=l}function Zw(i){var l=i,u=l.alternate;switch(l.tag){case 15:case 0:l=yw(u,l,l.pendingProps,l.type,void 0,Nt);break;case 11:l=yw(u,l,l.pendingProps,l.type.render,l.ref,Nt);break;case 5:bg(l);default:Tw(u,l),l=Et=JS(l,zo),l=Cw(u,l,zo)}i.memoizedProps=i.pendingProps,l===null?zf(i):Et=l}function ql(i,l,u,h){Po=ys=null,bg(l),Ml=null,mu=0;var y=l.return;try{if(xN(i,y,l,u,Nt)){_n=1,Af(i,ri(u,i.current)),Et=null;return}}catch(w){if(y!==null)throw Et=y,w;_n=1,Af(i,ri(u,i.current)),Et=null;return}l.flags&32768?(Vt||h===1?i=!0:zl||(Nt&536870912)!==0?i=!1:(Ta=i=!0,(h===2||h===9||h===3||h===6)&&(h=si.current,h!==null&&h.tag===13&&(h.flags|=16384))),Jw(l,i)):zf(l)}function zf(i){var l=i;do{if((l.flags&32768)!==0){Jw(l,Ta);return}i=l.return;var u=SN(l.alternate,l,zo);if(u!==null){Et=u;return}if(l=l.sibling,l!==null){Et=l;return}Et=l=i}while(l!==null);_n===0&&(_n=5)}function Jw(i,l){do{var u=wN(i.alternate,i);if(u!==null){u.flags&=32767,Et=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(i=i.sibling,i!==null)){Et=i;return}Et=i=u}while(i!==null);_n=6,Et=null}function ej(i,l,u,h,y,w,D,O,U){i.cancelPendingCommit=null;do Uf();while(Xn!==0);if((Wt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=Ym,Hn(i,u,w,D,O,U),i===cn&&(Et=cn=null,Nt=0),Bl=l,Da=i,Vl=u,ev=w,tv=y,qw=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,ON(pe,function(){return oj(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=M.T,M.T=null,y=I.p,I.p=2,D=Wt,Wt|=4;try{jN(i,l,u)}finally{Wt=D,I.p=y,M.T=h}}Xn=1,tj(),nj(),rj()}}function tj(){if(Xn===1){Xn=0;var i=Da,l=Bl,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=M.T,M.T=null;var h=I.p;I.p=2;var y=Wt;Wt|=4;try{Iw(l,i);var w=vv,D=FS(i.containerInfo),O=w.focusedElem,U=w.selectionRange;if(D!==O&&O&&O.ownerDocument&&VS(O.ownerDocument.documentElement,O)){if(U!==null&&qm(O)){var te=U.start,fe=U.end;if(fe===void 0&&(fe=te),"selectionStart"in O)O.selectionStart=te,O.selectionEnd=Math.min(fe,O.value.length);else{var me=O.ownerDocument||document,ne=me&&me.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),ct=O.textContent.length,at=Math.min(U.start,ct),en=U.end===void 0?at:Math.min(U.end,ct);!oe.extend&&at>en&&(D=en,en=at,at=D);var Q=BS(O,at),G=BS(O,en);if(Q&&G&&(oe.rangeCount!==1||oe.anchorNode!==Q.node||oe.anchorOffset!==Q.offset||oe.focusNode!==G.node||oe.focusOffset!==G.offset)){var ee=me.createRange();ee.setStart(Q.node,Q.offset),oe.removeAllRanges(),at>en?(oe.addRange(ee),oe.extend(G.node,G.offset)):(ee.setEnd(G.node,G.offset),oe.addRange(ee))}}}}for(me=[],oe=O;oe=oe.parentNode;)oe.nodeType===1&&me.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<me.length;O++){var he=me[O];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Zf=!!gv,vv=gv=null}finally{Wt=y,I.p=h,M.T=u}}i.current=l,Xn=2}}function nj(){if(Xn===2){Xn=0;var i=Da,l=Bl,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=M.T,M.T=null;var h=I.p;I.p=2;var y=Wt;Wt|=4;try{Nw(i,l.alternate,l)}finally{Wt=y,I.p=h,M.T=u}}Xn=3}}function rj(){if(Xn===4||Xn===3){Xn=0,tn();var i=Da,l=Bl,u=Vl,h=qw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Xn=5:(Xn=0,Bl=Da=null,ij(i,i.pendingLanes));var y=i.pendingLanes;if(y===0&&(_a=null),cs(u),l=l.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Dt,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=M.T,y=I.p,I.p=2,M.T=null;try{for(var w=i.onRecoverableError,D=0;D<h.length;D++){var O=h[D];w(O.value,{componentStack:O.stack})}}finally{M.T=l,I.p=y}}(Vl&3)!==0&&Uf(),Yi(i),y=i.pendingLanes,(u&4194090)!==0&&(y&42)!==0?i===nv?Cu++:(Cu=0,nv=i):Cu=0,Eu(0)}}function ij(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,iu(l)))}function Uf(i){return tj(),nj(),rj(),oj()}function oj(){if(Xn!==5)return!1;var i=Da,l=ev;ev=0;var u=cs(Vl),h=M.T,y=I.p;try{I.p=32>u?32:u,M.T=null,u=tv,tv=null;var w=Da,D=Vl;if(Xn=0,Bl=Da=null,Vl=0,(Wt&6)!==0)throw Error(r(331));var O=Wt;if(Wt|=4,Vw(w.current),zw(w,w.current,D,u),Wt=O,Eu(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Dt,w)}catch{}return!0}finally{I.p=y,M.T=h,ij(i,l)}}function aj(i,l,u){l=ri(u,l),l=Og(i.stateNode,l,2),i=xa(i,l,2),i!==null&&(wr(i,2),Yi(i))}function rn(i,l,u){if(i.tag===3)aj(i,i,u);else for(;l!==null;){if(l.tag===3){aj(l,i,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(_a===null||!_a.has(h))){i=ri(u,i),u=uw(2),h=xa(l,u,2),h!==null&&(dw(u,h,l,i),wr(h,2),Yi(h));break}}l=l.return}}function av(i,l,u){var h=i.pingCache;if(h===null){h=i.pingCache=new TN;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),i=PN.bind(null,i,l,u),l.then(i,i))}function PN(i,l,u){var h=i.pingCache;h!==null&&h.delete(l),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,cn===i&&(Nt&u)===u&&(_n===4||_n===3&&(Nt&62914560)===Nt&&300>Re()-Jg?(Wt&2)===0&&Fl(i,0):Xg|=u,Ul===Nt&&(Ul=0)),Yi(i)}function sj(i,l){l===0&&(l=da()),i=El(i,l),i!==null&&(wr(i,l),Yi(i))}function kN(i){var l=i.memoizedState,u=0;l!==null&&(u=l.retryLane),sj(i,u)}function NN(i,l){var u=0;switch(i.tag){case 13:var h=i.stateNode,y=i.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),sj(i,u)}function ON(i,l){return Lt(i,l)}var Bf=null,Hl=null,sv=!1,Vf=!1,lv=!1,Es=0;function Yi(i){i!==Hl&&i.next===null&&(Hl===null?Bf=Hl=i:Hl=Hl.next=i),Vf=!0,sv||(sv=!0,LN())}function Eu(i,l){if(!lv&&Vf){lv=!0;do for(var u=!1,h=Bf;h!==null;){if(i!==0){var y=h.pendingLanes;if(y===0)var w=0;else{var D=h.suspendedLanes,O=h.pingedLanes;w=(1<<31-$t(42|i)+1)-1,w&=y&~(D&~O),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,dj(h,w))}else w=Nt,w=bo(h,h===cn?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||Jr(h,w)||(u=!0,dj(h,w));h=h.next}while(u);lv=!1}}function MN(){lj()}function lj(){Vf=sv=!1;var i=0;Es!==0&&(qN()&&(i=Es),Es=0);for(var l=Re(),u=null,h=Bf;h!==null;){var y=h.next,w=cj(h,l);w===0?(h.next=null,u===null?Bf=y:u.next=y,y===null&&(Hl=u)):(u=h,(i!==0||(w&3)!==0)&&(Vf=!0)),h=y}Eu(i)}function cj(i,l){for(var u=i.suspendedLanes,h=i.pingedLanes,y=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var D=31-$t(w),O=1<<D,U=y[D];U===-1?((O&u)===0||(O&h)!==0)&&(y[D]=ml(O,l)):U<=l&&(i.expiredLanes|=O),w&=~O}if(l=cn,u=Nt,u=bo(i,i===l?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===l&&(Qt===2||Qt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&pt(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Jr(i,u)){if(l=u&-u,l===i.callbackPriority)return l;switch(h!==null&&pt(h),cs(u)){case 2:case 8:u=Ae;break;case 32:u=pe;break;case 268435456:u=ze;break;default:u=pe}return h=uj.bind(null,i),u=Lt(u,h),i.callbackPriority=l,i.callbackNode=u,l}return h!==null&&h!==null&&pt(h),i.callbackPriority=2,i.callbackNode=null,2}function uj(i,l){if(Xn!==0&&Xn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Uf()&&i.callbackNode!==u)return null;var h=Nt;return h=bo(i,i===cn?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(Gw(i,h,l),cj(i,Re()),i.callbackNode!=null&&i.callbackNode===u?uj.bind(null,i):null)}function dj(i,l){if(Uf())return null;Gw(i,l,!0)}function LN(){GN(function(){(Wt&6)!==0?Lt(Xe,MN):lj()})}function cv(){return Es===0&&(Es=So()),Es}function fj(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Zd(""+i)}function hj(i,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,i.id&&u.setAttribute("form",i.id),l.parentNode.insertBefore(u,l),i=new FormData(i),u.parentNode.removeChild(u),i}function IN(i,l,u,h,y){if(l==="submit"&&u&&u.stateNode===y){var w=fj((y[Te]||null).action),D=h.submitter;D&&(l=(l=D[Te]||null)?fj(l.formAction):D.getAttribute("formAction"),l!==null&&(w=l,D=null));var O=new nf("action","action",null,h,y);i.push({event:O,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Es!==0){var U=D?hj(y,D):new FormData(y);Dg(u,{pending:!0,data:U,method:y.method,action:w},null,U)}}else typeof w=="function"&&(O.preventDefault(),U=D?hj(y,D):new FormData(y),Dg(u,{pending:!0,data:U,method:y.method,action:w},w,U))},currentTarget:y}]})}}for(var uv=0;uv<Qm.length;uv++){var dv=Qm[uv],$N=dv.toLowerCase(),zN=dv[0].toUpperCase()+dv.slice(1);Ti($N,"on"+zN)}Ti(GS,"onAnimationEnd"),Ti(WS,"onAnimationIteration"),Ti(QS,"onAnimationStart"),Ti("dblclick","onDoubleClick"),Ti("focusin","onFocus"),Ti("focusout","onBlur"),Ti(nN,"onTransitionRun"),Ti(rN,"onTransitionStart"),Ti(iN,"onTransitionCancel"),Ti(YS,"onTransitionEnd"),fr("onMouseEnter",["mouseout","mouseover"]),fr("onMouseLeave",["mouseout","mouseover"]),fr("onPointerEnter",["pointerout","pointerover"]),fr("onPointerLeave",["pointerout","pointerover"]),$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$r("onBeforeInput",["compositionend","keypress","textInput","paste"]),$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tu="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(" "),UN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tu));function pj(i,l){l=(l&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],y=h.event;h=h.listeners;e:{var w=void 0;if(l)for(var D=h.length-1;0<=D;D--){var O=h[D],U=O.instance,te=O.currentTarget;if(O=O.listener,U!==w&&y.isPropagationStopped())break e;w=O,y.currentTarget=te;try{w(y)}catch(fe){Df(fe)}y.currentTarget=null,w=U}else for(D=0;D<h.length;D++){if(O=h[D],U=O.instance,te=O.currentTarget,O=O.listener,U!==w&&y.isPropagationStopped())break e;w=O,y.currentTarget=te;try{w(y)}catch(fe){Df(fe)}y.currentTarget=null,w=U}}}}function Tt(i,l){var u=l[Ye];u===void 0&&(u=l[Ye]=new Set);var h=i+"__bubble";u.has(h)||(mj(l,i,2,!1),u.add(h))}function fv(i,l,u){var h=0;l&&(h|=4),mj(u,i,h,l)}var Ff="_reactListening"+Math.random().toString(36).slice(2);function hv(i){if(!i[Ff]){i[Ff]=!0,Xt.forEach(function(u){u!=="selectionchange"&&(UN.has(u)||fv(u,!1,i),fv(u,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Ff]||(l[Ff]=!0,fv("selectionchange",!1,l))}}function mj(i,l,u,h){switch(zj(l)){case 2:var y=hO;break;case 8:y=pO;break;default:y=Rv}u=y.bind(null,l,u,i),y=void 0,!Mm||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?i.addEventListener(l,u,{capture:!0,passive:y}):i.addEventListener(l,u,!0):y!==void 0?i.addEventListener(l,u,{passive:y}):i.addEventListener(l,u,!1)}function pv(i,l,u,h,y){var w=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 O=h.stateNode.containerInfo;if(O===y)break;if(D===4)for(D=h.return;D!==null;){var U=D.tag;if((U===3||U===4)&&D.stateNode.containerInfo===y)return;D=D.return}for(;O!==null;){if(D=ft(O),D===null)return;if(U=D.tag,U===5||U===6||U===26||U===27){h=w=D;continue e}O=O.parentNode}}h=h.return}wS(function(){var te=w,fe=Nm(u),me=[];e:{var ne=KS.get(i);if(ne!==void 0){var oe=nf,ct=i;switch(i){case"keypress":if(ef(u)===0)break e;case"keydown":case"keyup":oe=Ok;break;case"focusin":ct="focus",oe=zm;break;case"focusout":ct="blur",oe=zm;break;case"beforeblur":case"afterblur":oe=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":oe=ES;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=wk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Ik;break;case GS:case WS:case QS:oe=Ek;break;case YS:oe=zk;break;case"scroll":case"scrollend":oe=bk;break;case"wheel":oe=Bk;break;case"copy":case"cut":case"paste":oe=Rk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=RS;break;case"toggle":case"beforetoggle":oe=Fk}var at=(l&4)!==0,en=!at&&(i==="scroll"||i==="scrollend"),Q=at?ne!==null?ne+"Capture":null:ne;at=[];for(var G=te,ee;G!==null;){var he=G;if(ee=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ee===null||Q===null||(he=Hc(G,Q),he!=null&&at.push(Ru(G,he,ee))),en)break;G=G.return}0<at.length&&(ne=new oe(ne,ct,null,u,fe),me.push({event:ne,listeners:at}))}}if((l&7)===0){e:{if(ne=i==="mouseover"||i==="pointerover",oe=i==="mouseout"||i==="pointerout",ne&&u!==km&&(ct=u.relatedTarget||u.fromElement)&&(ft(ct)||ct[Ve]))break e;if((oe||ne)&&(ne=fe.window===fe?fe:(ne=fe.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(ct=u.relatedTarget||u.toElement,oe=te,ct=ct?ft(ct):null,ct!==null&&(en=s(ct),at=ct.tag,ct!==en||at!==5&&at!==27&&at!==6)&&(ct=null)):(oe=null,ct=te),oe!==ct)){if(at=ES,he="onMouseLeave",Q="onMouseEnter",G="mouse",(i==="pointerout"||i==="pointerover")&&(at=RS,he="onPointerLeave",Q="onPointerEnter",G="pointer"),en=oe==null?ne:Kt(oe),ee=ct==null?ne:Kt(ct),ne=new at(he,G+"leave",oe,u,fe),ne.target=en,ne.relatedTarget=ee,he=null,ft(fe)===te&&(at=new at(Q,G+"enter",ct,u,fe),at.target=ee,at.relatedTarget=en,he=at),en=he,oe&&ct)t:{for(at=oe,Q=ct,G=0,ee=at;ee;ee=Gl(ee))G++;for(ee=0,he=Q;he;he=Gl(he))ee++;for(;0<G-ee;)at=Gl(at),G--;for(;0<ee-G;)Q=Gl(Q),ee--;for(;G--;){if(at===Q||Q!==null&&at===Q.alternate)break t;at=Gl(at),Q=Gl(Q)}at=null}else at=null;oe!==null&&gj(me,ne,oe,at,!1),ct!==null&&en!==null&&gj(me,en,ct,at,!0)}}e:{if(ne=te?Kt(te):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var He=MS;else if(NS(ne))if(LS)He=Jk;else{He=Xk;var jt=Kk}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&Pm(te.elementType)&&(He=MS):He=Zk;if(He&&(He=He(i,te))){OS(me,He,u,fe);break e}jt&&jt(i,ne,te),i==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&Am(ne,"number",ne.value)}switch(jt=te?Kt(te):window,i){case"focusin":(NS(jt)||jt.contentEditable==="true")&&(wl=jt,Hm=te,Jc=null);break;case"focusout":Jc=Hm=wl=null;break;case"mousedown":Gm=!0;break;case"contextmenu":case"mouseup":case"dragend":Gm=!1,qS(me,u,fe);break;case"selectionchange":if(tN)break;case"keydown":case"keyup":qS(me,u,fe)}var tt;if(Bm)e:{switch(i){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Sl?PS(i,u)&&(st="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(st="onCompositionStart");st&&(_S&&u.locale!=="ko"&&(Sl||st!=="onCompositionStart"?st==="onCompositionEnd"&&Sl&&(tt=jS()):(ma=fe,Lm="value"in ma?ma.value:ma.textContent,Sl=!0)),jt=qf(te,st),0<jt.length&&(st=new TS(st,i,null,u,fe),me.push({event:st,listeners:jt}),tt?st.data=tt:(tt=kS(u),tt!==null&&(st.data=tt)))),(tt=Hk?Gk(i,u):Wk(i,u))&&(st=qf(te,"onBeforeInput"),0<st.length&&(jt=new TS("onBeforeInput","beforeinput",null,u,fe),me.push({event:jt,listeners:st}),jt.data=tt)),IN(me,i,te,u,fe)}pj(me,l)})}function Ru(i,l,u){return{instance:i,listener:l,currentTarget:u}}function qf(i,l){for(var u=l+"Capture",h=[];i!==null;){var y=i,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=Hc(i,u),y!=null&&h.unshift(Ru(i,y,w)),y=Hc(i,l),y!=null&&h.push(Ru(i,y,w))),i.tag===3)return h;i=i.return}return[]}function Gl(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function gj(i,l,u,h,y){for(var w=l._reactName,D=[];u!==null&&u!==h;){var O=u,U=O.alternate,te=O.stateNode;if(O=O.tag,U!==null&&U===h)break;O!==5&&O!==26&&O!==27||te===null||(U=te,y?(te=Hc(u,w),te!=null&&D.unshift(Ru(u,te,U))):y||(te=Hc(u,w),te!=null&&D.push(Ru(u,te,U)))),u=u.return}D.length!==0&&i.push({event:l,listeners:D})}var BN=/\r\n?/g,VN=/\u0000|\uFFFD/g;function vj(i){return(typeof i=="string"?i:""+i).replace(BN,`
|
|
581
|
-
`).replace(VN,"")}function yj(i,l){return l=vj(l),vj(i)===l}function Hf(){}function Jt(i,l,u,h,y,w){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||yl(i,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&yl(i,""+h);break;case"className":Eo(i,"class",h);break;case"tabIndex":Eo(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Eo(i,u,h);break;case"style":bS(i,h,w);break;case"data":if(l!=="object"){Eo(i,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Zd(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.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 w=="function"&&(u==="formAction"?(l!=="input"&&Jt(i,l,"name",y.name,y,null),Jt(i,l,"formEncType",y.formEncType,y,null),Jt(i,l,"formMethod",y.formMethod,y,null),Jt(i,l,"formTarget",y.formTarget,y,null)):(Jt(i,l,"encType",y.encType,y,null),Jt(i,l,"method",y.method,y,null),Jt(i,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Zd(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=Hf);break;case"onScroll":h!=null&&Tt("scroll",i);break;case"onScrollEnd":h!=null&&Tt("scrollend",i);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));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.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"){i.removeAttribute("xlink:href");break}u=Zd(""+h),i.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"?i.setAttribute(u,""+h):i.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"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":Tt("beforetoggle",i),Tt("toggle",i),Co(i,"popover",h);break;case"xlinkActuate":gt(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":gt(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":gt(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":gt(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":gt(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":gt(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":gt(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":gt(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":gt(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Co(i,"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=yk.get(u)||u,Co(i,u,h))}}function mv(i,l,u,h,y,w){switch(u){case"style":bS(i,h,w);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));i.innerHTML=u}}break;case"children":typeof h=="string"?yl(i,h):(typeof h=="number"||typeof h=="bigint")&&yl(i,""+h);break;case"onScroll":h!=null&&Tt("scroll",i);break;case"onScrollEnd":h!=null&&Tt("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Hf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qi.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),w=i[Te]||null,w=w!=null?w[u]:null,typeof w=="function"&&i.removeEventListener(l,w,y),typeof h=="function")){typeof w!="function"&&w!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(l,h,y);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):Co(i,u,h)}}}function Zn(i,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",i),Tt("load",i);var h=!1,y=!1,w;for(w in u)if(u.hasOwnProperty(w)){var D=u[w];if(D!=null)switch(w){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Jt(i,l,w,D,u,null)}}y&&Jt(i,l,"srcSet",u.srcSet,u,null),h&&Jt(i,l,"src",u.src,u,null);return;case"input":Tt("invalid",i);var O=w=D=y=null,U=null,te=null;for(h in u)if(u.hasOwnProperty(h)){var fe=u[h];if(fe!=null)switch(h){case"name":y=fe;break;case"type":D=fe;break;case"checked":U=fe;break;case"defaultChecked":te=fe;break;case"value":w=fe;break;case"defaultValue":O=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:Jt(i,l,h,fe,u,null)}}gS(i,w,O,U,te,D,y,!1),Kd(i);return;case"select":Tt("invalid",i),h=D=w=null;for(y in u)if(u.hasOwnProperty(y)&&(O=u[y],O!=null))switch(y){case"value":w=O;break;case"defaultValue":D=O;break;case"multiple":h=O;default:Jt(i,l,y,O,u,null)}l=w,u=D,i.multiple=!!h,l!=null?vl(i,!!h,l,!1):u!=null&&vl(i,!!h,u,!0);return;case"textarea":Tt("invalid",i),w=y=h=null;for(D in u)if(u.hasOwnProperty(D)&&(O=u[D],O!=null))switch(D){case"value":h=O;break;case"defaultValue":y=O;break;case"children":w=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:Jt(i,l,D,O,u,null)}yS(i,h,y,w),Kd(i);return;case"option":for(U in u)if(u.hasOwnProperty(U)&&(h=u[U],h!=null))switch(U){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Jt(i,l,U,h,u,null)}return;case"dialog":Tt("beforetoggle",i),Tt("toggle",i),Tt("cancel",i),Tt("close",i);break;case"iframe":case"object":Tt("load",i);break;case"video":case"audio":for(h=0;h<Tu.length;h++)Tt(Tu[h],i);break;case"image":Tt("error",i),Tt("load",i);break;case"details":Tt("toggle",i);break;case"embed":case"source":case"link":Tt("error",i),Tt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(h=u[te],h!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Jt(i,l,te,h,u,null)}return;default:if(Pm(l)){for(fe in u)u.hasOwnProperty(fe)&&(h=u[fe],h!==void 0&&mv(i,l,fe,h,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(h=u[O],h!=null&&Jt(i,l,O,h,u,null))}function FN(i,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,w=null,D=null,O=null,U=null,te=null,fe=null;for(oe in u){var me=u[oe];if(u.hasOwnProperty(oe)&&me!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":U=me;default:h.hasOwnProperty(oe)||Jt(i,l,oe,null,h,me)}}for(var ne in h){var oe=h[ne];if(me=u[ne],h.hasOwnProperty(ne)&&(oe!=null||me!=null))switch(ne){case"type":w=oe;break;case"name":y=oe;break;case"checked":te=oe;break;case"defaultChecked":fe=oe;break;case"value":D=oe;break;case"defaultValue":O=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,l));break;default:oe!==me&&Jt(i,l,ne,oe,h,me)}}Dm(i,D,O,U,te,fe,w,y);return;case"select":oe=D=O=ne=null;for(w in u)if(U=u[w],u.hasOwnProperty(w)&&U!=null)switch(w){case"value":break;case"multiple":oe=U;default:h.hasOwnProperty(w)||Jt(i,l,w,null,h,U)}for(y in h)if(w=h[y],U=u[y],h.hasOwnProperty(y)&&(w!=null||U!=null))switch(y){case"value":ne=w;break;case"defaultValue":O=w;break;case"multiple":D=w;default:w!==U&&Jt(i,l,y,w,h,U)}l=O,u=D,h=oe,ne!=null?vl(i,!!u,ne,!1):!!h!=!!u&&(l!=null?vl(i,!!u,l,!0):vl(i,!!u,u?[]:"",!1));return;case"textarea":oe=ne=null;for(O in u)if(y=u[O],u.hasOwnProperty(O)&&y!=null&&!h.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:Jt(i,l,O,null,h,y)}for(D in h)if(y=h[D],w=u[D],h.hasOwnProperty(D)&&(y!=null||w!=null))switch(D){case"value":ne=y;break;case"defaultValue":oe=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==w&&Jt(i,l,D,y,h,w)}vS(i,ne,oe);return;case"option":for(var ct in u)if(ne=u[ct],u.hasOwnProperty(ct)&&ne!=null&&!h.hasOwnProperty(ct))switch(ct){case"selected":i.selected=!1;break;default:Jt(i,l,ct,null,h,ne)}for(U in h)if(ne=h[U],oe=u[U],h.hasOwnProperty(U)&&ne!==oe&&(ne!=null||oe!=null))switch(U){case"selected":i.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Jt(i,l,U,ne,h,oe)}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 at in u)ne=u[at],u.hasOwnProperty(at)&&ne!=null&&!h.hasOwnProperty(at)&&Jt(i,l,at,null,h,ne);for(te in h)if(ne=h[te],oe=u[te],h.hasOwnProperty(te)&&ne!==oe&&(ne!=null||oe!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,l));break;default:Jt(i,l,te,ne,h,oe)}return;default:if(Pm(l)){for(var en in u)ne=u[en],u.hasOwnProperty(en)&&ne!==void 0&&!h.hasOwnProperty(en)&&mv(i,l,en,void 0,h,ne);for(fe in h)ne=h[fe],oe=u[fe],!h.hasOwnProperty(fe)||ne===oe||ne===void 0&&oe===void 0||mv(i,l,fe,ne,h,oe);return}}for(var Q in u)ne=u[Q],u.hasOwnProperty(Q)&&ne!=null&&!h.hasOwnProperty(Q)&&Jt(i,l,Q,null,h,ne);for(me in h)ne=h[me],oe=u[me],!h.hasOwnProperty(me)||ne===oe||ne==null&&oe==null||Jt(i,l,me,ne,h,oe)}var gv=null,vv=null;function Gf(i){return i.nodeType===9?i:i.ownerDocument}function xj(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function bj(i,l){if(i===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&l==="foreignObject"?0:i}function yv(i,l){return i==="textarea"||i==="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 qN(){var i=window.event;return i&&i.type==="popstate"?i===xv?!1:(xv=i,!0):(xv=null,!1)}var Sj=typeof setTimeout=="function"?setTimeout:void 0,HN=typeof clearTimeout=="function"?clearTimeout:void 0,wj=typeof Promise=="function"?Promise:void 0,GN=typeof queueMicrotask=="function"?queueMicrotask:typeof wj<"u"?function(i){return wj.resolve(null).then(i).catch(WN)}:Sj;function WN(i){setTimeout(function(){throw i})}function Pa(i){return i==="head"}function jj(i,l){var u=l,h=0,y=0;do{var w=u.nextSibling;if(i.removeChild(u),w&&w.nodeType===8)if(u=w.data,u==="/$"){if(0<h&&8>h){u=h;var D=i.ownerDocument;if(u&1&&_u(D.documentElement),u&2&&_u(D.body),u&4)for(u=D.head,_u(u),D=u.firstChild;D;){var O=D.nextSibling,U=D.nodeName;D[qe]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&D.rel.toLowerCase()==="stylesheet"||u.removeChild(D),D=O}}if(y===0){i.removeChild(w),Lu(l);return}y--}else u==="$"||u==="$?"||u==="$!"?y++:h=u.charCodeAt(0)-48;else h=0;u=w}while(u);Lu(l)}function bv(i){var l=i.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),Ke(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function QN(i,l,u,h){for(;i.nodeType===1;){var y=u;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[qe])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(w=i.getAttribute("rel"),w==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(w!==y.rel||i.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||i.getAttribute("title")!==(y.title==null?null:y.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(y.src==null?null:y.src)||i.getAttribute("type")!==(y.type==null?null:y.type)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=_i(i.nextSibling),i===null)break}return null}function YN(i,l,u){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=_i(i.nextSibling),i===null))return null;return i}function Sv(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function KN(i,l){var u=i.ownerDocument;if(i.data!=="$?"||u.readyState==="complete")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function _i(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return i}var wv=null;function Cj(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(l===0)return i;l--}else u==="/$"&&l++}i=i.previousSibling}return null}function Ej(i,l,u){switch(l=Gf(u),i){case"html":if(i=l.documentElement,!i)throw Error(r(452));return i;case"head":if(i=l.head,!i)throw Error(r(453));return i;case"body":if(i=l.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function _u(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);Ke(i)}var ci=new Map,Tj=new Set;function Wf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Uo=I.d;I.d={f:XN,r:ZN,D:JN,C:eO,L:tO,m:nO,X:iO,S:rO,M:oO};function XN(){var i=Uo.f(),l=$f();return i||l}function ZN(i){var l=et(i);l!==null&&l.tag===5&&l.type==="form"?G1(l):Uo.r(i)}var Wl=typeof document>"u"?null:document;function Rj(i,l,u){var h=Wl;if(h&&typeof l=="string"&&l){var y=ni(l);y='link[rel="'+i+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Tj.has(y)||(Tj.add(y),i={rel:i,crossOrigin:u,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),Zn(l,"link",i),mt(l),h.head.appendChild(l)))}}function JN(i){Uo.D(i),Rj("dns-prefetch",i,null)}function eO(i,l){Uo.C(i,l),Rj("preconnect",i,l)}function tO(i,l,u){Uo.L(i,l,u);var h=Wl;if(h&&i&&l){var y='link[rel="preload"][as="'+ni(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+ni(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+ni(u.imageSizes)+'"]')):y+='[href="'+ni(i)+'"]';var w=y;switch(l){case"style":w=Ql(i);break;case"script":w=Yl(i)}ci.has(w)||(i=m({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:i,as:l},u),ci.set(w,i),h.querySelector(y)!==null||l==="style"&&h.querySelector(Du(w))||l==="script"&&h.querySelector(Au(w))||(l=h.createElement("link"),Zn(l,"link",i),mt(l),h.head.appendChild(l)))}}function nO(i,l){Uo.m(i,l);var u=Wl;if(u&&i){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+ni(h)+'"][href="'+ni(i)+'"]',w=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Yl(i)}if(!ci.has(w)&&(i=m({rel:"modulepreload",href:i},l),ci.set(w,i),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Au(w)))return}h=u.createElement("link"),Zn(h,"link",i),mt(h),u.head.appendChild(h)}}}function rO(i,l,u){Uo.S(i,l,u);var h=Wl;if(h&&i){var y=vn(h).hoistableStyles,w=Ql(i);l=l||"default";var D=y.get(w);if(!D){var O={loading:0,preload:null};if(D=h.querySelector(Du(w)))O.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":l},u),(u=ci.get(w))&&jv(i,u);var U=D=h.createElement("link");mt(U),Zn(U,"link",i),U._p=new Promise(function(te,fe){U.onload=te,U.onerror=fe}),U.addEventListener("load",function(){O.loading|=1}),U.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Qf(D,l,h)}D={type:"stylesheet",instance:D,count:1,state:O},y.set(w,D)}}}function iO(i,l){Uo.X(i,l);var u=Wl;if(u&&i){var h=vn(u).hoistableScripts,y=Yl(i),w=h.get(y);w||(w=u.querySelector(Au(y)),w||(i=m({src:i,async:!0},l),(l=ci.get(y))&&Cv(i,l),w=u.createElement("script"),mt(w),Zn(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(y,w))}}function oO(i,l){Uo.M(i,l);var u=Wl;if(u&&i){var h=vn(u).hoistableScripts,y=Yl(i),w=h.get(y);w||(w=u.querySelector(Au(y)),w||(i=m({src:i,async:!0,type:"module"},l),(l=ci.get(y))&&Cv(i,l),w=u.createElement("script"),mt(w),Zn(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(y,w))}}function _j(i,l,u,h){var y=(y=we.current)?Wf(y):null;if(!y)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=Ql(u.href),u=vn(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"){i=Ql(u.href);var w=vn(y).hoistableStyles,D=w.get(i);if(D||(y=y.ownerDocument||y,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,D),(w=y.querySelector(Du(i)))&&!w._p&&(D.instance=w,D.state.loading=5),ci.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ci.set(i,u),w||aO(y,i,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=Yl(u),u=vn(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,i))}}function Ql(i){return'href="'+ni(i)+'"'}function Du(i){return'link[rel="stylesheet"]['+i+"]"}function Dj(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function aO(i,l,u,h){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=i.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),i.head.appendChild(l))}function Yl(i){return'[src="'+ni(i)+'"]'}function Au(i){return"script[async]"+i}function Aj(i,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=i.querySelector('style[data-href~="'+ni(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=(i.ownerDocument||i).createElement("style"),mt(h),Zn(h,"style",y),Qf(h,u.precedence,i),l.instance=h;case"stylesheet":y=Ql(u.href);var w=i.querySelector(Du(y));if(w)return l.state.loading|=4,l.instance=w,mt(w),w;h=Dj(u),(y=ci.get(y))&&jv(h,y),w=(i.ownerDocument||i).createElement("link"),mt(w);var D=w;return D._p=new Promise(function(O,U){D.onload=O,D.onerror=U}),Zn(w,"link",h),l.state.loading|=4,Qf(w,u.precedence,i),l.instance=w;case"script":return w=Yl(u.src),(y=i.querySelector(Au(w)))?(l.instance=y,mt(y),y):(h=u,(y=ci.get(w))&&(h=m({},u),Cv(h,y)),i=i.ownerDocument||i,y=i.createElement("script"),mt(y),Zn(y,"link",h),i.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,Qf(h,u.precedence,i));return l.instance}function Qf(i,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,w=y,D=0;D<h.length;D++){var O=h[D];if(O.dataset.precedence===l)w=O;else if(w!==y)break}w?w.parentNode.insertBefore(i,w.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(i,l.firstChild))}function jv(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function Cv(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Yf=null;function Pj(i,l,u){if(Yf===null){var h=new Map,y=Yf=new Map;y.set(u,h)}else y=Yf,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),y=0;y<u.length;y++){var w=u[y];if(!(w[qe]||w[ve]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var D=w.getAttribute(l)||"";D=i+D;var O=h.get(D);O?O.push(w):h.set(D,[w])}}return h}function kj(i,l,u){i=i.ownerDocument||i,i.head.insertBefore(u,l==="title"?i.querySelector("head > title"):null)}function sO(i,l,u){if(u===1||l.itemProp!=null)return!1;switch(i){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 i=l.disabled,typeof l.precedence=="string"&&i==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 Nj(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Pu=null;function lO(){}function cO(i,l,u){if(Pu===null)throw Error(r(475));var h=Pu;if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var y=Ql(u.href),w=i.querySelector(Du(y));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(h.count++,h=Kf.bind(h),i.then(h,h)),l.state.loading|=4,l.instance=w,mt(w);return}w=i.ownerDocument||i,u=Dj(u),(y=ci.get(y))&&jv(u,y),w=w.createElement("link"),mt(w);var D=w;D._p=new Promise(function(O,U){D.onload=O,D.onerror=U}),Zn(w,"link",u),l.instance=w}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(h.count++,l=Kf.bind(h),i.addEventListener("load",l),i.addEventListener("error",l))}}function uO(){if(Pu===null)throw Error(r(475));var i=Pu;return i.stylesheets&&i.count===0&&Ev(i,i.stylesheets),0<i.count?function(l){var u=setTimeout(function(){if(i.stylesheets&&Ev(i,i.stylesheets),i.unsuspend){var h=i.unsuspend;i.unsuspend=null,h()}},6e4);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(u)}}:null}function Kf(){if(this.count--,this.count===0){if(this.stylesheets)Ev(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Xf=null;function Ev(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Xf=new Map,l.forEach(dO,i),Xf=null,Kf.call(i))}function dO(i,l){if(!(l.state.loading&4)){var u=Xf.get(i);if(u)var h=u.get(null);else{u=new Map,Xf.set(i,u);for(var y=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var D=y[w];(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"),w=u.get(D)||h,w===h&&u.set(null,y),u.set(D,y),this.count++,h=Kf.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),w?w.parentNode.insertBefore(y,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(y,i.firstChild)),l.state.loading|=4}}var ku={$$typeof:T,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function fO(i,l,u,h,y,w,D,O){this.tag=1,this.containerInfo=i,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=Fi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fi(0),this.hiddenUpdates=Fi(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Oj(i,l,u,h,y,w,D,O,U,te,fe,me){return i=new fO(i,l,u,D,O,U,te,me),l=1,w===!0&&(l|=24),w=Ur(3,null,null,l),i.current=w,w.stateNode=i,l=ag(),l.refCount++,i.pooledCache=l,l.refCount++,w.memoizedState={element:h,isDehydrated:u,cache:l},ug(w),i}function Mj(i){return i?(i=Tl,i):Tl}function Lj(i,l,u,h,y,w){y=Mj(y),h.context===null?h.context=y:h.pendingContext=y,h=ya(l),h.payload={element:u},w=w===void 0?null:w,w!==null&&(h.callback=w),u=xa(i,h,l),u!==null&&(Hr(u,i,l),lu(u,i,l))}function Ij(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<l?u:l}}function Tv(i,l){Ij(i,l),(i=i.alternate)&&Ij(i,l)}function $j(i){if(i.tag===13){var l=El(i,67108864);l!==null&&Hr(l,i,67108864),Tv(i,67108864)}}var Zf=!0;function hO(i,l,u,h){var y=M.T;M.T=null;var w=I.p;try{I.p=2,Rv(i,l,u,h)}finally{I.p=w,M.T=y}}function pO(i,l,u,h){var y=M.T;M.T=null;var w=I.p;try{I.p=8,Rv(i,l,u,h)}finally{I.p=w,M.T=y}}function Rv(i,l,u,h){if(Zf){var y=_v(h);if(y===null)pv(i,l,h,Jf,u),Uj(i,h);else if(gO(y,i,l,u,h))h.stopPropagation();else if(Uj(i,h),l&4&&-1<mO.indexOf(i)){for(;y!==null;){var w=et(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var D=Ir(w.pendingLanes);if(D!==0){var O=w;for(O.pendingLanes|=2,O.entangledLanes|=2;D;){var U=1<<31-$t(D);O.entanglements[1]|=U,D&=~U}Yi(w),(Wt&6)===0&&(Lf=Re()+500,Eu(0))}}break;case 13:O=El(w,2),O!==null&&Hr(O,w,2),$f(),Tv(w,2)}if(w=_v(h),w===null&&pv(i,l,h,Jf,u),w===y)break;y=w}y!==null&&h.stopPropagation()}else pv(i,l,h,null,u)}}function _v(i){return i=Nm(i),Dv(i)}var Jf=null;function Dv(i){if(Jf=null,i=ft(i),i!==null){var l=s(i);if(l===null)i=null;else{var u=l.tag;if(u===13){if(i=c(l),i!==null)return i;i=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return Jf=i,null}function zj(i){switch(i){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 Xe:return 2;case Ae:return 8;case pe:case Se:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Av=!1,ka=null,Na=null,Oa=null,Nu=new Map,Ou=new Map,Ma=[],mO="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 Uj(i,l){switch(i){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Na=null;break;case"mouseover":case"mouseout":Oa=null;break;case"pointerover":case"pointerout":Nu.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ou.delete(l.pointerId)}}function Mu(i,l,u,h,y,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:w,targetContainers:[y]},l!==null&&(l=et(l),l!==null&&$j(l)),i):(i.eventSystemFlags|=h,l=i.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),i)}function gO(i,l,u,h,y){switch(l){case"focusin":return ka=Mu(ka,i,l,u,h,y),!0;case"dragenter":return Na=Mu(Na,i,l,u,h,y),!0;case"mouseover":return Oa=Mu(Oa,i,l,u,h,y),!0;case"pointerover":var w=y.pointerId;return Nu.set(w,Mu(Nu.get(w)||null,i,l,u,h,y)),!0;case"gotpointercapture":return w=y.pointerId,Ou.set(w,Mu(Ou.get(w)||null,i,l,u,h,y)),!0}return!1}function Bj(i){var l=ft(i.target);if(l!==null){var u=s(l);if(u!==null){if(l=u.tag,l===13){if(l=c(u),l!==null){i.blockedOn=l,X(i.priority,function(){if(u.tag===13){var h=qr();h=ls(h);var y=El(u,h);y!==null&&Hr(y,u,h),Tv(u,h)}});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function eh(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var u=_v(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);km=h,u.target.dispatchEvent(h),km=null}else return l=et(u),l!==null&&$j(l),i.blockedOn=u,!1;l.shift()}return!0}function Vj(i,l,u){eh(i)&&u.delete(l)}function vO(){Av=!1,ka!==null&&eh(ka)&&(ka=null),Na!==null&&eh(Na)&&(Na=null),Oa!==null&&eh(Oa)&&(Oa=null),Nu.forEach(Vj),Ou.forEach(Vj)}function th(i,l){i.blockedOn===l&&(i.blockedOn=null,Av||(Av=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,vO)))}var nh=null;function Fj(i){nh!==i&&(nh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nh===i&&(nh=null);for(var l=0;l<i.length;l+=3){var u=i[l],h=i[l+1],y=i[l+2];if(typeof h!="function"){if(Dv(h||u)===null)continue;break}var w=et(u);w!==null&&(i.splice(l,3),l-=3,Dg(w,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function Lu(i){function l(U){return th(U,i)}ka!==null&&th(ka,i),Na!==null&&th(Na,i),Oa!==null&&th(Oa,i),Nu.forEach(l),Ou.forEach(l);for(var u=0;u<Ma.length;u++){var h=Ma[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<Ma.length&&(u=Ma[0],u.blockedOn===null);)Bj(u),u.blockedOn===null&&Ma.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],w=u[h+1],D=y[Te]||null;if(typeof w=="function")D||Fj(u);else if(D){var O=null;if(w&&w.hasAttribute("formAction")){if(y=w,D=w[Te]||null)O=D.formAction;else if(Dv(y)!==null)continue}else O=D.action;typeof O=="function"?u[h+1]=O:(u.splice(h,3),h-=3),Fj(u)}}}function Pv(i){this._internalRoot=i}rh.prototype.render=Pv.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var u=l.current,h=qr();Lj(u,h,i,l,null,null)},rh.prototype.unmount=Pv.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Lj(i.current,2,null,i,null,null),$f(),l[Ve]=null}};function rh(i){this._internalRoot=i}rh.prototype.unstable_scheduleHydration=function(i){if(i){var l=V();i={blockedOn:null,target:i,priority:l};for(var u=0;u<Ma.length&&l!==0&&l<Ma[u].priority;u++);Ma.splice(u,0,i),u===0&&Bj(i)}};var qj=t.version;if(qj!=="19.1.1")throw Error(r(527,qj,"19.1.1"));I.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(l),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var yO={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ih=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ih.isDisabled&&ih.supportsFiber)try{Dt=ih.inject(yO),bt=ih}catch{}}return Fu.createRoot=function(i,l){if(!o(i))throw Error(r(299));var u=!1,h="",y=aw,w=sw,D=lw,O=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&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(D=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(O=l.unstable_transitionCallbacks)),l=Oj(i,1,!1,null,null,u,h,y,w,D,O,null),i[Ve]=l.current,hv(i),new Pv(l)},Fu.hydrateRoot=function(i,l,u){if(!o(i))throw Error(r(299));var h=!1,y="",w=aw,D=sw,O=lw,U=null,te=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(D=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(U=u.unstable_transitionCallbacks),u.formState!==void 0&&(te=u.formState)),l=Oj(i,1,!0,l,u??null,h,y,w,D,O,U,te),l.context=Mj(null),u=l.current,h=qr(),h=ls(h),y=ya(h),y.callback=null,xa(u,y,h),u=h,l.current.lanes=u,wr(l,u),Yi(l),i[Ve]=l.current,hv(i),new rh(l)},Fu.version="19.1.1",Fu}var wT;function VX(){if(wT)return vy.exports;wT=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(),vy.exports=BX(),vy.exports}var FX=VX();/**
|
|
582
|
-
* react-router v7.9.1
|
|
583
|
-
*
|
|
584
|
-
* Copyright (c) Remix Software Inc.
|
|
585
|
-
*
|
|
586
|
-
* This source code is licensed under the MIT license found in the
|
|
587
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
588
|
-
*
|
|
589
|
-
* @license MIT
|
|
590
|
-
*/var SP=e=>{throw TypeError(e)},qX=(e,t,n)=>t.has(e)||SP("Cannot "+n),by=(e,t,n)=>(qX(e,t,"read from private field"),n?n.call(e):t.get(e)),HX=(e,t,n)=>t.has(e)?SP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jT="popstate";function GX(e={}){function t(r,o){let{pathname:s,search:c,hash:d}=r.location;return dd("",{pathname:s,search:c,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Ja(o)}return QX(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 WX(){return Math.random().toString(36).substring(2,10)}function CT(e,t){return{usr:e.state,key:e.key,idx:t}}function dd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ua(t):t,state:n,key:t&&t.key||r||WX()}}function Ja({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 ua(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 QX(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,c=o.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(),R=C==null?null:C-p;p=C,f&&f({action:d,location:j.location,delta:R})}function x(C,R){d="PUSH";let E=dd(j.location,C,R);p=m()+1;let T=CT(E,p),_=j.createHref(E);try{c.pushState(T,"",_)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(_)}s&&f&&f({action:d,location:j.location,delta:1})}function b(C,R){d="REPLACE";let E=dd(j.location,C,R);p=m();let T=CT(E,p),_=j.createHref(E);c.replaceState(T,"",_),s&&f&&f({action:d,location:j.location,delta:0})}function S(C){return wP(C)}let j={get action(){return d},get location(){return e(o,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(jT,g),f=C,()=>{o.removeEventListener(jT,g),f=null}},createHref(C){return t(o,C)},createURL:S,encodeLocation(C){let R=S(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:b,go(C){return c.go(C)}};return j}function wP(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:Ja(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Yu,ET=class{constructor(e){if(HX(this,Yu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(by(this,Yu).has(e))return by(this,Yu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){by(this,Yu).set(e,t)}};Yu=new WeakMap;var YX=new Set(["lazy","caseSensitive","path","id","index","children"]);function KX(e){return YX.has(e)}var XX=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function ZX(e){return XX.has(e)}function JX(e){return e.index===!0}function fd(e,t,n=[],r={},o=!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(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),JX(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=fd(s.children,t,d,r,o)),p}})}function qa(e,t,n="/"){return Nh(e,t,n,!1)}function Nh(e,t,n,r){let o=typeof t=="string"?ua(t):t,s=xi(o.pathname||"/",n);if(s==null)return null;let c=jP(e);tZ(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let p=fZ(s);d=uZ(c[f],p,r)}return d}function eZ(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function jP(e,t=[],n=[],r="",o=!1){let s=(c,d,f=o,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=so([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}".`),jP(c.children,t,x,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:lZ(g,c.index),routesMeta:x})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))s(c,d);else for(let f of CP(c.path))s(c,d,!0,f)}),t}function CP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let c=CP(r.join("/")),d=[];return d.push(...c.map(f=>f===""?s:[s,f].join("/"))),o&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function tZ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cZ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var nZ=/^:[\w-]+$/,rZ=3,iZ=2,oZ=1,aZ=10,sZ=-2,TT=e=>e==="*";function lZ(e,t){let n=e.split("/"),r=n.length;return n.some(TT)&&(r+=sZ),t&&(r+=iZ),n.filter(o=>!TT(o)).reduce((o,s)=>o+(nZ.test(s)?rZ:s===""?oZ:aZ),r)}function cZ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function uZ(e,t,n=!1){let{routesMeta:r}=e,o={},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=dp({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),x=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=dp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),c.push({params:o,pathname:so([s,g.pathname]),pathnameBase:gZ(so([s,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(s=so([s,g.pathnameBase]))}return c}function dp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=dZ(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},x)=>{if(m==="*"){let S=d[x]||"";c=s.slice(0,s.length-S.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 dZ(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=[],o="^"+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:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function fZ(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 xi(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 hZ({basename:e,pathname:t}){return t==="/"?e:so([e,t])}function pZ(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ua(e):e;return{pathname:n?n.startsWith("/")?n:mZ(n,t):t,search:vZ(r),hash:yZ(o)}}function mZ(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Sy(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 EP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Kb(e){let t=EP(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Xb(e,t,n,r=!1){let o;typeof e=="string"?o=ua(e):(o={...e},xt(!o.pathname||!o.pathname.includes("?"),Sy("?","pathname","search",o)),xt(!o.pathname||!o.pathname.includes("#"),Sy("#","pathname","hash",o)),xt(!o.search||!o.search.includes("#"),Sy("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.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;o.pathname=x.join("/")}d=g>=0?t[g]:"/"}let f=pZ(o,d),p=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var so=e=>e.join("/").replace(/\/\/+/g,"/"),gZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),vZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,fp=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 hd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var TP=["POST","PUT","PATCH","DELETE"],xZ=new Set(TP),bZ=["GET",...TP],SZ=new Set(bZ),wZ=new Set([301,302,303,307,308]),jZ=new Set([307,308]),wy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},CZ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},EZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zb=e=>EZ.test(e),TZ=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),RP="remix-router-transitions",_P=Symbol("ResetLoaderData");function RZ(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||[],o=e.mapRouteProperties||TZ,s={},c=fd(e.routes,o,void 0,s),d,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let p=e.dataStrategy||kZ,m={...e.future},g=null,x=new Set,b=null,S=null,j=null,C=e.hydrationData!=null,R=qa(c,e.history.location,f),E=!1,T=null,_;if(R==null&&!e.patchRoutesOnNavigation){let V=fi(404,{pathname:e.history.location.pathname}),{matches:X,route:ie}=vh(c);_=!0,R=X,T={[ie.id]:V}}else if(R&&!e.hydrationData&&wo(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(V=>V.route.lazy))_=!1;else if(!R.some(V=>V.route.loader))_=!0;else{let V=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let ie=R.findIndex(ve=>X[ve.route.id]!==void 0);_=R.slice(0,ie+1).every(ve=>!hx(ve.route,V,X))}else _=R.every(ie=>!hx(ie.route,V,X))}else{_=!1,R=[];let V=wo(null,c,e.history.location.pathname);V.active&&V.matches&&(E=!0,R=V.matches)}let P,A={historyAction:e.history.action,location:e.history.location,matches:R,initialized:_,navigation:wy,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||T,fetchers:new Map,blockers:new Map},k="POP",L=!1,z,B=!1,Z=new Map,K=null,Y=!1,H=!1,W=new Set,M=new Map,I=0,$=-1,q=new Map,N=new Set,F=new Map,J=new Map,ae=new Set,je=new Map,xe,we=null;function Qe(){if(g=e.history.listen(({action:V,location:X,delta:ie})=>{if(xe){xe(),xe=void 0;return}Mn(je.size===0||ie!=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 ve=ml({currentLocation:A.location,nextLocation:X,historyAction:V});if(ve&&ie!=null){let Te=new Promise(Ve=>{xe=Ve});e.history.go(ie*-1),Jr(ve,{state:"blocked",location:X,proceed(){Jr(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),Te.then(()=>e.history.go(ie))},reset(){let Ve=new Map(A.blockers);Ve.set(ve,qu),nt({blockers:Ve})}});return}return pt(V,X)}),n){WZ(t,Z);let V=()=>QZ(t,Z);t.addEventListener("pagehide",V),K=()=>t.removeEventListener("pagehide",V)}return A.initialized||pt("POP",A.location,{initialHydration:!0}),P}function Ee(){g&&g(),K&&K(),x.clear(),z&&z.abort(),A.fetchers.forEach((V,X)=>$t(X)),A.blockers.forEach((V,X)=>bo(X))}function ot(V){return x.add(V),()=>x.delete(V)}function nt(V,X={}){V.matches&&(V.matches=V.matches.map(Te=>{let Ve=s[Te.route.id],Ye=Te.route;return Ye.element!==Ve.element||Ye.errorElement!==Ve.errorElement||Ye.hydrateFallbackElement!==Ve.hydrateFallbackElement?{...Te,route:Ve}:Te})),A={...A,...V};let ie=[],ve=[];A.fetchers.forEach((Te,Ve)=>{Te.state==="idle"&&(ae.has(Ve)?ie.push(Ve):ve.push(Ve))}),ae.forEach(Te=>{!A.fetchers.has(Te)&&!M.has(Te)&&ie.push(Te)}),[...x].forEach(Te=>Te(A,{deletedFetchers:ie,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),ie.forEach(Te=>$t(Te)),ve.forEach(Te=>A.fetchers.delete(Te))}function Ct(V,X,{flushSync:ie}={}){let ve=A.actionData!=null&&A.navigation.formMethod!=null&&Dr(A.navigation.formMethod)&&A.navigation.state==="loading"&&V.state?._isRedirect!==!0,Te;X.actionData?Object.keys(X.actionData).length>0?Te=X.actionData:Te=null:ve?Te=A.actionData:Te=null;let Ve=X.loaderData?LT(A.loaderData,X.loaderData,X.matches||[],X.errors):A.loaderData,Ye=A.blockers;Ye.size>0&&(Ye=new Map(Ye),Ye.forEach((qe,Ke)=>Ye.set(Ke,qu)));let Fe=Y?!1:Hn(V,X.matches||A.matches),Je=L===!0||A.navigation.formMethod!=null&&Dr(A.navigation.formMethod)&&V.state?._isRedirect!==!0;d&&(c=d,d=void 0),Y||k==="POP"||(k==="PUSH"?e.history.push(V,V.state):k==="REPLACE"&&e.history.replace(V,V.state));let it;if(k==="POP"){let qe=Z.get(A.location.pathname);qe&&qe.has(V.pathname)?it={currentLocation:A.location,nextLocation:V}:Z.has(V.pathname)&&(it={currentLocation:V,nextLocation:A.location})}else if(B){let qe=Z.get(A.location.pathname);qe?qe.add(V.pathname):(qe=new Set([V.pathname]),Z.set(A.location.pathname,qe)),it={currentLocation:A.location,nextLocation:V}}nt({...X,actionData:Te,loaderData:Ve,historyAction:k,location:V,initialized:!0,navigation:wy,revalidation:"idle",restoreScrollPosition:Fe,preventScrollReset:Je,blockers:Ye},{viewTransitionOpts:it,flushSync:ie===!0}),k="POP",L=!1,B=!1,Y=!1,H=!1,we?.resolve(),we=null}async function Mt(V,X){if(typeof V=="number"){e.history.go(V);return}let ie=fx(A.location,A.matches,f,V,X?.fromRouteId,X?.relative),{path:ve,submission:Te,error:Ve}=RT(!1,ie,X),Ye=A.location,Fe=dd(A.location,ve,X&&X.state);Fe={...Fe,...e.history.encodeLocation(Fe)};let Je=X&&X.replace!=null?X.replace:void 0,it="PUSH";Je===!0?it="REPLACE":Je===!1||Te!=null&&Dr(Te.formMethod)&&Te.formAction===A.location.pathname+A.location.search&&(it="REPLACE");let qe=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,Ke=(X&&X.flushSync)===!0,ft=ml({currentLocation:Ye,nextLocation:Fe,historyAction:it});if(ft){Jr(ft,{state:"blocked",location:Fe,proceed(){Jr(ft,{state:"proceeding",proceed:void 0,reset:void 0,location:Fe}),Mt(V,X)},reset(){let et=new Map(A.blockers);et.set(ft,qu),nt({blockers:et})}});return}await pt(it,Fe,{submission:Te,pendingError:Ve,preventScrollReset:qe,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:Ke})}function Lt(){we||(we=YZ()),Me(),nt({revalidation:"loading"});let V=we.promise;return A.navigation.state==="submitting"?V:A.navigation.state==="idle"?(pt(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),V):(pt(k||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:B===!0}),V)}async function pt(V,X,ie){z&&z.abort(),z=null,k=V,Y=(ie&&ie.startUninterruptedRevalidation)===!0,wr(A.location,A.matches),L=(ie&&ie.preventScrollReset)===!0,B=(ie&&ie.enableViewTransition)===!0;let ve=d||c,Te=ie&&ie.overrideNavigation,Ve=ie?.initialHydration&&A.matches&&A.matches.length>0&&!E?A.matches:qa(ve,X,f),Ye=(ie&&ie.flushSync)===!0;if(Ve&&A.initialized&&!H&&UZ(A.location,X)&&!(ie&&ie.submission&&Dr(ie.submission.formMethod))){Ct(X,{matches:Ve},{flushSync:Ye});return}let Fe=wo(Ve,ve,X.pathname);if(Fe.active&&Fe.matches&&(Ve=Fe.matches),!Ve){let{error:vn,notFoundMatches:mt,route:Xt}=So(X.pathname);Ct(X,{matches:mt,loaderData:{},errors:{[Xt.id]:vn}},{flushSync:Ye});return}z=new AbortController;let Je=cc(e.history,X,z.signal,ie&&ie.submission),it=e.getContext?await e.getContext():new ET,qe;if(ie&&ie.pendingError)qe=[Ha(Ve).route.id,{type:"error",error:ie.pendingError}];else if(ie&&ie.submission&&Dr(ie.submission.formMethod)){let vn=await Rt(Je,X,ie.submission,Ve,it,Fe.active,ie&&ie.initialHydration===!0,{replace:ie.replace,flushSync:Ye});if(vn.shortCircuited)return;if(vn.pendingActionResult){let[mt,Xt]=vn.pendingActionResult;if(Wr(Xt)&&hd(Xt.error)&&Xt.error.status===404){z=null,Ct(X,{matches:vn.matches,loaderData:{},errors:{[mt]:Xt.error}});return}}Ve=vn.matches||Ve,qe=vn.pendingActionResult,Te=jy(X,ie.submission),Ye=!1,Fe.active=!1,Je=cc(e.history,Je.url,Je.signal)}let{shortCircuited:Ke,matches:ft,loaderData:et,errors:Kt}=await tn(Je,X,Ve,it,Fe.active,Te,ie&&ie.submission,ie&&ie.fetcherSubmission,ie&&ie.replace,ie&&ie.initialHydration===!0,Ye,qe);Ke||(z=null,Ct(X,{matches:ft||Ve,...IT(qe),loaderData:et,errors:Kt}))}async function Rt(V,X,ie,ve,Te,Ve,Ye,Fe={}){Me();let Je=HZ(X,ie);if(nt({navigation:Je},{flushSync:Fe.flushSync===!0}),Ve){let Ke=await fa(ve,X.pathname,V.signal);if(Ke.type==="aborted")return{shortCircuited:!0};if(Ke.type==="error"){if(Ke.partialMatches.length===0){let{matches:et,route:Kt}=vh(c);return{matches:et,pendingActionResult:[Kt.id,{type:"error",error:Ke.error}]}}let ft=Ha(Ke.partialMatches).route.id;return{matches:Ke.partialMatches,pendingActionResult:[ft,{type:"error",error:Ke.error}]}}else if(Ke.matches)ve=Ke.matches;else{let{notFoundMatches:ft,error:et,route:Kt}=So(X.pathname);return{matches:ft,pendingActionResult:[Kt.id,{type:"error",error:et}]}}}let it,qe=Oh(ve,X);if(!qe.route.action&&!qe.route.lazy)it={type:"error",error:fi(405,{method:V.method,pathname:X.pathname,routeId:qe.route.id})};else{let Ke=mc(o,s,V,ve,qe,Ye?[]:r,Te),ft=await ze(V,Ke,Te,null);if(it=ft[qe.route.id],!it){for(let et of ve)if(ft[et.route.id]){it=ft[et.route.id];break}}if(V.signal.aborted)return{shortCircuited:!0}}if(Us(it)){let Ke;return Fe&&Fe.replace!=null?Ke=Fe.replace:Ke=NT(it.response.headers.get("Location"),new URL(V.url),f)===A.location.pathname+A.location.search,await Se(V,it,!0,{submission:ie,replace:Ke}),{shortCircuited:!0}}if(Wr(it)){let Ke=Ha(ve,qe.route.id);return(Fe&&Fe.replace)!==!0&&(k="PUSH"),{matches:ve,pendingActionResult:[Ke.route.id,it,qe.route.id]}}return{matches:ve,pendingActionResult:[qe.route.id,it]}}async function tn(V,X,ie,ve,Te,Ve,Ye,Fe,Je,it,qe,Ke){let ft=Ve||jy(X,Ye),et=Ye||Fe||zT(ft),Kt=!Y&&!it;if(Te){if(Kt){let zn=Re(Ke);nt({navigation:ft,...zn!==void 0?{actionData:zn}:{}},{flushSync:qe})}let gt=await fa(ie,X.pathname,V.signal);if(gt.type==="aborted")return{shortCircuited:!0};if(gt.type==="error"){if(gt.partialMatches.length===0){let{matches:To,route:jr}=vh(c);return{matches:To,loaderData:{},errors:{[jr.id]:gt.error}}}let zn=Ha(gt.partialMatches).route.id;return{matches:gt.partialMatches,loaderData:{},errors:{[zn]:gt.error}}}else if(gt.matches)ie=gt.matches;else{let{error:zn,notFoundMatches:To,route:jr}=So(X.pathname);return{matches:To,loaderData:{},errors:{[jr.id]:zn}}}}let vn=d||c,{dsMatches:mt,revalidatingFetchers:Xt}=_T(V,ve,o,s,e.history,A,ie,et,X,it?[]:r,it===!0,H,W,ae,F,N,vn,f,e.patchRoutesOnNavigation!=null,Ke);if($=++I,!e.dataStrategy&&!mt.some(gt=>gt.shouldLoad)&&!mt.some(gt=>gt.route.middleware)&&Xt.length===0){let gt=Ei();return Ct(X,{matches:ie,loaderData:{},errors:Ke&&Wr(Ke[1])?{[Ke[0]]:Ke[1].error}:null,...IT(Ke),...gt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:qe}),{shortCircuited:!0}}if(Kt){let gt={};if(!Te){gt.navigation=ft;let zn=Re(Ke);zn!==void 0&&(gt.actionData=zn)}Xt.length>0&&(gt.fetchers=Pe(Xt)),nt(gt,{flushSync:qe})}Xt.forEach(gt=>{An(gt.key),gt.controller&&M.set(gt.key,gt.controller)});let qi=()=>Xt.forEach(gt=>An(gt.key));z&&z.signal.addEventListener("abort",qi);let{loaderResults:$r,fetcherResults:fr}=await be(mt,Xt,V,ve);if(V.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",qi),Xt.forEach(gt=>M.delete(gt.key));let ei=yh($r);if(ei)return await Se(V,ei.result,!0,{replace:Je}),{shortCircuited:!0};if(ei=yh(fr),ei)return N.add(ei.key),await Se(V,ei.result,!0,{replace:Je}),{shortCircuited:!0};let{loaderData:gl,errors:ha}=MT(A,ie,$r,Ke,Xt,fr);it&&A.errors&&(ha={...A.errors,...ha});let jo=Ei(),Co=xo($),Eo=jo||Co||Xt.length>0;return{matches:ie,loaderData:gl,errors:ha,...Eo?{fetchers:new Map(A.fetchers)}:{}}}function Re(V){if(V&&!Wr(V[1]))return{[V[0]]:V[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Pe(V){return V.forEach(X=>{let ie=A.fetchers.get(X.key),ve=Hu(void 0,ie?ie.data:void 0);A.fetchers.set(X.key,ve)}),new Map(A.fetchers)}async function Xe(V,X,ie,ve){An(V);let Te=(ve&&ve.flushSync)===!0,Ve=d||c,Ye=fx(A.location,A.matches,f,ie,X,ve?.relative),Fe=qa(Ve,Ye,f),Je=wo(Fe,Ve,Ye);if(Je.active&&Je.matches&&(Fe=Je.matches),!Fe){bt(V,X,fi(404,{pathname:Ye}),{flushSync:Te});return}let{path:it,submission:qe,error:Ke}=RT(!0,Ye,ve);if(Ke){bt(V,X,Ke,{flushSync:Te});return}let ft=e.getContext?await e.getContext():new ET,et=(ve&&ve.preventScrollReset)===!0;if(qe&&Dr(qe.formMethod)){await Ae(V,X,it,Fe,ft,Je.active,Te,et,qe);return}F.set(V,{routeId:X,path:it}),await pe(V,X,it,Fe,ft,Je.active,Te,et,qe)}async function Ae(V,X,ie,ve,Te,Ve,Ye,Fe,Je){Me(),F.delete(V);let it=A.fetchers.get(V);Dt(V,GZ(Je,it),{flushSync:Ye});let qe=new AbortController,Ke=cc(e.history,ie,qe.signal,Je);if(Ve){let jn=await fa(ve,new URL(Ke.url).pathname,Ke.signal,V);if(jn.type==="aborted")return;if(jn.type==="error"){bt(V,X,jn.error,{flushSync:Ye});return}else if(jn.matches)ve=jn.matches;else{bt(V,X,fi(404,{pathname:ie}),{flushSync:Ye});return}}let ft=Oh(ve,ie);if(!ft.route.action&&!ft.route.lazy){let jn=fi(405,{method:Je.formMethod,pathname:ie,routeId:X});bt(V,X,jn,{flushSync:Ye});return}M.set(V,qe);let et=I,Kt=mc(o,s,Ke,ve,ft,r,Te),mt=(await ze(Ke,Kt,Te,V))[ft.route.id];if(Ke.signal.aborted){M.get(V)===qe&&M.delete(V);return}if(ae.has(V)){if(Us(mt)||Wr(mt)){Dt(V,za(void 0));return}}else{if(Us(mt))if(M.delete(V),$>et){Dt(V,za(void 0));return}else return N.add(V),Dt(V,Hu(Je)),Se(Ke,mt,!1,{fetcherSubmission:Je,preventScrollReset:Fe});if(Wr(mt)){bt(V,X,mt.error);return}}let Xt=A.navigation.location||A.location,qi=cc(e.history,Xt,qe.signal),$r=d||c,fr=A.navigation.state!=="idle"?qa($r,A.navigation.location,f):A.matches;xt(fr,"Didn't find any matches after fetcher action");let ei=++I;q.set(V,ei);let gl=Hu(Je,mt.data);A.fetchers.set(V,gl);let{dsMatches:ha,revalidatingFetchers:jo}=_T(qi,Te,o,s,e.history,A,fr,Je,Xt,r,!1,H,W,ae,F,N,$r,f,e.patchRoutesOnNavigation!=null,[ft.route.id,mt]);jo.filter(jn=>jn.key!==V).forEach(jn=>{let pa=jn.key,Qd=A.fetchers.get(pa),Yd=Hu(void 0,Qd?Qd.data:void 0);A.fetchers.set(pa,Yd),An(pa),jn.controller&&M.set(pa,jn.controller)}),nt({fetchers:new Map(A.fetchers)});let Co=()=>jo.forEach(jn=>An(jn.key));qe.signal.addEventListener("abort",Co);let{loaderResults:Eo,fetcherResults:gt}=await be(ha,jo,qi,Te);if(qe.signal.aborted)return;if(qe.signal.removeEventListener("abort",Co),q.delete(V),M.delete(V),jo.forEach(jn=>M.delete(jn.key)),A.fetchers.has(V)){let jn=za(mt.data);A.fetchers.set(V,jn)}let zn=yh(Eo);if(zn)return Se(qi,zn.result,!1,{preventScrollReset:Fe});if(zn=yh(gt),zn)return N.add(zn.key),Se(qi,zn.result,!1,{preventScrollReset:Fe});let{loaderData:To,errors:jr}=MT(A,fr,Eo,void 0,jo,gt);xo(ei),A.navigation.state==="loading"&&ei>$?(xt(k,"Expected pending action"),z&&z.abort(),Ct(A.navigation.location,{matches:fr,loaderData:To,errors:jr,fetchers:new Map(A.fetchers)})):(nt({errors:jr,loaderData:LT(A.loaderData,To,fr,jr),fetchers:new Map(A.fetchers)}),H=!1)}async function pe(V,X,ie,ve,Te,Ve,Ye,Fe,Je){let it=A.fetchers.get(V);Dt(V,Hu(Je,it?it.data:void 0),{flushSync:Ye});let qe=new AbortController,Ke=cc(e.history,ie,qe.signal);if(Ve){let Xt=await fa(ve,new URL(Ke.url).pathname,Ke.signal,V);if(Xt.type==="aborted")return;if(Xt.type==="error"){bt(V,X,Xt.error,{flushSync:Ye});return}else if(Xt.matches)ve=Xt.matches;else{bt(V,X,fi(404,{pathname:ie}),{flushSync:Ye});return}}let ft=Oh(ve,ie);M.set(V,qe);let et=I,Kt=mc(o,s,Ke,ve,ft,r,Te),mt=(await ze(Ke,Kt,Te,V))[ft.route.id];if(M.get(V)===qe&&M.delete(V),!Ke.signal.aborted){if(ae.has(V)){Dt(V,za(void 0));return}if(Us(mt))if($>et){Dt(V,za(void 0));return}else{N.add(V),await Se(Ke,mt,!1,{preventScrollReset:Fe});return}if(Wr(mt)){bt(V,X,mt.error);return}Dt(V,za(mt.data))}}async function Se(V,X,ie,{submission:ve,fetcherSubmission:Te,preventScrollReset:Ve,replace:Ye}={}){X.response.headers.has("X-Remix-Revalidate")&&(H=!0);let Fe=X.response.headers.get("Location");xt(Fe,"Expected a Location header on the redirect Response"),Fe=NT(Fe,new URL(V.url),f);let Je=dd(A.location,Fe,{_isRedirect:!0});if(n){let Kt=!1;if(X.response.headers.has("X-Remix-Reload-Document"))Kt=!0;else if(Zb(Fe)){const vn=wP(Fe,!0);Kt=vn.origin!==t.location.origin||xi(vn.pathname,f)==null}if(Kt){Ye?t.location.replace(Fe):t.location.assign(Fe);return}}z=null;let it=Ye===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:qe,formAction:Ke,formEncType:ft}=A.navigation;!ve&&!Te&&qe&&Ke&&ft&&(ve=zT(A.navigation));let et=ve||Te;if(jZ.has(X.response.status)&&et&&Dr(et.formMethod))await pt(it,Je,{submission:{...et,formAction:Fe},preventScrollReset:Ve||L,enableViewTransition:ie?B:void 0});else{let Kt=jy(Je,ve);await pt(it,Je,{overrideNavigation:Kt,fetcherSubmission:Te,preventScrollReset:Ve||L,enableViewTransition:ie?B:void 0})}}async function ze(V,X,ie,ve){let Te,Ve={};try{Te=await OZ(p,V,X,ve,ie,!1)}catch(Ye){return X.filter(Fe=>Fe.shouldLoad).forEach(Fe=>{Ve[Fe.route.id]={type:"error",error:Ye}}),Ve}if(V.signal.aborted)return Ve;for(let[Ye,Fe]of Object.entries(Te))if(FZ(Fe)){let Je=Fe.result;Ve[Ye]={type:"redirect",response:$Z(Je,V,Ye,X,f)}}else Ve[Ye]=await IZ(Fe);return Ve}async function be(V,X,ie,ve){let Te=ze(ie,V,ve,null),Ve=Promise.all(X.map(async Je=>{if(Je.matches&&Je.match&&Je.request&&Je.controller){let qe=(await ze(Je.request,Je.matches,ve,Je.key))[Je.match.route.id];return{[Je.key]:qe}}else return Promise.resolve({[Je.key]:{type:"error",error:fi(404,{pathname:Je.path})}})})),Ye=await Te,Fe=(await Ve).reduce((Je,it)=>Object.assign(Je,it),{});return{loaderResults:Ye,fetcherResults:Fe}}function Me(){H=!0,F.forEach((V,X)=>{M.has(X)&&W.add(X),An(X)})}function Dt(V,X,ie={}){A.fetchers.set(V,X),nt({fetchers:new Map(A.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function bt(V,X,ie,ve={}){let Te=Ha(A.matches,X);$t(V),nt({errors:{[Te.route.id]:ie},fetchers:new Map(A.fetchers)},{flushSync:(ve&&ve.flushSync)===!0})}function nn(V){return J.set(V,(J.get(V)||0)+1),ae.has(V)&&ae.delete(V),A.fetchers.get(V)||CZ}function $t(V){let X=A.fetchers.get(V);M.has(V)&&!(X&&X.state==="loading"&&q.has(V))&&An(V),F.delete(V),q.delete(V),N.delete(V),ae.delete(V),W.delete(V),A.fetchers.delete(V)}function $n(V){let X=(J.get(V)||0)-1;X<=0?(J.delete(V),ae.add(V)):J.set(V,X),nt({fetchers:new Map(A.fetchers)})}function An(V){let X=M.get(V);X&&(X.abort(),M.delete(V))}function Vi(V){for(let X of V){let ie=nn(X),ve=za(ie.data);A.fetchers.set(X,ve)}}function Ei(){let V=[],X=!1;for(let ie of N){let ve=A.fetchers.get(ie);xt(ve,`Expected fetcher: ${ie}`),ve.state==="loading"&&(N.delete(ie),V.push(ie),X=!0)}return Vi(V),X}function xo(V){let X=[];for(let[ie,ve]of q)if(ve<V){let Te=A.fetchers.get(ie);xt(Te,`Expected fetcher: ${ie}`),Te.state==="loading"&&(An(ie),q.delete(ie),X.push(ie))}return Vi(X),X.length>0}function Ir(V,X){let ie=A.blockers.get(V)||qu;return je.get(V)!==X&&je.set(V,X),ie}function bo(V){A.blockers.delete(V),je.delete(V)}function Jr(V,X){let ie=A.blockers.get(V)||qu;xt(ie.state==="unblocked"&&X.state==="blocked"||ie.state==="blocked"&&X.state==="blocked"||ie.state==="blocked"&&X.state==="proceeding"||ie.state==="blocked"&&X.state==="unblocked"||ie.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${ie.state} -> ${X.state}`);let ve=new Map(A.blockers);ve.set(V,X),nt({blockers:ve})}function ml({currentLocation:V,nextLocation:X,historyAction:ie}){if(je.size===0)return;je.size>1&&Mn(!1,"A router only supports one blocker at a time");let ve=Array.from(je.entries()),[Te,Ve]=ve[ve.length-1],Ye=A.blockers.get(Te);if(!(Ye&&Ye.state==="proceeding")&&Ve({currentLocation:V,nextLocation:X,historyAction:ie}))return Te}function So(V){let X=fi(404,{pathname:V}),ie=d||c,{matches:ve,route:Te}=vh(ie);return{notFoundMatches:ve,route:Te,error:X}}function da(V,X,ie){if(b=V,j=X,S=ie||null,!C&&A.navigation===wy){C=!0;let ve=Hn(A.location,A.matches);ve!=null&&nt({restoreScrollPosition:ve})}return()=>{b=null,j=null,S=null}}function Fi(V,X){return S&&S(V,X.map(ve=>eZ(ve,A.loaderData)))||V.key}function wr(V,X){if(b&&j){let ie=Fi(V,X);b[ie]=j()}}function Hn(V,X){if(b){let ie=Fi(V,X),ve=b[ie];if(typeof ve=="number")return ve}return null}function wo(V,X,ie){if(e.patchRoutesOnNavigation)if(V){if(Object.keys(V[0].params).length>0)return{active:!0,matches:Nh(X,ie,f,!0)}}else return{active:!0,matches:Nh(X,ie,f,!0)||[]};return{active:!1,matches:null}}async function fa(V,X,ie,ve){if(!e.patchRoutesOnNavigation)return{type:"success",matches:V};let Te=V;for(;;){let Ve=d==null,Ye=d||c,Fe=s;try{await e.patchRoutesOnNavigation({signal:ie,path:X,matches:Te,fetcherKey:ve,patch:(qe,Ke)=>{ie.aborted||DT(qe,Ke,Ye,Fe,o,!1)}})}catch(qe){return{type:"error",error:qe,partialMatches:Te}}finally{Ve&&!ie.aborted&&(c=[...c])}if(ie.aborted)return{type:"aborted"};let Je=qa(Ye,X,f);if(Je)return{type:"success",matches:Je};let it=Nh(Ye,X,f,!0);if(!it||Te.length===it.length&&Te.every((qe,Ke)=>qe.route.id===it[Ke].route.id))return{type:"success",matches:null};Te=it}}function ls(V){s={},d=fd(V,o,void 0,s)}function cs(V,X,ie=!1){let ve=d==null;DT(V,X,d||c,s,o,ie),ve&&(c=[...c],nt({}))}return P={get basename(){return f},get future(){return m},get state(){return A},get routes(){return c},get window(){return t},initialize:Qe,subscribe:ot,enableScrollRestoration:da,navigate:Mt,fetch:Xe,revalidate:Lt,createHref:V=>e.history.createHref(V),encodeLocation:V=>e.history.encodeLocation(V),getFetcher:nn,deleteFetcher:$n,dispose:Ee,getBlocker:Ir,deleteBlocker:bo,patchRoutes:cs,_internalFetchControllers:M,_internalSetRoutes:ls,_internalSetStateDoNotUseOrYouWillBreakYourApp(V){nt(V)}},P}function _Z(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function fx(e,t,n,r,o,s){let c,d;if(o){c=[];for(let p of t)if(c.push(p),p.route.id===o){d=p;break}}else c=t,d=t[t.length-1];let f=Xb(r||".",Kb(c),xi(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=Jb(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=hZ({basename:n,pathname:f.pathname})),Ja(f)}function RT(e,t,n){if(!n||!_Z(n))return{path:t};if(n.formMethod&&!qZ(n.formMethod))return{path:t,error:fi(405,{method:n.formMethod})};let r=()=>({path:t,error:fi(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=OP(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Dr(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,S])=>`${x}${b}=${S}
|
|
591
|
-
`,""):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(!Dr(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=mx(n.formData),f=n.formData;else if(n.body instanceof FormData)d=mx(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=OT(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=OT(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(Dr(p.formMethod))return{path:t,submission:p};let m=ua(t);return e&&m.search&&Jb(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Ja(m),submission:p}}function _T(e,t,n,r,o,s,c,d,f,p,m,g,x,b,S,j,C,R,E,T){let _=T?Wr(T[1])?T[1].error:T[1].data:void 0,P=o.createURL(s.location),A=o.createURL(f),k;if(m&&s.errors){let Y=Object.keys(s.errors)[0];k=c.findIndex(H=>H.route.id===Y)}else if(T&&Wr(T[1])){let Y=T[0];k=c.findIndex(H=>H.route.id===Y)-1}let L=T?T[1].statusCode:void 0,z=L&&L>=400,B={currentUrl:P,currentParams:s.matches[0]?.params||{},nextUrl:A,nextParams:c[0].params,...d,actionResult:_,actionStatus:L},Z=c.map((Y,H)=>{let{route:W}=Y,M=null;if(k!=null&&H>k?M=!1:W.lazy?M=!0:W.loader==null?M=!1:m?M=hx(W,s.loaderData,s.errors):DZ(s.loaderData,s.matches[H],Y)&&(M=!0),M!==null)return px(n,r,e,Y,p,t,M);let I=z?!1:g||P.pathname+P.search===A.pathname+A.search||P.search!==A.search||AZ(s.matches[H],Y),$={...B,defaultShouldRevalidate:I},q=hp(Y,$);return px(n,r,e,Y,p,t,q,$)}),K=[];return S.forEach((Y,H)=>{if(m||!c.some(J=>J.route.id===Y.routeId)||b.has(H))return;let W=s.fetchers.get(H),M=W&&W.state!=="idle"&&W.data===void 0,I=qa(C,Y.path,R);if(!I){if(E&&M)return;K.push({key:H,routeId:Y.routeId,path:Y.path,matches:null,match:null,request:null,controller:null});return}if(j.has(H))return;let $=Oh(I,Y.path),q=new AbortController,N=cc(o,Y.path,q.signal),F=null;if(x.has(H))x.delete(H),F=mc(n,r,N,I,$,p,t);else if(M)g&&(F=mc(n,r,N,I,$,p,t));else{let J={...B,defaultShouldRevalidate:z?!1:g};hp($,J)&&(F=mc(n,r,N,I,$,p,t,J))}F&&K.push({key:H,routeId:Y.routeId,path:Y.path,matches:F,match:$,request:N,controller:q})}),{dsMatches:Z,revalidatingFetchers:K}}function hx(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function DZ(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function AZ(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function hp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function DT(e,t,n,r,o,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=>DP(p,g));m?f.push({existingRoute:m,newRoute:p}):d.push(p)}),d.length>0){let p=fd(d,o,[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]=fd([g],o,[],{},!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 DP(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(o=>DP(n,o))):!1}var AT=new WeakMap,AP=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(xt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let s=o.lazy[e];if(!s)return;let c=AT.get(o);c||(c={},AT.set(o,c));let d=c[e];if(d)return d;let f=(async()=>{let p=KX(e),g=o[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 "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await s();x!=null&&(Object.assign(o,{[e]:x}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(x=>x===void 0)&&(o.lazy=void 0))})();return c[e]=f,f},PT=new WeakMap;function PZ(e,t,n,r,o){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=PT.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 S in x){let j=x[S];if(j===void 0)continue;let C=ZX(S),E=s[S]!==void 0&&S!=="hasErrorBoundary";C?Mn(!C,"Route property "+S+" 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 "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):b[S]=j}Object.assign(s,b),Object.assign(s,{...r(s),lazy:void 0})})();return PT.set(s,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],f;for(let m of c){if(o&&o.includes(m))continue;let g=AP({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 kT(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,s)=>{n[t[s].route.id]=o}),n}async function kZ(e){return e.matches.some(t=>t.route.middleware)?PP(e,()=>kT(e)):kT(e)}function PP(e,t){return NZ(e,t,r=>r,BZ,n);function n(r,o,s){if(s)return Promise.resolve(Object.assign(s.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(c.findIndex(p=>p.route.id===o)||0,c.findIndex(p=>p.unstable_shouldCallHandler())||0),f=Ha(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function NZ(e,t,n,r,o){let{matches:s,request:c,params:d,context:f}=e,p=s.flatMap(g=>g.route.middleware?g.route.middleware.map(x=>[g.route.id,x]):[]);return await kP({request:c,params:d,context:f},p,t,n,r,o)}async function kP(e,t,n,r,o,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 kP(e,t,n,r,o,s,c+1)},g.value}catch(b){return g={value:await s(b,p,g)},g.value}};try{let b=await m(e,x),S=b!=null?r(b):void 0;return o(S)?S:g?S??g.value:(g={value:await x()},g.value)}catch(b){return await s(b,p,g)}}function NP(e,t,n,r,o){let s=AP({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=PZ(r.route,Dr(n.method)?"action":"loader",t,e,o);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function px(e,t,n,r,o,s,c,d=null){let f=!1,p=NP(e,t,n,r,o);return{...r,_lazyPromises:p,shouldLoad:c,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler(m){return f=!0,d?typeof m=="boolean"?hp(r,{...d,defaultShouldRevalidate:m}):hp(r,d):c},resolve(m){return f||c||m&&!Dr(n.method)&&(r.route.lazy||r.route.loader)?MZ({request:n,match:r,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:m,scopedContext:s}):Promise.resolve({type:"data",result:void 0})}}}function mc(e,t,n,r,o,s,c,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:NP(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:px(e,t,n,f,s,c,!0,d))}async function OZ(e,t,n,r,o,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:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:p=>{let m=c;return PP(m,()=>p({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function MZ({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:o,scopedContext:s}){let c,d,f=Dr(e.method),p=f?"action":"loader",m=g=>{let x,b=new Promise((C,R)=>x=R);d=()=>x(),e.signal.addEventListener("abort",d);let S=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(o?o(R=>S(R)):S())}}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(S=>{x=S}),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),S=b.pathname+b.search;throw fi(405,{method:e.method,pathname:S,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 fi(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{d&&e.signal.removeEventListener("abort",d)}return c}async function LZ(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 IZ(e){let{result:t,type:n}=e;if(MP(t)){let r;try{r=await LZ(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new fp(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?$T(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 fp(t.init?.status||500,void 0,t.data),statusCode:hd(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:hd(t)?t.status:void 0}:$T(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 $Z(e,t,n,r,o){let s=e.headers.get("Location");if(xt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Zb(s)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);s=fx(new URL(t.url),c,o,s),e.headers.set("Location",s)}return e}function NT(e,t,n){if(Zb(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=xi(o.pathname,n)!=null;if(o.origin===t.origin&&s)return o.pathname+o.search+o.hash}return e}function cc(e,t,n,r){let o=e.createURL(OP(t)).toString(),s={signal:n};if(r&&Dr(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=mx(r.formData):s.body=r.formData}return new Request(o,s)}function mx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function OT(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zZ(e,t,n,r=!1,o=!1){let s={},c=null,d,f=!1,p={},m=n&&Wr(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(!Us(b),"Cannot handle redirect results in processLoaderData"),Wr(b)){let S=b.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},o)c[x]=S;else{let j=Ha(e,x);c[j.route.id]==null&&(c[j.route.id]=S)}r||(s[x]=_P),f||(f=!0,d=hd(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 MT(e,t,n,r,o,s){let{loaderData:c,errors:d}=zZ(t,n,r);return o.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"),Wr(x)){let b=Ha(e.matches,m?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:x.error}),e.fetchers.delete(p)}else if(Us(x))xt(!1,"Unhandled fetcher revalidation redirect");else{let b=za(x.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:d}}function LT(e,t,n,r){let o=Object.entries(t).filter(([,s])=>s!==_P).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&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function IT(e){return e?Wr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ha(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 vh(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 fi(e,{pathname:t,routeId:n,method:r,type:o,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.`:o==="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 fp(e||500,c,new Error(d),!0)}function yh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(Us(o))return{key:r,result:o}}}function OP(e){let t=typeof e=="string"?ua(e):e;return Ja({...t,hash:""})}function UZ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function BZ(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&VZ(n))}function VZ(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function FZ(e){return MP(e.result)&&wZ.has(e.result.status)}function Wr(e){return e.type==="error"}function Us(e){return(e&&e.type)==="redirect"}function $T(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function MP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function qZ(e){return SZ.has(e.toUpperCase())}function Dr(e){return xZ.has(e.toUpperCase())}function Jb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Oh(e,t){let n=typeof t=="string"?ua(t).search:t.search;if(e[e.length-1].route.index&&Jb(n||""))return e[e.length-1];let r=EP(e);return r[r.length-1]}function zT(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:s,json:c}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};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 jy(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 HZ(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 Hu(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 GZ(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 za(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 WZ(e,t){try{let n=e.sessionStorage.getItem(RP);if(n){let r=JSON.parse(n);for(let[o,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function QZ(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(RP,JSON.stringify(n))}catch(r){Mn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function YZ(){let e,t,n=new Promise((r,o)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{o(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var fl=v.createContext(null);fl.displayName="DataRouter";var Fd=v.createContext(null);Fd.displayName="DataRouterState";v.createContext(!1);var eS=v.createContext({isTransitioning:!1});eS.displayName="ViewTransition";var LP=v.createContext(new Map);LP.displayName="Fetchers";var KZ=v.createContext(null);KZ.displayName="Await";var yo=v.createContext(null);yo.displayName="Navigation";var qd=v.createContext(null);qd.displayName="Location";var Bi=v.createContext({outlet:null,matches:[],isDataRoute:!1});Bi.displayName="Route";var tS=v.createContext(null);tS.displayName="RouteError";function XZ(e,{relative:t}={}){xt(Hd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(yo),{hash:o,pathname:s,search:c}=Gd(e,{relative:t}),d=s;return n!=="/"&&(d=s==="/"?n:so([n,s])),r.createHref({pathname:d,search:c,hash:o})}function Hd(){return v.useContext(qd)!=null}function Lr(){return xt(Hd(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(qd).location}var IP="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $P(e){v.useContext(yo).static||v.useLayoutEffect(e)}function wn(){let{isDataRoute:e}=v.useContext(Bi);return e?fJ():ZZ()}function ZZ(){xt(Hd(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(fl),{basename:t,navigator:n}=v.useContext(yo),{matches:r}=v.useContext(Bi),{pathname:o}=Lr(),s=JSON.stringify(Kb(r)),c=v.useRef(!1);return $P(()=>{c.current=!0}),v.useCallback((f,p={})=>{if(Mn(c.current,IP),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Xb(f,JSON.parse(s),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:so([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,o,e])}var JZ=v.createContext(null);function eJ(e){let t=v.useContext(Bi).outlet;return t&&v.createElement(JZ.Provider,{value:e},t)}function Bt(){let{matches:e}=v.useContext(Bi),t=e[e.length-1];return t?t.params:{}}function Gd(e,{relative:t}={}){let{matches:n}=v.useContext(Bi),{pathname:r}=Lr(),o=JSON.stringify(Kb(n));return v.useMemo(()=>Xb(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function tJ(e,t){return zP(e,t)}function zP(e,t,n,r,o){xt(Hd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(yo),{matches:c}=v.useContext(Bi),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||"";UP(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.
|
|
592
|
-
|
|
593
|
-
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let x=Lr(),b;if(t){let E=typeof t=="string"?ua(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 S=b.pathname||"/",j=S;if(m!=="/"){let E=m.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=qa(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 R=aJ(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},f,E.params),pathname:so([m,s.encodeLocation?s.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:so([m,s.encodeLocation?s.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),c,n,r,o);return t&&R?v.createElement(qd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},R):R}function nJ(){let e=dJ(),t=hd(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)",o={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:o},n):null,c)}var rJ=v.createElement(nJ,null),iJ=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(Bi.Provider,{value:this.props.routeContext},v.createElement(tS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function oJ({routeContext:e,match:t,children:n}){let r=v.useContext(fl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Bi.Provider,{value:e},n)}function aJ(e,t=[],n=null,r=null,o=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,S=null,j=null;n&&(x=c&&m.route.id?c[m.route.id]:void 0,S=m.route.errorElement||rJ,d&&(f<0&&g===0?(UP("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)),R=()=>{let E;return x?E=S:b?E=j:m.route.Component?E=v.createElement(m.route.Component,null):m.route.element?E=m.route.element:E=p,v.createElement(oJ,{match:m,routeContext:{outlet:p,matches:C,isDataRoute:n!=null},children:E})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?v.createElement(iJ,{location:n.location,revalidation:n.revalidation,component:S,error:x,children:R(),routeContext:{outlet:null,matches:C,isDataRoute:!0},unstable_onError:r}):R()},null)}function nS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sJ(e){let t=v.useContext(fl);return xt(t,nS(e)),t}function lJ(e){let t=v.useContext(Fd);return xt(t,nS(e)),t}function cJ(e){let t=v.useContext(Bi);return xt(t,nS(e)),t}function rS(e){let t=cJ(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 uJ(){return rS("useRouteId")}function dJ(){let e=v.useContext(tS),t=lJ("useRouteError"),n=rS("useRouteError");return e!==void 0?e:t.errors?.[n]}function fJ(){let{router:e}=sJ("useNavigate"),t=rS("useNavigate"),n=v.useRef(!1);return $P(()=>{n.current=!0}),v.useCallback(async(o,s={})=>{Mn(n.current,IP),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var UT={};function UP(e,t,n){!t&&!UT[e]&&(UT[e]=!0,Mn(!1,n))}var BT={};function VT(e,t){!e&&!BT[t]&&(BT[t]=!0,console.warn(t))}function hJ(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 pJ=["HydrateFallback","hydrateFallbackElement"],mJ=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 gJ({router:e,flushSync:t,unstable_onError:n}){let[r,o]=v.useState(e.state),[s,c]=v.useState(),[d,f]=v.useState({isTransitioning:!1}),[p,m]=v.useState(),[g,x]=v.useState(),[b,S]=v.useState(),j=v.useRef(new Map),C=v.useCallback(P=>{o(A=>(P.errors&&n&&Object.entries(P.errors).forEach(([k,L])=>{A.errors?.[k]!==L&&n(L)}),P))},[n]),R=v.useCallback((P,{deletedFetchers:A,flushSync:k,viewTransitionOpts:L})=>{P.fetchers.forEach((B,Z)=>{B.data!==void 0&&j.current.set(Z,B.data)}),A.forEach(B=>j.current.delete(B)),VT(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 z=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(VT(L==null||z,"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."),!L||!z){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:L.currentLocation,nextLocation:L.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>C(P))});B.finished.finally(()=>{t(()=>{m(void 0),x(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>x(B));return}g?(p&&p.resolve(),g.skipTransition(),S({state:P,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(c(P),f({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[e.window,t,g,p,C]);v.useLayoutEffect(()=>e.subscribe(R),[e,R]),v.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new mJ)},[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}),S(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]),T=e.basename||"/",_=v.useMemo(()=>({router:e,navigator:E,static:!1,basename:T,unstable_onError:n}),[e,E,T,n]);return v.createElement(v.Fragment,null,v.createElement(fl.Provider,{value:_},v.createElement(Fd.Provider,{value:r},v.createElement(LP.Provider,{value:j.current},v.createElement(eS.Provider,{value:d},v.createElement(xJ,{basename:T,location:r.location,navigationType:r.historyAction,navigator:E},v.createElement(vJ,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var vJ=v.memo(yJ);function yJ({routes:e,future:t,state:n,unstable_onError:r}){return zP(e,void 0,n,r,t)}function iS(e){return eJ(e.context)}function Ie(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 xJ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){xt(!Hd(),"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:o,static:s,future:{}}),[c,o,s]);typeof n=="string"&&(n=ua(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:x="default"}=n,b=v.useMemo(()=>{let S=xi(f,c);return S==null?null:{location:{pathname:S,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(yo.Provider,{value:d},v.createElement(qd.Provider,{children:t,value:b}))}function bJ({children:e,location:t}){return tJ(gx(e),t)}function gx(e,t=[]){let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let s=[...t,o];if(r.type===v.Fragment){n.push.apply(n,gx(r.props.children,s));return}xt(r.type===Ie,`[${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=gx(r.props.children,s)),n.push(c)}),n}var Mh="get",Lh="application/x-www-form-urlencoded";function Tm(e){return e!=null&&typeof e.tagName=="string"}function SJ(e){return Tm(e)&&e.tagName.toLowerCase()==="button"}function wJ(e){return Tm(e)&&e.tagName.toLowerCase()==="form"}function jJ(e){return Tm(e)&&e.tagName.toLowerCase()==="input"}function CJ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function EJ(e,t){return e.button===0&&(!t||t==="_self")&&!CJ(e)}function vx(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(o=>[n,o]):[[n,r]])},[]))}function TJ(e,t){let n=vx(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var xh=null;function RJ(){if(xh===null)try{new FormData(document.createElement("form"),0),xh=!1}catch{xh=!0}return xh}var _J=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cy(e){return e!=null&&!_J.has(e)?(Mn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lh}"`),null):e}function DJ(e,t){let n,r,o,s,c;if(wJ(e)){let d=e.getAttribute("action");r=d?xi(d,t):null,n=e.getAttribute("method")||Mh,o=Cy(e.getAttribute("enctype"))||Lh,s=new FormData(e)}else if(SJ(e)||jJ(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?xi(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Mh,o=Cy(e.getAttribute("formenctype"))||Cy(d.getAttribute("enctype"))||Lh,s=new FormData(d,e),!RJ()){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=Mh,r=null,o=Lh,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function AJ(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&&xi(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function PJ(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 kJ(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 NJ(e,t,n){let r=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await PJ(s,n);return c.links?c.links():[]}return[]}));return IJ(r.flat(1).filter(kJ).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function FT(e,t,n,r,o,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(o.pathname+o.search+o.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 OJ(e,t,{includeHydrateFallback:n}={}){return MJ(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function MJ(e){return[...new Set(e)]}function LJ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function IJ(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let s=JSON.stringify(LJ(o));return n.has(s)||(n.add(s),r.push({key:s,link:o})),r},[])}function BP(){let e=v.useContext(fl);return oS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $J(){let e=v.useContext(Fd);return oS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var aS=v.createContext(void 0);aS.displayName="FrameworkContext";function VP(){let e=v.useContext(aS);return oS(e,"You must render this element inside a <HydratedRouter> element"),e}function zJ(e,t){let n=v.useContext(aS),[r,o]=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=R=>{R.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=()=>{o(!0)},S=()=>{o(!1),c(!1)};return n?e!=="intent"?[s,x,{}]:[s,x,{onFocus:Gu(d,b),onBlur:Gu(f,S),onMouseEnter:Gu(p,b),onMouseLeave:Gu(m,S),onTouchStart:Gu(g,b)}]:[!1,x,{}]}function Gu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function UJ({page:e,...t}){let{router:n}=BP(),r=v.useMemo(()=>qa(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(VJ,{page:e,matches:r,...t}):null}function BJ(e){let{manifest:t,routeModules:n}=VP(),[r,o]=v.useState([]);return v.useEffect(()=>{let s=!1;return NJ(e,t,n).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,n]),r}function VJ({page:e,matches:t,...n}){let r=Lr(),{manifest:o,routeModules:s}=VP(),{basename:c}=BP(),{loaderData:d,matches:f}=$J(),p=v.useMemo(()=>FT(e,t,f,o,r,"data"),[e,t,f,o,r]),m=v.useMemo(()=>FT(e,t,f,o,r,"assets"),[e,t,f,o,r]),g=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,j=!1;if(t.forEach(R=>{let E=o.routes[R.route.id];!E||!E.hasLoader||(!p.some(T=>T.route.id===R.route.id)&&R.route.id in d&&s[R.route.id]?.shouldRevalidate||E.hasClientLoader?j=!0:S.add(R.route.id))}),S.size===0)return[];let C=AJ(e,c,"data");return j&&S.size>0&&C.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[c,d,r,o,p,t,e,s]),x=v.useMemo(()=>OJ(m,o),[m,o]),b=BJ(m);return v.createElement(v.Fragment,null,g.map(S=>v.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),x.map(S=>v.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),b.map(({key:S,link:j})=>v.createElement("link",{key:S,nonce:n.nonce,...j})))}function FJ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var FP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{FP&&(window.__reactRouterVersion="7.9.1")}catch{}function qJ(e,t){return RZ({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:GX({window:t?.window}),hydrationData:HJ(),routes:e,mapRouteProperties:hJ,hydrationRouteProperties:pJ,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function HJ(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:GJ(e.errors)}),e}function GJ(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new fp(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let c=new s(o.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let s=new Error(o.message);s.stack="",n[r]=s}}else n[r]=o;return n}var qP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,HP=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:s,replace:c,state:d,target:f,to:p,preventScrollReset:m,viewTransition:g,...x},b){let{basename:S}=v.useContext(yo),j=typeof p=="string"&&qP.test(p),C,R=!1;if(typeof p=="string"&&j&&(C=p,FP))try{let z=new URL(window.location.href),B=p.startsWith("//")?new URL(z.protocol+p):new URL(p),Z=xi(B.pathname,S);B.origin===z.origin&&Z!=null?p=Z+B.search+B.hash:R=!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=XZ(p,{relative:o}),[T,_,P]=zJ(r,x),A=KJ(p,{replace:c,state:d,target:f,preventScrollReset:m,relative:o,viewTransition:g});function k(z){t&&t(z),z.defaultPrevented||A(z)}let L=v.createElement("a",{...x,...P,href:C||E,onClick:R||s?t:k,ref:FJ(b,_),target:f,"data-discover":!j&&n==="render"?"true":void 0});return T&&!j?v.createElement(v.Fragment,null,L,v.createElement(UJ,{page:E})):L});HP.displayName="Link";var WJ=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:s,to:c,viewTransition:d,children:f,...p},m){let g=Gd(c,{relative:p.relative}),x=Lr(),b=v.useContext(Fd),{navigator:S,basename:j}=v.useContext(yo),C=b!=null&&tee(g)&&d===!0,R=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,E=x.pathname,T=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(E=E.toLowerCase(),T=T?T.toLowerCase():null,R=R.toLowerCase()),T&&j&&(T=xi(T,j)||T);const _=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let P=E===R||!o&&E.startsWith(R)&&E.charAt(_)==="/",A=T!=null&&(T===R||!o&&T.startsWith(R)&&T.charAt(R.length)==="/"),k={isActive:P,isPending:A,isTransitioning:C},L=P?t:void 0,z;typeof r=="function"?z=r(k):z=[r,P?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof s=="function"?s(k):s;return v.createElement(HP,{...p,"aria-current":L,className:z,ref:m,style:B,to:c,viewTransition:d},typeof f=="function"?f(k):f)});WJ.displayName="NavLink";var QJ=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:c=Mh,action:d,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...x},b)=>{let S=JJ(),j=eee(d,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&qP.test(d),E=T=>{if(f&&f(T),T.defaultPrevented)return;T.preventDefault();let _=T.nativeEvent.submitter,P=_?.getAttribute("formmethod")||c;S(_||T.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:o,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":!R&&e==="render"?"true":void 0})});QJ.displayName="Form";function YJ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GP(e){let t=v.useContext(fl);return xt(t,YJ(e)),t}function KJ(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:c}={}){let d=wn(),f=Lr(),p=Gd(e,{relative:s});return v.useCallback(m=>{if(EJ(m,t)){m.preventDefault();let g=n!==void 0?n:Ja(f)===Ja(p);d(e,{replace:g,state:r,preventScrollReset:o,relative:s,viewTransition:c})}},[f,d,p,n,r,t,e,o,s,c])}function sS(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(vx(e)),n=v.useRef(!1),r=Lr(),o=v.useMemo(()=>TJ(r.search,n.current?null:t.current),[r.search]),s=wn(),c=v.useCallback((d,f)=>{const p=vx(typeof d=="function"?d(new URLSearchParams(o)):d);n.current=!0,s("?"+p,f)},[s,o]);return[o,c]}var XJ=0,ZJ=()=>`__${String(++XJ)}__`;function JJ(){let{router:e}=GP("useSubmit"),{basename:t}=v.useContext(yo),n=uJ();return v.useCallback(async(r,o={})=>{let{action:s,method:c,encType:d,formData:f,body:p}=DJ(r,t);if(o.navigate===!1){let m=o.fetcherKey||ZJ();await e.fetch(m,n,o.action||s,{preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await e.navigate(o.action||s,{preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function eee(e,{relative:t}={}){let{basename:n}=v.useContext(yo),r=v.useContext(Bi);xt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Gd(e||".",{relative:t})},c=Lr();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===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:so([n,s.pathname])),Ja(s)}function tee(e,{relative:t}={}){let n=v.useContext(eS);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=GP("useViewTransitionState"),o=Gd(e,{relative:t});if(!n.isTransitioning)return!1;let s=xi(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=xi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return dp(o.pathname,c)!=null||dp(o.pathname,s)!=null}function lS(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function nee(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 as(e){return Hs(e.getActiveLogin()?.project)}function Rm(e){const t=De(),n=as(t),r=wn(),[o,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(qc,{search:o,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})}function ree(){return a.jsxs(a.Fragment,{children:[a.jsx(Oe,{children:"Bots"}),a.jsx(Rm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ge,{justify:"flex-end",children:a.jsx(vt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function iee(){return a.jsxs(a.Fragment,{children:[a.jsx(Oe,{children:"Clients"}),a.jsx(Rm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ge,{justify:"flex-end",children:a.jsx(vt,{to:"/admin/clients/new",children:"Create new client"})})]})}function _m(e){return a.jsx(ul,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{go(t)?e.onChange(qt(t)):e.onChange(void 0)}})}function oee(){const e=De(),t=as(e),[n,r]=v.useState(""),[o,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(Oe,{children:"Create new Bot"}),a.jsxs(ut,{onSubmit:()=>{const x={name:n,description:o,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($e,{children:[a.jsx(Ot,{title:"Name",htmlFor:"name",outcome:f,children:a.jsx(Ue,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:x=>r(x.currentTarget.value),error:kt(f,"name")})}),a.jsx(Ot,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(Ue,{id:"description",name:"description",onChange:x=>s(x.currentTarget.value),error:kt(f,"description")})}),a.jsx(Ot,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(_m,{name:"accessPolicy",onChange:d})}),a.jsx(ge,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Create Bot"})})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(_e,{children:"Bot created"}),a.jsxs(vr,{children:[a.jsx(vr.Item,{children:a.jsx(vt,{to:m,children:"Go to new bot"})}),a.jsx(vr.Item,{children:a.jsx(vt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function aee(){const e=De(),t=as(e),[n,r]=v.useState(""),[o,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(Oe,{children:"Create new Client"}),a.jsxs(ut,{onSubmit:()=>{const S={name:n,description:o,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",S).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($e,{children:[a.jsx(Ot,{title:"Name",htmlFor:"name",outcome:m,children:a.jsx(Ue,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:kt(m,"name")})}),a.jsx(Ot,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(Ue,{id:"description",name:"description",onChange:S=>s(S.currentTarget.value),error:kt(m,"description")})}),a.jsx(Ot,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(Ue,{id:"redirectUri",name:"redirectUri",onChange:S=>d(S.currentTarget.value),error:kt(m,"redirectUri")})}),a.jsx(Ot,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(_m,{name:"accessPolicy",onChange:p})}),a.jsx(ge,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Create Client"})})]}),x&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(_e,{children:"Client created"}),a.jsxs(vr,{children:[a.jsx(vr.Item,{children:a.jsx(vt,{to:x,children:"Go to new client"})}),a.jsx(vr.Item,{children:a.jsx(vt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function cS(e,t,n,r){const o=Date.now().toString();Ne({id:o,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(_e,{children:c.issue[0].details.text})),hi.update({id:o,color:"green",title:t,message:d,icon:a.jsx(vo,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw hi.update({id:o,color:"red",title:t,message:Ge(c),icon:a.jsx(Ys,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function _s(e,t,n,r){cS(e,t,n,r).catch(()=>{})}const see=8;function lee({pillInputProps:e,inputProps:t,data:n,onChange:r}){const o=il({onDropdownClose:()=>o.resetSelectedOption(),onDropdownOpen:()=>o.updateSelectedOptionIndex("active")}),[s,c]=v.useState(""),[d,f]=v.useState([]),p=S=>{const j=d.includes(S)?d.filter(C=>C!==S):[...d,S];f(j),r&&r(j)},m=S=>f(j=>j.filter(C=>C!==S)),g=v.useMemo(()=>d.map(S=>a.jsx(Yo,{withRemoveButton:!0,onRemove:()=>m(S),children:S},S)),[d]),x=v.useMemo(()=>{const S=s.trim().toLowerCase();return n.filter(j=>j.toLowerCase().includes(S))},[n,s]),b=v.useMemo(()=>{const S=new Array(Math.min(x.length,see));for(let j=0;j<S.length;j++){const C=x[j];S[j]=a.jsx(We.Option,{value:C,active:d.includes(C),children:a.jsxs(ge,{gap:"sm",children:[d.includes(C)?a.jsx(jd,{size:12}):null,a.jsx("span",{children:C})]})},C)}return S},[x,d]);return a.jsxs(We,{store:o,onOptionSubmit:p,withinPortal:!1,children:[a.jsx(We.DropdownTarget,{children:a.jsx(Ka,{onClick:()=>o.openDropdown(),...e,children:a.jsxs(Yo.Group,{children:[g,a.jsx(We.EventsTarget,{children:a.jsx(Ka.Field,{onFocus:()=>o.openDropdown(),onBlur:()=>{o.closeDropdown(),c("")},value:s,onChange:S=>{o.updateSelectedOptionIndex(),c(S.currentTarget.value)},onKeyDown:S=>{S.key==="Backspace"&&s.length===0&&d.length>0&&(S.preventDefault(),m(d[d.length-1]))},...t})})]})})}),a.jsx(We.Dropdown,{children:a.jsx(We.Options,{children:b.length>0?b:a.jsx(We.Empty,{children:"Nothing found..."})})})]})}function cee({defaultGinPendingListLimit:e,availableTables:t,onResponse:n}){const r=De(),[o,s]=v.useState(!1),[c,d]=v.useState([]),[f,p]=v.useState("unspecified"),[m,g]=v.useState("unspecified"),[x,b]=v.useState(void 0),S=()=>{const j={tableName:c};f==="reset"?j.fastUpdateAction="reset":f==="on"?(j.fastUpdateAction="set",j.fastUpdateValue=!0):f==="off"&&(j.fastUpdateAction="set",j.fastUpdateValue=!1),m==="reset"?j.ginPendingListLimitAction="reset":m==="set"&&(j.ginPendingListLimitAction="set",j.ginPendingListLimitValue=x),s(!0),cS(r,"Configure GIN Indexes","fhir/R4/$db-configure-indexes",j).then(C=>{n(C)}).catch(()=>{}).finally(()=>{s(!1)})};return a.jsx(ut,{onSubmit:S,children:a.jsxs($e,{gap:"sm",maw:"800",children:[a.jsx(xd,{label:"Table(s)",children:a.jsx(lee,{data:t,onChange:j=>d(j),inputProps:{name:"tables",placeholder:"e.g. Observation"}})}),a.jsx(rr.Group,{name:"fastUpdate",label:"fastupdate",value:f,onChange:j=>p(j),children:a.jsxs(ge,{h:"36",children:[a.jsx(rr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(rr,{size:"sm",value:"reset",label:"reset to default (on)"}),a.jsx(rr,{size:"sm",value:"off",label:"off"}),a.jsx(rr,{size:"sm",value:"on",label:"on"})]})}),a.jsx(rr.Group,{name:"ginPendingListLimit",label:"gin_pending_list_limit",value:m,onChange:j=>{g(j),j!=="set"&&b(void 0)},children:a.jsxs(ge,{h:"36",children:[a.jsx(rr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(rr,{size:"sm",value:"reset",label:`reset to default (${e}kB)`}),a.jsxs(ge,{children:[a.jsx(rr,{size:"sm",value:"set",label:"Set to (kB)"}),a.jsx(wc,{title:"gin_pending_list_limit_value",name:"gin_pending_list_limit_value",value:(m==="set"?x:"")||"",disabled:m!=="set",required:m==="set",size:"sm",w:"100",min:64,max:2147483647,onChange:j=>{b(typeof j=="number"?j:void 0)}})]})]})}),a.jsx(ge,{justify:"center",children:a.jsx(ur,{size:"sm",loading:o,children:"Update"})})]})})}const uee=8;function dee({inputProps:e,data:t,onChange:n}){const r=il({onDropdownClose:()=>r.resetSelectedOption()}),[o,s]=v.useState(null),[c,d]=v.useState(""),f=v.useMemo(()=>t.filter(m=>m.toLowerCase().includes(c.toLowerCase().trim())),[t,c]),p=v.useMemo(()=>{const m=new Array(Math.min(f.length,uee));for(let g=0;g<m.length;g++){const x=f[g];m[g]=a.jsx(We.Option,{value:x,children:x},x)}return m},[f]);return a.jsxs(We,{store:r,withinPortal:!1,onOptionSubmit:m=>{n&&n(m),s(m),d(m),r.closeDropdown()},children:[a.jsx(We.Target,{children:a.jsx(Sr,{rightSection:a.jsx(We.Chevron,{}),value:c,onChange:m=>{r.openDropdown(),r.updateSelectedOptionIndex(),d(m.currentTarget.value)},onClick:()=>r.openDropdown(),onFocus:()=>r.openDropdown(),onBlur:()=>{r.closeDropdown(),d(o||"")},rightSectionPointerEvents:"none",...e})}),a.jsx(We.Dropdown,{children:a.jsx(We.Options,{children:p.length>0?p:a.jsx(We.Empty,{children:"Nothing found"})})})]})}function fee(e){let t=[];for(const n of e)t.push(n),t.push(n+"_History"),t.push(n+"_References");return t.push("Address"),t.push("ContactPoint"),t.push("HumanName"),t.push("Coding"),t.push("Coding_Property"),t.push("DatabaseMigration"),t=Ec(t),t}function WP(e){return typeof e=="string"?e.length>50?e.substring(0,50)+"...":e:typeof e=="boolean"?e.toString().toLocaleUpperCase():e}function hee(){const e=De(),[t,{open:n,close:r}]=md(!1),[o,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(void 0),[m,g]=v.useState(0),[x,b]=v.useState(!1),[S,j]=v.useState(void 0),[C,R]=v.useState([]),[E,T]=v.useState(0);v.useEffect(()=>{async function k(){return(await e.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",count:200})).expansion?.contains?.map(z=>z.code).filter(z=>z!==void 0)??[]}k().then(L=>{R(fee(L))}).catch(console.error)},[e]),v.useEffect(()=>{b(!0),e.get("fhir/R4/$db-indexes?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(k=>{const L=k.parameter?.find(B=>B.name==="defaultGinPendingListLimit")?.valueInteger??0;g(L);const z=k.parameter?.filter(B=>B.name==="index");j(z??[])}).finally(()=>{b(!1)}).catch(k=>{Ne({color:"red",message:k.message})})},[e,f,E]);const _=k=>{s("Configure results"),d(a.jsx("pre",{children:JSON.stringify(k,null,2)})),n(),T(L=>(L+1)%100)},P={onClick:k=>{s("Details"),d(a.jsx("pre",{children:k})),n()}};let A;return x?A="Loading...":f?S?.length===0&&(A="No GIN indexes on this table"):A="Select a table",a.jsxs(a.Fragment,{children:[a.jsxs($e,{gap:"sm",children:[a.jsx("h2",{children:"Configure GIN indexes"}),a.jsx(ge,{children:a.jsx(cee,{defaultGinPendingListLimit:m,availableTables:C,onResponse:_})}),a.jsx("h2",{children:"GIN index stats"}),a.jsxs(ge,{children:[a.jsx(dee,{data:C,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:k=>{p(k)}}),a.jsx(ke,{loading:x,onClick:()=>T(k=>(k+1)%100),disabled:!f,children:"Refresh"})]}),a.jsx(de.ScrollContainer,{minWidth:500,children:a.jsxs(de,{striped:!0,highlightOnHover:!0,children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{children:"Schema"}),a.jsx(de.Th,{children:"Table"}),a.jsx(de.Th,{children:"Index"}),a.jsx(de.Th,{children:"fastupdate"}),a.jsx(de.Th,{children:"gin_pending_list_limit"}),a.jsx(de.Th,{children:"options"})]})}),a.jsxs(de.Tbody,{children:[A&&a.jsx(de.Tr,{children:a.jsx(de.Td,{colSpan:16,children:A})}),!A&&S?.map(k=>{const L=k.part??[],z=L.find(B=>B.name==="indexName")?.valueString;if(!z)throw new Error("Index missing name",{cause:k});return a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:L.find(B=>B.name==="schemaName")?.valueString}),a.jsx(de.Td,{children:L.find(B=>B.name==="tableName")?.valueString}),a.jsx(de.Td,{children:z}),a.jsx(Ey,{value:L.find(B=>B.name==="fastUpdate")?.valueBoolean,defaultValue:a.jsxs(_e,{span:!0,c:"dimmed",fs:"italic",children:["default (",WP(!0),")"]}),...P}),a.jsx(Ey,{value:L.find(B=>B.name==="ginPendingListLimit")?.valueInteger,defaultValue:a.jsxs(_e,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}),...P}),a.jsx(Ey,{value:L.find(B=>B.name==="indexOptions")?.valueString,defaultValue:a.jsx(_e,{span:!0,c:"dimmed",fs:"italic",children:"NULL"}),...P})]},z)})]})]})})]}),a.jsx(In,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function Ey({value:e,onClick:t,defaultValue:n}){return a.jsx(de.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:e===void 0?n:WP(e)})}function pee(){const e=De(),t=["GIN Indexes"],[n,r]=v.useState(t[0]);function o(s){s||(s=t[0]),r(s)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(dr,{outcome:Md}):a.jsx(Vc,{maw:"100%",children:a.jsxs(cl,{children:[a.jsx(Oe,{order:1,children:"Database Tools"}),a.jsxs(_t,{value:n,onChange:o,children:[a.jsx(_t.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:t.map(s=>a.jsx(_t.Tab,{value:s,children:s},s))}),a.jsx(_t.Panel,{value:"GIN Indexes",pt:"md",children:a.jsx(hee,{})})]})]})})}function mee(e){return a.jsx(ul,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{go(t)?e.onChange(qt(t)):e.onChange(void 0)}})}function gee(){const{membershipId:e}=Bt(),t=De(),n=as(t),r=wn(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[s,c]=v.useState(o.accessPolicy),[d,f]=v.useState(o.userConfiguration),[p,m]=v.useState(o.admin),[g,x]=v.useState(),[b,S]=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(Oe,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(pc,{value:o.profile,link:!0})}),a.jsxs(ut,{onSubmit:()=>{const C={...o,accessPolicy:s,userConfiguration:d,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(R=>x(Ht(R)))},children:[!b&&a.jsxs($e,{children:[a.jsx(Ot,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(_m,{name:"accessPolicy",defaultValue:s,onChange:c})}),a.jsx(Ot,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx(mee,{name:"userConfiguration",defaultValue:d,onChange:f})}),a.jsx(Ot,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx(Dn,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),a.jsxs(ge,{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 vee(){const e=De(),[t,n]=v.useState(e.getProject()),[r,o]=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(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),rm(S)?c(S):m(S),f(b.sendEmail??!1),Ne({color:"green",message:"Invite success"})}).catch(S=>{Ne({color:"red",message:Ge(S),autoClose:!1}),c(Ht(S))})},[e,t,r]);return a.jsxs(ut,{onSubmit:g,children:[!p&&!s&&a.jsxs($e,{children:[a.jsx(Oe,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(Ot,{title:"Project",htmlFor:"project",outcome:s,children:a.jsx(ul,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(sn,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:kt(s,"resourceType")}),a.jsx(Ue,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:kt(s,"firstName")}),a.jsx(Ue,{name:"lastName",label:"Last Name",required:!0,error:kt(s,"lastName")}),a.jsx(Ue,{name:"email",type:"email",label:"Email",required:!0,error:kt(s,"email")}),a.jsx(Ot,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:a.jsx(_m,{name:"accessPolicy",onChange:o})}),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(ge,{justify:"flex-end",children:a.jsx(ur,{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(_e,{children:"User created"}),d&&a.jsx(_e,{children:"Email sent"}),a.jsxs(vr,{children:[a.jsx(vr.Item,{children:a.jsx(vt,{to:p,children:"Go to new membership"})}),a.jsx(vr.Item,{children:a.jsx(vt,{to:p.profile,children:"Go to new profile"})}),a.jsx(vr.Item,{children:a.jsx(vt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function yee(){return a.jsxs(a.Fragment,{children:[a.jsx(Oe,{children:"Patients"}),a.jsx(Rm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(ge,{justify:"flex-end",children:a.jsx(vt,{to:"/admin/invite",children:"Invite new patient"})})]})}function xee(){const e=De();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(dr,{outcome:Md});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(Oe,{order:1,children:"Project Admin"}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{order:2,children:"Force Set Password"}),a.jsx(_e,{children:"Sets the password for the specified user in this project."}),a.jsx(_e,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(ut,{onSubmit:t,children:a.jsxs($e,{children:[a.jsx(Ue,{name:"email",label:"Email",required:!0}),a.jsx(Oi,{name:"password",label:"Password",required:!0}),a.jsx(ke,{type:"submit",children:"Force Set Password"})]})})]})}function qT(){const e=De(),t=as(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(Oe,{children:"Details"}),a.jsxs(vm,{children:[a.jsx(mi,{term:"ID",children:n.project.id}),a.jsx(mi,{term:"Name",children:n.project.name})]})]})}const HT=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function bee(){const e=wn(),n=Lr().pathname.replace("/admin/","")||HT[0],r=De(),o=as(r),s=v.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function c(d){e(`/admin/${d}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(yr,{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(Zr,{children:a.jsx(_t,{value:n.toLowerCase(),onChange:c,children:a.jsx(_t.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:HT.map(d=>a.jsx(_t.Tab,{value:d.toLowerCase(),children:d},d))})})})]}),a.jsx(lt,{children:a.jsx(iS,{})})]})}function See(){const e=De(),t=as(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Kr(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(Oe,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(Bd,{property:is("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(ke,{type:"submit",children:"Save"})]})}function wee(){const e=De(),t=as(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Kr(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(Oe,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(Bd,{property:is("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(ke,{type:"submit",children:"Save"})]})}const QP="System AsyncJob",YP="Post-deploy Migrations",bh=[YP,QP];function jee(){const e=De(),[t,n]=v.useState(bh[0]);function r(o){o||=bh[0],bh.includes(o)&&n(o)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(dr,{outcome:Md}):a.jsx(Vc,{miw:"1600",maw:"2000",children:a.jsxs(cl,{children:[a.jsx(Oe,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(_t,{keepMounted:!1,value:t,onChange:r,children:[a.jsx(_t.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:bh.map(o=>a.jsx(_t.Tab,{value:o,children:o},o))}),a.jsx(_t.Panel,{value:QP,pt:"md",children:a.jsx(Eee,{})}),a.jsx(_t.Panel,{value:YP,pt:"md",children:a.jsx(Ree,{})})]})]})})}const Cee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function Eee(){const e=wn(),[t]=v.useState(Cee);return a.jsxs($e,{children:[a.jsx(vt,{to:`/${t.resourceType}/${Wa(t)}`,children:"Show in search page"}),a.jsx(qc,{checkboxesEnabled:!1,search:t,onClick:n=>e(GT(n.resource))?.catch(console.error),onAuxClick:n=>window.open(GT(n.resource),"_blank")})]})}const Tee={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 Ree(){const e=De(),[t,n]=v.useState(),[r,o]=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((R,E)=>E-R),n(C)}).catch(C=>{Ne({color:"red",message:Ge(C),autoClose:!1})}).finally(()=>m(C=>C.filter(R=>R!==j)))},[e,d]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",Wa({...Tee,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{o(C.entry?.map(R=>R.resource))})).catch(C=>{o(void 0),Ne({color:"red",message:Ge(C),autoClose:!1})}).finally(()=>m(C=>C.filter(R=>R!==j)))},[e,d]);function g(){f(j=>j+1)}function x(j){cS(e,"Run Pending Data Migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const b=p.length>0;function S(j,{isLoading:C}){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx($p,{visible:C}),a.jsxs(de,{children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{children:"Version"}),a.jsx(de.Th,{children:"Action"}),a.jsx(de.Th,{children:"Status"}),a.jsx(de.Th,{children:"AsyncJob"}),a.jsx(de.Th,{children:"Last Updated"}),a.jsx(de.Th,{children:"Request Time"}),a.jsx(de.Th,{children:"Duration"}),a.jsx(de.Th,{children:"Attempts"})]})}),a.jsx(de.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(ke,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx(SA,{size:14}),onClick:g,loading:b,children:"Refresh"}),S(()=>{if(!b){if(!t)return a.jsx(de.Tr,{children:a.jsx(de.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(de.Tr,{children:a.jsx(de.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:R,asyncJobs:E}=_ee(j,r??[],t?.pendingPostDeployMigration),T=s.includes(j),_=j===t?.pendingPostDeployMigration&&(!R||R?.status==="error"),P=[a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:j}),a.jsx(de.Td,{children:_&&a.jsx(ke,{color:"green",size:"xs",onClick:()=>x(j),children:"Start"})}),a.jsx(de.Td,{children:C}),a.jsx(de.Td,{children:R&&a.jsx(vt,{to:`/AsyncJob/${R?.id}`,children:R?.id})}),a.jsx(de.Td,{children:R?.meta?.lastUpdated}),a.jsx(de.Td,{children:R?.requestTime}),a.jsx(de.Td,{children:WT(R)}),a.jsx(de.Td,{display:"flex",children:a.jsxs(ge,{gap:"xs",children:[E.length?E.length:"",T&&E.length>1&&a.jsx(ke,{leftSection:a.jsx(Zq,{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"}),!T&&E.length>1&&a.jsx(ke,{leftSection:a.jsx(bA,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(A=>A.includes(j)?A:[...A,j]),children:"Show all"})]})})]},j)];return T&&P.push(...E.filter(A=>A.id!==R?.id).map(A=>a.jsxs(de.Tr,{bg:"gray.1",children:[a.jsx(de.Td,{children:j}),a.jsx(de.Td,{}),a.jsx(de.Td,{children:A.status}),a.jsx(de.Td,{children:a.jsx(vt,{to:`/AsyncJob/${A.id}`,children:A.id})}),a.jsx(de.Td,{children:A.meta?.lastUpdated}),a.jsx(de.Td,{children:A.requestTime}),a.jsx(de.Td,{children:WT(A)}),a.jsx(de.Td,{})]},A.id))),P})},{isLoading:b})]})}function _ee(e,t,n){const r=t.filter(c=>c.dataVersion===e),o=r.find(c=>c.status==="completed")??r[0];let s;return n===0?s=o?.status??"completed":e>n?s=o?.status??"pending":e===n?s=o?.status??"next":s=o?.status??"completed",{status:s,asyncJob:o,asyncJobs:r}}function GT(e){return`/${e.resourceType}/${e.id}`}function WT(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 Dee(){const e=De(),[t,{open:n,close:r}]=md(!1),[o,s]=v.useState(""),[c,d]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(dr,{outcome:Md});function f(){_s(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){_s(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){_s(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(P){_s(e,"Reindexing Resources","admin/super/reindex",P)}function x(){_s(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){_s(e,"Run Pending Data Migration","admin/super/migrate")}function S(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:$b(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 R(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(`
|
|
594
|
-
`)})),n()}).catch(P=>Ne({color:"red",message:Ge(P),autoClose:!1}))}function T(){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 _(){_s(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return a.jsxs(lt,{width:600,children:[a.jsx(Oe,{order:1,children:"Super Admin"}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{children:a.jsx(ke,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{children:a.jsx(ke,{onClick:p,children:"Rebuild SearchParameters"})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{children:a.jsx(ke,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{onSubmit:b,children:a.jsx($e,{children:a.jsx(ke,{type:"submit",children:"Start Migration"})})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{onSubmit:g,children:a.jsxs($e,{children:[a.jsx(Ot,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(Ue,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(Ot,{title:"Search Filter",htmlFor:"filter",children:a.jsx(Ue,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx(Ot,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx(Aee,{})}),a.jsx(ke,{type:"submit",children:"Reindex"})]})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{onSubmit:j,children:a.jsxs($e,{children:[a.jsx(Ot,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(sn,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(Ot,{title:"Purge Before",htmlFor:"before",children:a.jsx(ao,{name:"before",placeholder:"Before Date"})}),a.jsx(ke,{type:"submit",children:"Purge"})]})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(ut,{onSubmit:S,children:a.jsxs($e,{children:[a.jsx(Ot,{title:"Bot ID",children:a.jsx(Ue,{name:"botId",placeholder:"Bot Id"})}),a.jsx(ke,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{onSubmit:C,children:a.jsxs($e,{children:[a.jsx(Ue,{name:"email",label:"Email",required:!0}),a.jsx(Oi,{name:"password",label:"Password",required:!0}),a.jsx(Ue,{name:"projectId",label:"Project ID"}),a.jsx(ke,{type:"submit",children:"Force Set Password"})]})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(ut,{onSubmit:R,children:a.jsxs($e,{children:[a.jsx(Ot,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(Ue,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(ke,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(ut,{onSubmit:E,children:a.jsx($e,{children:a.jsx(ke,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{order:2,children:"Database Schema Drift"}),a.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),a.jsxs(ar,{children:[a.jsx(ar.Col,{span:6,children:a.jsx(ut,{onSubmit:T,children:a.jsx($e,{children:a.jsx(ke,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(ar.Col,{span:6,children:a.jsx(ut,{onSubmit:_,children:a.jsx($e,{children:a.jsx(ke,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{onSubmit:x,children:a.jsx($e,{children:a.jsx(ke,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(Pee,{setModalTitle:s,setModalContent:d,openModal:n}),a.jsx(In,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function Aee(){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(wc,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function Pee({setModalTitle:e,setModalContent:t,openModal:n}){const r=De(),[o,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(),x=v.useMemo(()=>{if(o?.reference)return{"_has:ProjectMembership:profile:project":o.reference}},[o]);v.useEffect(()=>{if(g(void 0),!c?.reference&&!o?.reference){p(void 0);return}r.searchResources("ProjectMembership",{profile:c?.reference,project:o?.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,o]);const b=v.useMemo(()=>{const j={};return c?.reference&&(j.profile=c?.reference),o?.reference&&(j.project=o?.reference),j},[c,o]);function S(j){if(!j.query){Ne({color:"red",message:"Query is required",autoClose:!1});return}const C=j.onBehalfOfProjectMembership;delete j.onBehalfOfProjectMembership;const R={query:j.query,analyze:j.analyze==="on",format:"text"},E={};C&&(E["x-medplum-on-behalf-of"]=C),r.post("fhir/R4/$explain",R,void 0,{headers:E}).then(T=>{e("Database Explain");const _=T.parameter?.find(L=>L.name==="explain")?.valueString,P=T.parameter?.find(L=>L.name==="query")?.valueString,A=T.parameter?.find(L=>L.name==="parameters")?.valueString,k=[P,A,`
|
|
595
|
-
`,_].join(`
|
|
596
|
-
`);t(a.jsx(Cd,{block:!0,maw:"100%",children:k})),n()}).catch(T=>{Ne({color:"red",message:Ge(T),autoClose:!1})})}return!r.isLoading()&&!r.isSuperAdmin()?a.jsx(dr,{outcome:Md}):a.jsx(ut,{onSubmit:S,children:a.jsxs($e,{children:[a.jsx(Ue,{name:"query",label:"Search",required:!0,placeholder:"Observation?code=85354-9&_sort=-date&_count=5"}),a.jsx(Dn,{name:"analyze",label:"Analyze"}),a.jsx(xd,{label:"On Behalf Of",children:a.jsxs($e,{gap:"sm",children:[a.jsx(Qa,{required:!0,placeholder:"Project",targetTypes:["Project"],name:"onBehalfOfProject",onChange:s}),a.jsx(Qa,{required:!0,placeholder:"Practitioner or Patient",name:"onBehalfOfProfile",targetTypes:["Practitioner","Patient"],onChange:d,searchCriteria:x}),f?.length!==1&&a.jsx(Qa,{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:At(f[0])}),a.jsx(ip,{value:qt(f[0])})]}),!m&&a.jsx(_e,{fs:"italic",children:"On Behalf Of not set. Running as super admin"})]})}),a.jsx(ke,{type:"submit",children:"Explain Search"})]})})}function kee(){return a.jsxs(a.Fragment,{children:[a.jsx(Oe,{children:"Users"}),a.jsx(Rm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ge,{justify:"flex-end",children:a.jsx(vt,{to:"/admin/invite",children:"Invite new user"})})]})}const Nee=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 _c(e,t,n){const r=Oee(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&QT(r,"path",s),QT(r,"relativePath",s),r}function Oee(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=Nee.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function QT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var hl=(e,t,n)=>new Promise((r,o)=>{var s=f=>{try{d(n.next(f))}catch(p){o(p)}},c=f=>{try{d(n.throw(f))}catch(p){o(p)}},d=f=>f.done?r(f.value):Promise.resolve(f.value).then(s,c);d((n=n.apply(e,t)).next())});const Mee=[".DS_Store","Thumbs.db"];function Lee(e){return hl(this,null,function*(){return pp(e)&&Iee(e.dataTransfer)?Bee(e.dataTransfer,e.type):$ee(e)?zee(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Uee(e):[]})}function Iee(e){return pp(e)}function $ee(e){return pp(e)&&pp(e.target)}function pp(e){return typeof e=="object"&&e!==null}function zee(e){return yx(e.target.files).map(t=>_c(t))}function Uee(e){return hl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>_c(n))})}function Bee(e,t){return hl(this,null,function*(){if(e.items){const n=yx(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(Vee));return YT(KP(r))}return YT(yx(e.files).map(n=>_c(n)))})}function YT(e){return e.filter(t=>Mee.indexOf(t.name)===-1)}function yx(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 Vee(e){if(typeof e.webkitGetAsEntry!="function")return KT(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?XP(t):KT(e,t)}function KP(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?KP(n):[n]],[])}function KT(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(s=>hl(this,null,function*(){const c=yield s.getFile();return c.handle=s,_c(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const o=_c(r,(n=t?.fullPath)!=null?n:void 0);return Promise.resolve(o)}function Fee(e){return hl(this,null,function*(){return e.isDirectory?XP(e):qee(e)})}function XP(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function s(){t.readEntries(c=>hl(this,null,function*(){if(c.length){const d=Promise.all(c.map(Fee));o.push(d),s()}else try{const d=yield Promise.all(o);n(d)}catch(d){r(d)}}),c=>{r(c)})}s()})}function qee(e){return hl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=_c(r,e.fullPath);t(o)},r=>{n(r)})})})}function Ty(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(c=>{const d=c.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?s===d.replace(/\/.*$/,""):o===d})}return!0}var Hee=Object.defineProperty,Gee=Object.defineProperties,Wee=Object.getOwnPropertyDescriptors,XT=Object.getOwnPropertySymbols,Qee=Object.prototype.hasOwnProperty,Yee=Object.prototype.propertyIsEnumerable,ZT=(e,t,n)=>t in e?Hee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kee=(e,t)=>{for(var n in t||(t={}))Qee.call(t,n)&&ZT(e,n,t[n]);if(XT)for(var n of XT(t))Yee.call(t,n)&&ZT(e,n,t[n]);return e},Xee=(e,t)=>Gee(e,Wee(t));const Zee=typeof Ty=="function"?Ty:Ty.default,Jee="file-invalid-type",ete="file-too-large",tte="file-too-small",nte="too-many-files",rte=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:Jee,message:`File type must be ${n}`}},JT=e=>({code:ete,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),eR=e=>({code:tte,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),ite={code:nte,message:"Too many files"};function ZP(e,t){const n=e.type==="application/x-moz-file"||Zee(e,t);return[n,n?null:rte(t)]}function JP(e,t,n){if(Ns(e.size))if(Ns(t)&&Ns(n)){if(e.size>n)return[!1,JT(n)];if(e.size<t)return[!1,eR(t)]}else{if(Ns(t)&&e.size<t)return[!1,eR(t)];if(Ns(n)&&e.size>n)return[!1,JT(n)]}return[!0,null]}function Ns(e){return e!=null}function ote({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:s,validator:c}){return!o&&e.length>1||o&&s>=1&&e.length>s?!1:e.every(d=>{const[f]=ZP(d,t),[p]=JP(d,n,r),m=c?c(d):null;return f&&p&&!m})}function mp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Sh(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 tR(e){e.preventDefault()}function ate(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function ste(e){return e.indexOf("Edge/")!==-1}function lte(e=window.navigator.userAgent){return ate(e)||ste(e)}function Xi(...e){return(t,...n)=>e.some(r=>(!mp(t)&&r&&r(t,...n),mp(t)))}function cte(){return"showOpenFilePicker"in window}function ute(e){return Ns(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return ek(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.`),o=!1),(!Array.isArray(r)||!r.every(tk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>Xee(Kee({},n),{[r]:o}),{})}]:e}function dte(e){if(Ns(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>ek(t)||tk(t)).join(",")}function fte(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function hte(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ek(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function tk(e){return/^.*\.[\w]+$/.test(e)}var pte=Object.defineProperty,mte=Object.defineProperties,gte=Object.getOwnPropertyDescriptors,gp=Object.getOwnPropertySymbols,nk=Object.prototype.hasOwnProperty,rk=Object.prototype.propertyIsEnumerable,nR=(e,t,n)=>t in e?pte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gr=(e,t)=>{for(var n in t||(t={}))nk.call(t,n)&&nR(e,n,t[n]);if(gp)for(var n of gp(t))rk.call(t,n)&&nR(e,n,t[n]);return e},Va=(e,t)=>mte(e,gte(t)),vp=(e,t)=>{var n={};for(var r in e)nk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gp)for(var r of gp(e))t.indexOf(r)<0&&rk.call(e,r)&&(n[r]=e[r]);return n};const uS=v.forwardRef((e,t)=>{var n=e,{children:r}=n,o=vp(n,["children"]);const s=ok(o),{open:c}=s,d=vp(s,["open"]);return v.useImperativeHandle(t,()=>({open:c}),[c]),En.createElement(v.Fragment,null,r(Va(gr({},d),{open:c})))});uS.displayName="Dropzone";const ik={disabled:!1,getFilesFromEvent:Lee,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};uS.defaultProps=ik;uS.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 xx={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function ok(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:s,multiple:c,maxFiles:d,onDragEnter:f,onDragLeave:p,onDragOver:m,onDrop:g,onDropAccepted:x,onDropRejected:b,onFileDialogCancel:S,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:R,preventDropOnDocument:E,noClick:T,noKeyboard:_,noDrag:P,noDragEventsBubbling:A,onError:k,validator:L}=gr(gr({},ik),e),z=v.useMemo(()=>dte(t),[t]),B=v.useMemo(()=>ute(t),[t]),Z=v.useMemo(()=>typeof j=="function"?j:rR,[j]),K=v.useMemo(()=>typeof S=="function"?S:rR,[S]),Y=v.useRef(null),H=v.useRef(null),[W,M]=v.useReducer(vte,xx),{isFocused:I,isFileDialogActive:$}=W,q=v.useRef(typeof window<"u"&&window.isSecureContext&&C&&cte()),N=()=>{!q.current&&$&&setTimeout(()=>{if(H.current){const{files:pe}=H.current;pe.length||(M({type:"closeDialog"}),K())}},300)};v.useEffect(()=>(window.addEventListener("focus",N,!1),()=>{window.removeEventListener("focus",N,!1)}),[H,$,K,q]);const F=v.useRef([]),J=pe=>{Y.current&&Y.current.contains(pe.target)||(pe.preventDefault(),F.current=[])};v.useEffect(()=>(E&&(document.addEventListener("dragover",tR,!1),document.addEventListener("drop",J,!1)),()=>{E&&(document.removeEventListener("dragover",tR),document.removeEventListener("drop",J))}),[Y,E]),v.useEffect(()=>(!n&&R&&Y.current&&Y.current.focus(),()=>{}),[Y,R,n]);const ae=v.useCallback(pe=>{k?k(pe):console.error(pe)},[k]),je=v.useCallback(pe=>{pe.preventDefault(),pe.persist(),Re(pe),F.current=[...F.current,pe.target],Sh(pe)&&Promise.resolve(r(pe)).then(Se=>{if(mp(pe)&&!A)return;const ze=Se.length,be=ze>0&&ote({files:Se,accept:z,minSize:s,maxSize:o,multiple:c,maxFiles:d,validator:L}),Me=ze>0&&!be;M({isDragAccept:be,isDragReject:Me,isDragActive:!0,type:"setDraggedFiles"}),f&&f(pe)}).catch(Se=>ae(Se))},[r,f,ae,A,z,s,o,c,d,L]),xe=v.useCallback(pe=>{pe.preventDefault(),pe.persist(),Re(pe);const Se=Sh(pe);if(Se&&pe.dataTransfer)try{pe.dataTransfer.dropEffect="copy"}catch{}return Se&&m&&m(pe),!1},[m,A]),we=v.useCallback(pe=>{pe.preventDefault(),pe.persist(),Re(pe);const Se=F.current.filter(be=>Y.current&&Y.current.contains(be)),ze=Se.indexOf(pe.target);ze!==-1&&Se.splice(ze,1),F.current=Se,!(Se.length>0)&&(M({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Sh(pe)&&p&&p(pe))},[Y,p,A]),Qe=v.useCallback((pe,Se)=>{const ze=[],be=[];pe.forEach(Me=>{const[Dt,bt]=ZP(Me,z),[nn,$t]=JP(Me,s,o),$n=L?L(Me):null;if(Dt&&nn&&!$n)ze.push(Me);else{let An=[bt,$t];$n&&(An=An.concat($n)),be.push({file:Me,errors:An.filter(Vi=>Vi)})}}),(!c&&ze.length>1||c&&d>=1&&ze.length>d)&&(ze.forEach(Me=>{be.push({file:Me,errors:[ite]})}),ze.splice(0)),M({acceptedFiles:ze,fileRejections:be,isDragReject:be.length>0,type:"setFiles"}),g&&g(ze,be,Se),be.length>0&&b&&b(be,Se),ze.length>0&&x&&x(ze,Se)},[M,c,z,s,o,d,g,x,b,L]),Ee=v.useCallback(pe=>{pe.preventDefault(),pe.persist(),Re(pe),F.current=[],Sh(pe)&&Promise.resolve(r(pe)).then(Se=>{mp(pe)&&!A||Qe(Se,pe)}).catch(Se=>ae(Se)),M({type:"reset"})},[r,Qe,ae,A]),ot=v.useCallback(()=>{if(q.current){M({type:"openDialog"}),Z();const pe={multiple:c,types:B};window.showOpenFilePicker(pe).then(Se=>r(Se)).then(Se=>{Qe(Se,null),M({type:"closeDialog"})}).catch(Se=>{fte(Se)?(K(Se),M({type:"closeDialog"})):hte(Se)?(q.current=!1,H.current?(H.current.value=null,H.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}H.current&&(M({type:"openDialog"}),Z(),H.current.value=null,H.current.click())},[M,Z,K,C,Qe,ae,B,c]),nt=v.useCallback(pe=>{!Y.current||!Y.current.isEqualNode(pe.target)||(pe.key===" "||pe.key==="Enter"||pe.keyCode===32||pe.keyCode===13)&&(pe.preventDefault(),ot())},[Y,ot]),Ct=v.useCallback(()=>{M({type:"focus"})},[]),Mt=v.useCallback(()=>{M({type:"blur"})},[]),Lt=v.useCallback(()=>{T||(lte()?setTimeout(ot,0):ot())},[T,ot]),pt=pe=>n?null:pe,Rt=pe=>_?null:pt(pe),tn=pe=>P?null:pt(pe),Re=pe=>{A&&pe.stopPropagation()},Pe=v.useMemo(()=>(pe={})=>{var Se=pe,{refKey:ze="ref",role:be,onKeyDown:Me,onFocus:Dt,onBlur:bt,onClick:nn,onDragEnter:$t,onDragOver:$n,onDragLeave:An,onDrop:Vi}=Se,Ei=vp(Se,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return gr(gr({onKeyDown:Rt(Xi(Me,nt)),onFocus:Rt(Xi(Dt,Ct)),onBlur:Rt(Xi(bt,Mt)),onClick:pt(Xi(nn,Lt)),onDragEnter:tn(Xi($t,je)),onDragOver:tn(Xi($n,xe)),onDragLeave:tn(Xi(An,we)),onDrop:tn(Xi(Vi,Ee)),role:typeof be=="string"&&be!==""?be:"presentation",[ze]:Y},!n&&!_?{tabIndex:0}:{}),Ei)},[Y,nt,Ct,Mt,Lt,je,xe,we,Ee,_,P,n]),Xe=v.useCallback(pe=>{pe.stopPropagation()},[]),Ae=v.useMemo(()=>(pe={})=>{var Se=pe,{refKey:ze="ref",onChange:be,onClick:Me}=Se,Dt=vp(Se,["refKey","onChange","onClick"]);const bt={accept:z,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(Xi(be,Ee)),onClick:pt(Xi(Me,Xe)),tabIndex:-1,[ze]:H};return gr(gr({},bt),Dt)},[H,t,c,Ee,n]);return Va(gr({},W),{isFocused:I&&!n,getRootProps:Pe,getInputProps:Ae,rootRef:Y,inputRef:H,open:pt(ot)})}function vte(e,t){switch(t.type){case"focus":return Va(gr({},e),{isFocused:!0});case"blur":return Va(gr({},e),{isFocused:!1});case"openDialog":return Va(gr({},xx),{isFileDialogActive:!0});case"closeDialog":return Va(gr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Va(gr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Va(gr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return gr({},xx);default:return e}}function rR(){}const[yte,xte]=xr("Dropzone component was not found in tree");function dS(e){const t=n=>{const{children:r,...o}=se(`Dropzone${tC(e)}`,{},n),s=xte(),c=Jo(r)?r:a.jsx("span",{children:r});return s[e]?v.cloneElement(c,o):null};return t.displayName=`@mantine/dropzone/${tC(e)}`,t}const bte=dS("accept"),Ste=dS("reject"),wte=dS("idle");var pd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const jte={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},Cte=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const s=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:o||"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}}},ss=ye((e,t)=>{const n=se("Dropzone",jte,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,disabled:m,loading:g,multiple:x,maxSize:b,accept:S,children:j,onDropAny:C,onDrop:R,onReject:E,openRef:T,name:_,maxFiles:P,autoFocus:A,activateOnClick:k,activateOnDrag:L,dragEventsBubbling:z,activateOnKeyboard:B,onDragEnter:Z,onDragLeave:K,onDragOver:Y,onFileDialogCancel:H,onFileDialogOpen:W,preventDropOnDocument:M,useFsAccessApi:I,getFilesFromEvent:$,validator:q,rejectColor:N,acceptColor:F,enablePointerEvents:J,loaderProps:ae,inputProps:je,mod:xe,...we}=n,Qe=Le({name:"Dropzone",classes:pd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Cte}),{getRootProps:Ee,getInputProps:ot,isDragAccept:nt,isDragReject:Ct,isDragActive:Mt,open:Lt}=ok({onDrop:C,onDropAccepted:R,onDropRejected:E,disabled:m||g,accept:Array.isArray(S)?S.reduce((Re,Pe)=>({...Re,[Pe]:[]}),{}):S,multiple:x,maxSize:b,maxFiles:P,autoFocus:A,noClick:!k,noDrag:!L,noDragEventsBubbling:!z,noKeyboard:!B,onDragEnter:Z,onDragLeave:K,onDragOver:Y,onFileDialogCancel:H,onFileDialogOpen:W,preventDropOnDocument:M,useFsAccessApi:I,validator:q,...$?{getFilesFromEvent:$}:null});ed(T,Lt);const pt=Mt&&nt,Rt=Mt&&Ct,tn=!pt&&!Rt;return a.jsx(yte,{value:{accept:pt,reject:Rt,idle:tn},children:a.jsxs(ce,{...Ee(),...Qe("root",{focusable:!0}),...we,mod:[{accept:pt,reject:Rt,idle:tn,disabled:m,loading:g,"activate-on-click":k},xe],children:[a.jsx($p,{visible:g,overlayProps:{radius:p},unstyled:d,loaderProps:ae}),a.jsx("input",{...ot(je),name:_}),a.jsx("div",{...Qe("inner"),ref:t,"data-enable-pointer-events":J||void 0,children:j})]})})});ss.classes=pd;ss.displayName="@mantine/dropzone/Dropzone";ss.Accept=bte;ss.Idle=wte;ss.Reject=Ste;const Ete={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Xr("max"),withinPortal:!0},fS=ye((e,t)=>{const n=se("DropzoneFullScreen",Ete,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,active:p,onDrop:m,onReject:g,zIndex:x,withinPortal:b,portalProps:S,...j}=n,C=Le({name:"DropzoneFullScreen",classes:pd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"fullScreen"}),{resolvedClassNames:R,resolvedStyles:E}=el({classNames:r,styles:c,props:n}),[T,_]=v.useState(0),[P,{open:A,close:k}]=md(!1),L=B=>{B.dataTransfer?.types.includes("Files")&&(_(Z=>Z+1),A())},z=()=>{_(B=>B-1)};return v.useEffect(()=>{T===0&&k()},[T]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",L,!1),document.addEventListener("dragleave",z,!1),()=>{document.removeEventListener("dragenter",L,!1),document.removeEventListener("dragleave",z,!1)}},[p]),a.jsx(ts,{...S,withinPortal:b,children:a.jsx(ce,{...C("fullScreen",{style:{opacity:P?1:0,pointerEvents:P?"all":"none",zIndex:x}}),ref:t,children:a.jsx(ss,{...j,classNames:R,styles:E,unstyled:d,className:pd.dropzone,onDrop:B=>{m?.(B),k(),_(0)},onReject:B=>{g?.(B),k(),_(0)}})})})});fS.classes=pd;fS.displayName="@mantine/dropzone/DropzoneFullScreen";ss.FullScreen=fS;const wh=ss,Tte='{"resourceType": "Bundle"}';function Ry({id:e,title:t,message:n,color:r,icon:o,withCloseButton:s=!1,method:c="show",loading:d}){hi[c]({id:e,loading:d,title:t,message:n,color:r,icon:o,withCloseButton:s,autoClose:!1})}function Rte(){const e=Sn(),t=De(),[n,r]=v.useState({}),o=v.useCallback(async(d,f)=>{const p="batch-upload";Ry({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=YD(m));const g=await t.executeBatch(m);r(x=>({...x,[f]:g})),Ry({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(vo,{size:"1rem"}),withCloseButton:!0})}catch(m){Ry({id:p,title:"Batch Upload Failed",color:"red",message:Ge(m),method:"update",icon:a.jsx(Ys,{size:"1rem"}),withCloseButton:!0})}},[t]),s=v.useCallback(async d=>{for(const f of d){const p=new FileReader;p.onload=m=>o(m.target?.result,f.name),p.readAsText(f)}},[o]),c=v.useCallback(async d=>{await o(d.input,"JSON Data")},[o]);return a.jsxs(lt,{children:[a.jsx(Oe,{children:"Batch Create"}),a.jsxs(_e,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",a.jsx(Pt,{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(_t,{defaultValue:"upload",children:[a.jsxs(_t.List,{children:[a.jsx(_t.Tab,{value:"upload",children:"File Upload"}),a.jsx(_t.Tab,{value:"json",children:"JSON"})]}),a.jsx(_t.Panel,{value:"upload",pt:"xs",children:a.jsx(wh,{onDrop:s,accept:["application/json"],children:a.jsxs(ge,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(wh.Accept,{children:a.jsx(WE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(wh.Reject,{children:a.jsx(Ys,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(wh.Idle,{children:a.jsx(WE,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(_e,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(_e,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(_t.Panel,{value:"json",pt:"xs",children:a.jsxs(ut,{onSubmit:c,children:[a.jsx(Lc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:Tte,deserialize:JSON.parse}),a.jsx(ge,{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(_t,{defaultValue:Object.keys(n)[0],children:[a.jsx(_t.List,{children:Object.keys(n).map(d=>a.jsx(_t.Tab,{value:d,children:d},d))}),Object.keys(n).map(d=>a.jsx(_t.Panel,{value:d,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[d],void 0,2)})},d))]}),a.jsx(ge,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{onClick:()=>r({}),children:"Start over"})})]})]})}function _te(){const{resourceType:e}=Bt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Rc("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(lt,{children:[a.jsxs(Oe,{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(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(vt,{to:`/forms/${o.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(yi,{})}function Dte(){const e=De(),[t,n]=v.useState(),[r,o]=v.useState(!1);return a.jsx(lt,{width:450,children:a.jsxs(ut,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>o(!0)).catch(c=>n(Ht(c)))},children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{children:"Change password"})]}),!r&&a.jsxs($e,{gap:"xl",mt:"xl",children:[a.jsx(Oi,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:kt(t,"oldPassword")}),a.jsx(Oi,{name:"newPassword",label:"New password",required:!0,error:kt(t,"newPassword")}),a.jsx(Oi,{name:"confirmPassword",label:"Confirm new password",required:!0,error:kt(t,"confirmPassword")}),a.jsx(ge,{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 bx=["Form","JSON","Profiles"],Ate=["Profiles"],_y=bx[0].toLowerCase();function Pte(){const e=wn(),t=Sn(),{resourceType:n}=Bt(),[r,o]=v.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&bx.map(d=>d.toLowerCase()).includes(c)?c:_y});function s(c){c||(c=_y),o(c),e(`/${n}/new/${c}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(yr,{children:[a.jsxs(_e,{p:"md",fw:500,children:["New ",n]}),a.jsx(Zr,{children:a.jsx(_t,{defaultValue:_y,value:r,onChange:s,children:a.jsx(_t.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:bx.map(c=>a.jsx(_t.Tab,{value:c.toLowerCase(),px:"md",children:Ate.includes(c)?a.jsxs(ge,{gap:"xs",wrap:"nowrap",children:[c,a.jsx(Ip,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),a.jsx(iS,{})]})}function kte(){return a.jsx(lt,{children:a.jsxs($e,{children:[a.jsx(Oe,{order:1,children:"Unexpected Error"}),a.jsx(_e,{children:"We're sorry, something went wrong."}),a.jsxs(_e,{children:["Please contact ",a.jsx(Pt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function ak(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 o(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=Zo(t);c!==At(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(o):o(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 Nte(){const{id:e}=Bt(),t=Lr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=De(),[s,c]=v.useState(!0),[d,f]=v.useState(),[p,m]=v.useState(),[g,x]=v.useState(),[b,S]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const T={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const _=r.split(",").filter(P=>!!P);_.length===1&&T.entry.push({request:{method:"GET",url:_[0]}}),m(_)}o.executeBatch(T).then(_=>{_.entry?.[0]?.response?.status!=="200"?S(_.entry?.[0]?.response?.outcome):(f(_.entry[0]?.resource),x(_.entry[1]?.resource)),c(!1)}).catch(_=>{S(_),c(!1)})},[o,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(Oe,{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(T=>a.jsx("li",{children:a.jsx(vt,{to:T,children:At(T)})},T.id))})]}),g&&a.jsx("li",{children:a.jsxs(vt,{to:g,children:["Back to ",Zo(g)]})}),a.jsx("li",{children:a.jsx(vt,{to:"/",children:"Go back home"})})]})]});if(s||!d)return a.jsx(yi,{});const R=g&&lS(g);return a.jsxs(a.Fragment,{children:[a.jsxs(yr,{shadow:"xs",radius:0,children:[R&&a.jsx(cP,{patient:R}),g&&g.resourceType!=="Patient"&&a.jsx(ak,{resource:g}),a.jsx(ce,{px:"xl",py:"md",children:a.jsxs(_e,{children:[Zo(d),p&&p.length>1&&a.jsxs(a.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),a.jsx(lt,{children:a.jsx(xP,{questionnaire:d,subject:g&&qt(g),onSubmit:E})})]});async function E(T){const _=[];if(!p||p.length===0)_.push(await o.createResource(T));else for(const P of p)_.push(await o.createResource({...T,subject:{reference:P}}));C(_)}}const Ote="_paper_unw9o_1",Mte={paper:Ote},Lte={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function sk(e,t){const n=e.resourceType||Ite(t),r=e.fields??$te(n),o=e.filters??(e.resourceType?void 0:zte(n)),s=e.sortRules??Ute(n),c=e.offset??0,d=e.count??sm;return{...e,resourceType:n,fields:r,filters:o,sortRules:s,offset:c,count:d}}function Ite(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function $te(e){const t=hS(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 zte(e){return hS(e)?.filters}function Ute(e){const t=hS(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function hS(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function Bte(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function Vte(e,t){const n={...e,count:1e3,offset:0},r=sk(n,t.getUserConfiguration()),o=await t.search(r.resourceType,Wa({...r,total:"accurate",fields:void 0}));return YD(o)}function iR(){const e=De(),t=wn(),n=Lr(),[r,o]=v.useState();return v.useEffect(()=>{const s=HD(n.pathname+n.search),c=sk(s,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===Wa(c)?(Bte(c),o(c)):t(`/${c.resourceType}${Wa(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(yi,{}):a.jsx(yr,{shadow:"xs",m:"md",p:"xs",className:Mte.paper,children:a.jsx(qc,{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}${Wa(s.definition)}`)?.catch(console.error)},onNew:()=>{t(Lte[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+Wa(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()=>{Vte(r,e).then(s=>EA(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(()=>o({...r})).catch(c=>Ne({color:"red",message:Ge(c),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)?.catch(console.error)}})})}function Fte(){const[e]=Rc("ObservationDefinition","_count=100");return e?a.jsxs(de,{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(oo,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(oo,{value:t.code})}),a.jsx("td",{children:a.jsx(oo,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(Sx,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(yi,{})}function Sx(e){const{ranges:t}=e;if(!t)return null;const n=oR(t.map(o=>o.gender));if(n.length>1)return Ec(n),a.jsx(a.Fragment,{children:n.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Ln(o)})}),a.jsx(Sx,{ranges:e.ranges?.filter(s=>s.gender===o)})]},o))});const r=oR(t.map(o=>o.age&&ld(o.age)));return r.length>1?(Ec(r),a.jsx(a.Fragment,{children:r.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Ln(o)})}),a.jsx(Sx,{ranges:e.ranges?.filter(s=>ld(s.age)===o)})]},o))})):a.jsx(a.Fragment,{children:t.map(o=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:o.condition}),a.jsx("td",{children:a.jsx(Ib,{value:o.range})})]})})},`range-${o.condition}`))})}function oR(e){return[...new Set(e.filter(t=>!!t))]}function qte(){const[e]=Rc("ActivityDefinition","_count=100"),[t]=Rc("ObservationDefinition","_count=100");return!e||!t?a.jsx(yi,{}):a.jsxs(de,{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(oo,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(oo,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(o=>o.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function Hte(){const e=De(),[t,n]=v.useState(),[r,o]=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),o(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(()=>{o(!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(In,{title:"Disable MFA",opened:s,onClose:()=>c(!1),children:a.jsx(rp,{title:"Disable MFA",buttonText:"Submit code",onSubmit:async m=>{await p(m),c(!1),o(!1),Ne({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(sq,{})}),d()}})}),a.jsxs(ge,{children:[a.jsx(Oe,{children:"MFA is enabled"}),a.jsx(ke,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):a.jsx(lt,{width:400,children:a.jsx(rp,{title:"Multi Factor Auth Setup",buttonText:"Enroll",qrCodeUrl:t,onSubmit:f})})}const Gte={},wx={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Gte?.MEDPLUM_AWS_TEXTRACT_ENABLED};function Wd(){return wx}function lk(){return ck("registerEnabled")}function Wte(){return ck("awsTextractEnabled")}function ck(e){try{return wx[e]!==!1&&wx[e]!=="false"}catch{return!0}}function Qte(){const e=wn(),[t]=sS(),n=De(),r=t.get("scope")||"openid",[o,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(LA,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:Wd().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:[o?.logo?.url?a.jsx("img",{src:o?.logo?.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):a.jsx(Ci,{size:32}),a.jsx(Oe,{children:o?.welcomeString??"Sign in to Medplum"})]})})}function Yte(){const e=De(),t=wn(),n=Wd();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),lk()?a.jsxs(qG,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{children:"Create a new account"})]}):a.jsx(lt,{width:450,children:a.jsx(oa,{icon:a.jsx(ll,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function Kte(){const e=wn(),t=De(),[n,r]=v.useState(),[o,s]=v.useState(!1),c=Wd().recaptchaSiteKey;return v.useEffect(()=>{OA(c)},[c]),a.jsx(lt,{width:450,children:a.jsxs(ut,{onSubmit:async d=>{let f="";f=await MA(c),t.post("auth/resetpassword",{...d,recaptchaToken:f}).then(()=>s(!0)).catch(p=>r(Ht(p)))},children:[a.jsxs($e,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{children:"Medplum Password Reset"})]}),a.jsxs($e,{gap:"xl",children:[a.jsx(dr,{issues:Fc(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(Ue,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:kt(n,"email")}),a.jsxs(ge,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Pt,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register")?.catch(console.error),size:"xs",children:"Register"}),a.jsx(ke,{type:"submit",children:"Reset password"})]})]}),o&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function Xte(e){const t=De(),[n,r]=v.useState(),[o,s]=v.useState();return o?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:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(vt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(ut,{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($e,{children:[a.jsxs(Oe,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(_e,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(_e,{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(oo,{value:c.code[0]})]},`action-${d}`))}),a.jsx(Ot,{title:"Subject",children:a.jsx(Qa,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(ge,{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(Xte,{planDefinition:n})}):null}function Jte(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t}),[r,o]=Rc("Questionnaire","subject-type="+e),[s,c]=Rc("ClientApplication",{_count:1e3});if(!n||o||c)return a.jsx(yi,{});const d=s?.filter(m=>ene(e)&&!!m.launchUri);if((!r||r.length===0)&&(!d||d.length===0))return a.jsxs(lt,{children:[a.jsx(Oe,{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(Oe,{order:3,children:a.jsx(vt,{to:`/forms/${m.id}?subject=${At(n)}`,children:m.title||m.name})}),a.jsx(_e,{children:m.description})]},m.id)),d?.map(m=>a.jsxs("div",{children:[a.jsx(Oe,{order:3,children:a.jsx($X,{client:m,patient:f,encounter:p,children:m.name})}),a.jsx(_e,{children:m.description})]},m.id))]})}function ene(e){return e==="Patient"||e==="Encounter"}function tne(){const{resourceType:e,id:t}=Bt(),n=wn(),[r,o]=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(qc,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function nne(){const e=De(),{resourceType:t,id:n}=Bt(),r=e.readHistory(t,n).read();return a.jsx(Ed,{maw:1200,children:a.jsx(cl,{children:a.jsx(RX,{history:r})})})}const rne="_hl7Input_k5xm3_1",ine={hl7Input:rne};function one(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 ane(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=>{Xu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const sne=`{
|
|
597
|
-
"resourceType": "Patient",
|
|
598
|
-
"name": [
|
|
599
|
-
{
|
|
600
|
-
"given": [
|
|
601
|
-
"Alice"
|
|
602
|
-
],
|
|
603
|
-
"family": "Smith"
|
|
604
|
-
}
|
|
605
|
-
]
|
|
606
|
-
}`,lne="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 cne(){const e=De(),{id:t}=Bt(),[n,r]=v.useState(),[o,s]=v.useState(),[c,d]=v.useState(sne),[f,p]=v.useState(lne),[m,g]=v.useState(un.FHIR_JSON),x=v.useRef(null),b=v.useRef(null),[S,j]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async A=>{r(A),s(await une(e,A))}).catch(A=>Ne({color:"red",message:Ge(A),autoClose:!1}))},[e,t]);const C=v.useCallback(async()=>Xu(x.current,{command:"getValue"}),[]),R=v.useCallback(async()=>Xu(x.current,{command:"getOutput"}),[]),E=v.useCallback(async()=>m===un.FHIR_JSON?JSON.parse(c):f,[m,c,f]),T=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{const k=await C(),L=await R(),z=await e.createAttachment({data:k,filename:"index.ts",contentType:"text/typescript"}),B=await e.createAttachment({data:L,filename:"index.js",contentType:"text/typescript"}),Z=[{op:"add",path:"/sourceCode",value:z},{op:"add",path:"/executableCode",value:B}];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,R]),_=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(),L=await e.post(e.fhirUrl("Bot",t,"$execute"),k,m);await Xu(b.current,{command:"setValue",value:L}),Ne({color:"green",message:"Success"})}catch(k){Ne({color:"red",message:Ge(k),autoClose:!1})}finally{j(!1)}},[e,t,E,m]);return!n||o===void 0?null:a.jsxs(ar,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(ar.Col,{span:8,children:a.jsxs(yr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(ane,{iframeRef:x,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),a.jsxs(ge,{justify:"flex-end",gap:"xs",children:[a.jsx(ke,{type:"button",onClick:T,loading:S,leftSection:a.jsx(xq,{size:"1rem"}),children:"Save"}),a.jsx(ke,{type:"button",onClick:_,loading:S,leftSection:a.jsx(_b,{size:"1rem"}),children:"Deploy"}),a.jsx(ke,{type:"button",onClick:P,loading:S,leftSection:a.jsx(aH,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(ar.Col,{span:4,children:[a.jsxs(yr,{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(Lc,{value:c,onChange:A=>d(A),autosize:!0,minRows:15}):a.jsx("textarea",{className:ine.hl7Input,value:f,onChange:A=>p(A.currentTarget.value),rows:15})]}),a.jsx(yr,{m:2,p:"xs",shadow:"md",children:a.jsx(one,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function une(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(PD);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function pl(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function dne(){const e=De(),{resourceType:t,id:n}=Bt(),r={reference:t+"/"+n},o=v.useCallback(s=>{e.updateResource(pl(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(sK,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(lt,{children:a.jsx(MK,{questionnaire:r,onSubmit:o})});default:return null}}function fne(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t}),r=wn();return n?a.jsx(lt,{children:a.jsx(cX,{value:n,onStart:(o,s)=>r(`/forms/${Hs(s)}`)?.catch(console.error),onEdit:(o,s,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function hne(){const e=De(),{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(o=>Ne({color:"red",message:Ge(o),autoClose:!1}))},children:"Delete"})]})}const pne="_selectProfileBtn_tbaz6_1",mne="_chevron_tbaz6_13",aR={selectProfileBtn:pne,chevron:mne};function gne(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t}),[r,o]=v.useState(),s=il({onDropdownClose:()=>s.resetSelectedOption()}),c=v.useMemo(()=>{if(Tn(n?.meta?.profile))return[a.jsx(We.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(We.Option,{value:f,children:f},f))]},[n?.meta?.profile]);if(v.useEffect(()=>{n?.meta?.profile?.length===1&&o(n.meta.profile[0])},[n?.meta?.profile]),!n)return null;let d;return Tn(c)&&(d=a.jsx(ge,{justify:"flex-end",children:a.jsxs($e,{align:"flex-end",gap:"xs",children:[a.jsxs(We,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:f=>{o(f),s.closeDropdown()},children:[a.jsx(We.Target,{children:a.jsx(er,{onClick:()=>s.toggleDropdown(),children:a.jsxs(Cd,{fw:"bold",fs:"sm",className:aR.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(Rb,{stroke:1.5,className:aR.chevron})]})})}),a.jsx(We.Dropdown,{w:"max-content",children:a.jsx(We.Options,{children:c})})]}),a.jsx(ce,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(_e,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(_e,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(_e,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(lt,{children:a.jsxs($e,{gap:"xl",children:[d,a.jsx(qb,{value:n,profileUrl:r})]})})}function vne(){const e=De(),{resourceType:t,id:n}=Bt(),[r,o]=v.useState(),[s,c]=v.useState(),d=wn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{o(Kr(b)),c(Kr(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(pl(b)).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(S=>{p(Ht(S)),Ne({color:"red",message:Ge(S),autoClose:!1})})},[e,t,n,d]),g=v.useCallback(b=>{p(void 0);const S=JA.createPatch(r,b);e.patchResource(t,n,S).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(up,{defaultValue:s,onSubmit:m,onPatch:g,onDelete:x,outcome:f})}):null}function yne(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t});return n?a.jsx(lt,{maw:700,children:n.resourceType==="Patient"?a.jsx(tK,{patient:n}):a.jsx(oa,{icon:a.jsx(ll,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function uk({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=De(),[s,c]=v.useState();return v.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(d=>{c(d.filter(wW))}).catch(console.error)},[o,n,r]),a.jsx(_t,{value:t?.url,onChange:d=>{const f=s?.find(p=>p.url===d);f&&n(f)},children:a.jsx(_t.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(_t.Tab,{value:d.url,title:p,rightSection:f&&a.jsx(rb,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx($H,{size:"90%"})}),children:d.title||d.name},d.url)})})})}function dk(e,t){const n=De(),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 Dy(){const{resourceType:e}=Bt(),t=Lr(),[n,r]=v.useState(),{defaultValue:o,handleSubmit:s}=dk(e,r),[c,d]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=pl(m);c&&LD(g,c.url),s(g)},[c,s]);return f?a.jsx(lt,{children:a.jsxs($e,{children:[a.jsx(uk,{resource:o,currentProfile:c,onChange:d}),c?a.jsx(up,{defaultValue:o,onSubmit:p,outcome:n,profileUrl:c.url},c.url):a.jsx(_e,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(lt,{children:a.jsx(up,{defaultValue:o,onSubmit:s,outcome:n})})}function sR(){const e=De(),{resourceType:t,id:n}=Bt(),r=e.readHistory(t,n).read();return a.jsx(lt,{children:a.jsx(OX,{history:r})})}function xne(){const{resourceType:e}=Bt(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:o}=dk(e,n),s=v.useCallback(c=>{o(JSON.parse(c["new-resource"]))},[o]);return a.jsxs(lt,{children:[t&&a.jsx(dr,{outcome:t}),a.jsxs(ut,{onSubmit:s,children:[a.jsx(Lc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Ii(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ge,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"OK"})})]})]})}function bne(){const e=De(),{resourceType:t,id:n}=Bt(),r=Gt({reference:t+"/"+n}),o=wn(),[s,c]=v.useState(),d=v.useCallback(f=>{e.updateResource(pl(JSON.parse(f.resource))).then(()=>{c(void 0),o(`/${t}/${n}/details`)?.catch(console.error),Ne({color:"green",message:"Success"})}).catch(p=>{Ne({color:"red",message:Ge(p),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(lt,{children:[s&&a.jsx(dr,{outcome:s}),a.jsxs(ut,{onSubmit:d,children:[a.jsx(Lc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Ii(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ge,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"OK"})})]})]}):null}function Sne(){const{resourceType:e,id:t}=Bt();return Gt({reference:e+"/"+t})?a.jsxs(lt,{children:[a.jsxs(oa,{icon:a.jsx(ll,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Pt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),a.jsx(xP,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function wne(){const e=De(),{resourceType:t,id:n}=Bt(),[r,o]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(d=>o(Kr(d))).catch(d=>{Ne({color:"red",message:Ge(d)})})},[e,t,n]),r?a.jsxs(lt,{children:[a.jsxs(Oe,{order:2,children:["Available ",t," profiles"]}),a.jsx($e,{children:a.jsxs(a.Fragment,{children:[a.jsx(uk,{resource:r,currentProfile:s,onChange:c}),s?a.jsx(jne,{profile:s,resource:r,onResourceUpdated:d=>o(d)},s.url):a.jsx(_e,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const jne=({profile:e,resource:t,onResourceUpdated:n})=>{const r=De(),[o,s]=v.useState(),[c,d]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(p=>{s(void 0);const m=pl(p);c?LD(m,e.url):xU(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($e,{children:[a.jsx(Pd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>d(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(up,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:a.jsx(ge,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"OK"})})})]})},fk={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},Cne=Object.keys(fk);function Ene(){const e=De(),{id:t}=Bt(),n=Gt({reference:`Questionnaire/${t}`}),[r,o]=v.useState(),[s,c]=v.useState("create"),[d,f]=v.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>Tne(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},${At(n)}`:At(n)}`,channel:{type:"rest-hook",endpoint:At(r)},...s?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:s}]}:void 0}).then(()=>{o(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(Oe,{children:"Bots"}),a.jsxs($e,{children:[p.length===0&&a.jsx("p",{children:"No bots found."}),p.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(dl,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(pn,{}),a.jsxs($e,{mt:10,children:[a.jsx(yd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(ge,{children:[a.jsx(ul,{name:"bot",resourceType:"Bot",onChange:g=>o(g)}),a.jsx(ke,{onClick:m,children:"Connect"})]}),a.jsx(ge,{children:a.jsx(sn,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:Cne,onChange:g=>c(fk[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:d})]})}function Tne(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(At(t))||(t.url?n.includes(t.url):!1))}function Rne(){const{id:e}=Bt(),t=wn(),r=De().readReference({reference:`Questionnaire/${e}`}).read(),[o,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(qc,{search:o,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})})}function _ne(){const e=De(),{resourceType:t,id:n}=Bt(),r=Gt({reference:t+"/"+n}),o=v.useCallback(s=>{e.updateResource(pl(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(tX,{onSubmit:o,definition:r})}):null}function Dne(){const{resourceType:e,id:t}=Bt(),n=Gt({reference:e+"/"+t});return n?a.jsx(lt,{children:e==="MeasureReport"?a.jsx(JY,{measureReport:n}):a.jsx(Fb,{value:n})}):null}const Ane="_container_1ue98_1",Pne="_entry_1ue98_14",kne="_active_1ue98_21",Ay={container:Ane,entry:Pne,active:kne};function Nne(e){const t=De(),n=Gt(e.value),[r,o]=v.useState();return v.useEffect(()=>{if(!n)return;const s=lS(n);if(!s)return;const c="reference"in s?s.reference:At(s);t.search("ServiceRequest","subject="+c).then(d=>{const p=(d.entry??[]).map(m=>m.resource);eP(p),p.reverse(),o(p)}).catch(d=>Ne({color:"red",message:Ge(d),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:Ay.container,children:r.map(s=>a.jsxs("div",{className:It(Ay.entry,{[Ay.active]:s.id===n?.id}),children:[a.jsx("p",{children:a.jsx(vt,{to:s,children:One(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:Mne(s)})]},s.id))}):null}function One(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function Mne(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const Lne="_container_1l2dh_1",Ine={container:Lne};function $ne(e){const t=Gt(e.valueSet);if(!t)return null;const n=[""],r=t.compose?.include?.[0]?.concept?.map(o=>o.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:Ine.container,children:a.jsx(sn,{defaultValue:e.defaultValue,onChange:o=>e.onChange(o.currentTarget.value),data:n})})}function zne(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:lr(t.collection?.collectedDateTime)})]}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Specimen Age"}),a.jsx(ht.Value,{children:Une(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Specimen Stability"}),a.jsx(ht.Value,{children:Bne(t)})]}):a.jsx(a.Fragment,{})]}):null}function Une(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return hk(pk(n,new Date))}function Bne(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return hk(pk(t,n))}function hk(e){return e.toString().padStart(3,"0")+"D"}function pk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function Vne(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 Fne(){const e=De(),{resourceType:t,id:n}=Bt(),r={reference:t+"/"+n},o=wn(),[s,c]=v.useState(),d=Gt(r,c),f=Vne(t),[p,m]=v.useState(()=>{const E=window.location.pathname.split("/").pop();return E&&f.map(T=>T.toLowerCase()).includes(E)?E:f[0].toLowerCase()});async function g(){const T=(await e.readHistory(t,n)).entry?.find(_=>!!_.resource)?.resource;T?x(T):Ne({color:"red",message:"No history to restore",autoClose:!1})}function x(E){e.updateResource(pl(E)).then(()=>{c(void 0),Ne({color:"green",message:"Success"})}).catch(T=>{Ne({color:"red",message:Ge(T),autoClose:!1})})}if(s)return Dz(s)?a.jsxs(lt,{children:[a.jsx(Oe,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(ke,{color:"red",onClick:g,children:"Restore"})]}):a.jsx(dr,{outcome:s});function b(E){E||(E=f[0].toLowerCase()),m(E),o(`/${t}/${n}/${E}`)?.catch(console.error)}function S(E){const T=d,_=T.orderDetail||[];_.length===0&&_.push({}),_[0].text!==E&&(_[0].text=E,x({...T,orderDetail:_}))}const j=d&&lS(d),C=d&&nee(d),R=e.getUserConfiguration()?.option?.find(E=>E.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[d?.resourceType==="ServiceRequest"&&R&&a.jsx($ne,{valueSet:{reference:R},defaultValue:d.orderDetail?.[0]?.text,onChange:S},At(d)+"-"+d.orderDetail?.[0]?.text),d&&a.jsx(Nne,{value:d}),d&&a.jsxs(yr,{children:[j&&a.jsx(cP,{patient:j}),C&&a.jsx(zne,{specimen:C}),t!=="Patient"&&a.jsx(ak,{resource:r}),a.jsx(Zr,{children:a.jsx(_t,{value:p.toLowerCase(),onChange:b,children:a.jsx(_t.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map(E=>a.jsx(_t.Tab,{value:E.toLowerCase(),children:E},E))})})})]}),a.jsx(iS,{})]})}function jh(){const e=wn(),{resourceType:t,id:n,versionId:r,tab:o}=Bt(),s=De(),[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(T=>p(T)).then(()=>d(!1)).catch(T=>{g(T),d(!1)})},[s,t,n]),c)return a.jsx(yi,{});const x=f?.entry??[],b=x.findIndex(T=>T.resource?.meta?.versionId===r);if(b===-1)return a.jsxs(lt,{children:[a.jsx(Oe,{children:"Version not found"}),a.jsx(vt,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=x[b].resource,j=b<x.length-1?x[b+1].resource:void 0,C="diff",R=o||C,E=x.length-b;return a.jsx(Ed,{maw:1200,children:a.jsx(cl,{children:a.jsxs($e,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(tm,{cols:2,mb:"lg",children:[a.jsx(ji,{total:x.length,value:E,getControlProps:oP,onChange:T=>e(`/${t}/${n}/_history/${x[x.length-T]?.resource?.meta?.versionId}/${R}`)?.catch(console.error)}),a.jsx(ge,{justify:"right",children:a.jsx(Ad,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:R,onChange:T=>e(`/${t}/${n}/_history/${r}/${T||C}`)?.catch(console.error)})})]}),a.jsx(ce,{mb:"lg",children:a.jsxs(vm,{compact:!0,children:[a.jsx(mi,{term:"Version ID",children:S.meta?.versionId}),a.jsx(mi,{term:"Author",children:a.jsx(pc,{value:S.meta?.author,link:!0},S.meta?.author?.reference)}),a.jsx(mi,{term:"Date/Time",children:lr(S.meta?.lastUpdated)})]})}),R==="diff"&&a.jsx(AX,{original:j??{resourceType:t,id:n},revised:S}),R==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(S,void 0,2)})]})})})}function qne(){const{resourceType:e,id:t}=Bt(),n=wn(),[r,o]=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(IY,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function Hne(e){const t=De(),{resource:n,opened:r,onClose:o}=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?At(d):void 0,verbose:p}),Ne({color:"green",message:"Done"}),o()}catch(x){Ne({color:"red",message:Ge(x),autoClose:!1})}},[t,n,o,s,d,p]);return a.jsx(In,{opened:r,onClose:o,title:"Resend Subscriptions",children:a.jsx(ut,{onSubmit:g,children:a.jsxs($e,{children:[a.jsx(Dn,{label:"Choose subscription (all subscriptions by default)",onChange:x=>c(x.currentTarget.checked)}),s&&a.jsx(ul,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx(Dn,{label:"Verbose mode",onChange:x=>m(x.currentTarget.checked)}),a.jsx(ge,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Resend"})})]})})})}function lR(){const e=De(),t=hm(),{resourceType:n,id:r}=Bt(),o={reference:n+"/"+r},[s,c]=v.useState(),d=md(!1);function f(E,T){return e.updateResource({...E,priority:T})}function p(E,T){f(E,"stat").then(T).catch(console.error)}function m(E,T){f(E,"routine").then(T).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 S(E){c(E),d[1].open()}function j(E){t(`/${E.resourceType}/${E.id}/_history/${E.meta?.versionId}`)}function C(E,T){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(()=>{T(),Ms({id:_,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(vo,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(P=>Ms({id:_,title:"AWS Textract Error",color:"red",message:Ge(P),icon:a.jsx(Ys,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function R(E){const{primaryResource:T,currentResource:_,reloadTimeline:P}=E,A=_.resourceType===T.resourceType&&_.id===T.id,k=_.resourceType==="Communication"&&_.priority!=="stat",L=_.resourceType==="Communication"&&_.priority==="stat",z=A,B=!A,Z=!A,K=!A,Y=e.getProjectMembership()?.admin,H=Y,W=Wte()&&(_.resourceType==="DocumentReference"||_.resourceType==="Media");return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Label,{children:"Resource"}),k&&a.jsx(Ce.Item,{leftSection:a.jsx(nH,{size:14}),onClick:()=>p(_,P),"aria-label":`Pin ${At(_)}`,children:"Pin"}),L&&a.jsx(Ce.Item,{leftSection:a.jsx(iH,{size:14}),onClick:()=>m(_,P),"aria-label":`Unpin ${At(_)}`,children:"Unpin"}),B&&a.jsx(Ce.Item,{leftSection:a.jsx(GE,{size:14}),onClick:()=>g(_),"aria-label":`Details ${At(_)}`,children:"Details"}),z&&a.jsx(Ce.Item,{leftSection:a.jsx(GE,{size:14}),onClick:()=>j(_),"aria-label":`Details ${At(_)}`,children:"Details"}),Z&&a.jsx(Ce.Item,{leftSection:a.jsx(vA,{size:14}),onClick:()=>x(_),"aria-label":`Edit ${At(_)}`,children:"Edit"}),Y&&a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Label,{children:"Admin"}),H&&a.jsx(Ce.Item,{leftSection:a.jsx(fH,{size:14}),onClick:()=>S(_),"aria-label":`Resend Subscriptions ${At(_)}`,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(PH,{size:14}),onClick:()=>C(_,P),"aria-label":`AWS Textract ${At(_)}`,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 ${At(_)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(HQ,{encounter:o,getMenu:R}),n==="Patient"&&a.jsx(iK,{patient:o,getMenu:R}),n==="ServiceRequest"&&a.jsx(IX,{serviceRequest:o,getMenu:R}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(qQ,{resource:o,getMenu:R}),a.jsx(Hne,{resource:s,opened:d[0],onClose:d[1].close},`resend-subscriptions-${s?.id}`)]})}function Gne(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:s,handleUpgrade:c}=e,[d,f]=v.useState(),[p,m]=v.useState(!1);return v.useEffect(()=>{t&&(d||XV("app-tools-page").then(f).catch(console.error),s())},[t,d,s]),d&&r&&!o?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(ge,{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(yi,{})}function Wne(){const e=De(),{id:t}=Bt(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=v.useState(!1),[s,c]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState(!1),[g,x]=v.useState(),[b,S]=v.useState(),[j,C]=v.useState(),[R,E]=v.useState(),[T,_]=v.useState(!1),[P,A]=v.useState(!1),[k,L]=v.useState(),[z,{open:B,close:Z}]=md(!1);v.useEffect(()=>{if(r||s||d||T){A(!0);return}A(!1)},[r,s,d,T]);const K=v.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(q=>{x(q.parameter?.find(N=>N.name==="status")?.valueCode),S(q.parameter?.find(N=>N.name==="version")?.valueString),C(q.parameter?.find(N=>N.name==="lastUpdated")?.valueInstant)}).catch(q=>$(Ge(q))).finally(()=>o(!1))},[e,t]),Y=v.useCallback(q=>{const N=q.host,F=q.pingCount||1;N&&(_(!0),e.pushToAgent(n,N,`PING ${F}`,un.PING,!0).then(J=>E(J)).catch(J=>$(Ge(J))).finally(()=>_(!1)))},[e,n]),H=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(q=>{I("Agent config reloaded successfully.")}).catch(q=>$(Ge(q))).finally(()=>c(!1))},[e,t]),W=v.useCallback(q=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade",`?force=${q}`),{cache:"reload"}).then(N=>{I("Agent upgraded successfully.")}).catch(N=>$(Ge(N))).finally(()=>f(!1))},[e,t]),M=v.useCallback(q=>{m(!0);const N=q.logLimit||20;e.get(e.fhirUrl("Agent",t,`$fetch-logs${N!==void 0?`?limit=${N}`:""}`),{cache:"reload"}).then(F=>{const J=F?.parameter?.find(ae=>ae.name==="logs");J&&L(J?.valueString)}).catch(F=>$(Ge(F))).finally(()=>m(!1))},[e,t]);function I(q){Ne({color:"green",title:"Success",icon:a.jsx(vo,{size:"1rem"}),message:q})}function $(q){Ne({color:"red",title:"Error",message:q,autoClose:!1})}return a.jsxs(lt,{children:[a.jsx(In,{opened:z,onClose:Z,title:"Upgrade Agent",centered:!0,children:a.jsx(Gne,{opened:z,close:Z,version:b,loadingStatus:r,handleStatus:K,handleUpgrade:W})}),a.jsx(Oe,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(dl,{value:n,link:!0})]}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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:K,loading:r,disabled:P&&!r,children:"Get Status"}),!r&&g&&a.jsx(de,{children:a.jsxs(de.Tbody,{children:[a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:"Status"}),a.jsx(de.Td,{children:a.jsx(bm,{status:g})})]}),a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:"Version"}),a.jsx(de.Td,{children:b})]}),a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:"Last Updated"}),a.jsx(de.Td,{children:lr(j,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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:H,loading:s,disabled:P&&!s,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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:B,loading:d,disabled:P&&!d,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(pn,{my:"lg"}),a.jsxs(ut,{onSubmit:M,children:[a.jsx(Oe,{order:2,children:"Fetch Logs"}),a.jsx("p",{children:"Fetch logs from the agent."}),k?.length?a.jsx(Cd,{block:!0,mb:15,children:k}):null,a.jsxs(ge,{children:[a.jsx(wc,{w:100,id:"logLimit",name:"logLimit",placeholder:"20",label:"Log Limit"}),a.jsx(ke,{mt:22,loading:p,disabled:P&&!p,"aria-label":"Fetch logs",type:"submit",children:"Fetch Logs"})]})]}),a.jsx(pn,{my:"lg"}),a.jsx(Oe,{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(ut,{onSubmit:Y,children:a.jsxs(ge,{children:[a.jsx(Ue,{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:P&&!T,children:a.jsx(gH,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(wc,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!T&&R&&a.jsxs(a.Fragment,{children:[a.jsx(Oe,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:R})]})]})}function Qne(){const e=wn(),t=De(),[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 o(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(Oe,{children:"Security"}),a.jsxs(vm,{children:[a.jsx(mi,{term:"ID",children:a.jsx(Pt,{href:`/${At(n.profile)}`,children:n.profile.id})}),a.jsx(mi,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(mi,{term:"Name",children:Bc(n.profile.name?.[0])})]})]}),a.jsxs(lt,{children:[a.jsx(Oe,{children:"Sessions"}),a.jsxs(de,{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:lr(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Pt,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(lt,{children:[a.jsx(Oe,{children:"Password"}),a.jsx(ke,{onClick:()=>e("/changepassword")?.catch(console.error),children:"Change password"})]}),a.jsxs(lt,{children:[a.jsx(Oe,{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 Yne(){const{id:e,secret:t}=Bt(),n=De(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=Fc(r,void 0);return a.jsxs(lt,{width:450,children:[a.jsx(dr,{issues:d}),a.jsxs(ut,{onSubmit:f=>{if(f.password!==f.confirmPassword){o(io("Passwords do not match","confirmPassword"));return}o(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>o(Ht(m)))},children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{children:"Set password"})]}),!s&&a.jsxs($e,{children:[a.jsx(Oi,{name:"password",label:"New password",required:!0,error:kt(r,"password")}),a.jsx(Oi,{name:"confirmPassword",label:"Confirm new password",required:!0,error:kt(r,"confirmPassword")}),a.jsx(ge,{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 Kne(){const e=pm(),t=wn(),[n]=sS(),r=Wd(),o=v.useCallback(()=>{const s=n.get("next");t(s?.startsWith("/")?s:"/")?.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(LA,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:lk()?()=>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(Ci,{size:32}),a.jsx(Oe,{children:"Sign in to Medplum"}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function Xne(){const e=wn(),t=Lr(),[n,r]=v.useState(),[o,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||!o||!c?null:a.jsx(FY,{resourceType:n,checkboxesEnabled:!0,query:o,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=De(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=Fc(r,void 0);return a.jsxs(lt,{width:450,children:[a.jsx(dr,{issues:d}),a.jsxs(ut,{onSubmit:()=>{o(void 0);const f={id:e,secret:t};n.post("auth/verifyemail",f).then(()=>c(!0)).catch(p=>o(Ht(p)))},children:[a.jsxs(Jn,{style:{flexDirection:"column"},children:[a.jsx(Ci,{size:32}),a.jsx(Oe,{children:"Email address verification required"})]}),!s&&a.jsxs($e,{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(ge,{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 Jne(){return a.jsx(bJ,{children:a.jsxs(Ie,{errorElement:a.jsx(kte,{}),children:[a.jsx(Ie,{path:"/signin",element:a.jsx(Kne,{})}),a.jsx(Ie,{path:"/oauth",element:a.jsx(Qte,{})}),a.jsx(Ie,{path:"/resetpassword",element:a.jsx(Kte,{})}),a.jsx(Ie,{path:"/setpassword/:id/:secret",element:a.jsx(Yne,{})}),a.jsx(Ie,{path:"/verifyemail/:id/:secret",element:a.jsx(Zne,{})}),a.jsx(Ie,{path:"/register",element:a.jsx(Yte,{})}),a.jsx(Ie,{path:"/changepassword",element:a.jsx(Dte,{})}),a.jsx(Ie,{path:"/security",element:a.jsx(Qne,{})}),a.jsx(Ie,{path:"/mfa",element:a.jsx(Hte,{})}),a.jsx(Ie,{path:"/batch",element:a.jsx(Rte,{})}),a.jsx(Ie,{path:"/bulk/:resourceType",element:a.jsx(_te,{})}),a.jsx(Ie,{path:"/smart",element:a.jsx(Xne,{})}),a.jsx(Ie,{path:"/forms/:id",element:a.jsx(Nte,{})}),a.jsx(Ie,{path:"/admin/super",element:a.jsx(Dee,{})}),a.jsx(Ie,{path:"/admin/super/asyncjob",element:a.jsx(jee,{})}),a.jsx(Ie,{path:"/admin/super/db",element:a.jsx(pee,{})}),a.jsx(Ie,{path:"/admin/config",element:a.jsx(xee,{})}),a.jsxs(Ie,{path:"/admin",element:a.jsx(bee,{}),children:[a.jsx(Ie,{path:"patients",element:a.jsx(yee,{})}),a.jsx(Ie,{path:"bots/new",element:a.jsx(oee,{})}),a.jsx(Ie,{path:"bots",element:a.jsx(ree,{})}),a.jsx(Ie,{path:"clients/new",element:a.jsx(aee,{})}),a.jsx(Ie,{path:"clients",element:a.jsx(iee,{})}),a.jsx(Ie,{path:"details",element:a.jsx(qT,{})}),a.jsx(Ie,{path:"invite",element:a.jsx(vee,{})}),a.jsx(Ie,{path:"users",element:a.jsx(kee,{})}),a.jsx(Ie,{path:"project",element:a.jsx(qT,{})}),a.jsx(Ie,{path:"secrets",element:a.jsx(See,{})}),a.jsx(Ie,{path:"sites",element:a.jsx(wee,{})}),a.jsx(Ie,{path:"members/:membershipId",element:a.jsx(gee,{})})]}),a.jsx(Ie,{path:"/lab/assays",element:a.jsx(Fte,{})}),a.jsx(Ie,{path:"/lab/panels",element:a.jsx(qte,{})}),a.jsxs(Ie,{path:"/:resourceType/new",element:a.jsx(Pte,{}),children:[a.jsx(Ie,{index:!0,element:a.jsx(Dy,{})}),a.jsx(Ie,{path:"form",element:a.jsx(Dy,{})}),a.jsx(Ie,{path:"json",element:a.jsx(xne,{})}),a.jsx(Ie,{path:"profiles",element:a.jsx(Dy,{})})]}),a.jsxs(Ie,{path:"/:resourceType/:id",element:a.jsx(Fne,{}),children:[a.jsx(Ie,{index:!0,element:a.jsx(lR,{})}),a.jsx(Ie,{path:"apply",element:a.jsx(Zte,{})}),a.jsx(Ie,{path:"apps",element:a.jsx(Jte,{})}),a.jsx(Ie,{path:"event",element:a.jsx(tne,{})}),a.jsx(Ie,{path:"blame",element:a.jsx(nne,{})}),a.jsx(Ie,{path:"bots",element:a.jsx(Ene,{})}),a.jsx(Ie,{path:"builder",element:a.jsx(dne,{})}),a.jsx(Ie,{path:"checklist",element:a.jsx(fne,{})}),a.jsx(Ie,{path:"delete",element:a.jsx(hne,{})}),a.jsx(Ie,{path:"details",element:a.jsx(gne,{})}),a.jsx(Ie,{path:"edit",element:a.jsx(vne,{})}),a.jsx(Ie,{path:"editor",element:a.jsx(cne,{})}),a.jsxs(Ie,{path:"history",children:[a.jsx(Ie,{index:!0,element:a.jsx(sR,{})}),a.jsx(Ie,{path:":versionId/:tab",element:a.jsx(jh,{})}),a.jsx(Ie,{path:":versionId",element:a.jsx(jh,{})})]}),a.jsxs(Ie,{path:"_history",children:[a.jsx(Ie,{index:!0,element:a.jsx(sR,{})}),a.jsx(Ie,{path:":versionId/:tab",element:a.jsx(jh,{})}),a.jsx(Ie,{path:":versionId",element:a.jsx(jh,{})})]}),a.jsx(Ie,{path:"json",element:a.jsx(bne,{})}),a.jsx(Ie,{path:"preview",element:a.jsx(Sne,{})}),a.jsx(Ie,{path:"responses",element:a.jsx(Rne,{})}),a.jsx(Ie,{path:"report",element:a.jsx(Dne,{})}),a.jsx(Ie,{path:"ranges",element:a.jsx(_ne,{})}),a.jsx(Ie,{path:"subscriptions",element:a.jsx(qne,{})}),a.jsx(Ie,{path:"timeline",element:a.jsx(lR,{})}),a.jsx(Ie,{path:"tools",element:a.jsx(Wne,{})}),a.jsx(Ie,{path:"profiles",element:a.jsx(wne,{})}),a.jsx(Ie,{path:"export",element:a.jsx(yne,{})})]}),a.jsx(Ie,{path:"/:resourceType",element:a.jsx(iR,{})}),a.jsx(Ie,{path:"/",element:a.jsx(iR,{})})]})})}function ere(){const e=De(),t=e.getUserConfiguration(),n=Lr(),[r]=sS();return e.isLoading()?a.jsx(yi,{}):a.jsx(AG,{logo:a.jsx(Ci,{size:24}),pathname:n.pathname,searchParams:r,version:JD,menus:tre(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(yi,{}),children:a.jsx(Jne,{})})})}function tre(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:nre(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(Vq,{})}]}),t}const cR={Patient:EH,Practitioner:Iq,Organization:eq,ServiceRequest:cH,DiagnosticReport:pH,Questionnaire:Mq,admin:QF,AccessPolicy:Uq,Subscription:MH,batch:eH,Observation:Kq};function nre(e){if(e.includes("admin/super/db"))return a.jsx(vq,{});try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in cR){const n=cR[t];return a.jsx(n,{})}}catch{}return a.jsx(nm,{w:30})}async function rre(){const e=Wd(),t=new eA({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=qJ([{path:"*",element:a.jsx(ere,{})}]),o=c=>r.navigate(c);FX.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(ZV,{medplum:t,navigate:o,children:a.jsxs(OR,{theme:n,children:[a.jsx(la,{position:"bottom-right"}),a.jsx(gJ,{router:r})]})})}))}rre().catch(console.error);
|
|
607
|
-
//# sourceMappingURL=index-BVGe6_AW.js.map
|